ContainerOverviewA deployment specification is represented by a <container> XML element directive. The directive presents a deployment scenerario to the runtime containment model and through this process, defines a composite component model based on a series of subsidiary containment and component diectives. Each containment directive represents a composite component solution. Each component directive represents an implementation deployment directive designed to fulfill a particular application scenario. In structural terms, a <container> elements contains a set of components, sub-containers, and includes that make up the compostion a block in terms of its internal functionality. This functionality is in turn exported through optional service directives declared at the level of the <container> . Nested Elements
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> |