Container DirectiveNested Elements
DescriptionA container holds a set of components, sub-containers, and includes that make up the compostion of the block in terms of its internal functionality, exported through optional service directives. Sample XMLThe 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> |