link
Avalon
Deployment Specification
Home PlanetProductsCentral
container
Nested Elements
ElementOccuranceDescription
services0..1 A container can declare the export of a set of services established by the components contained within it. This enables a container to function as a composite component relative to its peers.
classloader0..1 The classloader to assign to the container.
component0..n A component directive is an instruction to merlin to build a component of the type specified, and deploy the component in accordance with a stated policy.
container0..n A container directive is simply a composite component. A container establishes a partition within which a set of other components and containers can be declared.
include0..n An include directive instructs Merlin to include an external block within the container. Services exported by the block will be made available to other components at the same level as the included block.
Sample XML

The following XML is a sample of a implementation declaration containing an engine, components, subcontainers and block includes.

 <!-- block implementation declaration -->
<container>
  
     <!-- 
     declaration of the classloader that this block 
     will execute within 
     -->

     <classloader>
       <classpath>
         <repository>
           <resource id="tutorial:composition-api" version="1.0"/>
         </repository>
       </classpath>
     </classloader>

     <!-- 
     declaration of a root component (services provided by this component
     will be avbailable to all other components at the same or lower levels
     in the container hierachy
     -->

     <component name="application" 
        class="tutorial.application.Application" activation="startup">
     </component>

     <!-- 
     declaration of a container contining other components
     -->

     <container name="subcontainer">
       
       <!--
       This component is only visible to other components at the same
       level or lower in this branch of the container hierachy
       -->

       <component name="test2" class="AnotherComponent"/>

       <!--
       A subcontainer declaring a custom container type.
       -->

       <container name="testing" class="MySpecialContainerClass">
         <!-- etc. -->
       </container>

     </container>

     <!--
     Declaration of a block to includes.  The inclusion of a block
     results in the establishment of a container with a name correponding
     to the name of the block.
     -->

     <include path="example-block.xml"/>
     <include id="osm:collaboration" version="1.0"/>

</container>