<%=link("Brokers","Brokers")%> are created merging components assemblies from different layers.
The layers used to create a broker are denominated its flavor.
The flavor used in the creation of a broker is provided by field flavor
of the configuration table passed as argument of function <%=link("Module","oil.init
","#init")%>(config)
.
The value of this field must be a string with the names of the different layers separated by semicolons (;
), like in the example below:
broker = oil.init{ flavor = "intercepted;corba;typed;base" }
The order the layer names in the flavor string is important because layers are created from left to right. Therefore, the components of left-most layers are created first and shall not be replaced by components from other layers. Generally, more specific layers must appear first. In particular, extensions layers must come before the layer they extend. In the example above, the extension layer <%=link("RMI","intercepted","#intercepted")%> comes first then the extended layer <%=link("RMI","corba","#corba")%>. The same is true for extension layer <%=link("Core","typed","#typed")%> and extended layer <%=link("Core","base","#base")%>. Theoretically, complementary layers can come in any order relative to one another. However, it is a good practice to put RMI layers first than the core layer because the RMI layer might extend the core layer in some way. See section <%=link("Arch","Architectural Layers","#layer")%> for the list of layers defined by OiL.
The flavor is a feature used to help the creation of brokers from combination of assemblies defined as architectural layers.
For a description about the definition of layers see section <%=link"Layers"%>.
However, you do not have to define a new layer to can create different assemblies.
Moreover, you can provide a flavor that completes a partial assembly you provide to function <%=link("Module","oil.init
","#init")%>.
As an example, consider the following code that provides RMI components and completes the broker assembly with components from layer <%=link("Core","base","#base")%>.
-- create assembly broker = oil.init{ flavor = "cooperative;base", OperationRequester = MyProtocolRequester(), ObjectReferrer = MyProtocolReferrer(), RequestListener = MyProtocolListener(), } -- make connections from your components -- to components from layer 'base' broker.OperationRequester.sockets = broker.BasicSystem.sockets broker.RequestListener.sockets = broker.BasicSystem.sockets