Advanced FeaturesContainment IncludesA container directive may include other containers via the <include> statement. This tutorial describes how to use include elements to wire together complex block defintions. Sample BlockThe following block defintion contains:
<container name="tutorial"> <classloader> <classpath> <repository> <resource id="tutorial:tutorial" version="1.0"/> </repository> </classpath> </classloader> <component name="test1" class="tutorial.TestComponent" activation="startup"/> <!-- Deomonstration of an include the establishes a subsidiary block named "my-block" based on the block defintion from the resource repository. --> <include name="my-block" id="cornerstone-store:cornerstone-store-impl" version="1.0"/> <container name="subcontainer"> <component name="test2" class="tutorial.TestComponent" activation="startup"/> <!-- Inclusion of the block xml file. --> <include name="another-block" id="my-group:block" version="1.0" type="xml"/> </container> </container> |