[jboss-cvs] JBossAS SVN: r89249 - in projects/mc-docs/trunk: docbook-xslt and 307 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu May 21 08:52:12 EDT 2009


Author: alesj
Date: 2009-05-21 08:52:11 -0400 (Thu, 21 May 2009)
New Revision: 89249

Added:
   projects/mc-docs/trunk/docbook-xslt/
   projects/mc-docs/trunk/docbook-xslt/pom.xml
   projects/mc-docs/trunk/docbook-xslt/src/
   projects/mc-docs/trunk/docbook-xslt/src/main/
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/common.xsl
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/eclipse.xsl
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/pdf.xsl
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml-single.xsl
   projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml.xsl
   projects/mc-docs/trunk/examples/
   projects/mc-docs/trunk/examples/User_Guide/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/AnnotatedSimpleBean.java
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/EnvInitialContextFactory.java
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockJndiProvider.java
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockNameParser.java
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBean.java
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBeanLookup.java
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/dist.xml
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/log4j.properties
   projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/extending/
   projects/mc-docs/trunk/examples/User_Guide/extending/osgi/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/addStage.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/classloader.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/common.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/jar.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/properties.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/structure.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/xml.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-addStage.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-classloader.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-jar.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-properties.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-structure.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-xml.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.properties
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/jboss-structure.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/run.sh
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/Client.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/ConsoleInput.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/UserInterface.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyClassLoaderDeployer.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyDeployer.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/log4j.properties
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestSuite.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/MockUserInterface.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/AuditAspect.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/aop.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/classloader.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/common.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/pojo.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/aop-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/classloader-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/pojo-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/run.sh
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/Client.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/ConsoleInput.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/UserInterface.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/log4j.properties
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestSuite.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/MockUserInterface.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Address.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Employee.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/HRManager.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/AgeBasedSalaryStrategy.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/LocationBasedSalaryStrategy.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/SalaryStrategy.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerAgeBasedTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerLocationBasedTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTest.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestSuite.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/AgeBasedSalaryTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/LocationBasedSalaryTestCase.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/SalaryStrategyTestSuite.java
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/log4j.properties
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerAgeBasedTestCase.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerLocationBasedTestCase.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerTestCase.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/AgeBasedSalaryTestCase.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/LocationBasedSalaryTestCase.xml
   projects/mc-docs/trunk/examples/User_Guide/gettingStarted/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/integrating/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/MBeanServerChecker.java
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoInjectee.java
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoName.java
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestService.java
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestServiceMBean.java
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-services.xml
   projects/mc-docs/trunk/examples/User_Guide/integrating/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/Nameable.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/ObjectHolder.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/AnnotationChecker.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/Name.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/POJO.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/example/microcontainer/autowiring/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/example/microcontainer/classloader/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/ObjectPrinter.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/ConstructorBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Demander.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Starters.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/dist.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/FactoryCreatedBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/SingletonFactory.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/StaticFactory.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/InjectionBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/DeamonTimer.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/MyTimerTask.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/example/microcontainer/javabeans/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/LifecycleBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/ControllerLocator.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/HashtableLocator.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/Locator.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/SimpleBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/User.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/log4j.properties
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/PropertiesBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/SimpleBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/MCBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/SimpleBean.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/pom.xml
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/Binder.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/PojoLookup.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/StaticBinder.java
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/resources/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/
   projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/jboss-beans.xml
   projects/mc-docs/trunk/gettingstarted/
   projects/mc-docs/trunk/gettingstarted/en-US/
   projects/mc-docs/trunk/gettingstarted/en-US/pom.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/master.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/annotations.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/aop.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/basics.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/classloader.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/conclusion.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/core.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/deployers.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/examples.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/glossary.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/guice.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/installation.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/introduction.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/javabeans.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/managed.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/mbeans.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/modules.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/osgi.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/packaging.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_identity.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_jbpm.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_rules.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/spring.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/standalone.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/vfs.xml
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/empty.dir
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.odg
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.pdf
   projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.png
   projects/mc-docs/trunk/gettingstarted/pom.xml
   projects/mc-docs/trunk/legalnotice.html
   projects/mc-docs/trunk/pom.xml
   projects/mc-docs/trunk/reference/
   projects/mc-docs/trunk/reference/en-US/
   projects/mc-docs/trunk/reference/en-US/pom.xml
   projects/mc-docs/trunk/reference/en-US/src/
   projects/mc-docs/trunk/reference/en-US/src/main/
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/master.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/beaninfo.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bootstrap.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bus.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/classadapter.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/configuration.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependency.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencycontroller.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencyinfo.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/deployment.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/events.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/introduction.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/joinpoint.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/kernel.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/metadata.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/outline.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/reflection.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/registry.xml
   projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/wikilinks.xml
   projects/mc-docs/trunk/reference/en-US/src/main/resources/
   projects/mc-docs/trunk/reference/en-US/src/main/resources/shared/
   projects/mc-docs/trunk/reference/en-US/src/main/resources/shared/images/
   projects/mc-docs/trunk/reference/en-US/src/main/resources/shared/images/empty.dir
   projects/mc-docs/trunk/reference/pom.xml
   projects/mc-docs/trunk/userguide/
   projects/mc-docs/trunk/userguide/pom.xml
   projects/mc-docs/trunk/userguide/src/
   projects/mc-docs/trunk/userguide/src/main/
   projects/mc-docs/trunk/userguide/src/main/docbook/
   projects/mc-docs/trunk/userguide/src/main/docbook/Author_Group.xml
   projects/mc-docs/trunk/userguide/src/main/docbook/Legal_Notice.xml
   projects/mc-docs/trunk/userguide/src/main/docbook/User_Guide.xml
   projects/mc-docs/trunk/userguide/src/main/docbook/images/
   projects/mc-docs/trunk/userguide/src/main/docbook/images/deployOutput.png
   projects/mc-docs/trunk/userguide/src/main/docbook/images/tuiMenu.png
Log:
Initial MC docs move.

Added: projects/mc-docs/trunk/docbook-xslt/pom.xml
===================================================================
--- projects/mc-docs/trunk/docbook-xslt/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/docbook-xslt/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,59 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+   <modelVersion>4.0.0</modelVersion>
+
+   <groupId>org.jboss.microcontainer</groupId>
+   <artifactId>docbook-xslt</artifactId>
+   <packaging>jar</packaging>
+   <version>1.1.0-SNAPSHOT</version>
+
+   <name>Microcontainer DocBook XSLT</name>
+   <description>
+      The main project to transform DocBook XML into XHTML and other formats for
+      Microcontainer Documentation.
+   </description>
+   <url>http://www.jboss.org/jbossmc</url>
+
+   <contributors>
+      <contributor>
+         <name>Ales Justin</name>
+      </contributor>
+   </contributors>
+
+   <dependencies>
+      <dependency>
+         <groupId>org.jboss</groupId>
+         <artifactId>jbossorg-docbook-xslt</artifactId>
+      </dependency>
+   </dependencies>
+
+   <dependencyManagement>
+      <dependencies>
+         <dependency>
+            <groupId>org.jboss</groupId>
+            <artifactId>jbossorg-docbook-xslt</artifactId>
+            <version>1.1.0</version>
+         </dependency>
+      </dependencies>
+   </dependencyManagement>
+
+   <build>
+      <extensions>
+         <extension>
+            <groupId>org.apache.maven.wagon</groupId>
+            <artifactId>wagon-webdav</artifactId>
+            <version>1.0-beta-2</version>
+         </extension>
+      </extensions>
+      <pluginManagement>
+         <plugins>
+            <plugin>
+               <groupId>org.jboss.maven.plugins</groupId>
+               <artifactId>maven-jdocbook-plugin</artifactId>
+               <version>2.1.1</version>
+            </plugin>
+         </plugins>
+      </pluginManagement>
+   </build>
+
+</project>

Added: projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/common.xsl
===================================================================
--- projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/common.xsl	                        (rev 0)
+++ projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/common.xsl	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,37 @@
+<?xml version='1.0'?>
+
+<!--
+   Copyright 2009 JBoss, a division of Red Hat
+   License: LGPL
+   Author: Steve Ebersole <steve at hibernate.org>
+   Author: Ales Justin <ajustin at jboss.org>
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+   <xsl:param name="use.id.as.filename">1</xsl:param>
+
+    <xsl:param name="legalnotice.filename">legalnotice.html</xsl:param>
+
+    <xsl:template match="legalnotice" mode="chunk-filename">
+        <xsl:value-of select="$legalnotice.filename"/>
+    </xsl:template>
+
+    <xsl:template name="user.footer.content">
+        <HR/>
+        <a>
+            <xsl:attribute name="href">
+                <xsl:apply-templates select="//legalnotice[1]" mode="chunk-filename"/>
+            </xsl:attribute>
+            <xsl:choose>
+                <xsl:when test="//copyright[1]">
+                    <xsl:apply-templates select="//copyright[1]" mode="titlepage.mode"/>
+                </xsl:when>
+                <xsl:when test="//legalnotice[1]">
+                    <xsl:apply-templates select="//legalnotice[1]" mode="titlepage.mode"/>
+                </xsl:when>
+            </xsl:choose>
+        </a>
+    </xsl:template>
+
+</xsl:stylesheet>

Added: projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/eclipse.xsl
===================================================================
--- projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/eclipse.xsl	                        (rev 0)
+++ projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/eclipse.xsl	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+
+<!--
+   Copyright 2009 JBoss, a division of Red Hat
+   License: LGPL
+   Author: Ales Justin <ajustin at jboss.org>
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+   <xsl:import href="classpath:/xslt/org/jboss/eclipse.xsl"/>
+   <xsl:import href="common.xsl"/>
+
+</xsl:stylesheet>

Added: projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/pdf.xsl
===================================================================
--- projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/pdf.xsl	                        (rev 0)
+++ projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/pdf.xsl	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+
+<!--
+   Copyright 2009 JBoss, a division of Red Hat
+   License: LGPL
+   Author: Ales Justin <ajustin at jboss.org>
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+   <xsl:import href="classpath:/xslt/org/jboss/pdf.xsl"/>
+   <xsl:import href="common.xsl"/>
+
+</xsl:stylesheet>

Added: projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml-single.xsl
===================================================================
--- projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml-single.xsl	                        (rev 0)
+++ projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml-single.xsl	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+
+<!--
+   Copyright 2009 JBoss, a division of Red Hat
+   License: LGPL
+   Author: Ales Justin <ajustin at jboss.org>
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+   <xsl:import href="classpath:/xslt/org/jboss/xhtml-single.xsl"/>
+   <xsl:import href="common.xsl"/>
+
+</xsl:stylesheet>

Added: projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml.xsl
===================================================================
--- projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml.xsl	                        (rev 0)
+++ projects/mc-docs/trunk/docbook-xslt/src/main/resources/xslt/org/jboss/microcontainer/xhtml.xsl	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+
+<!--
+   Copyright 2009 JBoss, a division of Red Hat
+   License: LGPL
+   Author: Ales Justin <ajustin at jboss.org>
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+   <xsl:import href="classpath:/xslt/org/jboss/xhtml.xsl"/>
+   <xsl:import href="common.xsl"/>
+
+</xsl:stylesheet>

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>aopDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>aspects</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Aspects</name>
+  <description></description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-aop-mc-int</artifactId>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/AnnotatedSimpleBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/AnnotatedSimpleBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/AnnotatedSimpleBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.aspects;
+
+import java.io.Serializable;
+
+import org.jboss.aop.microcontainer.aspects.jndi.JndiBinding;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at JndiBinding(name = "beans/AnnotatedSimpleBean")
+public class AnnotatedSimpleBean implements Serializable
+{
+   public String toString()
+   {
+      return "I'm annotated SimpleBean.";
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/EnvInitialContextFactory.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/EnvInitialContextFactory.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/EnvInitialContextFactory.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.example.microcontainer.aspects;
+
+import java.util.Hashtable;
+import java.util.List;
+import javax.management.MBeanServerFactory;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.spi.InitialContextFactory;
+
+/**
+ * We check if we are in AS or standalone.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class EnvInitialContextFactory implements InitialContextFactory
+{
+   public Context getInitialContext(Hashtable<?, ?> env) throws NamingException
+   {
+      return isApplicationServer() ? new InitialContext(env) : new MockJndiProvider(env);
+   }
+
+   protected boolean isApplicationServer()
+   {
+      List servers = MBeanServerFactory.findMBeanServer("jboss");
+      return servers != null && servers.isEmpty() == false;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockJndiProvider.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockJndiProvider.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockJndiProvider.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,217 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.example.microcontainer.aspects;
+
+import java.io.IOException;
+import java.rmi.MarshalledObject;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import javax.naming.Binding;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NameClassPair;
+import javax.naming.NameParser;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class MockJndiProvider implements Context
+{
+   private static Map<Object, Object> bindings = new ConcurrentHashMap<Object, Object>();
+   private Hashtable<?, ?> env;
+
+   MockJndiProvider(Hashtable<?, ?> env)
+   {
+      this.env = env;
+   }
+
+   public Object addToEnvironment(String propName, Object propVal) throws NamingException
+   {
+      return null;
+   }
+
+   public void bind(Name name, Object obj) throws NamingException
+   {
+      String sname = name.toString();
+      bind(sname, obj);
+   }
+
+   public void bind(String name, Object obj) throws NamingException
+   {
+      try
+      {
+         MarshalledObject mo = new MarshalledObject(obj);
+         bindings.put(name, mo);
+      }
+      catch(IOException e)
+      {
+         NamingException ex = new NamingException("Failed to bind name: "+name);
+         ex.setRootCause(e);
+         throw ex;
+      }
+   }
+
+   public void close() throws NamingException
+   {
+   }
+
+   public Name composeName(Name name, Name prefix) throws NamingException
+   {
+      return null;
+   }
+
+   public String composeName(String name, String prefix) throws NamingException
+   {
+      return null;
+   }
+
+   public Context createSubcontext(Name name) throws NamingException
+   {
+      return null;
+   }
+
+   public Context createSubcontext(String name) throws NamingException
+   {
+      return null;
+   }
+
+   public void destroySubcontext(Name name) throws NamingException
+   {
+   }
+
+   public void destroySubcontext(String name) throws NamingException
+   {
+
+   }
+
+   public Hashtable<?, ?> getEnvironment() throws NamingException
+   {
+      return env;
+   }
+
+   public String getNameInNamespace() throws NamingException
+   {
+      return null;
+   }
+
+   public NameParser getNameParser(Name name) throws NamingException
+   {
+      return new MockNameParser();
+   }
+
+   public NameParser getNameParser(String name) throws NamingException
+   {
+      return new MockNameParser();
+   }
+
+   public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
+   {
+      return null;
+   }
+
+   public NamingEnumeration<NameClassPair> list(String name) throws NamingException
+   {
+      return null;
+   }
+
+   public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
+   {
+      return null;
+   }
+
+   public NamingEnumeration<Binding> listBindings(String name) throws NamingException
+   {
+      return null;
+   }
+
+   public Object lookup(Name name) throws NamingException
+   {
+      String sname = name.toString();
+      return lookup(sname);
+   }
+
+   public Object lookup(String name) throws NamingException
+   {
+      MarshalledObject mo = (MarshalledObject) bindings.get(name);
+      Object value = null;
+      if( mo != null )
+      {
+         try
+         {
+            value = mo.get();
+         }
+         catch(Exception e)
+         {
+            NamingException ex = new NamingException();
+            ex.setRootCause(e);
+            throw ex;
+         }
+      }
+      return value;
+   }
+
+   public Object lookupLink(Name name) throws NamingException
+   {
+      return null;
+   }
+
+   public Object lookupLink(String name) throws NamingException
+   {
+      return null;
+   }
+
+   public void rebind(Name name, Object obj) throws NamingException
+   {
+   }
+
+   public void rebind(String name, Object obj) throws NamingException
+   {
+      bindings.put(name, obj);
+   }
+
+   public Object removeFromEnvironment(String propName) throws NamingException
+   {
+      return null;
+   }
+
+   public void rename(Name oldName, Name newName) throws NamingException
+   {
+   }
+
+   public void rename(String oldName, String newName) throws NamingException
+   {
+   }
+
+   public void unbind(Name name) throws NamingException
+   {
+      unbind(name.toString());
+   }
+
+   public void unbind(String name) throws NamingException
+   {
+      bindings.remove(name);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockNameParser.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockNameParser.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockNameParser.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,22 @@
+package org.jboss.example.microcontainer.aspects;
+
+import java.util.Properties;
+import javax.naming.CompoundName;
+import javax.naming.Name;
+import javax.naming.NameParser;
+import javax.naming.NamingException;
+
+public class MockNameParser implements NameParser
+{
+   private static final Properties syntax = new Properties();
+
+   static
+   {
+      syntax.setProperty("jndi.syntax.direction", "flat");
+   }
+
+   public Name parse(String name) throws NamingException
+   {
+      return new CompoundName(name, syntax);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.aspects;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SimpleBean implements Serializable
+{
+   public String toString()
+   {
+      return "I'm plain SimpleBean.";
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBeanLookup.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBeanLookup.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBeanLookup.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.aspects;
+
+import java.util.Properties;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SimpleBeanLookup
+{
+   private Properties env;
+
+   public String getName()
+   {
+      return getClass().getName();
+   }
+
+   public void setEnv(Properties env)
+   {
+      this.env = env;
+   }
+
+   public void start() throws Exception
+   {
+      Context context = new InitialContext(env);
+      System.out.println(context.lookup("beans/SimpleBean"));
+      System.out.println(context.lookup("beans/AnnotatedSimpleBean"));
+      System.out.println(context.lookup("beans/XmlAnnotatedSimpleBean"));
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Repository" class="org.jboss.metadata.plugins.repository.basic.BasicMetaDataRepository"/>
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+	<!-- Define the jndi binding advice -->
+   <beanfactory name="JndiAdvice" class="org.jboss.aop.microcontainer.aspects.jndi.JndiIntroduction">
+   	<property name="env">
+           <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+              <entry>
+                 <key>java.naming.factory.initial</key>
+                 <value>org.jboss.example.microcontainer.aspects.EnvInitialContextFactory</value>
+              </entry>
+           </map>
+   	</property>
+   </beanfactory>
+
+   <bean name="JndiAspect" class="org.jboss.aop.microcontainer.beans.Aspect">
+      <property name="advice"><inject bean="JndiAdvice"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <!-- Introduce the KernelControllerContextAware interface to the JndiBinding annotation -->
+   <bean name="JndiIntroduction" class="org.jboss.aop.microcontainer.beans.IntroductionBinding">
+      <property name="classes">@org.jboss.aop.microcontainer.aspects.jndi.JndiBinding</property>
+      <property name="interfaces">
+         <list elementClass="java.lang.String">
+            <value>org.jboss.kernel.spi.dependency.KernelControllerContextAware</value>
+         </list>
+      </property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <!-- Apply the jndi binding to all KernelControllerContextAware interface callbacks -->
+   <bean name="JndiBinding" class="org.jboss.aop.microcontainer.beans.AspectBinding">
+      <property name="pointcut">execution(* $instanceof{org.jboss.kernel.spi.dependency.KernelControllerContextAware}->$implements{org.jboss.kernel.spi.dependency.KernelControllerContextAware}(..))</property>
+      <property name="aspect"><inject bean="JndiAspect" property="definition"/></property>
+      <property name="manager"><inject bean="AspectManager"/></property>
+   </bean>
+
+   <bean name="Bean" class="org.jboss.example.microcontainer.aspects.SimpleBean">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="beans/SimpleBean", aliases={"beans/XmlAnnotatedSimpleBean"})</annotation>
+   </bean>
+
+   <bean name="AnnotatedBean" class="org.jboss.example.microcontainer.aspects.AnnotatedSimpleBean" />
+
+   <bean name="lookup" class="org.jboss.example.microcontainer.aspects.SimpleBeanLookup">
+      <property name="env">
+           <map class="java.util.Properties" keyClass="java.lang.String" valueClass="java.lang.String">
+              <entry>
+                 <key>java.naming.factory.initial</key>
+                 <value>org.jboss.example.microcontainer.aspects.EnvInitialContextFactory</value>
+              </entry>
+           </map>
+      </property>
+      <demand>JndiBinding</demand>
+   </bean>
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/dist.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/dist.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/dist.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,47 @@
+<assembly>
+  <id>dist</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>target</directory>
+      <outputDirectory/>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+  <files>
+    <file>
+      <source>${parent.relative.dir}/log4j.properties</source>
+      <outputDirectory/>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <!-- Need to explicity include dependencies here until optional dependencies are sorted out. -->
+       <includes>
+        <include>org.jboss.microcontainer:jboss-kernel</include>
+        <include>org.jboss.microcontainer:jboss-dependency</include>
+        <include>org.jboss.microcontainer:jboss-container</include>
+        <include>org.jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-logging-spi</include>
+        <include>jboss:jboss-common-logging-log4j</include>
+        <include>log4j:log4j</include>
+        <include>org.jboss:jbossxb</include>
+        <include>apache-xerces:xercesImpl</include>
+        <include>oswego-concurrent:concurrent</include>
+        <include>org.jboss.aop:jboss-aop</include>
+        <include>org.jboss.microcontainer:jboss-aop-mc-int</include>
+        <include>org.jboss:javassist</include>
+        <include>trove:trove</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/log4j.properties
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/log4j.properties	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/log4j.properties	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,7 @@
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=AOP Example %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n

Added: projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/aopDevelopment/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,107 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>aopDev</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0.0</version>
+  <name></name>
+  <description></description>
+
+  <modules>
+    <module>aspects</module>
+  </modules>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-kernel</artifactId>
+        <version>2.0.0.Beta6</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.aop</groupId>
+        <artifactId>jboss-aop</artifactId>
+        <version>2.0.0.beta1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-aop-mc-int</artifactId>
+        <version>2.0.0.Beta6</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <scope>runtime</scope>      
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-aop-mc-int</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.aop</groupId>
+      <artifactId>jboss-aop</artifactId>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins> 
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <debug>true</debug>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+          <optimize>true</optimize>
+        </configuration>
+      </plugin>  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>  
+         <configuration>
+           <archive>
+             <addMavenDescriptor>false</addMavenDescriptor>
+             <manifest>
+               <mainClass>org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap</mainClass>
+               <addClasspath>true</addClasspath>
+               <classpathPrefix>lib</classpathPrefix>
+             </manifest>
+             <manifestEntries>
+               <Class-Path>.</Class-Path>
+             </manifestEntries>
+           </archive>
+         </configuration>
+       </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>${parent.relative.dir}/dist.xml</descriptor>
+          </descriptors>
+          <finalName>${pom.artifactId}</finalName>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>directory-inline</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <parent.relative.dir>.</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,118 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>gettingStarted</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>advDeployment</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Advanced Deployment</name>
+  <description>A simple command line client that uses the aspectized deployers.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-client-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-client</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-core-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-structure-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-vfs-spi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-deployers-vfs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-managed</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-metatype</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-vfs</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer.examples</groupId>
+      <artifactId>humanResourcesService</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+    
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <addMavenDescriptor>false</addMavenDescriptor>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/main/assembly/xml.xml</descriptor>
+            <descriptor>src/main/assembly/jar.xml</descriptor>
+            <descriptor>src/main/assembly/properties.xml</descriptor>
+            <descriptor>src/main/assembly/structure.xml</descriptor>
+            <descriptor>src/main/assembly/classloader.xml</descriptor>
+            <descriptor>src/main/assembly/addStage.xml</descriptor>
+          </descriptors>
+          <finalName>${pom.artifactId}</finalName>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>directory-inline</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/addStage.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/addStage.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/addStage.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<assembly>
+  <id>addStage</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/deployer-beans-addStage.xml</source>
+      <destName>deployer-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/hrService-beans.xml</source>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/classloader.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/classloader.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/classloader.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+<assembly>
+  <id>classloader</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/deployer-beans-classloader.xml</source>
+      <destName>deployer-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/hrService-beans.xml</source>
+      <destName>otherLib/humanResourcesService-1.0.0.jar/META-INF/jboss-beans.xml</destName>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/otherLib</outputDirectory>
+      <unpack>true</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/common.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/common.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/common.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,48 @@
+<component>
+  <fileSets>
+    <fileSet>
+      <directory>target</directory>
+      <outputDirectory/>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+  <files>
+    <file>
+      <source>src/main/config/run.sh</source>
+      <fileMode>0744</fileMode>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <!-- Need to explicity include dependencies here until optional dependencies are sorted out. -->
+       <includes>
+        <include>org.jboss.microcontainer:jboss-kernel</include>
+        <include>org.jboss.microcontainer:jboss-dependency</include>
+        <include>org.jboss.microcontainer:jboss-container</include>
+        <include>org.jboss.microcontainer:jboss-deployers-client</include>
+        <include>org.jboss.microcontainer:jboss-deployers-client-spi</include>
+        <include>org.jboss.microcontainer:jboss-deployers-core</include>
+        <include>org.jboss.microcontainer:jboss-deployers-core-spi</include>
+        <include>org.jboss.microcontainer:jboss-deployers-impl</include>
+        <include>org.jboss.microcontainer:jboss-deployers-spi</include>
+        <include>org.jboss.microcontainer:jboss-deployers-structure-spi</include>
+        <include>org.jboss.microcontainer:jboss-deployers-vfs</include>
+        <include>org.jboss.microcontainer:jboss-deployers-vfs-spi</include>
+        <include>org.jboss.microcontainer:jboss-managed</include>
+        <include>org.jboss.microcontainer:jboss-metatype</include>
+        <include>org.jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-logging-spi</include>
+        <include>jboss:jboss-common-logging-log4j</include>
+        <include>log4j:log4j</include>
+        <include>org.jboss:jbossxb</include>
+        <include>apache-xerces:xercesImpl</include>
+        <include>org.jboss:jboss-vfs</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+</component>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/jar.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/jar.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/jar.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+<assembly>
+  <id>jar</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/deployer-beans-jar.xml</source>
+      <destName>deployer-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/hrService-beans.xml</source>
+      <destName>lib/humanResourcesService-1.0.0.jar/META-INF/jboss-beans.xml</destName>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>true</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/properties.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/properties.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/properties.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<assembly>
+  <id>properties</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/deployer-beans-properties.xml</source>
+      <destName>deployer-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/hrService-beans.properties</source>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/structure.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/structure.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/structure.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,34 @@
+<assembly>
+  <id>structure</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/deployer-beans-structure.xml</source>
+      <destName>deployer-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/hrService-beans.xml</source>
+      <destName>lib/humanResourcesService-1.0.0.jar/OTHER-DIR/jboss-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/jboss-structure.xml</source>
+      <destName>lib/humanResourcesService-1.0.0.jar/META-INF/jboss-structure.xml</destName>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>true</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/xml.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/xml.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/xml.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<assembly>
+  <id>xml</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/deployer-beans-xml.xml</source>
+      <destName>deployer-beans.xml</destName>
+    </file>
+    <file>
+      <source>src/main/config/hrService-beans.xml</source>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-addStage.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-addStage.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-addStage.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+    <!-- File Structure -->
+    <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>-service.xml</value>
+                <value>-beans.xml</value>
+                <value>-ds.xml</value>
+                <value>-aop.xml</value>
+             </set>
+          </parameter>
+       </constructor>
+    </bean>
+
+   <bean name="MyDeployer" class="org.jboss.example.deployment.MyDeployer">
+      <property name="type">beans</property>
+   </bean>
+   
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-classloader.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-classloader.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-classloader.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+    <!-- JAR Structure -->
+    <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+       <!-- Unless specified the default list of suffixes is .zip, .ear, .jar, ,.rar, .war, .sar, .har, .aop -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>.zip</value>
+                <value>.ear</value>
+                <value>.jar</value>
+                <value>.rar</value>
+                <value>.war</value>
+                <value>.sar</value>
+                <value>.har</value>
+                <value>.aop</value>
+                <value>.deployer</value>
+                <value>.beans</value>
+             </set>
+          </parameter>
+       </constructor>
+       <property name="candidateStructureVisitorFactory">
+          <!-- Any file that is not an ordinary directory is a candidate -->
+          <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+             <!-- A filter to exclude some obvious non-subdeployments -->
+             <property name="filter">
+                <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+                   <constructor><parameter>
+                      <list elementClass="java.lang.String">
+                         <!-- Exclude class files as subdeployments -->
+                         <value>.class</value>
+                      </list>
+                   </parameter></constructor>
+                </bean>
+             </property>
+          </bean>
+       </property>
+    </bean>
+
+   <bean name="MyClassLoaderDeployer" class="org.jboss.example.deployment.MyClassLoaderDeployer">
+      <property name="type">beans</property>
+   </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-jar.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-jar.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-jar.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+    <!-- JAR Structure -->
+    <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+       <!-- Unless specified the default list of suffixes is .zip, .ear, .jar, ,.rar, .war, .sar, .har, .aop -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>.zip</value>
+                <value>.ear</value>
+                <value>.jar</value>
+                <value>.rar</value>
+                <value>.war</value>
+                <value>.sar</value>
+                <value>.har</value>
+                <value>.aop</value>
+                <value>.deployer</value>
+                <value>.beans</value>
+             </set>
+          </parameter>
+       </constructor>
+       <property name="candidateStructureVisitorFactory">
+          <!-- Any file that is not an ordinary directory is a candidate -->
+          <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+             <!-- A filter to exclude some obvious non-subdeployments -->
+             <property name="filter">
+                <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+                   <constructor><parameter>
+                      <list elementClass="java.lang.String">
+                         <!-- Exclude class files as subdeployments -->
+                         <value>.class</value>
+                      </list>
+                   </parameter></constructor>
+                </bean>
+             </property>
+          </bean>
+       </property>
+    </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-properties.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-properties.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-properties.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+    <!-- File Structure -->
+    <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>-service.xml</value>
+                <value>-beans.xml</value>
+                <value>-ds.xml</value>
+                <value>-aop.xml</value>
+             </set>
+          </parameter>
+       </constructor>
+    </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.Properties2BeansDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-structure.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-structure.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-structure.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+    <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"/>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-xml.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-xml.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-xml.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <!-- The MainDeployer -->
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
+
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
+      </property>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
+
+    <!-- File Structure -->
+    <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>-service.xml</value>
+                <value>-beans.xml</value>
+                <value>-ds.xml</value>
+                <value>-aop.xml</value>
+             </set>
+          </parameter>
+       </constructor>
+    </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.properties
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.properties	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.properties	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,12 @@
+HRService.(class)=org.jboss.example.service.HRManager
+#HRService.hiringFreeze=true
+#HRService.salaryStrategy=(inject).AgeBasedSalary
+
+#AgeBasedSalary.(class)=org.jboss.example.service.util.AgeBasedSalaryStrategy
+#AgeBasedSalary.minSalary=1000
+#AgeBasedSalary.maxSalary=80000
+
+#LocationBasedSalary.(class)=org.jboss.example.service.util.LocationBasedSalaryStrategy
+#LocationBasedSalary.minSalary=2000
+#LocationBasedSalary.maxSalary=90000
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <!-- <property name="hiringFreeze">true</property>    
+     <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> -->
+   </bean>
+      
+   <!-- <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy">
+     <property name="minSalary">1000</property>
+     <property name="maxSalary">80000</property>
+   </bean>
+   
+   <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy">
+     <property name="minSalary">2000</property>
+     <property name="maxSalary">90000</property>
+   </bean> -->
+         
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/jboss-structure.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/jboss-structure.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/jboss-structure.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,11 @@
+<structure>
+  <context>
+    <path name=""/>
+    <metaDataPath>
+      <path name="OTHER-DIR"/>
+    </metaDataPath>
+    <classpath>
+      <path name=""/>
+    </classpath>
+  </context>
+</structure>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/run.sh
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/run.sh	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/config/run.sh	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+java -Djava.ext.dirs=`pwd`/lib -cp .:advDeployment-1.0.0.jar org.jboss.example.client.Client $1

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/Client.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/Client.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/Client.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,256 @@
+package org.jboss.example.client;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.Set;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.plugins.main.MainDeployerImpl;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+import org.jboss.example.service.HRManager;
+import org.jboss.example.service.util.SalaryStrategy;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.registry.KernelBus;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A simple client that starts JBoss Microcontainer and then  
+ * uses the command line as a User Interface to pass requests
+ * to the Human Resources service either directly or via the bus.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class Client {
+    
+	private boolean useBus = false;
+	private URL deployerBeansUrl, hrServiceBeansUrl;
+	private UserInterface userInterface;
+	private HRManager manager;
+	private MainDeployerImpl mainDeployer;
+	private Deployment deployment;
+	
+	private EmbeddedBootstrap bootstrap;
+	private KernelController controller;
+	private KernelBus bus;
+
+	private final static String MAIN_DEPLOYER = "MainDeployer";
+	private final static String DEPLOYMENT = "org.jboss.deployers.client.spi.Deployment";
+	private final static String HRSERVICE = "HRService";
+	private final static String EMPLOYEE = "org.jboss.example.service.Employee";
+
+	public static void main(String[] args) throws Exception {
+		if ((args.length == 1 && !args[0].equals("bus")) || args.length > 1) {
+			System.out.println("Usage: ./run.sh [bus]");
+			System.exit(1);
+		}
+
+		Client client = new Client(args.length == 1);
+		client.setUserInterface(new ConsoleInput(client));
+    }
+
+	public Client(final boolean useBus) throws Exception {
+		this.useBus = useBus;
+		
+		ClassLoader cl = Thread.currentThread().getContextClassLoader();
+		deployerBeansUrl = cl.getResource("deployer-beans.xml");
+		hrServiceBeansUrl = cl.getResource("hrService-beans.xml");
+		
+		if (hrServiceBeansUrl == null) {
+			hrServiceBeansUrl = cl.getResource("hrService-beans.properties");
+		}
+		
+		if (hrServiceBeansUrl == null) {
+			hrServiceBeansUrl = cl.getResource("lib/humanResourcesService-1.0.0.jar");
+		}
+		
+		if (hrServiceBeansUrl == null) {
+			hrServiceBeansUrl = cl.getResource("otherLib/humanResourcesService-1.0.0.jar");
+		}
+		
+		// Create VFSDeployment to use with aspectized deployers
+		File hrServiceBeans = new File(hrServiceBeansUrl.getFile());
+		VirtualFile root = VFS.getRoot(hrServiceBeans.toURI());	    
+		VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+	    deployment = deploymentFactory.createVFSDeployment(root);
+		
+		// Start JBoss Microcontainer
+		bootstrap = new EmbeddedBootstrap();
+		bootstrap.run();
+		
+		controller = bootstrap.getKernel().getController();
+		bus = bootstrap.getKernel().getBus();		
+ 	}
+	
+	public void setUserInterface(UserInterface userInterface) {
+		this.userInterface = userInterface;
+	}
+	
+	void deploy() {
+		bootstrap.deploy(deployerBeansUrl);	
+		if (!useBus && mainDeployer == null) {
+			ControllerContext context = controller.getInstalledContext(MAIN_DEPLOYER);
+			if (context != null) { mainDeployer = (MainDeployerImpl) context.getTarget(); }			
+		}
+	}
+	
+	void undeploy() {
+		bootstrap.undeploy(deployerBeansUrl);
+	}
+	
+	void deployService() throws DeploymentException { 
+		if (useBus) {
+			if (invoke(MAIN_DEPLOYER, "getDeployment", new Object[] {deployment.getName()}, new String[] {"java.lang.String"}) != null) {
+				System.out.println("Service is already deployed.");
+				return;
+			}			
+			
+			invoke(MAIN_DEPLOYER, "addDeployment", new Object[] {deployment}, new String[] {DEPLOYMENT});
+			invoke(MAIN_DEPLOYER, "process", new Object[] {}, new String[] {});
+		} else {
+			if (mainDeployer.getDeployment(deployment.getName()) != null) {
+				System.out.println("Service is already deployed.");
+				return;
+			}
+			
+	        mainDeployer.addDeployment(deployment);
+	        mainDeployer.process();
+	        
+	        if (manager == null) {
+				ControllerContext hrServiceCtx = controller.getInstalledContext(HRSERVICE);
+				if (hrServiceCtx != null) { manager = (HRManager) hrServiceCtx.getTarget(); }	        	
+	        }
+		}
+	}
+
+	void undeployService() throws DeploymentException {		
+		if (useBus) {
+			if (invoke(MAIN_DEPLOYER, "getDeployment", new Object[] {deployment.getName()}, new String[] {"java.lang.String"}) == null) {
+				System.out.println("Service is already undeployed.");
+				return;
+			}			
+			
+			invoke(MAIN_DEPLOYER, "removeDeployment", new Object[] {deployment}, new String[] {DEPLOYMENT});
+			invoke(MAIN_DEPLOYER, "process", new Object[] {}, new String[] {});
+		} else {
+			if (mainDeployer.getDeployment(deployment.getName()) == null) {
+				System.out.println("Service is already undeployed.");
+				return;
+			}
+			
+			mainDeployer.removeDeployment(deployment);
+		    mainDeployer.process();
+		}
+	}
+
+	private Object invoke(String serviceName, String methodName, Object[] args, String[] types) {
+		Object result = null;
+		try {
+			result = bus.invoke(serviceName, methodName, args, types);
+		} catch (Throwable t) {
+			t.printStackTrace();
+		}	
+		return result;
+	}
+	
+	boolean addEmployee() throws ParseException, NumberFormatException, IllegalArgumentException, IOException {
+		Employee newEmployee = userInterface.getEmployee();		
+		Address address = userInterface.getAddress();
+		Date dateOfBirth = userInterface.getDateOfBirth();		
+		newEmployee.setAddress(address);
+		newEmployee.setDateOfBirth(dateOfBirth);
+		
+		if (useBus)
+			return (Boolean) invoke(HRSERVICE, "addEmployee", new Object[] {newEmployee}, new String[] {EMPLOYEE});
+		else
+			return manager.addEmployee(newEmployee);			
+	}
+	
+	@SuppressWarnings("unchecked")
+	Set<Employee> listEmployees() {			
+		if (useBus)
+			return (Set<Employee>) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {});
+		else
+			return manager.getEmployees();
+	}
+	
+	void removeEmployee() throws IllegalArgumentException, IOException {			
+		Employee employee = userInterface.getEmployee();
+		
+		if (useBus)
+			invoke(HRSERVICE, "removeEmployee", new Object[] {employee}, new String[] {EMPLOYEE});
+		else
+			manager.removeEmployee(employee);
+	}
+	
+	Integer getSalary() throws IllegalArgumentException, IOException {
+		Employee employee = userInterface.getEmployee();
+
+		if (useBus)
+			return(Integer) invoke(HRSERVICE, "getSalary", new Object[] {employee}, new String[] {EMPLOYEE});
+		else
+			return manager.getSalary(employee);
+	}
+	
+	void setSalary() throws NumberFormatException, IllegalArgumentException, IOException {
+		Employee employee = userInterface.getEmployee();	
+		Integer salary = userInterface.getSalary();		
+		
+		Employee actualEmployee;
+		if (useBus) {
+			actualEmployee = (Employee) invoke(HRSERVICE, "getEmployee", new Object[] {employee.getFirstName(), employee.getLastName()}, new String[] {"java.lang.String","java.lang.String"});	
+			invoke(HRSERVICE, "setSalary", new Object[] {actualEmployee, salary}, new String[] {EMPLOYEE, "java.lang.Integer"});	
+		} else {
+			actualEmployee = manager.getEmployee(employee.getFirstName(), employee.getLastName());
+			manager.setSalary(actualEmployee, salary);			
+		}			
+	}
+	
+	boolean toggleHiringFreeze() {
+		boolean hiringFreeze;
+		if (useBus) {
+			hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {});	
+			invoke(HRSERVICE, "setHiringFreeze", new Object[] {!hiringFreeze}, new String[] {"boolean"});	
+		} else {
+			hiringFreeze = manager.isHiringFreeze();
+			manager.setHiringFreeze(!hiringFreeze);
+		}
+		return !hiringFreeze;
+	}
+	
+	@SuppressWarnings("unchecked")
+	String printStatus() {
+		boolean hiringFreeze;
+		int totalEmployees;
+		SalaryStrategy salaryStrategy;
+		
+		if (useBus) {
+			hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {});
+			Set<Employee> employees = (Set<Employee>) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {});
+			totalEmployees = employees.size();				
+			salaryStrategy = (SalaryStrategy) invoke(HRSERVICE, "getSalaryStrategy", new Object[] {}, new String[] {});
+		} else {
+			hiringFreeze = manager.isHiringFreeze();
+			totalEmployees = manager.getEmployees().size();
+			salaryStrategy = manager.getSalaryStrategy();		
+		}	
+		
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("Total number of employees: " + totalEmployees);
+		buffer.append("\nHiring Freeze: " + hiringFreeze);	
+		buffer.append("\nSalary Strategy: ");
+		if (salaryStrategy == null) {
+			buffer.append("None");
+		} else {
+			buffer.append(salaryStrategy.toString());
+		}
+		return buffer.toString();
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/ConsoleInput.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/ConsoleInput.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/ConsoleInput.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,147 @@
+package org.jboss.example.client;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URISyntaxException;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+
+/**
+ * A simple Text User Interface (TUI) so a user can access
+ * the Human Resources service from the command line.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class ConsoleInput implements UserInterface {
+	
+	private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+
+	public ConsoleInput(final Client client) {
+		System.out.println(getMenu());
+		
+		Thread eventThread = new Thread(new Runnable() {
+			private boolean deployersDeployed = false, hrServiceDeployed = false;
+			private boolean quit = false;
+			
+			public void run() {
+				
+				while (!quit) {
+
+					System.out.print(">");
+					
+					try {
+						String input = in.readLine();
+						if (input.length() != 1) {
+							System.out.println("Please enter a valid option.");
+							continue;
+						}
+	
+						char option = input.charAt(0);
+						if (deployersDeployed == false &&
+						    (option == 'D' || option == 'U' ||option == 'u' || option == 'a' ||
+						     option == 'l' || option == 'r' || option == 'g' || option == 's' ||
+						     option == 't' || option == 'p')) {
+							System.out.println("Aspectized deployers have not been deployed yet.");
+							continue;
+						} else if (hrServiceDeployed == false &&
+						    (option == 'U' || option == 'a' || option == 'l' || option == 'r' ||
+							 option == 'g' || option == 's' || option == 't' || option == 'p')) {
+							System.out.println("Service has not been deployed yet.");
+							continue;
+						}
+						
+						switch (option) {
+							case 'd': client.deploy(); deployersDeployed = true; break;
+							case 'D': client.deployService(); hrServiceDeployed = true; break;
+							case 'U': client.undeployService(); break;
+							case 'u': client.undeploy(); break;
+							case 'a': System.out.println("Added employee: " + client.addEmployee()); break;
+							case 'l': System.out.println("Employees: " + client.listEmployees()); break;
+							case 'r': client.removeEmployee(); break;
+							case 'g': System.out.println("Salary: " + client.getSalary()); break;
+							case 's': client.setSalary(); break;
+							case 't': System.out.println("Hiring Freeze: " + client.toggleHiringFreeze()); break;
+							case 'm': System.out.println(getMenu()); break;
+							case 'p': System.out.println(client.printStatus()); break;
+							case 'q': quit = true; break;
+							default: System.out.println("Invalid option."); break;
+						}
+					} catch (ParseException e) {
+						System.out.println(e.getMessage());
+					} catch (NumberFormatException e) {
+						System.out.println("Invalid integer " + e.getMessage());
+					} catch (IllegalArgumentException e) {
+						System.out.println(e.getMessage());
+					} catch (IOException e) {
+						e.printStackTrace();
+					} catch (DeploymentException e) {
+						System.out.println("Error during deployment/undeployment: " + e.getMessage());
+					}
+				}
+			}
+		});
+		
+		eventThread.start();			
+	}
+	
+	private String getMenu() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("-----------------------------------\n");
+		buffer.append("Menu:\n");
+		buffer.append("\n");
+		buffer.append("d) Deploy Aspectized Deployers\n");
+		buffer.append("D) Deploy Human Resources service\n");
+		buffer.append("U) Undeploy Human Resources service\n");
+		buffer.append("u) Undeploy Aspectized Deployers\n");
+		buffer.append("\n");
+		buffer.append("a) Add employee\n");
+		buffer.append("l) List employees\n");
+		buffer.append("r) Remove employee\n");
+		buffer.append("g) Get a salary\n");
+		buffer.append("s) Set a salary\n");
+		buffer.append("t) Toggle hiring freeze\n");
+		buffer.append("\n");
+		buffer.append("m) Display menu\n");
+		buffer.append("p) Print service status\n");
+		buffer.append("q) Quit");
+		return buffer.toString();
+	}
+
+	public Employee getEmployee() throws IllegalArgumentException, IOException {	
+
+		System.out.println("Please enter the employee's name [firstName lastName]:");
+		String name = in.readLine();
+		String[] names = name.split("\\s");
+		if (names.length != 2) { throw new IllegalArgumentException("Employees must have a first and last name."); }
+		return new Employee(names[0], names[1]);
+	}
+	
+	public Address getAddress() throws NumberFormatException, IllegalArgumentException, IOException {
+	
+		System.out.println("Please enter the employee's address [number,street,city]:");
+		String address = in.readLine();
+		String[] lines = address.split(",");
+		if (lines.length != 3) { throw new IllegalArgumentException("Addresses must contain a number, street and city."); }
+		return new Address(Integer.parseInt(lines[0]), lines[1], lines[2]);
+	}
+	
+	public Date getDateOfBirth() throws ParseException, IOException {
+	
+		System.out.println("Please enter the employee's date of birth [dd/MM/yyyy]:");
+		String date = in.readLine();
+		return new SimpleDateFormat("dd/MM/yyyy").parse(date);
+	}
+	
+	public Integer getSalary()  throws NumberFormatException, IOException {	
+	
+		System.out.println("Please enter the employee's new salary [integer]: ");
+		String salary = in.readLine();
+		return Integer.valueOf(salary);
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,59 @@
+package org.jboss.example.client;
+
+import java.net.URL;
+
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+
+/**
+ * Add a BasicXMLDeployer to the BasicBootstrap so that we can parse
+ * XML descriptors for the beans (*-beans.xml).
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class EmbeddedBootstrap extends BasicBootstrap {
+	
+	protected BasicXMLDeployer deployer;
+
+	public EmbeddedBootstrap() throws Exception {
+		super();
+	}
+
+	public void bootstrap() throws Throwable {
+		super.bootstrap();
+		deployer = new BasicXMLDeployer(getKernel());
+		Runtime.getRuntime().addShutdownHook(new Shutdown());
+	}
+
+	public void deploy(URL url) {
+		try {
+			// Workaround the fact that the BasicXMLDeployer does not handle redeployment correctly
+			if (deployer.getDeploymentNames().contains(url.toString())) {
+				System.out.println("Aspectized deployers are already deployed.");
+				return;
+			}
+			deployer.deploy(url);
+		} catch (Throwable t) {
+			log.warn("Error during deployment: " + url, t);
+		}
+	}
+
+	public void undeploy(URL url) {
+		if (!deployer.getDeploymentNames().contains(url.toString())) {
+			System.out.println("Aspectized deployers are already undeployed.");
+			return;
+		}
+		try {
+			deployer.undeploy(url);
+		} catch (Throwable t) {
+			log.warn("Error during undeployment: " + url, t);
+		}
+	}
+
+	protected class Shutdown extends Thread {
+		public void run() {
+			log.info("Shutting down");		
+			deployer.shutdown();
+		}
+	}	
+}
\ No newline at end of file

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/UserInterface.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/UserInterface.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/UserInterface.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+package org.jboss.example.client;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Date;
+
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+
+/**
+ * Allow different implementations of a user interface to be used.
+ * i.e. command line, Swing or even a mock for testing purposes.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public interface UserInterface {
+	Employee getEmployee() throws IOException;
+	Address getAddress() throws IOException;
+	Date getDateOfBirth() throws ParseException, IOException;
+	Integer getSalary() throws IOException;
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyClassLoaderDeployer.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyClassLoaderDeployer.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyClassLoaderDeployer.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+package org.jboss.example.deployment;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.jboss.deployers.spi.deployer.helpers.AbstractTopLevelClassLoaderDeployer;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.plugins.client.AbstractVFSDeployment;
+import org.jboss.virtual.VirtualFile;
+
+public class MyClassLoaderDeployer extends AbstractTopLevelClassLoaderDeployer {
+
+	@Override
+	protected ClassLoader createTopLevelClassLoader(DeploymentContext context) throws Exception {
+		
+		ClassLoader current = Thread.currentThread().getContextClassLoader();
+		
+		AbstractVFSDeployment deployment = (AbstractVFSDeployment) context.getDeployment();
+		VirtualFile root = deployment.getRoot();
+		URL url = root.getHandler().toURL();
+		
+		URLClassLoader cl = new URLClassLoader(new URL[] {url}, current);
+		context.setClassLoader(cl);
+		
+		// Hack to get the PreInstallAction working
+		Thread.currentThread().setContextClassLoader(cl);
+		
+		return context.getClassLoader();
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyDeployer.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyDeployer.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyDeployer.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,23 @@
+package org.jboss.example.deployment;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
+public class MyDeployer extends AbstractDeployer {
+
+	public MyDeployer() {
+		// We want this deployer to be called after the installed stage
+		setStage(new DeploymentStage("MyDeploymentStage", DeploymentStages.INSTALLED));
+	}
+	
+	public void deploy(DeploymentUnit unit) throws DeploymentException {
+		System.out.println("Calling deploy() within MyDeployer...");
+	}
+	
+	public void undeploy(DeploymentUnit unit) {
+		System.out.println("Calling undeploy() within MyDeployer...");
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/log4j.properties
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/log4j.properties	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/log4j.properties	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,7 @@
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=AdvDeployment %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,51 @@
+package org.jboss.example.client;
+
+import junit.framework.TestCase;
+
+/**
+ * Use a mock User Interface to pass values into the client
+ * and check that the Human Resources service is called correctly.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class ClientTestCase extends TestCase
+{	
+    public ClientTestCase(String name) {
+		super(name);
+	}
+
+	public void testClientWithoutBus() throws Exception {
+//		Client client = new Client(false);
+//		assertNotNull(client);
+//		runTests(client);
+	}
+	
+	public void testClientWithBus() throws Exception {
+//		Client client = new Client(true);
+//		assertNotNull(client);
+//		runTests(client);
+	}
+	
+	private void runTests(Client client) throws Exception {
+//		client.setUserInterface(new MockUserInterface());
+//		
+//		client.deploy();
+//
+//		assertEquals(true, client.toggleHiringFreeze());
+//		assertEquals(false, client.addEmployee());
+//		assertEquals(0, client.listEmployees().size());
+//
+//		assertEquals(false, client.toggleHiringFreeze());
+//		assertEquals(true, client.addEmployee());
+//		assertEquals(1, client.listEmployees().size());
+//		assertEquals((Integer) 10000, client.getSalary());
+//		
+//		client.setSalary();
+//		assertEquals((Integer) 50000, client.getSalary());
+//		
+//		client.removeEmployee();
+//		assertEquals(0, client.listEmployees().size());
+//		
+//		client.undeploy();
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestSuite.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestSuite.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestSuite.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,25 @@
+package org.jboss.example.client;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Allow all Client tests to be run.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class ClientTestSuite extends TestSuite
+{
+   public static void main(String[] args) {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite() {
+      TestSuite suite = new TestSuite("Client Tests");
+
+      suite.addTestSuite(ClientTestCase.class);
+
+      return suite;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/MockUserInterface.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/MockUserInterface.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/MockUserInterface.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,39 @@
+package org.jboss.example.client;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+
+/**
+ * A mock user interface to simulate values being passed in by a user.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class MockUserInterface implements UserInterface {
+
+	public Address getAddress() throws IOException {
+		return new Address(5, "Oxford St", "London");
+	}
+
+	public Date getDateOfBirth() throws ParseException, IOException {
+		Calendar age = Calendar.getInstance();
+		int year = age.get(Calendar.YEAR);
+		int month = age.get(Calendar.MONTH);
+		int day = age.get(Calendar.DAY_OF_MONTH);
+		
+		age.set(year - 43, month, day);
+		return age.getTime();
+	}
+
+	public Employee getEmployee() throws IOException {
+		return new Employee("David", "Hasselhof");
+	}
+
+	public Integer getSalary() throws IOException {
+		return new Integer("50000");
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager"/>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>gettingStarted</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>auditAspect</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Audit Aspect</name>
+  <description>An auditing aspect that keeps a log of actions performed.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.aop</groupId>
+      <artifactId>jboss-aop</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+    
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/AuditAspect.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/AuditAspect.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/AuditAspect.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,70 @@
+package org.jboss.example.aspect;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+
+import org.jboss.aop.joinpoint.ConstructorInvocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+
+/**
+ * An auditing aspect to keep track of all invocations made to
+ * methods on an object. A log file is used to store the audit
+ * information.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class AuditAspect {
+
+	private String logDir;
+	private BufferedWriter out;
+	
+	public AuditAspect() {
+		logDir = System.getProperty("user.dir") + "/log";
+		
+		File directory = new File(logDir);
+		if (!directory.exists()) {
+			directory.mkdir();
+		}
+	}
+	
+	public Object audit(ConstructorInvocation inv) throws Throwable {
+		SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy-kkmmss");
+		Calendar now = Calendar.getInstance();
+		String filename = "auditLog-" + formatter.format(now.getTime());
+
+		File auditLog = new File(logDir + "/" + filename);
+		auditLog.createNewFile();
+		out = new BufferedWriter(new FileWriter(auditLog));
+		return inv.invokeNext();		
+	}
+	
+	public Object audit(MethodInvocation inv) throws Throwable {		
+		String name = inv.getMethod().getName();
+		Object[] args = inv.getArguments();
+		Object retVal = inv.invokeNext();
+		
+		StringBuffer buffer = new StringBuffer();
+		for (int i=0; i < args.length; i++) {
+			if (i > 0) {
+				buffer.append(", ");
+			}
+			buffer.append(args[i].toString());
+		}
+		
+		if (out != null) {
+			out.write("Method: " + name);
+			if (buffer.length() > 0) {
+				out.write(" Args: " + buffer.toString());
+			}
+			if (retVal != null) {
+				 out.write(" Return: " + retVal.toString());
+			}
+			out.write("\n");
+			out.flush();
+		}
+		return retVal;
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,80 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>gettingStarted</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>client</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Client</name>
+  <description>A simple command line client that uses the Human Resources Service.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.aop</groupId>
+      <artifactId>jboss-aop</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-aop-mc-int</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer.examples</groupId>
+      <artifactId>humanResourcesService</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer.examples</groupId>
+      <artifactId>auditAspect</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+    
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <addMavenDescriptor>false</addMavenDescriptor>
+          </archive>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/main/assembly/pojo.xml</descriptor>
+            <descriptor>src/main/assembly/aop.xml</descriptor>
+            <descriptor>src/main/assembly/classloader.xml</descriptor>
+          </descriptors>
+          <finalName>${pom.artifactId}</finalName>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>directory-inline</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/aop.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/aop.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/aop.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+<assembly>
+  <id>aop</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/aop-beans.xml</source>
+      <destName>jboss-beans.xml</destName>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+        <include>org.jboss.microcontainer.examples:auditAspect</include>
+        <include>org.jboss.aop:jboss-aop</include>
+        <include>org.jboss.microcontainer:jboss-aop-mc-int</include>
+        <include>org.jboss:javassist</include>
+        <include>trove:trove</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/classloader.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/classloader.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/classloader.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,27 @@
+<assembly>
+  <id>cl</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/classloader-beans.xml</source>
+      <destName>jboss-beans.xml</destName>
+      <filtered>true</filtered>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/otherLib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/common.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/common.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/common.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,38 @@
+<component>
+  <fileSets>
+    <fileSet>
+      <directory>target</directory>
+      <outputDirectory/>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+  <files>
+    <file>
+      <source>src/main/config/run.sh</source>
+      <fileMode>0744</fileMode>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <!-- Need to explicity include dependencies here until optional dependencies are sorted out. -->
+       <includes>
+        <include>org.jboss.microcontainer:jboss-kernel</include>
+        <include>org.jboss.microcontainer:jboss-dependency</include>
+        <include>org.jboss.microcontainer:jboss-container</include>
+        <include>org.jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-logging-spi</include>
+        <include>jboss:jboss-common-logging-log4j</include>
+        <include>log4j:log4j</include>
+        <include>org.jboss:jbossxb</include>
+        <include>apache-xerces:xercesImpl</include>
+        <include>oswego-concurrent:concurrent</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+</component>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/pojo.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/pojo.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/pojo.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,26 @@
+<assembly>
+  <id>pojo</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <files>
+    <file>
+      <source>src/main/config/pojo-beans.xml</source>
+      <destName>jboss-beans.xml</destName>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <includes>
+        <include>org.jboss.microcontainer.examples:humanResourcesService</include>
+       </includes>
+     </dependencySet>
+  </dependencySets>
+  <componentDescriptors>
+    <componentDescriptor>src/main/assembly/common.xml</componentDescriptor>
+  </componentDescriptors>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/aop-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/aop-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/aop-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ 
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+   
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+     <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+   
+   <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
+               name="AuditAspect" class="org.jboss.example.aspect.AuditAspect"
+               method="audit" pointcut="execution(public org.jboss.example.service.HRManager->new(..)) OR
+                                        execution(public * org.jboss.example.service.HRManager->*(..))">
+   </aop:aspect>
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <!-- <property name="hiringFreeze">true</property>    
+     <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> -->
+   </bean>
+   
+   <!-- <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy">
+     <property name="minSalary">1000</property>
+     <property name="maxSalary">80000</property>
+   </bean>
+   
+   <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy">
+     <property name="minSalary">2000</property>
+     <property name="maxSalary">90000</property>
+   </bean> -->
+   
+</deployment>
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/classloader-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/classloader-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/classloader-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="URL" class="java.net.URL"> 
+      <constructor> 
+         <parameter>file:${project.build.directory}/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar</parameter>
+      </constructor> 
+   </bean> 
+
+   <bean name="customCL" class="java.net.URLClassLoader">
+      <constructor>
+         <parameter>
+            <array>
+               <inject bean="URL"/>
+            </array>
+         </parameter>
+      </constructor>
+   </bean>
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <classloader><inject bean="customCL"/></classloader>
+     <!-- <property name="hiringFreeze">true</property>    
+     <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> -->
+   </bean>
+      
+   <!-- <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy">
+     <property name="minSalary">1000</property>
+     <property name="maxSalary">80000</property>
+   </bean>
+   
+   <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy">
+     <property name="minSalary">2000</property>
+     <property name="maxSalary">90000</property>
+   </bean> -->
+         
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/pojo-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/pojo-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/pojo-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <!-- <property name="hiringFreeze">true</property>    
+     <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> -->
+   </bean>
+      
+   <!-- <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy">
+     <property name="minSalary">1000</property>
+     <property name="maxSalary">80000</property>
+   </bean>
+   
+   <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy">
+     <property name="minSalary">2000</property>
+     <property name="maxSalary">90000</property>
+   </bean> -->
+         
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/run.sh
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/run.sh	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/run.sh	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/Client.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/Client.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/Client.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,182 @@
+package org.jboss.example.client;
+
+import java.io.IOException;
+import java.net.URL;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.Set;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+import org.jboss.example.service.HRManager;
+import org.jboss.example.service.util.SalaryStrategy;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.registry.KernelBus;
+
+/**
+ * A simple client that starts JBoss Microcontainer and then  
+ * uses the command line as a User Interface to pass requests
+ * to the Human Resources service either directly or via the bus.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class Client {
+    
+	private boolean useBus = false;
+	private URL url;
+	private UserInterface userInterface;
+	private HRManager manager;
+	
+	private EmbeddedBootstrap bootstrap;
+	private KernelController controller;
+	private KernelBus bus;
+
+	private final static String HRSERVICE = "HRService";
+	private final static String EMPLOYEE = "org.jboss.example.service.Employee";
+
+	public static void main(String[] args) throws Exception {
+		if ((args.length == 1 && !args[0].equals("bus")) || args.length > 1) {
+			System.out.println("Usage: ./run.sh [bus]");
+			System.exit(1);
+		}
+
+		Client client = new Client(args.length == 1);
+		client.setUserInterface(new ConsoleInput(client));
+    }
+
+	public Client(final boolean useBus) throws Exception {
+		this.useBus = useBus;
+		
+		ClassLoader cl = Thread.currentThread().getContextClassLoader();
+		url = cl.getResource("jboss-beans.xml");
+	
+		// Start JBoss Microcontainer
+		bootstrap = new EmbeddedBootstrap();
+		bootstrap.run();
+		
+		controller = bootstrap.getKernel().getController();
+		bus = bootstrap.getKernel().getBus();		
+ 	}
+	
+	public void setUserInterface(UserInterface userInterface) {
+		this.userInterface = userInterface;
+	}
+	
+	void deploy() {
+		bootstrap.deploy(url);
+		if (!useBus && manager == null) {
+			ControllerContext context = controller.getInstalledContext(HRSERVICE);
+			if (context != null) { manager = (HRManager) context.getTarget(); }
+		}
+	}
+	
+	void undeploy() {
+		bootstrap.undeploy(url);
+	}
+	
+	private Object invoke(String serviceName, String methodName, Object[] args, String[] types) {
+		Object result = null;
+		try {
+			result = bus.invoke(serviceName, methodName, args, types);
+		} catch (Throwable t) {
+			t.printStackTrace();
+		}	
+		return result;
+	}
+	
+	boolean addEmployee() throws ParseException, NumberFormatException, IllegalArgumentException, IOException {
+		Employee newEmployee = userInterface.getEmployee();		
+		Address address = userInterface.getAddress();
+		Date dateOfBirth = userInterface.getDateOfBirth();		
+		newEmployee.setAddress(address);
+		newEmployee.setDateOfBirth(dateOfBirth);
+		
+		if (useBus)
+			return (Boolean) invoke(HRSERVICE, "addEmployee", new Object[] {newEmployee}, new String[] {EMPLOYEE});
+		else
+			return manager.addEmployee(newEmployee);			
+	}
+	
+	@SuppressWarnings("unchecked")
+	Set<Employee> listEmployees() {			
+		if (useBus)
+			return (Set<Employee>) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {});
+		else
+			return manager.getEmployees();
+	}
+	
+	void removeEmployee() throws IllegalArgumentException, IOException {			
+		Employee employee = userInterface.getEmployee();
+		
+		if (useBus)
+			invoke(HRSERVICE, "removeEmployee", new Object[] {employee}, new String[] {EMPLOYEE});
+		else
+			manager.removeEmployee(employee);
+	}
+	
+	Integer getSalary() throws IllegalArgumentException, IOException {
+		Employee employee = userInterface.getEmployee();
+
+		if (useBus)
+			return(Integer) invoke(HRSERVICE, "getSalary", new Object[] {employee}, new String[] {EMPLOYEE});
+		else
+			return manager.getSalary(employee);
+	}
+	
+	void setSalary() throws NumberFormatException, IllegalArgumentException, IOException {
+		Employee employee = userInterface.getEmployee();	
+		Integer salary = userInterface.getSalary();		
+		
+		Employee actualEmployee;
+		if (useBus) {
+			actualEmployee = (Employee) invoke(HRSERVICE, "getEmployee", new Object[] {employee.getFirstName(), employee.getLastName()}, new String[] {"java.lang.String","java.lang.String"});	
+			invoke(HRSERVICE, "setSalary", new Object[] {actualEmployee, salary}, new String[] {EMPLOYEE, "java.lang.Integer"});	
+		} else {
+			actualEmployee = manager.getEmployee(employee.getFirstName(), employee.getLastName());
+			manager.setSalary(actualEmployee, salary);			
+		}			
+	}
+	
+	boolean toggleHiringFreeze() {
+		boolean hiringFreeze;
+		if (useBus) {
+			hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {});	
+			invoke(HRSERVICE, "setHiringFreeze", new Object[] {!hiringFreeze}, new String[] {"boolean"});	
+		} else {
+			hiringFreeze = manager.isHiringFreeze();
+			manager.setHiringFreeze(!hiringFreeze);
+		}
+		return !hiringFreeze;
+	}
+	
+	@SuppressWarnings("unchecked")
+	String printStatus() {
+		boolean hiringFreeze;
+		int totalEmployees;
+		SalaryStrategy salaryStrategy;
+		
+		if (useBus) {
+			hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {});
+			Set<Employee> employees = (Set<Employee>) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {});
+			totalEmployees = employees.size();				
+			salaryStrategy = (SalaryStrategy) invoke(HRSERVICE, "getSalaryStrategy", new Object[] {}, new String[] {});
+		} else {
+			hiringFreeze = manager.isHiringFreeze();
+			totalEmployees = manager.getEmployees().size();
+			salaryStrategy = manager.getSalaryStrategy();		
+		}	
+		
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("Total number of employees: " + totalEmployees);
+		buffer.append("\nHiring Freeze: " + hiringFreeze);	
+		buffer.append("\nSalary Strategy: ");
+		if (salaryStrategy == null) {
+			buffer.append("None");
+		} else {
+			buffer.append(salaryStrategy.toString());
+		}
+		return buffer.toString();
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/ConsoleInput.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/ConsoleInput.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/ConsoleInput.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,133 @@
+package org.jboss.example.client;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+
+/**
+ * A simple Text User Interface (TUI) so a user can access
+ * the Human Resources service from the command line.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class ConsoleInput implements UserInterface {
+	
+	private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+
+	public ConsoleInput(final Client client) {
+		System.out.println(getMenu());
+		
+		Thread eventThread = new Thread(new Runnable() {
+			private boolean initialDeployment = false;
+			private boolean quit = false;
+			
+			public void run() {
+				
+				while (!quit) {
+
+					System.out.print(">");
+					
+					try {
+						String input = in.readLine();
+						if (input.length() != 1) {
+							System.out.println("Please enter a valid option.");
+							continue;
+						}
+	
+						char option = input.charAt(0);
+						if (initialDeployment == false &&
+						    (option == 'u' || option == 'a' || option == 'l' || option == 'r' ||
+							 option == 'g' || option == 's' || option == 't' || option == 'p')) {
+							System.out.println("Service has not been deployed yet.");
+							continue;
+						}
+						
+						switch (option) {
+							case 'd': client.deploy(); initialDeployment = true; break;
+							case 'u': client.undeploy(); break;
+							case 'a': System.out.println("Added employee: " + client.addEmployee()); break;
+							case 'l': System.out.println("Employees: " + client.listEmployees()); break;
+							case 'r': client.removeEmployee(); break;
+							case 'g': System.out.println("Salary: " + client.getSalary()); break;
+							case 's': client.setSalary(); break;
+							case 't': System.out.println("Hiring Freeze: " + client.toggleHiringFreeze()); break;
+							case 'm': System.out.println(getMenu()); break;
+							case 'p': System.out.println(client.printStatus()); break;
+							case 'q': quit = true; break;
+							default: System.out.println("Invalid option."); break;
+						}
+					} catch (ParseException e) {
+						System.out.println(e.getMessage());
+					} catch (NumberFormatException e) {
+						System.out.println("Invalid integer " + e.getMessage());
+					} catch (IllegalArgumentException e) {
+						System.out.println(e.getMessage());
+					} catch (IOException e) {
+						e.printStackTrace();
+					}					
+				}
+			}
+		});
+		
+		eventThread.start();			
+	}
+	
+	private String getMenu() {
+		StringBuffer buffer = new StringBuffer();
+		buffer.append("-----------------------------------\n");
+		buffer.append("Menu:\n");
+		buffer.append("\n");
+		buffer.append("d) Deploy Human Resources service\n");
+		buffer.append("u) Undeploy Human Resources service\n");
+		buffer.append("\n");
+		buffer.append("a) Add employee\n");
+		buffer.append("l) List employees\n");
+		buffer.append("r) Remove employee\n");
+		buffer.append("g) Get a salary\n");
+		buffer.append("s) Set a salary\n");
+		buffer.append("t) Toggle hiring freeze\n");
+		buffer.append("\n");
+		buffer.append("m) Display menu\n");
+		buffer.append("p) Print service status\n");
+		buffer.append("q) Quit");
+		return buffer.toString();
+	}
+
+	public Employee getEmployee() throws IllegalArgumentException, IOException {	
+
+		System.out.println("Please enter the employee's name [firstName lastName]:");
+		String name = in.readLine();
+		String[] names = name.split("\\s");
+		if (names.length != 2) { throw new IllegalArgumentException("Employees must have a first and last name."); }
+		return new Employee(names[0], names[1]);
+	}
+	
+	public Address getAddress() throws NumberFormatException, IllegalArgumentException, IOException {
+	
+		System.out.println("Please enter the employee's address [number,street,city]:");
+		String address = in.readLine();
+		String[] lines = address.split(",");
+		if (lines.length != 3) { throw new IllegalArgumentException("Addresses must contain a number, street and city."); }
+		return new Address(Integer.parseInt(lines[0]), lines[1], lines[2]);
+	}
+	
+	public Date getDateOfBirth() throws ParseException, IOException {
+	
+		System.out.println("Please enter the employee's date of birth [dd/MM/yyyy]:");
+		String date = in.readLine();
+		return new SimpleDateFormat("dd/MM/yyyy").parse(date);
+	}
+	
+	public Integer getSalary()  throws NumberFormatException, IOException {	
+	
+		System.out.println("Please enter the employee's new salary [integer]: ");
+		String salary = in.readLine();
+		return Integer.valueOf(salary);
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/EmbeddedBootstrap.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,59 @@
+package org.jboss.example.client;
+
+import java.net.URL;
+
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+
+/**
+ * Add a BasicXMLDeployer to the BasicBootstrap so that we can parse
+ * XML descriptors for the beans (*-beans.xml).
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class EmbeddedBootstrap extends BasicBootstrap {
+	
+	protected BasicXMLDeployer deployer;
+
+	public EmbeddedBootstrap() throws Exception {
+		super();
+	}
+
+	public void bootstrap() throws Throwable {
+		super.bootstrap();
+		deployer = new BasicXMLDeployer(getKernel());
+		Runtime.getRuntime().addShutdownHook(new Shutdown());
+	}
+
+	public void deploy(URL url) {
+		try {
+			// Workaround the fact that the BasicXMLDeployer does not handle redeployment correctly
+			if (deployer.getDeploymentNames().contains(url.toString())) {
+				System.out.println("Service is already deployed.");
+				return;
+			}
+			deployer.deploy(url);
+		} catch (Throwable t) {
+			log.warn("Error during deployment: " + url, t);
+		}
+	}
+
+	public void undeploy(URL url) {
+		if (!deployer.getDeploymentNames().contains(url.toString())) {
+			System.out.println("Service is already undeployed.");
+			return;
+		}
+		try {
+			deployer.undeploy(url);
+		} catch (Throwable t) {
+			log.warn("Error during undeployment: " + url, t);
+		}
+	}
+
+	protected class Shutdown extends Thread {
+		public void run() {
+			log.info("Shutting down");		
+			deployer.shutdown();
+		}
+	}	
+}
\ No newline at end of file

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/UserInterface.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/UserInterface.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/UserInterface.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+package org.jboss.example.client;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Date;
+
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+
+/**
+ * Allow different implementations of a user interface to be used.
+ * i.e. command line, Swing or even a mock for testing purposes.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public interface UserInterface {
+	Employee getEmployee() throws IOException;
+	Address getAddress() throws IOException;
+	Date getDateOfBirth() throws ParseException, IOException;
+	Integer getSalary() throws IOException;
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/log4j.properties
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/log4j.properties	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/log4j.properties	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,7 @@
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=Client %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,51 @@
+package org.jboss.example.client;
+
+import junit.framework.TestCase;
+
+/**
+ * Use a mock User Interface to pass values into the client
+ * and check that the Human Resources service is called correctly.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class ClientTestCase extends TestCase
+{	
+    public ClientTestCase(String name) {
+		super(name);
+	}
+
+	public void testClientWithoutBus() throws Exception {
+		Client client = new Client(false);
+		assertNotNull(client);
+		runTests(client);
+	}
+	
+	public void testClientWithBus() throws Exception {
+		Client client = new Client(true);
+		assertNotNull(client);
+		runTests(client);
+	}
+	
+	private void runTests(Client client) throws Exception {
+		client.setUserInterface(new MockUserInterface());
+		
+		client.deploy();
+
+		assertEquals(true, client.toggleHiringFreeze());
+		assertEquals(false, client.addEmployee());
+		assertEquals(0, client.listEmployees().size());
+
+		assertEquals(false, client.toggleHiringFreeze());
+		assertEquals(true, client.addEmployee());
+		assertEquals(1, client.listEmployees().size());
+		assertEquals((Integer) 10000, client.getSalary());
+		
+		client.setSalary();
+		assertEquals((Integer) 50000, client.getSalary());
+		
+		client.removeEmployee();
+		assertEquals(0, client.listEmployees().size());
+		
+		client.undeploy();
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestSuite.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestSuite.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestSuite.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,25 @@
+package org.jboss.example.client;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Allow all Client tests to be run.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class ClientTestSuite extends TestSuite
+{
+   public static void main(String[] args) {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite() {
+      TestSuite suite = new TestSuite("Client Tests");
+
+      suite.addTestSuite(ClientTestCase.class);
+
+      return suite;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/MockUserInterface.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/MockUserInterface.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/MockUserInterface.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,39 @@
+package org.jboss.example.client;
+
+import java.io.IOException;
+import java.text.ParseException;
+import java.util.Calendar;
+import java.util.Date;
+
+import org.jboss.example.service.Address;
+import org.jboss.example.service.Employee;
+
+/**
+ * A mock user interface to simulate values being passed in by a user.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class MockUserInterface implements UserInterface {
+
+	public Address getAddress() throws IOException {
+		return new Address(5, "Oxford St", "London");
+	}
+
+	public Date getDateOfBirth() throws ParseException, IOException {
+		Calendar age = Calendar.getInstance();
+		int year = age.get(Calendar.YEAR);
+		int month = age.get(Calendar.MONTH);
+		int day = age.get(Calendar.DAY_OF_MONTH);
+		
+		age.set(year - 43, month, day);
+		return age.getTime();
+	}
+
+	public Employee getEmployee() throws IOException {
+		return new Employee("David", "Hasselhof");
+	}
+
+	public Integer getSalary() throws IOException {
+		return new Integer("50000");
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager"/>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>gettingStarted</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>humanResourcesService</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Human Resources Service</name>
+  <description>A simple service created using a POJO.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <scope>test</scope>      
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+  </dependencies>
+
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Address.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Address.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Address.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,43 @@
+package org.jboss.example.service;
+
+/**
+ * A basic address.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class Address {
+
+	private int number;
+	private String street;
+	private String city;
+	
+	public Address(int number, String street, String city) {
+		this.number = number;
+		this.street = street;
+		this.city = city;
+	}
+	
+	public int getNumber() {
+		return number;
+	}
+	public void setNumber(int number) {
+		this.number = number;
+	}
+	public String getStreet() {
+		return street;
+	}
+	public void setStreet(String street) {
+		this.street = street;
+	}
+	public String getCity() {
+		return city;
+	}
+	public void setCity(String city) {
+		this.city = city;
+	}
+	
+	@Override
+	public String toString() {
+		return number + " " + street + ", " + city;
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Employee.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Employee.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Employee.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,96 @@
+package org.jboss.example.service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * A basic employee.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class Employee {
+
+	private String firstName;
+	private String lastName;
+	private Date dateOfBirth;
+	private Address address;
+	
+	public Employee(String firstName, String lastName) {
+		this.firstName = firstName;
+		this.lastName = lastName;
+	}
+	
+	public String getFirstName() {
+		return firstName;
+	}
+	public void setFirstName(String firstName) {
+		this.firstName = firstName;
+	}
+	public String getLastName() {
+		return lastName;
+	}
+	public void setLastName(String lastName) {
+		this.lastName = lastName;
+	}
+	public Date getDateOfBirth() {
+		return dateOfBirth;
+	}
+	public void setDateOfBirth(Date dateOfBirth) {
+		this.dateOfBirth = dateOfBirth;
+	}
+	public Address getAddress() {
+		return address;
+	}
+	public void setAddress(Address address) {
+		this.address = address;
+	}
+	
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		int result = 1;
+		result = prime * result
+				+ ((firstName == null) ? 0 : firstName.hashCode());
+		result = prime * result
+				+ ((lastName == null) ? 0 : lastName.hashCode());
+		return result;
+	}
+	
+	@Override
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final Employee other = (Employee) obj;
+		if (firstName == null) {
+			if (other.firstName != null)
+				return false;
+		} else if (!firstName.equals(other.firstName))
+			return false;
+		if (lastName == null) {
+			if (other.lastName != null)
+				return false;
+		} else if (!lastName.equals(other.lastName))
+			return false;
+		return true;
+	}
+	
+	@Override
+	public String toString() {
+		SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
+		StringBuffer buffer = new StringBuffer();
+		
+		buffer.append("(" + firstName + " " + lastName + ", ");
+		buffer.append(address + " - ");
+		if (dateOfBirth == null) {
+			buffer.append("Birth date unknown" + ")");
+		} else {
+			buffer.append(formatter.format(dateOfBirth) + ")");
+		}
+		
+		return buffer.toString();
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/HRManager.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/HRManager.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/HRManager.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,88 @@
+package org.jboss.example.service;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.jboss.example.service.util.SalaryStrategy;
+
+/**
+ * An HRManager (Human Resource Manager) keeps track
+ * of a set of employees and their associated salaries.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class HRManager {
+    
+	private static final Integer STANDARD_SALARY = 10000;
+	
+	private Map<Employee, Integer> employees;
+	 
+	private boolean hiringFreeze = false;
+	
+	private SalaryStrategy salaryStrategy = null;
+	
+	public HRManager() {
+		employees =  new ConcurrentHashMap<Employee, Integer>();
+ 	}
+	
+	public boolean addEmployee(Employee employee) {
+		if (hiringFreeze == false) {
+			employees.put(employee, STANDARD_SALARY);
+		}
+		
+		return (hiringFreeze == false);
+	}
+	
+	public Set<Employee> getEmployees() {
+		return employees.keySet();
+	}
+	
+	public Employee getEmployee(String firstName, String lastName) {
+		Set<Employee> employees = getEmployees();
+		for (Employee employee : employees) {
+			if (employee.getFirstName().equals(firstName)
+					&& employee.getLastName().equals(lastName)) {
+				return employee;
+			}
+		}
+		
+		return null;
+	}
+	
+	public void removeEmployee(Employee employee) {
+		employees.remove(employee);
+	}
+	
+	public Integer getSalary(Employee employee) {
+		return employees.get(employee);
+	}
+	
+	public void setSalary(Employee employee, Integer salary) {
+		if (employee == null || !employees.containsKey(employee)) {
+			return;
+		}
+		
+		int adjustedSalary = salary;
+		if (salaryStrategy != null) {
+			adjustedSalary = salaryStrategy.checkSalary(employee, salary);
+		}
+		employees.put(employee, adjustedSalary);
+	}
+
+	public boolean isHiringFreeze() {
+		return hiringFreeze;
+	}
+
+	public void setHiringFreeze(boolean hiringFreeze) {
+		this.hiringFreeze = hiringFreeze;
+	}
+	
+	public SalaryStrategy getSalaryStrategy() {
+		return salaryStrategy;
+	}
+
+	public void setSalaryStrategy(SalaryStrategy salaryStrategy) {
+		this.salaryStrategy = salaryStrategy;
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/AgeBasedSalaryStrategy.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/AgeBasedSalaryStrategy.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/AgeBasedSalaryStrategy.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,83 @@
+package org.jboss.example.service.util;
+
+import java.util.Calendar;
+
+import org.jboss.example.service.Employee;
+
+/**
+ * Check that the salary is relative to the employee's age in years.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class AgeBasedSalaryStrategy implements SalaryStrategy {
+
+	private int minSalary = 5000;
+	private int maxSalary = 100000;
+	
+	private static final int JUNIOR_MIN_SALARY = 25000;
+	private static final int SENIOR_MIN_SALARY = 50000;
+
+	public Integer checkSalary(Employee employee, Integer salary) {
+		
+		Calendar dateOfBirth = Calendar.getInstance();
+		dateOfBirth.setTime(employee.getDateOfBirth());
+		
+		Calendar now = Calendar.getInstance();
+		
+		if (now.before(dateOfBirth)) {
+			throw new IllegalArgumentException("Employee is not born yet!");
+		}
+		
+		int age = now.get(Calendar.YEAR) - dateOfBirth.get(Calendar.YEAR);
+		
+		// Check if the employee has already had their birthday this year
+		if (age > 0) {
+			if (now.get(Calendar.MONTH) - dateOfBirth.get(Calendar.MONTH) > 0) {
+				age--;
+			} else if (now.get(Calendar.MONTH) - dateOfBirth.get(Calendar.MONTH) == 0) {
+				if (now.get(Calendar.DAY_OF_MONTH) - dateOfBirth.get(Calendar.DAY_OF_MONTH) > 0 ) {
+					age--;
+				}
+			}
+		}
+
+		// Set minimum salaries depending on the age of the employee
+		if (age >= 21 && age < 30 && salary < JUNIOR_MIN_SALARY) {
+			salary = JUNIOR_MIN_SALARY; 
+		}
+		
+		if (age >= 30 && age < 50 && salary < SENIOR_MIN_SALARY) {
+			salary = SENIOR_MIN_SALARY; 
+		}
+		
+		// Apply company-wide ranges
+		if (salary < minSalary) {
+			salary = minSalary;
+		} else if (salary > maxSalary) {
+			salary = maxSalary;
+		}
+		
+		return salary;
+	}
+
+	public int getMinSalary() {
+		return minSalary;
+	}
+	
+	public void setMinSalary(int minSalary) {
+		this.minSalary = minSalary;
+	}
+	
+	public int getMaxSalary() {
+		return maxSalary;
+	}
+	
+	public void setMaxSalary(int maxSalary) {
+		this.maxSalary = maxSalary;
+	}
+	
+	@Override
+	public String toString() {
+		return "AgeBased - MinSalary: " + minSalary + " MaxSalary: " + maxSalary;
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/LocationBasedSalaryStrategy.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/LocationBasedSalaryStrategy.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/LocationBasedSalaryStrategy.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,65 @@
+package org.jboss.example.service.util;
+
+import org.jboss.example.service.Employee;
+
+/**
+ * Check that the salary is relative to the employee's location.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class LocationBasedSalaryStrategy implements SalaryStrategy {
+
+	private int minSalary = 5000;
+	private int maxSalary = 100000;
+	
+	private static final int LONDON_MIN_SALARY = 50000;
+	private static final int MANCHESTER_MIN_SALARY = 40000;
+	private static final int GLASGOW_MIN_SALARY = 30000;
+	private static final int BELFAST_MIN_SALARY = 20000;
+	
+	public Integer checkSalary(Employee employee, Integer salary) {
+		
+		String city = employee.getAddress().getCity();
+		
+		// Set minimum salaries depending on the location of the employee
+		if (city.equals("London") && salary < LONDON_MIN_SALARY) {
+			salary = LONDON_MIN_SALARY;
+		} else if (city.equals("Manchester") && salary < MANCHESTER_MIN_SALARY) {
+			salary = MANCHESTER_MIN_SALARY;
+		} else if (city.equals("Glasgow") && salary < GLASGOW_MIN_SALARY) {
+			salary = GLASGOW_MIN_SALARY;
+		} else if (city.equals("Belfast") & salary < BELFAST_MIN_SALARY) {
+			salary = BELFAST_MIN_SALARY;
+		}
+		
+		// Apply company-wide ranges
+		if (salary < minSalary) {
+			salary = minSalary;
+		} else if (salary > maxSalary) {
+			salary = maxSalary;
+		}
+		
+		return salary;
+	}
+
+	public int getMinSalary() {
+		return minSalary;
+	}
+	
+	public void setMinSalary(int minSalary) {
+		this.minSalary = minSalary;
+	}
+	
+	public int getMaxSalary() {
+		return maxSalary;
+	}
+	
+	public void setMaxSalary(int maxSalary) {
+		this.maxSalary = maxSalary;
+	}
+	
+	@Override
+	public String toString() {
+		return "LocationBased - MinSalary: " + minSalary + " MaxSalary: " + maxSalary;
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/SalaryStrategy.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/SalaryStrategy.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/SalaryStrategy.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,15 @@
+package org.jboss.example.service.util;
+
+import org.jboss.example.service.Employee;
+
+/**
+ * Apply some rules to calculate an employee's minimum and maximum salary.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public interface SalaryStrategy {
+
+	public int getMinSalary();
+	public int getMaxSalary();
+	public Integer checkSalary(Employee employee, Integer salary);
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerAgeBasedTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerAgeBasedTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerAgeBasedTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+package org.jboss.example.service;
+
+import org.jboss.example.service.HRManager;
+
+/**
+ * Check that the AgeBasedSalaryStrategy behaves as expected
+ * when used by the HRManager.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class HRManagerAgeBasedTestCase extends HRManagerTest
+{	
+    public HRManagerAgeBasedTestCase(String name) {
+		super(name);
+	}
+
+	public void testSalaryStrategy() throws Exception {
+		HRManager manager = (HRManager) getBean("HRService");
+		assertNotNull(manager);
+
+		assertEquals(false, manager.isHiringFreeze());
+		assertEquals(true, manager.addEmployee(bob));
+		assertEquals((Integer) 10000, manager.getSalary(bob));
+		
+		// Test setting a salary using an age based salary strategy
+		Employee employee = manager.getEmployee("Bob", "Smith");
+		assertNotNull(employee);
+		
+		manager.setSalary(employee, 600);		
+		assertEquals((Integer) 1000, manager.getSalary(employee));
+		
+		manager.setSalary(employee, 90000);
+		assertEquals((Integer) 80000, manager.getSalary(employee));
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerLocationBasedTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerLocationBasedTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerLocationBasedTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+package org.jboss.example.service;
+
+import org.jboss.example.service.HRManager;
+
+/**
+ * Check that the LocationBasedSalaryStrategy behaves as expected
+ * when used by the HRManager.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class HRManagerLocationBasedTestCase extends HRManagerTest
+{	
+    public HRManagerLocationBasedTestCase(String name) {
+		super(name);
+	}
+
+	public void testSalaryStrategy() throws Exception {
+		HRManager manager = (HRManager) getBean("HRService");
+		assertNotNull(manager);
+
+		assertEquals(false, manager.isHiringFreeze());
+		assertEquals(true, manager.addEmployee(rebecca));
+		assertEquals((Integer) 10000, manager.getSalary(rebecca));
+		
+		// Test setting a salary using a location based salary strategy
+		Employee employee = manager.getEmployee("Rebecca", "Jones");
+		assertNotNull(employee);
+		
+		manager.setSalary(employee, 15000);		
+		assertEquals((Integer) 20000, manager.getSalary(employee));
+		
+		manager.setSalary(employee, 71000);
+		assertEquals((Integer) 70000, manager.getSalary(employee));
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTest.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTest.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTest.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,50 @@
+package org.jboss.example.service;
+
+import java.util.Calendar;
+
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+
+/**
+ * Setup a number of test employees for the various tests.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public abstract class HRManagerTest extends MicrocontainerTest
+{
+	protected Employee bob, rebecca, karen, joe;
+
+	public HRManagerTest(String name) {
+		super(name);
+	}
+	   
+	protected void setUp() throws Exception {
+		super.setUp();
+
+		Calendar now = Calendar.getInstance();
+		int year = now.get(Calendar.YEAR);
+		int month = now.get(Calendar.MONTH);
+		int day = now.get(Calendar.DAY_OF_MONTH);
+
+		Calendar age = Calendar.getInstance();
+
+		bob = new Employee("Bob", "Smith");
+		age.set(year - 17, month, day);
+		bob.setDateOfBirth(age.getTime());
+		bob.setAddress(new Address(5, "Waterloo Road", "London"));
+
+		rebecca = new Employee("Rebecca", "Jones");
+		age.set(year - 25, month, day);
+		rebecca.setDateOfBirth(age.getTime());
+		rebecca.setAddress(new Address(16, "Holt Street", "Belfast"));
+
+		karen = new Employee("Karen", "McKenzie");
+		age.set(year - 44, month, day);
+		karen.setDateOfBirth(age.getTime());
+		karen.setAddress(new Address(78, "Kelvinbridge Road", "Glasgow"));
+
+		joe = new Employee("Joe", "Yates");
+		age.set(year - 62, month, day);
+		joe.setDateOfBirth(age.getTime());
+		joe.setAddress(new Address(30, "Oxford Street", "Manchester"));
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,43 @@
+package org.jboss.example.service;
+
+import org.jboss.example.service.HRManager;
+
+/**
+ * Check that the HRManager behaves as expected when no
+ * salary strategy is used.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class HRManagerTestCase extends HRManagerTest
+{	
+    public HRManagerTestCase(String name) {
+		super(name);
+	}
+
+	public void testHiringFiring() throws Exception {
+		HRManager manager = (HRManager) getBean("HRService");
+		assertNotNull(manager);
+
+		// Test add and remove (with and without a hiring freeze)
+		assertEquals(true, manager.isHiringFreeze());
+		assertEquals(false, manager.addEmployee(bob));
+		assertEquals(0, manager.getEmployees().size());
+		
+		manager.setHiringFreeze(false);		
+		assertEquals(false, manager.isHiringFreeze());
+
+		assertEquals(true, manager.addEmployee(bob));
+		assertEquals(1, manager.getEmployees().size());
+		assertEquals((Integer) 10000, manager.getSalary(bob));
+		
+		// Test setting a salary without using a salary strategy
+		Employee employee = manager.getEmployee("Bob", "Smith");
+		assertNotNull(employee);
+
+		manager.setSalary(employee, 600);		
+		assertEquals((Integer) 600, manager.getSalary(employee));
+		
+		manager.removeEmployee(bob);
+		assertEquals(0, manager.getEmployees().size());	
+	}
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestSuite.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestSuite.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestSuite.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,31 @@
+package org.jboss.example.service;
+
+import org.jboss.example.service.util.SalaryStrategyTestSuite;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Allow all HRManager tests to be run.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class HRManagerTestSuite extends TestSuite
+{
+   public static void main(String[] args) {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite() {
+      TestSuite suite = new TestSuite("HRManager Tests");
+      
+      suite.addTestSuite(HRManagerTestCase.class);
+      suite.addTestSuite(HRManagerAgeBasedTestCase.class);
+      suite.addTestSuite(HRManagerLocationBasedTestCase.class);
+      
+      suite.addTest(SalaryStrategyTestSuite.suite());
+      
+      return suite;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/AgeBasedSalaryTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/AgeBasedSalaryTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/AgeBasedSalaryTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+package org.jboss.example.service.util;
+
+import org.jboss.example.service.HRManagerTest;
+import org.jboss.example.service.util.SalaryStrategy;
+
+/**
+ * Check the behaviour of the AgeBasedSalaryStrategy.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class AgeBasedSalaryTestCase extends HRManagerTest
+{
+	public AgeBasedSalaryTestCase(String name) {
+		super(name);
+	}
+
+	public void testSalaryRanges() throws Exception {
+		SalaryStrategy strategy = (SalaryStrategy) getBean("AgeBasedSalary");
+		assertNotNull(strategy);
+		
+		// Check the minimum and maximum salaries for all employees
+		assertEquals(1000, strategy.getMinSalary());		
+		assertEquals(80000, strategy.getMaxSalary());		
+
+		// Check the minimum and maximum salaries that bob (age 17) can earn
+		assertEquals((Integer) 1000, strategy.checkSalary(bob, 500));
+		assertEquals((Integer) 80000, strategy.checkSalary(bob, 85000));
+
+		// Check the minimum and maximum salaries that rebecca (age 25) can earn
+		assertEquals((Integer) 25000, strategy.checkSalary(rebecca, 20000));
+		assertEquals((Integer) 80000, strategy.checkSalary(rebecca, 90000));
+		
+		// Check the minimum and maximum salaries that karen (age 44) can earn
+		assertEquals((Integer) 50000, strategy.checkSalary(karen, 49000));
+		assertEquals((Integer) 80000, strategy.checkSalary(karen, 81000));
+		
+		// Check the minimum and maximum salaries that joe (age 62) can earn
+		assertEquals((Integer) 1000, strategy.checkSalary(joe, 900));
+		assertEquals((Integer) 80000, strategy.checkSalary(joe, 90000));
+	}
+}
\ No newline at end of file

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/LocationBasedSalaryTestCase.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/LocationBasedSalaryTestCase.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/LocationBasedSalaryTestCase.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+package org.jboss.example.service.util;
+
+import org.jboss.example.service.HRManagerTest;
+import org.jboss.example.service.util.SalaryStrategy;
+
+/**
+ * Check the behaviour of the LocationBasedSalaryStrategy.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class LocationBasedSalaryTestCase extends HRManagerTest
+{
+	public LocationBasedSalaryTestCase(String name) {
+		super(name);
+	}
+
+	public void testSalaryRanges() throws Exception {
+		SalaryStrategy strategy = (SalaryStrategy) getBean("LocationBasedSalary");
+		assertNotNull(strategy);
+		
+		// Check the minimum and maximum salaries for all employees
+		assertEquals(2000, strategy.getMinSalary());		
+		assertEquals(90000, strategy.getMaxSalary());		
+
+		// Check the minimum and maximum salaries that bob (London) can earn
+		assertEquals((Integer) 50000, strategy.checkSalary(bob, 30000));
+		assertEquals((Integer) 90000, strategy.checkSalary(bob, 95000));
+
+		// Check the minimum and maximum salaries that rebecca (Belfast) can earn
+		assertEquals((Integer) 20000, strategy.checkSalary(rebecca, 10000));
+		assertEquals((Integer) 90000, strategy.checkSalary(rebecca, 91000));
+		
+		// Check the minimum and maximum salaries that karen (Glagow) can earn
+		assertEquals((Integer) 30000, strategy.checkSalary(karen, 29000));
+		assertEquals((Integer) 90000, strategy.checkSalary(karen, 98000));
+		
+		// Check the minimum and maximum salaries that joe (Manchester) can earn
+		assertEquals((Integer) 40000, strategy.checkSalary(joe, 31000));
+		assertEquals((Integer) 90000, strategy.checkSalary(joe, 96000));
+	}
+}
\ No newline at end of file

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/SalaryStrategyTestSuite.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/SalaryStrategyTestSuite.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/SalaryStrategyTestSuite.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+package org.jboss.example.service.util;
+
+import org.jboss.example.service.util.AgeBasedSalaryTestCase;
+import org.jboss.example.service.util.LocationBasedSalaryTestCase;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Allow all SalaryStrategy tests to be run.
+ * 
+ * @author <a href="mailto:mark.newton at jboss.org">Mark Newton</a>
+ */
+public class SalaryStrategyTestSuite extends TestSuite
+{
+   public static void main(String[] args) {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite() {
+      TestSuite suite = new TestSuite("SalaryStrategy Tests");
+      
+      suite.addTestSuite(AgeBasedSalaryTestCase.class);
+      suite.addTestSuite(LocationBasedSalaryTestCase.class);
+      
+      return suite;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/log4j.properties
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/log4j.properties	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/log4j.properties	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,8 @@
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=HRService %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n
+

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerAgeBasedTestCase.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerAgeBasedTestCase.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerAgeBasedTestCase.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <property name="hiringFreeze">false</property>
+     <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property>
+   </bean>
+
+   <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy">
+     <property name="minSalary">1000</property>
+     <property name="maxSalary">80000</property>
+   </bean>
+       
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerLocationBasedTestCase.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerLocationBasedTestCase.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerLocationBasedTestCase.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <property name="hiringFreeze">false</property>
+     <property name="salaryStrategy"><inject bean="LocationBasedSalary"/></property>
+   </bean>
+
+   <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy">
+     <property name="minSalary">2000</property>
+     <property name="maxSalary">70000</property>
+   </bean>
+       
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerTestCase.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerTestCase.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerTestCase.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="HRService" class="org.jboss.example.service.HRManager">
+     <property name="hiringFreeze">true</property>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/AgeBasedSalaryTestCase.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/AgeBasedSalaryTestCase.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/AgeBasedSalaryTestCase.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy">
+     <property name="minSalary">1000</property>
+     <property name="maxSalary">80000</property>
+   </bean>
+   
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/LocationBasedSalaryTestCase.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/LocationBasedSalaryTestCase.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/LocationBasedSalaryTestCase.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy">
+     <property name="minSalary">2000</property>
+     <property name="maxSalary">90000</property>
+   </bean>
+   
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/gettingStarted/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/gettingStarted/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/gettingStarted/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,127 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>gettingStarted</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0.0</version>
+  <name></name>
+  <description></description>
+
+  <!-- We need to build auditAspect before commandLineClient
+       as the client-aop assembly depends on it. -->
+  <modules>
+    <module>humanResourcesService</module>
+    <module>auditAspect</module>
+    <module>commandLineClient</module>
+  </modules>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-kernel</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-client-spi</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-client</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-core-spi</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-core</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-impl</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-spi</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-structure-spi</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-vfs-spi</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-deployers-vfs</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-managed</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-metatype</artifactId>
+        <version>${release}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss</groupId>
+        <artifactId>jboss-vfs</artifactId>
+        <version>2.0.0.Beta6</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.aop</groupId>
+        <artifactId>jboss-aop</artifactId>
+        <version>2.0.0.beta1</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-aop-mc-int</artifactId>
+        <version>${release}</version>
+        <scope>runtime</scope>
+      </dependency>
+      <dependency>
+        <groupId>junit</groupId>
+        <artifactId>junit</artifactId>
+        <version>3.8.1</version>
+        <scope>test</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <build>
+    <plugins> 
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <debug>true</debug>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+          <optimize>true</optimize>
+        </configuration>
+      </plugin>  
+    </plugins>
+  </build>
+
+    <properties>
+        <release>2.0.0.Beta9</release>
+    </properties>
+
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,18 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>integrating</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>mbeans</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>MBeans</name>
+  <description></description>
+
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/MBeanServerChecker.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/MBeanServerChecker.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/MBeanServerChecker.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.mbeans;
+
+import java.util.ArrayList;
+import javax.management.MBeanServerFactory;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MBeanServerChecker
+{
+   public void create()
+   {
+      ArrayList servers = MBeanServerFactory.findMBeanServer("jboss");
+      if (servers == null || servers.isEmpty())
+         throw new IllegalArgumentException("Only able to run this demo with MBeanServer present!");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoInjectee.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoInjectee.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoInjectee.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.mbeans;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PojoInjectee
+{
+   public PojoName getName()
+   {
+      return new PojoName("SimplePojoInjectee");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoName.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoName.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoName.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.mbeans;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PojoName implements Serializable
+{
+   private static final long serialVersionUID = 2468887813576431620L;
+   private String name;
+
+   public PojoName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public String toString()
+   {
+      return getName();
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestService.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestService.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestService.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.mbeans;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class TestService implements TestServiceMBean
+{
+   public void setInjecteeName(PojoName name)
+   {
+      System.out.println(name);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestServiceMBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestServiceMBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestServiceMBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.mbeans;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface TestServiceMBean
+{
+   public void setInjecteeName(PojoName name);
+}

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="PojoInjectee" class="org.jboss.example.microcontainer.mbeans.PojoInjectee">
+      <depends>MBeanServerChecker</depends>
+   </bean>
+
+   <bean name="MBeanServerChecker" class="org.jboss.example.microcontainer.mbeans.MBeanServerChecker" />
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-services.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-services.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-services.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <mbean code="org.jboss.example.microcontainer.mbeans.TestService"
+      name="jboss.j2ee:service=MCExampleTestService"
+      xmbean-dd="">
+      <attribute name="InjecteeName"><inject bean="PojoInjectee" property="name"/></attribute>
+   </mbean>
+
+</server>
+

Added: projects/mc-docs/trunk/examples/User_Guide/integrating/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/integrating/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/integrating/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,47 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>integrating</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0.0</version>
+  <name></name>
+  <description></description>
+
+  <modules>
+    <module>mbeans</module>
+  </modules>
+
+  <dependencyManagement>
+  </dependencyManagement>
+
+  <dependencies>
+  </dependencies>
+
+  <build>
+    <plugins> 
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <debug>true</debug>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+          <optimize>true</optimize>
+        </configuration>
+      </plugin>  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>  
+         <configuration>
+           <archive>
+             <addMavenDescriptor>false</addMavenDescriptor>
+           </archive>
+         </configuration>
+       </plugin>
+    </plugins>
+  </build>
+
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>alias</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Alias</name>
+  <description></description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/Nameable.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/Nameable.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/Nameable.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,59 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.alias;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.kernel.spi.dependency.CreateKernelControllerContextAware;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Nameable implements CreateKernelControllerContextAware
+{
+   private Set<Object> names;
+
+   public void setKernelControllerContext(KernelControllerContext context) throws Exception
+   {
+      names = new HashSet<Object>();
+      names.add(context.getName());
+      names.addAll(context.getAliases());
+   }
+
+   public void unsetKernelControllerContext(KernelControllerContext context) throws Exception
+   {
+      names.clear();
+      names = null;
+   }
+
+   public boolean contains(Object name)
+   {
+      return names != null && names.contains(name);
+   }
+
+   public String toString()
+   {
+      return names != null ? names.toString() : "<empty>";
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/ObjectHolder.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/ObjectHolder.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/ObjectHolder.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,55 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.alias;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ObjectHolder
+{
+   private Nameable nameable;
+   private Set<Nameable> names;
+
+   public ObjectHolder(Nameable nameable)
+   {
+      this.nameable = nameable;
+   }
+
+   public void setNameable(Nameable nameable)
+   {
+      this.nameable = nameable;
+   }
+
+   public void setNames(Set<Nameable> names)
+   {
+      this.names = names;
+   }
+
+   public void validate()
+   {
+      System.out.println("I'm nameable: " + nameable);
+      System.out.println("Names size: " + names.size());
+      System.out.println("Names: " + names);     
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="ObjectHolder" class="org.jboss.example.microcontainer.alias.ObjectHolder">
+      <constructor><parameter><inject bean="viaconst"/></parameter></constructor>
+      <property name="nameable"><inject bean="viaprop"/></property>
+      <property name="names">
+         <set>
+            <inject bean="vianame"/>
+            <inject bean="viaset"/>
+            <inject bean="viaextalias"/>
+         </set>
+      </property>
+      <start method="validate"/>
+   </bean>
+
+   <bean name="vianame" class="org.jboss.example.microcontainer.alias.Nameable">
+      <alias>viaprop</alias>
+      <alias>viaconst</alias>
+      <alias>viaset</alias>
+   </bean>
+
+   <alias name="vianame">viaextalias</alias>
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>annotations</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Annotations</name>
+  <description></description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <scope>compile</scope>      
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/AnnotationChecker.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/AnnotationChecker.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/AnnotationChecker.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,90 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.annotations;
+
+import java.lang.annotation.Annotation;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.kernel.spi.metadata.KernelMetaDataRepository;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotationChecker
+{
+   private Kernel kernel;
+   private Map<String, Set<String>> checker;
+
+   public void setKernel(Kernel kernel)
+   {
+      this.kernel = kernel;
+   }
+
+   public void setCheckerMap(Map<String, Set<String>> checker)
+   {
+      this.checker = checker;
+   }
+
+   public void check()
+   {
+      KernelController controller = kernel.getController();
+      for(String key : checker.keySet())
+      {
+         KernelControllerContext context = (KernelControllerContext)controller.getInstalledContext(key);
+         Set<String> annotations = checker.get(key);
+         for(String annotation : annotations)
+         {
+            System.out.println(
+                  "Annotation " + annotation + (check(context, annotation) ?
+                  " exists " : " doesn't exist ") + " on " + context.getTarget().getClass().getSuperclass()
+            );
+         }
+      }
+   }
+
+   public boolean check(KernelControllerContext context, String annotation)
+   {
+      KernelMetaDataRepository repository = kernel.getMetaDataRepository();
+      MetaData retrieval = repository.getMetaData(context);
+      if (retrieval != null)
+      {
+         Annotation[] annotations = retrieval.getAnnotations();
+         if (annotations != null && annotations.length > 0)
+         {
+            for (Annotation annItem : annotations)
+            {
+               if (annItem.annotationType().getName().equals(annotation))
+               {
+                  return true;
+               }
+            }
+         }
+      }
+      return false;
+   }
+
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/Name.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/Name.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/Name.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface Name
+{
+   String value();
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/POJO.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/POJO.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/POJO.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.annotations;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class POJO
+{
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AnnotationChecker" class="org.jboss.example.microcontainer.annotations.AnnotationChecker">
+      <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+      <property name="checkerMap">
+         <map keyClass="java.lang.String">
+            <entry>
+               <key>pojo</key>
+               <value>
+                  <set elementClass="java.lang.String">
+                     <value>org.jboss.example.microcontainer.annotations.Name</value>
+                  </set>
+               </value>
+            </entry>
+         </map>
+      </property>
+      <start method="check"/>
+      <demand>pojo</demand>
+   </bean>
+
+   <bean name="pojo" class="org.jboss.example.microcontainer.annotations.POJO">
+      <annotation>@org.jboss.example.microcontainer.annotations.Name("pojo")</annotation>
+   </bean>
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/autowiring/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>autowiring</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Autowiring</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/classloader/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>classloader</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Classloader</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>collections</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Collections</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/ObjectPrinter.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/ObjectPrinter.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/ObjectPrinter.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,77 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.collections;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+/**
+ * A ObjectPrinter.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class ObjectPrinter
+{
+   String context;
+   
+   public ObjectPrinter(String context)
+   {
+      this.context = context;
+   }
+   
+   public void setPrint(Object print)
+   {
+      if (print != null)
+      {
+         System.out.println(context + " type=" + print.getClass().getName());
+         if (print instanceof Collection)
+         {
+            for (Iterator i = ((Collection) print).iterator(); i.hasNext();)
+            {
+               Object object = i.next();
+               System.out.println("value='" + object + "' type=" + object.getClass().getName());
+               
+            }
+         }
+         else if (print instanceof Map)
+         {
+            for (Iterator i = ((Map) print).entrySet().iterator(); i.hasNext();)
+            {
+               Entry entry = (Entry) i.next();
+               Object key = entry.getKey();
+               Object value = entry.getValue();
+               System.out.println("key='" + key + "' type=" + key.getClass().getName());
+               System.out.println("value='" + value + "' type=" + value.getClass().getName());
+               
+            }
+         }
+         else
+         {
+            System.out.println("value='" + print + "'");
+         }
+         System.out.println();
+      }
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="PrintCollection" class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+      <constructor><parameter>Collection</parameter></constructor>
+      <property name="print">
+
+         <collection elementClass="java.lang.String">
+            <value>Value of type elementClass</value>
+            <value class="java.lang.Integer">4</value>
+         </collection>
+
+      </property>
+   </bean>
+
+   <bean name="PrintList" class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+      <constructor><parameter>List</parameter></constructor>
+      <property name="print">
+
+         <list elementClass="java.lang.String">
+            <value>Value of type elementClass</value>
+            <value class="java.lang.Integer">4</value>
+         </list>
+
+      </property>
+   </bean>
+
+   <bean name="PrintLinkedList" class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+      <constructor><parameter>LinkedList</parameter></constructor>
+      <property name="print">
+
+         <list class="java.util.LinkedList" elementClass="java.lang.String">
+            <value>Value of type elementClass</value>
+            <value class="java.lang.Integer">4</value>
+         </list>
+
+      </property>
+   </bean>
+
+   <bean name="PrintSet" class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+      <constructor><parameter>Set</parameter></constructor>
+      <property name="print">
+
+         <set elementClass="java.lang.String">
+            <value>Value of type elementClass</value>
+            <value class="java.lang.Integer">4</value>
+         </set>
+
+      </property>
+   </bean>
+
+   <bean name="PrintMap" class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+      <constructor><parameter>Map</parameter></constructor>
+      <property name="print">
+
+         <map keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>Key1 of type keyClass</key>
+               <value>Value1 of type valueClass</value>
+            </entry>
+            <entry>
+               <key>Key2 of type keyClass</key>
+               <value class="java.lang.Integer">4</value>
+            </entry>
+            <entry>
+               <key class="java.lang.Long">4</key>
+               <value>Value of type valueClass</value>
+            </entry>
+         </map>
+
+      </property>
+   </bean>
+
+   <bean name="PrintHashtable" class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+      <constructor><parameter>Hashtable</parameter></constructor>
+      <property name="print">
+
+         <map class="java.util.Hashtable" keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>Key1 of type keyClass</key>
+               <value>Value1 of type valueClass</value>
+            </entry>
+            <entry>
+               <key>Key2 of type keyClass</key>
+               <value class="java.lang.Integer">4</value>
+            </entry>
+            <entry>
+               <key class="java.lang.Long">4</key>
+               <value>Value of type valueClass</value>
+            </entry>
+         </map>
+
+      </property>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>constructor</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Constructor</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/ConstructorBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/ConstructorBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/ConstructorBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.constructor;
+
+/**
+ * A ConstructorBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class ConstructorBean
+{
+   public ConstructorBean(int integer)
+   {
+      System.out.println("ConstructorBean(int) with " + integer);
+   }
+
+   public ConstructorBean(String string, int integer)
+   {
+      System.out.println("ConstructorBean(String, int) with " + string + " and " + integer);
+   }
+
+   public ConstructorBean(String string, long l)
+   {
+      System.out.println("ConstructorBean(String, long) with " + string + " and " + l);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Integer" class="org.jboss.example.microcontainer.constructor.ConstructorBean">
+      <constructor>
+         <parameter>4</parameter>
+      </constructor>
+   </bean>
+
+   <bean name="StringLong" class="org.jboss.example.microcontainer.constructor.ConstructorBean">
+      <constructor>
+         <parameter>a string</parameter>
+         <parameter class="long">10</parameter>
+      </constructor>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>demand</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Demand</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Demander.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Demander.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Demander.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.demand;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Demander
+{
+   public static int counter = 0;
+
+   public void start()
+   {
+      System.out.println(counter != 2 ? "I demanded 2 beans!" : "I'm fine. :-)");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Starters.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Starters.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Starters.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,38 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.demand;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Starters
+{
+   public void start()
+   {
+      System.out.println("I'm started: " + this);   
+   }
+
+   public void installed()
+   {
+      Demander.counter++;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="demander" class="org.jboss.example.microcontainer.demand.Demander">
+      <demand state="Create">guice</demand>
+      <demand state="Create">coke</demand>
+   </bean>
+
+   <bean name="guice" class="org.jboss.example.microcontainer.demand.Starters">
+      <install method="installed"/>
+   </bean>
+
+   <bean name="coke" class="org.jboss.example.microcontainer.demand.Starters">
+      <install method="installed"/>
+   </bean>
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/dist.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/dist.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/dist.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,43 @@
+<assembly>
+  <id>dist</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+  <fileSets>
+    <fileSet>
+      <directory>target</directory>
+      <outputDirectory/>
+      <includes>
+        <include>*.jar</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+  <files>
+    <file>
+      <source>${parent.relative.dir}/log4j.properties</source>
+      <outputDirectory/>
+    </file>
+  </files>
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>/lib</outputDirectory>
+      <unpack>false</unpack>
+      <scope>runtime</scope>
+       <!-- Need to explicity include dependencies here until optional dependencies are sorted out. -->
+       <includes>
+        <include>org.jboss.microcontainer:jboss-kernel</include>
+        <include>org.jboss.microcontainer:jboss-dependency</include>
+        <include>org.jboss.microcontainer:jboss-container</include>
+        <include>org.jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-core</include>
+        <include>jboss:jboss-common-logging-spi</include>
+        <include>jboss:jboss-common-logging-log4j</include>
+        <include>log4j:log4j</include>
+        <include>org.jboss:jbossxb</include>
+        <include>apache-xerces:xercesImpl</include>
+        <include>oswego-concurrent:concurrent</include>
+      </includes>
+    </dependencySet>
+  </dependencySets>
+</assembly>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>factory</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Factory</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/FactoryCreatedBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/FactoryCreatedBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/FactoryCreatedBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.factory;
+
+/**
+ * A FactoryCreatedBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class FactoryCreatedBean
+{
+   /* package */ FactoryCreatedBean(String where)
+   {
+      System.out.println("FactoryCreatedBean() from " + where);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/SingletonFactory.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/SingletonFactory.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/SingletonFactory.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.factory;
+
+/**
+ * A singleton factory.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class SingletonFactory
+{
+   private static SingletonFactory singleton;
+   
+   public synchronized static SingletonFactory getInstance()
+   {
+      if (singleton == null)
+         singleton = new SingletonFactory();
+      return singleton;
+   }
+   
+   public FactoryCreatedBean createBean()
+   {
+      return new FactoryCreatedBean("SingletonFactory.createBean()");
+   }
+   
+   private SingletonFactory()
+   {
+      System.out.println("SingletonFactory()");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/StaticFactory.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/StaticFactory.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/StaticFactory.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.factory;
+
+/**
+ * A static factory.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class StaticFactory
+{
+   public static FactoryCreatedBean createBean()
+   {
+      return new FactoryCreatedBean("StaticFactory.createBean()");
+   }
+   
+   private StaticFactory()
+   {
+      System.out.println("YOU SHOULD NOT SEE THIS!");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="StaticFactoryCreatedBean" class="org.jboss.example.microcontainer.factory.FactoryCreatedBean">
+      <constructor factoryMethod="createBean" factoryClass="org.jboss.example.microcontainer.factory.StaticFactory"/>
+   </bean>
+
+   <bean name="SingletonFactory" class="org.jboss.example.microcontainer.factory.SingletonFactory">
+      <constructor factoryMethod="getInstance" factoryClass="org.jboss.example.microcontainer.factory.SingletonFactory"/>
+   </bean>
+
+   <bean name="SingletonFactoryCreatedBean" class="org.jboss.example.microcontainer.factory.FactoryCreatedBean">
+      <constructor factoryMethod="createBean">
+         <factory bean="SingletonFactory"/>
+      </constructor>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>injection</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Injection</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/InjectionBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/InjectionBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/InjectionBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.injection;
+
+/**
+ * A PropertiesBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class InjectionBean
+{
+   String name;
+   
+   public InjectionBean(String name)
+   {
+      this.name = name;
+      System.out.println("InjectionBean() " + this);
+   }
+
+   public String toString()
+   {
+      return name;
+   }
+   
+   public void setHost(String host)
+   {
+      System.out.println("setHost: " + host + " on " + this);
+   }
+   
+   public void setOther(InjectionBean other)
+   {
+      System.out.println("setOther: " + other + " on " + this);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="URL" class="java.net.URL">
+      <constructor>
+         <parameter>http://www.jboss.org/index.html</parameter>
+      </constructor>
+   </bean>
+
+   <bean name="InjectionBean1" class="org.jboss.example.microcontainer.injection.InjectionBean">
+      <constructor>
+         <parameter>InjectionBean1</parameter>
+      </constructor>
+      <property name="host"><inject bean="URL" property="host"/></property>
+   </bean>
+
+   <bean name="InjectionBean2" class="org.jboss.example.microcontainer.injection.InjectionBean">
+      <constructor>
+         <parameter>InjectionBean2</parameter>
+      </constructor>
+      <property name="other"><inject bean="InjectionBean1"/></property>
+   </bean>
+
+   <bean name="Circular1" class="org.jboss.example.microcontainer.injection.InjectionBean">
+      <constructor>
+         <parameter>Circular1</parameter>
+      </constructor>
+      <property name="other"><inject bean="Circular2"/></property>
+   </bean>
+
+   <bean name="Circular2" class="org.jboss.example.microcontainer.injection.InjectionBean">
+      <constructor>
+         <parameter>Circular2</parameter>
+      </constructor>
+      <property name="other"><inject bean="Circular1" state="Instantiated"/></property>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>installation</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Installation</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/DeamonTimer.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/DeamonTimer.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/DeamonTimer.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.installation;
+
+import java.util.Timer;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DeamonTimer extends Timer
+{
+   public DeamonTimer()
+   {
+      super(true);
+   }
+
+   public void cancel()
+   {
+      System.out.println("Canceling timer: " + this);
+      super.cancel();
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/MyTimerTask.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/MyTimerTask.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/MyTimerTask.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.installation;
+
+import java.util.TimerTask;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MyTimerTask extends TimerTask
+{
+   public MyTimerTask()
+   {
+      System.out.println("Creating MyTimerTask [" + this + "]");
+   }
+
+   public void run()
+   {
+      System.out.println("Running timer task: " + this);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Task" class="org.jboss.example.microcontainer.installation.MyTimerTask">
+      <install bean="Timer" method="schedule">
+         <parameter><this/></parameter>
+         <parameter class="long">100</parameter>
+         <parameter class="long">10000</parameter>
+      </install>
+      <uninstall method="cancel"/>
+   </bean>
+
+   <bean name="Timer" class="org.jboss.example.microcontainer.installation.DeamonTimer">
+      <uninstall method="cancel"/>
+   </bean>
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/javabeans/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>javabeans</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Javabeans</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>lifecycle</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Lifecycle</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/LifecycleBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/LifecycleBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/LifecycleBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,64 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.lifecycle;
+
+/**
+ * A Lifecycle Bean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class LifecycleBean
+{
+   String name;
+   
+   public LifecycleBean(String name)
+   {
+      this.name = name;
+      System.out.println("LifecycleBean() " + this);
+   }
+   
+   public void create()
+   {
+      System.out.println("create: " + this);
+   }
+   
+   public void start()
+   {
+      System.out.println("start: " + this);
+   }
+   
+   public void stop()
+   {
+      System.out.println("stop: " + this);
+   }
+   
+   public void destroy()
+   {
+      System.out.println("destroy: " + this);
+   }
+
+   public String toString()
+   {
+      return name;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Lifecycle1" class="org.jboss.example.microcontainer.lifecycle.LifecycleBean">
+      <constructor>
+         <parameter>Lifecycle1</parameter>
+      </constructor>
+      <depends>Lifecycle2</depends>
+   </bean>
+
+   <bean name="Lifecycle2" class="org.jboss.example.microcontainer.lifecycle.LifecycleBean">
+      <constructor>
+         <parameter>Lifecycle2</parameter>
+      </constructor>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>locator</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Locator</name>
+  <description></description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <scope>compile</scope>      
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/ControllerLocator.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/ControllerLocator.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/ControllerLocator.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.locator;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * A locator that uses the kernel controller.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40465 $
+ */
+public class ControllerLocator implements Locator
+{
+   private KernelController controller;
+
+   public void setController(KernelController controller)
+   {
+      this.controller = controller;
+   }
+
+   public Object locate(String name)
+   {
+      if (controller == null)
+         return null;
+      ControllerContext context = controller.getInstalledContext(name);
+      if (context == null)
+         return null;
+      return context.getTarget();
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/HashtableLocator.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/HashtableLocator.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/HashtableLocator.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.locator;
+
+import java.util.Hashtable;
+
+/**
+ * A locator that uses a hashtable.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40465 $
+ */
+public class HashtableLocator implements Locator
+{
+   private static final HashtableLocator singleton = new HashtableLocator();
+
+   private Hashtable locations;
+
+   public static HashtableLocator getLocator()
+   {
+      return singleton;
+   }
+   
+   private HashtableLocator ()
+   {
+   }
+
+   public void setLocations(Hashtable locations)
+   {
+      this.locations = locations;
+   }
+
+   public Object locate(String name)
+   {
+      if (locations == null)
+         return null;
+      return locations.get(name);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/Locator.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/Locator.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/Locator.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.locator;
+
+/**
+ * Locator.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40465 $
+ */
+public interface Locator
+{
+   Object locate(String name);
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/SimpleBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/SimpleBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/SimpleBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.locator;
+
+/**
+ * A SimpleBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40465 $
+ */
+public class SimpleBean
+{
+   private String text;
+
+   public SimpleBean()
+   {
+   }
+
+   public String getText()
+   {
+      return text;
+   }
+
+   public void setText(String text)
+   {
+      this.text = text;
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/User.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/User.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/User.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.locator;
+
+/**
+ * User of a locator
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40465 $
+ */
+public class User
+{
+   private Locator locator;
+
+   public Locator getLocator()
+   {
+      return locator;
+   }
+
+   public void setLocator(Locator locator)
+   {
+      this.locator = locator;
+   }
+   
+   public void create()
+   {
+      if (locator == null)
+         throw new IllegalStateException("Locator is not set");
+
+      System.out.println("=============================================================");
+      System.out.println("Using locator: " + locator);
+      System.out.println();
+      
+      SimpleBean bean = (SimpleBean) locator.locate("Simple1");
+      System.out.println("SimpleBean1 text=" + bean.getText());
+
+      bean = (SimpleBean) locator.locate("Simple2");
+      System.out.println("SimpleBean2 text=" + bean.getText());
+      System.out.println("=============================================================");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Simple1" class="org.jboss.example.microcontainer.locator.SimpleBean">
+      <property name="text">Simple1</property>
+   </bean>
+      
+   <bean name="Simple2" class="org.jboss.example.microcontainer.locator.SimpleBean">
+      <property name="text">Simple2</property>
+   </bean>
+      
+   <bean name="HashtableLocator" class="org.jboss.example.microcontainer.locator.HashtableLocator">
+      <constructor factoryMethod="getLocator" factoryClass="org.jboss.example.microcontainer.locator.HashtableLocator"/>
+      <property name="locations">
+         <map class="java.util.Hashtable" keyClass="java.lang.String" valueClass="java.lang.Object">
+            <entry>
+               <key>Simple1</key>
+               <value><inject bean="Simple1"/></value>
+            </entry>
+            <entry>
+               <key>Simple2</key>
+               <value><inject bean="Simple2"/></value>
+            </entry>
+         </map>
+      </property>
+   </bean>
+      
+   <bean name="HashtableLocatorUser" class="org.jboss.example.microcontainer.locator.User">
+      <property name="locator"><inject bean="HashtableLocator"/></property>
+   </bean>
+      
+   <bean name="ControllerLocator" class="org.jboss.example.microcontainer.locator.ControllerLocator">
+      <property name="controller"><inject bean="jboss.kernel:service=KernelController"/></property>
+   </bean>
+      
+   <bean name="ControllerLocatorUser" class="org.jboss.example.microcontainer.locator.User">
+      <property name="locator"><inject bean="ControllerLocator"/></property>
+   </bean>
+
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/log4j.properties
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/log4j.properties	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/log4j.properties	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,7 @@
+log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=POJO Example %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,108 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>pojoDev</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0.0</version>
+  <name></name>
+  <description></description>
+
+  <modules>
+    <module>simple</module>
+    <module>constructor</module>
+    <module>factory</module>
+    <module>properties</module>
+    <module>injection</module>
+    <module>collections</module>
+    <module>lifecycle</module>
+    <module>installation</module>
+    <module>classloader</module>
+    <module>annotations</module>
+    <module>alias</module>
+    <module>supply</module>
+    <module>demand</module>
+    <module>autowiring</module>
+    <module>javabeans</module>
+    <module>spring</module>
+    <module>locator</module>
+  </modules>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-kernel</artifactId>
+        <version>2.0.0.Beta6</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.microcontainer</groupId>
+        <artifactId>jboss-spring-int</artifactId>
+        <version>2.0.0.Beta6</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins> 
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <debug>true</debug>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+          <optimize>true</optimize>
+        </configuration>
+      </plugin>  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>  
+         <configuration>
+           <archive>
+             <addMavenDescriptor>false</addMavenDescriptor>
+             <manifest>
+               <mainClass>org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap</mainClass>
+               <addClasspath>true</addClasspath>
+               <classpathPrefix>lib</classpathPrefix>
+             </manifest>
+             <manifestEntries>
+               <Class-Path>.</Class-Path>
+             </manifestEntries>
+           </archive>
+         </configuration>
+       </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>${parent.relative.dir}/dist.xml</descriptor>
+          </descriptors>
+          <finalName>${pom.artifactId}</finalName>
+        </configuration>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>directory-inline</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+  <properties>
+    <parent.relative.dir>.</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>properties</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Properties</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/PropertiesBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/PropertiesBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/PropertiesBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.properties;
+
+import java.net.URL;
+
+/**
+ * A PropertiesBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class PropertiesBean
+{
+   public PropertiesBean()
+   {
+      System.out.println("PropertiesBean()");
+   }
+   
+   public void setTitle(String title)
+   {
+      System.out.println("setTitle: " + title);
+   }
+   
+   public void setSubTitle(String subTitle)
+   {
+      System.out.println("setSubTitle: " + subTitle);
+   }
+   
+   public void setLink(URL url)
+   {
+      System.out.println("setLink: " + url);
+   }
+   
+   public void setNumber(Number number)
+   {
+      System.out.println("setNumber: " + number + " type=" + number.getClass().getName());
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean">
+      <property name="title">JBoss Microcontainer property example</property>
+      <property name="subTitle"><null/></property>
+      <property name="link">http://www.jboss.org</property>
+      <property name="number" class="java.lang.Long">4</property>
+   </bean>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>simple</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Simple</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/SimpleBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/SimpleBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/SimpleBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.simple;
+
+/**
+ * A SimpleBean.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 37459 $
+ */
+public class SimpleBean
+{
+   public SimpleBean()
+   {
+      System.out.println("SimpleBean() constructor");
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Simple" class="org.jboss.example.microcontainer.simple.SimpleBean"/>
+      
+</deployment>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,29 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>spring</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Spring</name>
+  <description></description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-spring-int</artifactId>
+      <scope>runtime</scope>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/MCBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/MCBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/MCBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,33 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.spring;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MCBean
+{
+   public void setSimpleBean(SimpleBean simpleBean)
+   {
+      System.out.println("Setting simple bean: " + simpleBean);
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/SimpleBean.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/SimpleBean.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/SimpleBean.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,123 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.spring;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SimpleBean
+{
+
+   private int x;
+   private double y;
+   private String s;
+   private List mylist;
+   private Set myset;
+   private Map mymap;
+   private MCBean refBean;
+
+   public SimpleBean()
+   {
+   }
+
+   public SimpleBean(int x, double y, String s)
+   {
+      this.x = x;
+      this.y = y;
+      this.s = s;
+   }
+
+   public int getX()
+   {
+      return x;
+   }
+
+   public double getY()
+   {
+      return y;
+   }
+
+   public String getS()
+   {
+      return s;
+   }
+
+   public List getMylist()
+   {
+      return mylist;
+   }
+
+   public void setMylist(List mylist)
+   {
+      this.mylist = mylist;
+   }
+
+   public Set getMyset()
+   {
+      return myset;
+   }
+
+   public void setMyset(Set myset)
+   {
+      this.myset = myset;
+   }
+
+   public Map getMymap()
+   {
+      return mymap;
+   }
+
+   public void setMymap(Map mymap)
+   {
+      this.mymap = mymap;
+   }
+
+   public MCBean getRefBean()
+   {
+      return refBean;
+   }
+
+   public void setRefBean(MCBean refBean)
+   {
+      System.out.println("Setting ref bean: " + refBean);
+      refBean.setSimpleBean(this);
+      this.refBean = refBean;
+   }
+
+   public String toString()
+   {
+      StringBuilder builder = new StringBuilder();
+      builder.append(x).append(",");
+      builder.append(y).append(",");
+      builder.append(s).append(",");
+      builder.append(mylist).append(",");
+      builder.append(myset).append(",");
+      builder.append(mymap);
+      builder.append(refBean);
+      return builder.toString();
+   }
+
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<beans xmlns="urn:jboss:spring-beans:2.0">
+
+   <bean id="testBean" class="org.jboss.example.microcontainer.spring.SimpleBean">
+      <constructor-arg index="2">
+         <value>SpringBean</value>
+      </constructor-arg>
+      <constructor-arg index="0">
+         <value>1</value>
+      </constructor-arg>
+      <constructor-arg index="1">
+         <value>3.14159</value>
+      </constructor-arg>
+      <property name="mylist">
+         <list value-type="java.lang.String">
+            <value>onel</value>
+            <value>twol</value>
+            <value>threel</value>
+         </list>
+      </property>
+      <property name="myset">
+         <set value-type="java.lang.String">
+            <value>ones</value>
+            <value>twos</value>
+            <value>ones</value>
+         </set>
+      </property>
+      <property name="mymap">
+         <map>
+            <entry>
+               <key>
+                  <value>test_key</value>
+               </key>
+               <value>myvalue</value>
+            </entry>
+         </map>
+      </property>
+      <property><ref bean="mcBean"/></property>
+   </bean>
+
+   <bean xmlns="urn:jboss:bean-deployer:2.0" name="mcBean" class="org.jboss.example.microcontainer.spring.MCBean"/>
+
+   <!-- TODO other features -->
+
+</beans>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/pom.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>org.jboss.microcontainer.examples</groupId>
+    <artifactId>pojoDev</artifactId>
+    <version>1.0.0</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer.examples</groupId>
+  <artifactId>supply</artifactId>
+  <packaging>jar</packaging>
+  <version>1.0.0</version>
+  <name>Supply</name>
+  <description></description>
+
+  <properties>
+    <parent.relative.dir>..</parent.relative.dir>
+  </properties>
+</project>

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/Binder.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/Binder.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/Binder.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.supply;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface Binder
+{
+   Object getBindedObject();
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/PojoLookup.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/PojoLookup.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/PojoLookup.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.supply;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PojoLookup
+{
+   public void start()
+   {
+      Binder binder = StaticBinder.getInstance();
+      System.out.println("Got it, " + binder.getBindedObject());
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/StaticBinder.java
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/StaticBinder.java	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/StaticBinder.java	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.example.microcontainer.supply;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class StaticBinder implements Binder
+{
+   private static Binder instance;
+
+   private StaticBinder()
+   {
+      System.out.println("Creating StaticBinder");
+   }
+
+   public static Binder getInstance()
+   {
+      if (instance == null)
+         instance = new StaticBinder();
+      return instance;
+   }
+
+   public Object getBindedObject()
+   {
+      return "[BindedObject]";
+   }
+}

Added: projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/jboss-beans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="lookup" class="org.jboss.example.microcontainer.supply.PojoLookup">
+      <demand>pojo</demand>
+   </bean>
+
+   <bean name="binder">
+      <constructor factoryMethod="getInstance" factoryClass="org.jboss.example.microcontainer.supply.StaticBinder"/>
+      <supply>pojo</supply>
+   </bean>
+
+</deployment>

Added: projects/mc-docs/trunk/gettingstarted/en-US/pom.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.microcontainer</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.2.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer</groupId>
+  <artifactId>getting-started-${translation}</artifactId>
+  <version>1.0</version>
+  <packaging>jdocbook</packaging>
+  <name>JBossMC Getting Started Guide (${translation})</name>
+  <description>The JBossMC Getting Started Guide (${translation})</description>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.jboss.maven.plugins</groupId>
+        <artifactId>maven-jdocbook-plugin</artifactId>
+        <version>2.0.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <formats>
+            <format>
+              <formatName>pdf</formatName>
+              <finalName>gettingstarted.pdf</finalName>
+            </format>
+            <format>
+              <formatName>html</formatName>
+              <finalName>index.html</finalName>
+            </format>
+          </formats>
+          <sourceDocumentName>master.xml</sourceDocumentName>
+          <options>
+            <xincludeSupported>true</xincludeSupported>
+          </options>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <properties>
+    <translation>en_US</translation>
+  </properties>
+  
+</project>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/master.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/master.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/master.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<book lang="en">
+   <bookinfo>
+      <title>Getting Started with the JBoss Microcontainer</title>
+
+      <subtitle>A Guide for POJO Developers</subtitle>
+
+      <releaseinfo>2.0.0</releaseinfo>
+   </bookinfo>
+
+   <toc></toc>
+
+   <preface id="target" revision="1">
+      <title>Target Audience</title>
+
+      <para>This guide is aimed at developers who want to use the Microcontainer to assemble their own applications or
+         use it to develop shared services in the JBoss Application Server.
+      </para>
+   </preface>
+
+   <preface id="preface" revision="1">
+      <title>Preface</title>
+
+      <para>Commercial development support, production support and training for
+         the JBoss Microcontainer is available through
+         <ulink url="http://www.jboss.com">JBoss Inc.</ulink>
+         The JBoss Microcontainer is a project of the JEMS product suite.
+      </para>
+
+      <para>Authors:
+         <itemizedlist spacing="compact">
+            <listitem>
+               <para>Adrian Brock - Chief Scientist of JBoss Inc.</para>
+               <para>Scott Stark - VP Architecture &amp; Technology</para>
+               <para>Kabir Khan - JBoss AOP Project Lead</para>
+               <para>Ales Justin - JBoss Microcontainer Project Lead</para>
+            </listitem>
+         </itemizedlist>
+      </para>
+   </preface>
+
+   <xi:include href="modules/introduction.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/installation.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/glossary.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/examples.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/packaging.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/core.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/modules.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/mbeans.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/vfs.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/deployers.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/managed.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/classloader.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/osgi.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/reliance.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/guice.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/standalone.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/conclusion.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+</book>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/annotations.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/annotations.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/annotations.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,959 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<section>
+   <title>Annotations support</title>
+
+   <para>We learned how to configure our POJOs with Microcontainer's XML elements.
+      In today's development most of the configuration is done with annotations.
+      The Microcontainer is no exception.
+   </para>
+
+   <para>Almost all of the features available in XML are also present in the Microcontainer's
+      annotations support, except for the classloading configuration, which for obvious reasons
+      doesn't have its equivalent (the class needs to be loaded before we can check for annotations, right). 
+      Let's now look at the annotations supported and some of its caveats.
+   </para>
+
+   <para>Like in most other configurations XML and predetermined bean metadata override annotations.
+      This is the current list of supported annotations and their XML equivalents. Later we will show how
+      you can extend support for your own annotations directly into Microcontainer's configuration.
+   </para>
+
+      <itemizedlist>
+         <listitem>
+            <para>@Aliases - &lt;alias></para>
+            <para>
+               <programlisting>
+     /**
+      * The aliases.
+      * Equivalent to deployment's alias element.
+      *
+      * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+      */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.TYPE})
+      public @interface Aliases
+      {
+         /**
+          * Get aliases array.
+          *
+          * @return the aliases
+          */
+         String[] value();
+
+         /**
+          * Do system property replace.
+          *
+          * @return true to replace system property, false otherwise
+          */
+         boolean replace() default true;
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Aliases({"MyAlias", "YetAnotherSimpleBean"})
+      public class AliasSimpleBeanImpl extends SimpleBeanImpl
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@ArrayValue - &lt;array></para>
+            <para>@CollectionValue - &lt;collection></para>
+            <para>@ListValue - &lt;list></para>
+            <para>@SetValue - &lt;set></para>
+            <para>
+               <programlisting>
+      /**
+       * Injecting array value.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>     
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface ArrayValue
+      {
+         /**
+          * Set the array class.
+          *
+          * @return array class name
+          */
+         String clazz() default "";
+
+         /**
+          * Array's element class.
+          *
+          * @return element class name
+          */
+         String elementClass() default "";
+
+         /**
+          * Get the values.
+          *
+          * @return the values
+          */
+         Value[] value();
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @ArrayValue(
+         value = {
+            @Value(string = @StringValue("string1")),
+            @Value(string = @StringValue("string2")),
+            @Value(string = @StringValue("string2")),
+            @Value(string = @StringValue("string1"))
+         },
+         elementClass = "java.lang.String",
+         clazz = "[Ljava.lang.Comparable;"
+      )
+      public void setArray(Object[] array)
+      {
+         super.setArray(array);
+      }
+
+      @CollectionValue(
+         value = {
+            @Value(string = @StringValue("string1")),
+            @Value(string = @StringValue("string2")),
+            @Value(string = @StringValue("string2")),
+            @Value(string = @StringValue("string1"))
+         },
+         elementClass = "java.lang.String",
+         clazz = "java.util.ArrayList"
+      )
+      public void setCollection(Collection collection)
+      {
+         super.setCollection(collection);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Constructor - &lt;constructor></para>
+            <para>
+               <programlisting>
+      /**
+       * Mark the constructor used to instantiate bean.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.CONSTRUCTOR})
+      public @interface Constructor
+      {
+      }
+         </programlisting>
+      </para>
+      <para>
+         Example:
+         <programlisting>
+      @Constructor
+      public TestConstructorBean(@Inject(bean = "testBean") TestBean test)
+      {
+         ...
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Create - &lt;create></para>
+            <para>@Start - &lt;start></para>
+            <para>@Stop - &lt;stop></para>
+            <para>@Destroy - &lt;destroy></para>
+            <para>
+               <programlisting>
+      /**
+       * Mark lifecycle create method.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD})
+      public @interface Create
+      {
+         /**
+          * Is this lifecycle callback ignored.
+          *
+          * @return ignored
+          */
+         boolean ignored() default false;
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Create
+      public void notCreate(
+                 @Inject(bean = "Name1") SimpleBeanWithLifecycle bean)
+      {
+         super.notCreate(bean);
+      }
+
+      @Start
+      public void notStart(@Inject(bean = "Name2")SimpleBeanWithLifecycle bean)
+      {
+         super.notStart(bean);
+      }
+
+      @Stop
+      public void notStop(@Inject(bean = "Name3")SimpleBeanWithLifecycle bean)
+      {
+         super.notStop(bean);
+      }
+
+      @Destroy
+      public void notDestroy(
+                 @Inject(bean = "Name4")SimpleBeanWithLifecycle bean)
+      {
+         super.notDestroy(bean);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Demands - &lt;demands></para>
+            <para>
+               <programlisting>
+      /**
+       * The demands.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.TYPE})
+      public @interface Demands
+      {
+         /**
+          * Get demands.
+          *
+          * @return the demands
+          */
+         Demand[] value();
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Demands({@Demand("WhatIWant")})
+      public class DemandSimpleBeanImpl extends SimpleBeanImpl
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Depends - &lt;depends></para>
+            <para>
+               <programlisting>
+      /**
+       * The depends values.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.TYPE})
+      public @interface Depends
+      {
+         /**
+          * Get the depends values.
+          *
+          * @return the depends
+          */
+         String[] value();
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Depends({"Name1"})
+      public class DependSimpleBeanWithLifecycle extends SimpleBeanWithLifecycle
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@ExternalInstalls - &lt;install bean="..." method="..."/></para>
+            <para>@ExternalUninstalls - &lt;uninstall bean="..." method="..."/></para>
+            <para>
+               <programlisting>
+      /**
+       * Array of external installs.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.TYPE})
+      public @interface ExternalUninstalls
+      {
+         /**
+          * Get external installs.
+          *
+          * @return the external installs
+          */
+         ExternalInstall[] value();
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @ExternalInstalls({
+         @ExternalInstall(bean = "Name1", method = "addSimpleBean", 
+            parameters = {@Value(thisValue = @ThisValue)})})
+      @ExternalUninstalls({
+         @ExternalInstall(bean = "Name1", method = "removeSimpleBean", 
+            parameters = {@Value(thisValue = @ThisValue)})})
+      public class ExternalInstallSimpleBeanImpl implements Serializable, SimpleBean
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Factory - &lt;constructor>&lt;factory ...></para>
+            <para>
+               <programlisting>
+      /**
+       * Define constructor factory.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.TYPE})
+      public @interface Factory
+      {
+         /**
+          * Get the factory.
+          *
+          * @return the factory value
+          */
+         Value factory() default @Value();
+
+         /**
+          * Get the factory class.
+          *
+          * @return the factory class
+          */
+         String factoryClass() default "";
+
+         /**
+          * Get the factory method.
+          *
+          * @return the factory method
+          */
+         String factoryMethod();
+
+         /**
+          * Get parameters.
+          *
+          * @return the parameters
+          */
+         Value[] parameters() default {};
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Factory(
+            factory = @Value(javabean = @JavaBeanValue(
+              "org.jboss.test.kernel.config.support.SimpleBeanFactory")),
+            factoryMethod = "createSimpleBean",
+            parameters = {@Value(string = @StringValue("Factory Value"))}
+      )
+      public class FromFactoryWithParamSimpleBean extends SimpleBean
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@FactoryMethod - &lt;constructor>&lt;factory factoryMethod="..." ...></para>
+            <para>
+               <programlisting>
+      /**
+       * Mark static method as factory method.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD})
+      public @interface FactoryMethod
+      {
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @FactoryMethod
+      public static SimpleInject getInstance(@NullValue Object someNull)
+      {
+         return new SimpleInject();
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Inject - &lt;inject></para>
+            <para>
+               <programlisting>
+      /**
+       * Beans when injected by class type are by default changed to configured
+       * state - if not yet configured.
+       * You can change this behavior by setting state.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface Inject
+      {
+         /**
+          * Get bean.
+          * Default is no bean.
+          *
+          * @return bean name
+          */
+         String bean() default "";
+
+         /**
+          * Get property.
+          * Default is no property.
+          *
+          * @return property name
+          */
+         String property() default "";
+
+         /**
+          * Get when required.
+          *
+          * @return when required.
+          */
+         String whenRequired() default "";
+
+         /**
+          * Get dependent state.
+          * Default is Installed.
+          *
+          * @return dependent state.
+          */
+         String dependentState() default "Installed";
+
+         /**
+          * Get injection type.
+          * Default is by class.
+          *
+          * @return injection type
+          */
+         InjectType type() default InjectType.BY_CLASS;
+
+         /**
+          * Get injection option.
+          * Default is Strict.
+          *
+          * @return injection option
+          */
+         InjectOption option() default InjectOption.STRICT;
+
+         /**
+          * Get from context injection.
+          *
+          * @return from context type
+          */
+         FromContext fromContext() default FromContext.NONE;
+
+         /**
+          * Is this @Inject valid.
+          * Used with @Value.
+          *
+          * @return is this instance valid
+          */
+         boolean valid() default true;
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Inject(bean = "Name1")
+      public void setSimpleBean(SimpleBean bean)
+      {
+         super.setSimpleBean(bean);
+      }
+
+      @Start
+      public void startMeUp(
+        @Inject(bean = "lifecycleBean") TestBean bean, 
+          @ValueFactory(bean="valueBean", 
+          method = "getValue", 
+          parameter = "123") 
+        int value)
+      {
+         test = bean;
+         intVF =- value;
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Install - &lt;incallback></para>
+            <para>@Uninstall - &lt;uncallback></para>
+            <para>
+               <programlisting>
+      /**
+       * Install callback.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD})
+      public @interface Install
+      {
+         /**
+          * Get the cardinality.
+          * Default is no cardinality.
+          *
+          * @return cardinality
+          */
+         String cardinality() default "";
+
+         /**
+          * Get when required.
+          * Default is Configured.
+          *
+          * @return when required.
+          */
+         String whenRequired() default "Configured";
+
+         /**
+          * Get dependent state.
+          * Default is Installed.
+          *
+          * @return dependent state.
+          */
+         String dependentState() default "Installed";
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Install
+      public void addDeployer(MyDeployer deployer)
+      {
+         if (deployers == null)
+            deployers = new HashSet&lt;MyDeployer>();
+         deployers.add(deployer);
+      }
+
+      @Uninstall
+      public void removeDeployer(MyDeployer deployer)
+      {
+         deployers.remove(deployer);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@InstallMethod - &lt;install></para>
+            <para>Sethod - &lt;uninstall></para>
+            <para>
+               <programlisting>
+      /**
+       * Internal installation method.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD})
+      public @interface InstallMethod
+      {
+         /**
+          * Get dependant state.
+          *
+          * @return the dependant state
+          */
+         String dependantState() default "";
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @InstallMethod
+      public void install()
+      {
+         installed = true;
+      }
+
+      @UninstallMethod
+      public void uninstall()
+      {
+         installed = false;
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@JavaBeanValue - &lt;javabean></para>
+            <para>
+               <programlisting>
+      /**
+       * Java bean value.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface JavaBeanValue
+      {
+         /**
+          * Get java bean class name.
+          * Must have default constructor.
+          *
+          * @return the class name
+          */
+         String value() default "";
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Factory(
+            factory = @Value(javabean = @JavaBeanValue(
+               "org.jboss.test.kernel.config.support.SimpleBeanFactory")),
+            factoryMethod = "createSimpleBean"
+      )
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@MapValue - &lt;map></para>
+            <para>
+               <programlisting>
+      /**
+       * Map value injection.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface MapValue
+      {
+         /**
+          * Get the map class name.
+          *
+          * @return the map class name
+          */
+         String clazz() default "";
+
+         /**
+          * Get the key class name.
+          *
+          * @return the key class name
+          */
+         String keyClass() default "";
+
+         /**
+          * Get the value class name.
+          *
+          * @return the value class name
+          */
+         String valueClass() default "";
+
+         /**
+          * Get the entries.
+          *
+          * @return the entries
+          */
+         EntryValue[] value();
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Constructor
+      public AnnotatedLDAPFactory(
+            @MapValue(
+                  keyClass = "java.lang.String",
+                  valueClass = "java.lang.String",
+                  value = {
+                     @EntryValue(
+                        key = @Value(string = @StringValue("foo.bar.key")),
+                        value = @Value(string = @StringValue("QWERT"))
+                     ),
+                     @EntryValue(
+                        key = @Value(string = @StringValue("xyz.key")),
+                        value = @Value(string = @StringValue(" QWERT "))
+                     )
+                  }
+            )
+            Map&lt;String, String> map
+      )
+      {
+         super(map);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@NullValue - &lt;null></para>
+            <para>
+               <programlisting>
+      /**
+       * Null value.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface NullValue
+      {
+         /**
+          * Is valid.
+          * Used in @Parameter and @value to define
+          * unused value.
+          *
+          * @return is value valid
+          */
+         boolean valid() default true;
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @UninstallMethod
+      public void withUninstall(
+         @ThisValue SimpleInject me, 
+         @NullValue Object plainNull)
+      {
+         System.out.println(me == this);
+         System.out.println("plainNull = " + plainNull);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@StringValue - &lt;value>somestring&lt;/value></para>
+            <para>
+               <programlisting>
+      /**
+       * String value.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface StringValue
+      {
+         /**
+          * Get the value.
+          *
+          * @return the value
+          */
+         String value();
+
+         /**
+          * Get type.
+          *
+          * @return the type
+          */
+         String type() default "";
+
+         /**
+          * Do replace with system properties.
+          *
+          * @return true for replace with system properties, false otherwise
+          */
+         boolean replace() default true;
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Constructor
+      public ParamIntConstructorAnnBean(@StringValue("7") Integer string)
+      {
+         super(string);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@Supplys - &lt;supply></para>
+            <para>
+               <programlisting>
+      /**
+       * The supplys.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.TYPE})
+      public @interface Supplys
+      {
+         /**
+          * Get supply values.
+          *
+          * @return the supplys
+          */
+         String[] value();
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @Supplys({"WhatIWant"})
+      public class SupplyPlainDependecySimpleBeanImpl 
+         extends PlainDependecySimpleBeanImpl
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@ThisValue - &lt;this/></para>
+            <para>
+               <programlisting>
+      /**
+       * This value.
+       * Get the underlying target.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface ThisValue
+      {
+         /**
+          * Is instance valid.
+          *
+          * @see @org.jboss.beans.metadata.api.annotations.Value
+      * @see @org.jboss.beans.metadata.api.annotations.Parameter
+      * @return true for valid
+          */
+         boolean valid() default true;
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @InstallMethod
+      public void whenInstalled(
+         @ThisValue SimpleInject me, 
+		 @NullValue Object plainNull)
+      {
+         System.out.println(me == this);
+         System.out.println("plainNull = " + plainNull);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+         <listitem>
+            <para>@ValueFactory - &lt;value-factory></para>
+            <para>
+               <programlisting>
+      /**
+       * The value factory.
+       *
+       * @author &lt;a href="mailto:ales.justin at jboss.com">Ales Justin&lt;/a>
+       */
+      @Retention(RetentionPolicy.RUNTIME)
+      @Target({ElementType.METHOD, ElementType.PARAMETER})
+      public @interface ValueFactory
+      {
+         /**
+          * Get the bean.
+          *
+          * @return the bean
+          */
+         String bean();
+
+         /**
+          * Get the method.
+          *
+          * @return the method
+          */
+         String method();
+
+         /**
+          * Get single parameter.
+          *
+          * @return the single parameter
+          */
+         String parameter() default "";
+
+         /**
+          * Get parameters.
+          *
+          * @return the parameters
+          */
+         Parameter[] parameters() default {};
+
+         /**
+          * Get default value.
+          *
+          * @return the default value
+          */
+         String defaultValue() default "";
+
+         /**
+          * Get dependant state.
+          *
+          * @return the dependant state
+          */
+         String dependantState() default "Installed";
+
+         /**
+          * Get when required state.
+          *
+          * @return the when required state
+          */
+         String whenRequiredState() default "Configured";
+      }
+               </programlisting>
+            </para>
+            <para>
+               Example:
+               <programlisting>
+      @ValueFactory(bean = "ldap", 
+         method = "getValue", parameter = "foo.bar.key")
+      public void setValue(String value)
+      {
+         super.setValue(value);
+      }
+               </programlisting>
+            </para>
+         </listitem>
+
+      </itemizedlist>
+
+   <para>TODO - extending annotations support.      
+   </para>
+
+</section>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/aop.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/aop.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/aop.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<section>
+   <title>AOP Configuration and Usage</title>
+
+   <para>When writing a new version of the Kernel, there was always a need for
+      simple usage of advanced AOP features in the Kernel itself.
+      With version 2.0.0 of the Microcontainer there is an elegant way of
+      binding your aspect to wired POJOs, using all the advantages of full
+      dependency state machine. Meaning that even aspects behave as installed
+      services, having full lifecycle and dependency support in the Microcontainer.
+      And it's all a matter of configuration if you want to use an aspectized Microcontainer
+      or just plain POJO behaviour. To find out more about JBoss AOP, please see the JBoss
+      AOP documentation.
+   </para>
+
+   <sect2>
+      <title>Configuration</title>
+      <para>To leverage the JBoss AOP integration in the Microcontainer you need to make sure
+         that <literal>jboss-aop-mc-int.jar</literal> is available on the classpath. The
+         Microcontainer will decide how whether to use AOP depending on if classes
+         from this jar are present.
+      </para>
+
+      <para>To use the AOP integration we must include the <literal>AspectManager</literal> bean.
+         in our configuration. It is included as follows
+      </para>
+
+      <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor
+         factoryClass="org.jboss.aop.AspectManager"
+         factoryMethod="instance"/>
+   </bean>
+
+   <!-- declare beans and aspects -->
+</deployment>
+      ]]></programlisting>
+
+   </sect2>
+
+   <sect2>
+      <title>Using Aspects</title>
+      <para>We can apply aspects to any beans we like. This can either be done by using already woven
+         classes (loadtime or compile-time weaving). If the bean class is not already woven, but should
+         have aspects applied to it, a proxy will be generated. If the class is not woven, field level
+         aspects will not get triggered, you will only get constructor and method-level interception.
+      </para>
+
+      <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor
+         factoryClass="org.jboss.aop.AspectManager"
+         factoryMethod="instance"/>
+   </bean>
+
+   <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
+               name="FooAdvice"
+               class="org.jboss.test.microcontainer.support.TestAspect">
+   </aop:aspect>
+   
+   <aop:bind xmlns:aop="urn:jboss:aop-beans:1.0"
+               pointcut="execution(* *.SimpleBeanImpl->someMethod(..))">
+      <advice aspect="FooAdvice" advice="foo"/>	  
+   </aop:bind>
+
+   <bean
+      name="Intercepted"
+      class="org.jboss.test.microcontainer.support.SimpleBeanImpl"/>
+   <!-- declare beans and aspects -->
+</deployment>
+      ]]></programlisting>
+      <programlisting><![CDATA[
+import org.jboss.aop.joinpoint.Invocation;
+
+public class TestAspect
+{
+   public static boolean fooCalled;
+   public static boolean barCalled;
+   boolean shouldInvoke;
+
+   public Object foo(Invocation inv) throws Throwable
+   {
+      System.out.println("--- foo");
+      return inv.invokeNext();
+   }
+}
+      ]]></programlisting>
+
+      <para>In the above example, the elements in the <literal>aop</literal>
+         namespace follow the same format as in a <literal>-aop.xml</literal>. 
+         Please see the JBoss AOP documentation for more details.
+      </para>
+      <para>
+         Whenever we call the method <literal>someMethod()</literal>
+         in the <literal>Intercepted</literal> bean, we will get intercepted by the
+         <literal>FooAdvice</literal> bean's <literal>foo()</literal> method. The aspect
+         methods must have the signature shown. The JBoss AOP documentation contains
+         more information about advice methods, and the pointcut expressions used to pick out
+         methods/constructors/fields that should have aspects applied.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>AOP Lifecycle callbacks</title>
+      <para>We can also aspectize the installs and uninstalls of a bean. The following
+         snippet shows a AOP lifecycle callback handler that gets triggered once
+         <literal>StartBean</literal> enters the <literal>start</literal> state upon
+         deployment, and when it leaves the <literal>start</literal> state upon
+         undeployment.
+      </para>
+
+      <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor
+         factoryClass="org.jboss.aop.AspectManager"
+         factoryMethod="instance"/>
+   </bean>
+
+   <aop:lifecycle-start xmlns:aop="urn:jboss:aop-beans:1.0"
+               name="InstallAdvice"
+               class="org.jboss.test.microcontainer.support.LifecycleCallback"
+               classes="@org.jboss.test.microcontainer.support.Start">
+   </aop:lifecycle-start>
+
+   <bean name="StartBean"
+      class="org.jboss.test.microcontainer.support.SimpleBeanImpl">
+      <annotation>@org.jboss.test.microcontainer.support.Start</annotation>
+   </bean>
+
+</deployment>
+      ]]></programlisting>
+      <programlisting><![CDATA[
+import org.jboss.dependency.spi.ControllerContext;
+
+public class LifecycleCallback{
+   public void install(ControllerContext ctx){
+      System.out.println("Bean " + ctx.getName() + " is being installed";
+   }
+
+   public void install(ControllerContext ctx){
+      System.out.println("Bean " + ctx.getName() + " is being uninstalled";
+   }
+}
+      ]]></programlisting>
+
+      <para>The <literal>install</literal> and <literal>uninstall</literal> methods
+         are required, and must have the signature shown. The names of these methods can be
+         overridden by passing in the <literal>installMethod</literal> and
+         <literal>uninstallMethod</literal> attributes as part of the
+         <literal>aop:lifecycle-start</literal> tag.
+      </para>
+
+      <para>We can also intercept the install/uninstall upon entering/leaving other states, by
+         substituting <literal>aop:lifecycle-start</literal> with one of the following.
+      </para>
+
+      <itemizedlist mark="bullet">
+         <listitem><literal>aop:lifecycle-configure</literal> -
+            Triggered when the target beans enter/leave the <literal>configure</literal>
+            lifecycle state upon deployment/undeployment</listitem>
+         <listitem><literal>aop:lifecycle-create </literal> -
+            Triggered when the target beans enter/leave the <literal>create</literal>
+            lifecycle state upon deployment/undeployment</listitem>
+         <listitem><literal>aop:lifecycle-describe</literal> -
+            Triggered when the target beans enter/leave the <literal>describe</literal>
+            lifecycle state upon deployment/undeployment</listitem>
+         <listitem><literal>aop:lifecycle-install</literal> -
+            Triggered when the target beans enter/leave the <literal>install</literal>
+            lifecycle state upon deployment/undeployment</listitem>
+         <listitem><literal>aop:lifecycle-instantiate</literal> -
+            Triggered when the target beans enter/leave the <literal>instantiate</literal>
+            lifecycle state upon deployment/undeployment</listitem>
+      </itemizedlist>
+
+   </sect2>
+
+   <sect2>
+      <title>Aspect dependencies</title>
+      <para>Aspects and AOP lifecycle callbacks configured via the microcontainer can have
+         dependencies just as normal beans can have. Beans which have these aspects applied
+         inherit the aspect's dependencies.
+      </para>
+
+      <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor
+         factoryClass="org.jboss.aop.AspectManager"
+         factoryMethod="instance"/>
+   </bean>
+
+   <aop:lifecycle-configure xmlns:aop="urn:jboss:aop-beans:1.0"
+            name="JMXAdvice"
+            class="org.jboss.aop.microcontainer.aspects.jmx.JMXLifecycleCallback"
+            classes="@org.jboss.aop.microcontainer.aspects.jmx.JMX">
+      <property name="mbeanServer"><inject bean="MBeanServer"/></property>
+   </aop:lifecycle-configure>
+
+   <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0"
+            name="TxAdvice"
+            class="org.acme.aspects.TxAspect"
+      <property name="txManager"><inject bean="TxManager"/></property>
+   </aop:aspect>
+
+   <aop:bind xmlns:aop="urn:jboss:aop-beans:1.0"
+            pointcut="execution(* *->@org.acme.Tx(..))">
+      <advice aspect="TxAdvice" name="invoke"/>
+   </aop:bind>
+
+   <bean name="BeanWithAspects"
+      class="org.jboss.test.microcontainer.support.SimpleBeanImpl">
+      <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX</annotation>
+      <annotation>@org.acme.Tx</annotation>
+   </bean>
+
+   <bean name="PlainBean"
+      class="org.jboss.test.microcontainer.support.SimpleBeanImpl">
+   </bean>
+
+</deployment>
+      ]]></programlisting>
+
+      <para><literal>JmxAdvice</literal> depends on a
+      bean called <literal>MBeanServer</literal> having been deployed, and
+      <literal>TxAdvice</literal> depends on a bean called <literal>TxManager</literal>
+      having been deployed. <literal>BeanWithAspects</literal> has been annotated with both
+      <literal>@JMX</literal> and <literal>@Tx</literal>. Using this configuration,
+      <literal>BeanWithAspects</literal> gets both <literal>JMXAdvice</literal> and
+      <literal>TxAdvice</literal> applied. <literal>BeanWithAspects</literal> inherits the dependencies
+      of all applied aspects and AOP lifecycle callbacks, so it cannot be started until
+      <literal>JMXAdvice</literal> and <literal>TxAdvice</literal> have their dependencies
+      satisfied. <literal>PlainBean</literal> on the other hand, has no aspects applied, and
+      so has no extra dependencies from the AOP layer.
+      </para>
+
+   </sect2>
+</section>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/basics.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/basics.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/basics.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,1775 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<sect1>
+   <title>Basic Configuration and Usage</title>
+
+   <para>The Microcontainer's main purpose is to allow external configuration of
+      POJOs. As we have seen in
+      <xref linkend="examples"/>
+      , the POJOs in a Microcontainer applications are nothing special. The key element that drives
+      the application is the
+      <varname>jboss-beans.xml</varname>
+      configuration file.
+      So, in this chapter, we will look at the some of the common configurations in
+      <varname>jboss-beans.xml</varname>
+      .
+   </para>
+
+   <sect2>
+      <title>Deployment</title>
+
+      <para>The
+         <varname>deployment</varname>
+         element acts as a container for many beans that are deployed together.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+         <?xml version="1.0" encoding="UTF-8"?>
+
+         <!-- Deployment holds beans -->
+         <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         </deployment>
+
+]]>
+   </programlisting>
+
+   </sect2>
+
+   <sect2>
+      <title>Bean</title>
+
+      <para>The
+         <varname>bean</varname>
+         element is the main deployment component. It describes a single managed object in the runtime.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+         <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+         <bean name="Simple"
+            class="org.jboss.example.microcontainer.simple.SimpleBean"/>
+
+         </deployment>
+
+]]>
+      </programlisting>
+
+      <para>The example above from the
+         <varname>simple</varname>
+         example uses the default constructor of
+         <varname>SimpleBean</varname>
+         to create a new POJO.
+      </para>
+
+      <programlisting>
+         new org.jboss.example.microcontainer.simple.SimpleBean();
+      </programlisting>
+
+      <para>It is given the name
+         <varname>"Simple"</varname>
+         such that it can be referenced elsewhere.
+      </para>
+   </sect2>
+
+   <sect2>
+      <title>Construction</title>
+
+      <para>The example above uses the default constructor. What if you want to use some other constructor? The
+         simplest mechanism just matches the number of parameters in the constructor. The example below is from the
+         <varname>constructor</varname>
+         example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class ConstructorBean
+   {
+      ... ...
+
+      public ConstructorBean(int integer)
+      {
+         ... ...
+      }
+   }
+]]>
+      </programlisting>
+
+      <para>The
+         <varname>jboss-beans.xml</varname>
+         element for creating the POJO using the above constructor is as follows.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="Integer"
+      class="org.jboss.example.microcontainer.constructor.ConstructorBean">
+
+      <constructor>
+         <parameter>4</parameter>
+      </constructor>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>The microcontainer would just use the following to create the
+         <varname>Integer</varname>
+         named component.
+      </para>
+
+      <programlisting>
+         new ConstructorBean (4);
+      </programlisting>
+
+      <para>Sometimes there are two constructors with the same number of parameters. In this case, you must specify the
+         types to resolve the ambiguity.
+      </para>
+
+      <programlisting>
+         public class ConstructorBean {
+         public ConstructorBean(String string, int integer) {}
+         public ConstructorBean(String string, long long) {}
+         }
+      </programlisting>
+
+      <para>The following configuration creates a managed bean instance named
+         <varname>StringLong</varname>
+         using the second constructor listed above.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="StringLong"
+      class="org.jboss.example.microcontainer.constructor.ConstructorBean">
+
+      <constructor>
+         <parameter>a string</parameter>
+         <parameter class="long">10</parameter>
+      </constructor>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Behind the scene, the Micorcontainer invokes:</para>
+
+      <programlisting>
+         new ConstructorBean ("a string", (long) 10);
+      </programlisting>
+
+      <para>Note that you only have to be explicit enough to resolve the ambiguity.</para>
+
+   </sect2>
+
+   <sect2>
+      <title>Factories</title>
+
+      <para>Not all classes have pubic constructors. It is often good practice to use factories when you to have a
+         choice of implementation for an interface. The microcontainer includes support for the several different types
+         of factory. The simplest case is a static factory class with a static factory method like the following from
+         the
+         <varname>factory</varname>
+         example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class StaticFactory
+   {
+      public static FactoryCreatedBean createBean()
+      {
+         return new FactoryCreatedBean("StaticFactory.createBean()");
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>The bean configuration tells the microcontainer to the use the
+         <varname>StaticFactory.createBean()</varname>
+         static method to create an instance of
+         <varname>FactoryCreatedBean</varname>
+         .
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="StaticFactoryCreatedBean"
+      class="org.jboss.example.microcontainer.factory.FactoryCreatedBean">
+
+      <constructor factoryMethod="createBean"
+         factoryClass="org.jboss.example.microcontainer.factory.StaticFactory"/>
+
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Of course, the factory class itself does not have to be static. The microcontainer can create a non-static
+         factory itself as a managed object, and then use this factory object to create other bean objects. For
+         instance, the
+         <varname>factory</varname>
+         example contains a singleton factory class example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class SingletonFactory
+   {
+      private static SingletonFactory singleton;
+
+      public synchronized static SingletonFactory getInstance()
+      {
+         if (singleton == null)
+            singleton = new SingletonFactory();
+
+         return singleton;
+      }
+
+      public FactoryCreatedBean createBean()
+      {
+         return new FactoryCreatedBean("SingletonFactory.createBean()");
+      }
+
+      private SingletonFactory()
+      {
+         System.out.println("SingletonFactory()");
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>In the following configuration, we first create an instance of the
+         <varname>SingletonFactory</varname>
+         class under the name
+         <varname>"SingletonFactory"</varname>
+         using the
+         <varname>SingletonFactory.getInstance()</varname>
+         static method. Then, we use this factory object to create a
+         <varname>FactoryCreatedBean</varname>
+         instance under the name
+         <varname>SingletonFactoryCreatedBean</varname>
+         .
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="SingletonFactory"
+      class="org.jboss.example.microcontainer.factory.SingletonFactory">
+
+      <constructor factoryMethod="getInstance"
+         factoryClass="org.jboss.example.microcontainer.factory.SingletonFactory"/>
+
+   </bean>
+
+   <bean name="SingletonFactoryCreatedBean"
+      class="org.jboss.example.microcontainer.factory.FactoryCreatedBean">
+
+      <constructor factoryMethod="createBean">
+         <factory bean="SingletonFactory"/>
+      </constructor>
+
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Like the constructor method we mentioned before, the factory method can also take call parameters via the
+         nested
+         <varname>parameter</varname>
+         element.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>Properties</title>
+
+      <para>It is possible to create all objects using factories and constructors, however many people use the JavaBean
+         or MBean convention where an object is constructed using a default constructor and then configured using
+         properties or attributes (i.e., setter methods). The following class from the
+         <varname>properties</varname>
+         example is a JavaBean style POJO.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class PropertiesBean
+   {
+      public PropertiesBean()
+      {
+         System.out.println("PropertiesBean()");
+      }
+
+      public void setTitle(String title)
+      {
+         System.out.println("setTitle: " + title);
+      }
+
+      public void setSubTitle(String subTitle)
+      {
+         System.out.println("setSubTitle: " + subTitle);
+      }
+
+      public void setLink(URL url)
+      {
+         System.out.println("setLink: " + url);
+      }
+
+      public void setNumber(Number number)
+      {
+         System.out.println("setNumber: " + number + " type=" + number.getClass().getName());
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>The configuration creates the
+         <varname>PropertiesBean</varname>
+         instance and then uses the setter methods to set its properties.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="PropertiesBean"
+      class="org.jboss.example.microcontainer.properties.PropertiesBean">
+
+      <property name="title">JBoss Microcontainer property example</property>
+      <property name="subTitle"><null/></property>
+      <property name="link">http://www.jboss.org</property>
+      <property name="number" class="java.lang.Long">4</property>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Here we use the string representation of various objects, including the
+         <varname>null</varname>
+         value. They will be discussed in more detail in the next section.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>String Values</title>
+
+      <para>Now, you probably noticed that we use string values to represent all kinds of objects in the
+         <varname>parameter</varname>
+         element for the constructors or factory methods, and in the
+         <varname>property</varname>
+         element for JavaBean properties.
+      </para>
+
+      <para>In the most generic case, a JavaBean
+         <ulink url="http://java.sun.com/j2se/1.4.2/docs/api/java/beans/PropertyEditor.html">PropertyEditor</ulink>
+         can be used to convert a string to a specific type. JBoss already provides a large number of property editors
+         for standard types. Please see the example below for the POJO class, the configuration, and the resultant
+         Microcontainer action.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   import java.beans.PropertyEditorSupport;
+
+   public class URLEditor extends PropertyEditorSupport
+   {
+      public void setAsText(final String text)
+      {
+         setValue(new URL(text));
+      }
+   }
+
+   public class Example
+   {
+      public URL getLink() {}
+
+      public void setLink(URL url) {}
+
+   }
+
+   <bean name="Name1" class=com.acme.Example">
+      <property name="link">http://acme.com/index.html</property>
+   </bean>
+
+   Example example = new com.acme.Example();
+   PropertyEditor editor = PropertyEditorManager.findEditor(URL.class);
+   editor.setAsText("http://acme.com/index.html");
+   example.setLink((URL)editor.getValue());
+
+]]>
+      </programlisting>
+
+      <para>Often the property takes an interface or abstract class, but you want to pass a specific implementation or a
+         subclass. That is easy. Just specify the implementation class in the
+         <varname>property.class</varname>
+         attribute as show below.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class Example
+   {
+         public Number getNumber() {}
+
+         public void setNumber(Number number) {}
+
+   }
+
+   <bean name="Name1" class=com.acme.Example">
+      <property name="number" class="java.lang.Long">4</property>
+   </bean>
+
+   Example example = new com.acme.Example();
+   example.setNumber(new Long(4));
+
+]]>
+      </programlisting>
+
+
+      <para>There is also a more long-winded form of value that we will see later when configuring collections.</para>
+
+      <programlisting>
+<![CDATA[
+
+   public class Example
+   {
+      public Number getNumber() {}
+
+      public void setNumber(Number number) {}
+
+   }
+
+   <bean name="Name1" class=com.acme.Example">
+      <property name="number">
+         <value class="java.lang.Long">4</value>
+      </property>
+   </bean>
+
+   Example example = new com.acme.Example();
+   example.setNumber(new Long(4));
+
+]]>
+      </programlisting>
+
+
+      <para>Finally, the
+         <varname>null</varname>
+         value is trivial, <varname><![CDATA[<null/>]]></varname>. But, it needs to differentiated from the string "null". Please see the example
+         below for the usage.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class Example
+   {
+         public String getTitle() {}
+
+         public void setTitle(String string) {}
+
+   }
+
+   <!-- Wrong -->
+   <bean name="Name1" class=com.acme.Example">
+      <property name="title">null</property>
+   </bean>
+
+   Example example = new com.acme.Example();
+   example.setTitle(new String("null"));
+
+   <!-- Correct -->
+   <bean name="Name1" class=com.acme.Example">
+      <property name="title"><null/></property>
+   </bean>
+
+   Example example = new com.acme.Example();
+   example.setTitle(null);
+
+]]>
+      </programlisting>
+
+      <para>Sometimes it is still useful to be able to set or inject a value which can be morphed / progressed into
+         the needed type although the existing type is not compatible (normally getting <varname>ClassCastException</varname>). This is mostly true
+         for <varname>java.lang.Number</varname> subclasses. Let's see how <varname>progression</varname> is used in the following example
+         (here we use <varname><![CDATA[<inject />]]></varname>, which is actually explained in the next chapter).
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="FromBean" class="org.jboss.test.kernel.config.support.SimpleBean">
+      <property name="adouble">123.456</property>
+      <property name="AFloat" class="java.lang.Float">987.6543</property>
+      <property name="anInt">314159</property>
+   </bean>
+
+   <bean name="SimpleBean" class="org.jboss.test.kernel.config.support.SimpleBean">
+      <property name="anint">
+         <inject bean="FromBean" property="adouble" />
+      </property>
+
+      <property name="AShort">
+         <inject bean="FromBean" property="AFloat" />
+      </property>
+
+      <property name="AFloat">
+         <inject bean="FromBean" property="anInt" />
+      </property>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>SimpleBean is a plain JavaBean, property names reflect the field type: having a<varname>double</varname>
+         property name means that a field is of type double. A<varname>Float</varname> corresponds to Float type. Etc.
+      </para>
+
+      <para>You can change the progression behavior by setting the System property
+         <varname>org.jboss.reflect.plugins.progressionConvertor</varname>,
+         putting the ProgressionConvertor's implementation fully qualified class name as value.
+         By default the SimpleProgressionConvertor implementation is used. Another existing implementation is
+         NullProgressionConvertor, which doesn't do any actual progression.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>Injections</title>
+
+      <para>Objects by themself are not very useful. They need to be linked together to form more complicated data
+         structures. We have already seen one form of injection when using factory instances above. Injections can be
+         used anywhere a string value is used. All the examples that we have previously seen with strings could also be
+         done with injections.
+      </para>
+
+      <para>The
+         <varname>injection</varname>
+         example shows how dependency injection works in JBoss Microcontainer. The
+         <varname>InjectionBean</varname>
+         class has a
+         <varname>host</varname>
+         property, which is the
+         <varname>java.net.URL</varname>
+         type. We will inject an URL object into the bean via the microcontainer.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class InjectionBean
+   {
+      String name;
+
+      public InjectionBean(String name)
+      {
+         this.name = name;
+         System.out.println("InjectionBean() " + this);
+      }
+
+      public String toString()
+      {
+         return name;
+      }
+
+      public void setHost(String host)
+      {
+         System.out.println("setHost: " + host + " on " + this);
+      }
+
+      public void setOther(InjectionBean other)
+      {
+         System.out.println("setOther: " + other + " on " + this);
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>The microcontainer creates the
+         <varname>URL</varname>
+         object first, and then passes the
+         <varname>URL</varname>
+         object as a property into the
+         <varname>InjectionBean1</varname>
+         object when it is instantiated.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="URL" class="java.net.URL">
+      <constructor>
+         <parameter>http://www.jboss.org/index.html</parameter>
+      </constructor>
+   </bean>
+
+   <bean name="InjectionBean1"
+      class="org.jboss.example.microcontainer.injection.InjectionBean">
+
+      <constructor>
+         <parameter>InjectionBean1</parameter>
+      </constructor>
+
+      <property name="host">
+         <inject bean="URL" property="host"/>
+      </property>
+   </bean>
+
+]]>
+      </programlisting>
+
+
+      <para>The order of the
+         <varname>bean</varname>
+         elements does not matter. The microcontainer orders the beans into the correct order. For instance, in the
+         above example, the
+         <varname>URL</varname>
+         object is always created before the
+         <varname>InjectionBean1</varname>
+         object since the latter is dependent on the former. But that leaves the problem of how to resolve circular
+         dependencies. These can be resolved by specifying when you want the injection to occur. In the example below we
+         say once
+         <varname>Circular1</varname>
+         is "Instantiated" (constructed) it is ok to configure it on
+         <varname>Circular2</varname>
+         . Normally, injections wait for the referenced bean to reach the state "Installed" (see later on life cycles).
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="Circular1"
+      class="org.jboss.example.microcontainer.injection.InjectionBean">
+
+      <constructor>
+         <parameter>Circular1</parameter>
+      </constructor>
+
+      <property name="other">
+         <inject bean="Circular2"/>
+      </property>
+
+   </bean>
+
+   <bean name="Circular2"
+      class="org.jboss.example.microcontainer.injection.InjectionBean">
+
+      <constructor>
+         <parameter>Circular2</parameter>
+      </constructor>
+
+      <property name="other">
+         <inject bean="Circular1" state="Instantiated"/>
+      </property>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Here is the order the microcontainer instantiates those objects.</para>
+
+      <programlisting>
+<![CDATA[
+
+   InjectionBean Circular1 = new InjectionBean ();
+   InjectionBean Circular2 = new InjectionBean ();
+   Circular1.setOther(Circular2); // don't wait for a fully configured Circular1
+   Circular2.setOther(Circular1); // Complete the confguration of Circular2
+
+]]>
+      </programlisting>
+
+   </sect2>
+
+   <sect2>
+      <title>Value Factory</title>
+
+      <para>Similar to using <varname>inject</varname>'s property attribute, we sometimes want to use other beans to
+         create new values from bean's multi parameter methods.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="PropHolder" 
+     class="org.jboss.test.kernel.config.support.PropHolder">
+      <property name="value">
+         <value-factory bean="ldap" method="getValue">
+            <parameter>xyz.key</parameter>
+            <parameter>xyz</parameter>
+            <parameter>
+               <bean name="t" 
+                 class="org.jboss.test.kernel.config.support.TrimTransformer"/>
+            </parameter>
+         </value-factory>
+      </property>
+   </bean>
+
+   <bean name="ldap" class="org.jboss.test.kernel.config.support.LDAPFactory">
+      <constructor>
+         <parameter>
+            <map keyClass="java.lang.String" valueClass="java.lang.String">
+
+               <entry>
+                  <key>foo.bar.key</key>
+                  <value>QWERT</value>
+               </entry>
+
+               <entry>
+                  <key>xyz.key</key>
+                  <value>QWERT</value>
+               </entry>
+
+            </map>
+
+         </parameter>
+      </constructor>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>For the quick usage there is also shorthand version of the value-factory element, having single parameter
+         as string attribute.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="PropHolder" 
+     class="org.jboss.test.kernel.config.support.PropHolder">
+      <constructor>
+         <parameter>
+            <value-factory bean="ldap" method="getValue" parameter="foo.bar.key"/>
+         </parameter>
+      </constructor>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>You can also define a default value for the value-factory return value.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="PropHolder" 
+     class="org.jboss.test.kernel.config.support.PropHolder">
+      <property name="list">
+         <list elementClass="java.lang.String">
+            <value-factory bean="ldap" method="getValue" default="QWERT">
+               <parameter>no.such.key</parameter>
+            </value-factory>
+         </list>
+      <property>
+   </bean>
+
+]]>
+      </programlisting>
+
+   </sect2>
+
+   <sect2>
+      <title>Collections</title>
+
+      <para>The
+         <varname>collection</varname>
+         ,
+         <varname>list</varname>
+         ,
+         <varname>set</varname>
+         and
+         <varname>array</varname>
+         elements are used to enclose collection of values to pass to the bean components as properties or constructor
+         (factory method) parameters. The default types are:
+      </para>
+
+      <itemizedlist mark="bullet">
+         <listitem>
+            <para>collection: java.util.ArrayList</para>
+         </listitem>
+         <listitem>
+            <para>list: java.util.ArrayList</para>
+         </listitem>
+         <listitem>
+            <para>set: java.util.HashSet</para>
+         </listitem>
+         <listitem>
+            <para>array: java.lang.Object[]</para>
+         </listitem>
+      </itemizedlist>
+
+      <para>They all take the same form. So, only
+         <varname>list</varname>
+         is shown here in those examples. You just need to nest
+         <varname>value</varname>
+         elements inside the collection element to specify the contents of the collection. Please note that an
+         <varname>"elementClass"</varname>
+         attribute is required on the collection element, unless you specify explicit types on all the
+         <varname>value</varname>s.
+      </para>
+
+      <para>Below is a sample configuration from the
+         <varname>collections</varname>
+         example. It sets a
+         <varname>List</varname>
+         with two elements of mixed types to the
+         <varname>ObjectPrinter.print</varname>
+         property on the
+         <varname>PrintList</varname>
+         named object.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="PrintList"
+      class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+
+      <constructor>
+         <parameter>List</parameter>
+      </constructor>
+
+      <property name="print">
+         <list elementClass="java.lang.String">
+            <value>Value of type elementClass</value>
+            <value class="java.lang.Integer">4</value>
+         </list>
+      </property>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>It is also possible to use a
+         <varname>List</varname>
+         as an element inside another
+         <varname>List</varname>
+         . Here is an example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="Name1" class="com.acme.Example">
+      <property name="list">
+         <list class="java.util.LinkedList" elementClass="java.lang.String">
+
+            <!-- uses elementClass -->
+            <value>A string</value> 
+
+            <!-- a URL -->
+            <value class="java.lang.URL">http://acme.com/index.html</value> 
+
+            <!-- inject some other bean -->
+            <value><inject bean="SomeBean"/></value> 
+
+            <!-- a list inside a list -->
+            <value> 
+               <list elementClass="java.lang.String">
+                  <value>Another string</value>
+               </list>
+            </value>
+
+         </list>
+      </property>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Below is what happens inside the microcontainer.</para>
+
+      <programlisting>
+<![CDATA[
+
+   Example example = new com.acme.Example();
+   List list = new LinkedList();
+   list.add(new String("A string"));
+   list.add(new URL("http://acme.com/index.html"));
+   list.add(someBean);
+   List subList = new ArrayList();
+   subList.add(new String("Another string"));
+   list.add(subList);
+   element.setList(list);
+
+]]>
+      </programlisting>
+
+      <para>The other type of collection is a map which also covers Properties and Hashtables. The default is
+         <varname>java.util.HashMap</varname>
+         . The
+         <varname>entry</varname>
+         element inside the map differentiates each
+         <varname>key</varname>
+         and
+         <varname>value</varname>
+         pair. For maps there are two default types for the elements: the
+         <varname>keyClass</varname>
+         and
+         <varname>valueClass</varname>
+         . Below is a map sample from the
+         <varname>collections</varname>
+         example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="PrintMap"
+      class="org.jboss.example.microcontainer.collections.ObjectPrinter">
+
+      <constructor>
+         <parameter>Map</parameter>
+      </constructor>
+
+      <property name="print">
+         <map keyClass="java.lang.String" valueClass="java.lang.String">
+            <entry>
+               <key>Key1 of type keyClass</key>
+               <value>Value1 of type valueClass</value>
+            </entry>
+
+            <entry>
+               <key>Key2 of type keyClass</key>
+               <value class="java.lang.Integer">4</value>
+            </entry>
+
+            <entry>
+               <key class="java.lang.Long">4</key>
+               <value>Value of type valueClass</value>
+            </entry>
+         </map>
+      </property>
+
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>When using collections in your bean configuration, this is the order the Microcontainer will use for new
+         instantiation or using an already existing collection instance.
+         <itemizedlist mark="bullet">
+            <listitem>
+               <para>if the collection's class attribute is defined, a new instance of that class will be instantiated</para>
+            </listitem>
+            <listitem>
+               <para>if an already instantiated collection exists and is available via getter, this instance will be used -
+                  unless you define the preinstantiate attribute on the property to false
+               </para>
+            </listitem>
+            <listitem>
+               <para>if the collection references some non interface class, we'll try to instantiate a new instance of
+                  that class
+               </para>
+            </listitem>
+            <listitem>
+               <para>default collection instance will be used - Collection and List will use ArrayList, Set uses
+                  HashSet and Map will use HashMap
+               </para>
+            </listitem>
+         </itemizedlist>
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="SimpleBean" 
+     class="org.jboss.test.kernel.config.support.UnmodifiableGetterBean">
+      <property name="list" preinstantiate="false">
+         <list elementClass="java.lang.String">
+            <value>string1</value>
+            <value>string2</value>
+         </list>
+      </property>
+   </bean>
+
+]]>
+      </programlisting>
+
+   </sect2>
+
+   <sect2>
+      <title>Lifecycle</title>
+
+      <para>Anybody familiar with the JBoss JMX microkernel will know about the lifecycle. The microcontainer extends
+         the lifecycle concept to the managed POJOs. A POJO can have the following lifecycle states.
+      </para>
+
+      <itemizedlist mark="bullet">
+         <listitem>
+            <para>Not Installed: The POJO has not been described or has been uninstalled.</para>
+         </listitem>
+         <listitem>
+            <para>Pre Install: The scoping description has been examined and classloader dependencies determined.</para>
+         </listitem>
+         <listitem>
+            <para>Described: The POJO's bean description has been examined and dependencies determined.</para>
+         </listitem>
+         <listitem>
+            <para>Instantiated: All the dependencies have been resolved to construct the bean. These include: the class
+               exists, the constructor parameter injections can be resolved, any factory can be resolved.
+            </para>
+         </listitem>
+         <listitem>
+            <para>Configured: All the property injections can be resolved, this includes all the dependencies in any
+               collections.
+            </para>
+         </listitem>
+         <listitem>
+            <para>Create: All the dependent beans have been "created", this includes any injections passed to the create
+               method.
+            </para>
+         </listitem>
+         <listitem>
+            <para>Start: All the dependent beans have been "started", this includes any injections passed to the start
+               method.
+            </para>
+         </listitem>
+         <listitem>
+            <para>Installed: The lifecycle is complete.</para>
+         </listitem>
+         <listitem>
+            <para>*** ERROR ***: Some unexpected error occured, usually due to misconfiguration.</para>
+         </listitem>
+      </itemizedlist>
+
+      <para>At each stage of the lifecycle, the corresponding method in the bean class is automatically called by the
+         Microcontainer, so that you can programatically control how the objects behave throughout its lifecycle. For
+         instance, the
+         <varname>start()</varname>
+         method in the bean class is called when the bean enters the
+         <varname>Start</varname>
+         state. Below is the
+         <varname>LifecycleBean</varname>
+         class from the
+         <varname>lifecycle</varname>
+         example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class LifecycleBean
+   {
+      String name;
+
+      public LifecycleBean(String name)
+      {
+         this.name = name;
+         System.out.println("LifecycleBean() " + this);
+      }
+
+      public void create()
+      {
+         System.out.println("create: " + this);
+      }
+
+      public void start()
+      {
+         System.out.println("start: " + this);
+      }
+
+      public void stop()
+      {
+         System.out.println("stop: " + this);
+      }
+
+      public void destroy()
+      {
+         System.out.println("destroy: " + this);
+      }
+
+      public String toString()
+      {
+         return name;
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>The
+         <varname>depends</varname>
+         element allows two beans to perform two phase startup processing like the JMX microkernel.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="Lifecycle1"
+      class="org.jboss.example.microcontainer.lifecycle.LifecycleBean">
+
+      <constructor>
+         <parameter>Lifecycle1</parameter>
+      </constructor>
+
+      <depends>Lifecycle2</depends>
+
+   </bean>
+
+   <bean name="Lifecycle2"
+      class="org.jboss.example.microcontainer.lifecycle.LifecycleBean">
+
+      <constructor>
+         <parameter>Lifecycle2</parameter>
+      </constructor>
+
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>The microcontainer resolves the dependency and starts both beans in the appropriate order. Below is the
+         console output when you run the
+         <varname>lifecycle</varname>
+         example. It shows when various lifecycle methods are called when the bean enters those states.
+      </para>
+
+      <programlisting>
+         run:
+         [java] LifecycleBean() Lifecycle1
+         [java] LifecycleBean() Lifecycle2
+         [java] create: Lifecycle2
+         [java] create: Lifecycle1
+         [java] start: Lifecycle2
+         [java] start: Lifecycle1
+         [java] stop: Lifecycle1
+         [java] stop: Lifecycle2
+         [java] destroy: Lifecycle1
+         [java] destroy: Lifecycle2
+      </programlisting>
+
+      <para>The
+         <varname>create()</varname>
+         ,
+         <varname>start()</varname>
+         ,
+         <varname>stop()</varname>
+         and
+         <varname>destroy()</varname>
+         methods can be overridden with parameters passed to them. Below is an example on how to override the
+         <varname>create()</varname>
+         method via the
+         <varname>jboss-beans.xml</varname>
+         configuration file.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class Example
+   {
+      public void initialize(Object someObject) {}
+   }
+
+   <bean name="Name1" class="com.acme.Example">
+      <create method="initialize">
+         <parameter><inject bean="SomeBean"/></parameter>
+      </create>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>They can also be ignored. See the
+         <varname>jboss-beans.xml</varname>
+         with the <varname>ignore</varname> attribute set to true on the start element.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class Example
+   {
+      public void start() {}
+   }
+
+   <bean name="Name1" class="com.acme.Example">
+      <start ignore="true"/>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>In this case the Microcontainer would not
+         invoke the start method when passing over Start state.
+      </para>
+   </sect2>
+
+   <sect2>
+      <title>Installation</title>
+
+      <para>As of 2.0.0, you can provide generic install/uninstall actions. Allowing you to dynamically setup
+         repositories. Note the use of
+         <varname>this</varname>
+         to pass yourself as a parameter. If you exlude the bean name on the action, the operation is performed on
+         yourself.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="name1" class="java.util.Timer"/>
+
+   <bean name="name2" ...>
+      <install bean="name1" method="schedule">
+         <parameter><this/></parameter>
+         <parameter>100</parameter>
+         <parameter>10000</parameter>
+      </install>
+
+      <uninstall method="cancel"/>
+
+   </bean>
+
+   // Install
+   name1 = new Timer();
+   name2 = ...;
+   name1.schedule(name2, 100, 10000);
+
+   // Uninstall
+   name2.cancel();
+
+]]>
+      </programlisting>
+   </sect2>
+
+   <sect2>
+      <title>ClassLoader</title>
+
+      <para>The Microcontainer supports configuration of the classloader at either the deployment or bean level. The
+         classloader element has three alternatives.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <!-- deployment level - applies to all beans in the deployment -->
+   <deployment>
+      <classloader><inject bean="ClassLoaderName"/></classloader>
+
+      <!-- bean level -->
+      <bean name="Name2" ...>
+         <classloader><inject bean="ClassLoaderName"/></classloader>
+      </bean>
+
+      <!-- bean level will use any deployment level classloader -->
+      <bean name="Name3" ...>
+      </bean>
+
+      <!-- bean level as null to not use any deployment level classloader -->
+      <bean name="Name4" ...>
+         <classloader><null/></classloader>
+      </bean>
+
+   </deployment>
+
+]]>
+      </programlisting>
+   </sect2>
+
+   <sect2>
+      <title>Annotations via XML</title>
+
+      <para>With the new Microcontainer 2.0 we've added support for annotations via XML. Meaning you can have annotation
+<!--         support even in Java 1.4 and before, depending on the retrowoven Microcontainer project. -->
+         support where the annotation is not part of the bean class's bytecode.
+         Each annotation is set per bean instance and you can set annotations on the following types:
+         <itemizedlist>
+            <listitem><simpara>deployment (all beans inherit this annotations)</simpara></listitem>
+            <listitem><simpara>bean</simpara></listitem>
+            <listitem><simpara>constructor</simpara></listitem>
+            <listitem><simpara>lifecycle</simpara></listitem>
+            <listitem><simpara>install / uninstall</simpara></listitem>
+            <listitem><simpara>callback</simpara></listitem>
+            <listitem><simpara>annotated value</simpara></listitem>
+         </itemizedlist>
+         Let's see some use cases on the examples below.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <deployment name="SimpleDeployment" xmlns="urn:jboss:bean-deployer:2.0">
+
+      <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation1</annotation>
+      <annotation>@org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes(clazz=java.lang.Integer.class, integer=100, str="Annotations are nice")</annotation>
+
+      <bean name="bn1" class="org.jboss.test.Example1">
+         <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation2</annotation>
+         <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation3</annotation>
+      </bean>
+
+      <bean name="bn2" class="org.jboss.test.Example2">
+         <constructor>
+            <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation3</annotation>
+         </constructor>
+      </bean>
+
+      <bean name="bn3" class="org.jboss.test.Example3">
+         <install method="someMethod">
+            <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation1</annotation>
+         </install>
+      </bean>
+
+      <bean name="bn4" class="org.jboss.test.Example4">
+         <create>
+            <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation1</annotation>
+         </create>
+      </bean>
+
+      <bean name="bn5" class="org.jboss.test.Example5">
+         <property name="PropertyName">
+            <annotation>@org.jboss.test.kernel.deployment.xml.support.Annotation1</annotation>
+            <value>123</value>
+         </property>
+      </bean>
+
+   </deployment>
+
+]]>
+      </programlisting>
+
+      <para>The only issue with having annotations defined via XML is that they are per instance basis - 
+         as already mentioned, not added at compile time. In this case you need an external mechanism in
+         order to do the annotation inspection. In the Microcontainer this is its metadata repository.
+         See how this is done in Reference Manual, TODO.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>Alias</title>
+
+      <para>Mostly each bean will have one unique name, but sometimes it is useful to be able to have an extra name.
+         The extra ones are considered aliases.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean xmlns="urn:jboss:bean-deployer:2.0" class="org.acme.Example">
+      <alias>SimpleAlias</alias>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>As with all String values you can have System property replacement as part of actual alias value.
+         Additionally you can specify if this replacement is ignored. Or you can even convert a final alias String value
+         into any other class supported by PropertyEditors by setting the class attribute on an alias element. Lets see this
+         configuration on the examples below.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean xmlns="urn:jboss:bean-deployer:2.0" class="org.acme.Example">
+      <alias>${example.cluster.name}</alias>
+   </bean>
+
+   <bean xmlns="urn:jboss:bean-deployer:2.0" class="org.acme.Example">
+      <alias replace="false">X${alias.test.name}X</alias>
+   </bean>
+
+   <bean xmlns="urn:jboss:bean-deployer:2.0" class="org.acme.Example">
+      <alias class="java.lang.Integer">12345</alias>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>Having to specify all aliases when the bean is actually defined is not always adequate however. It is
+         sometimes desirable to introduce an alias for a bean which is defined elsewhere. In XML-based configuration
+         metadata this may be accomplished via the use of the standalone <varname><![CDATA[<alias/>]]></varname> element.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <deployment name="FirstDeployment" xmlns="urn:jboss:bean-deployer:2.0">
+
+      <bean name="Bean1" class="java.lang.Object"/>
+
+      <bean name="Bean2" class="java.lang.Object"/>
+
+   </deployment>
+
+   <deployment name="SecondDeployment" xmlns="urn:jboss:bean-deployer:2.0">
+
+      <bean name="Xyz1" class="java.lang.Object">
+         <property name="locker1"><inject name="Lock1"></property>
+         <property name="locker2"><inject name="Lock2"></property>
+      </bean>
+
+      <alias name="Bean1">Lock1</alias>
+
+      <alias name="Bean2">Lock2</alias>
+   </deployment>
+
+]]>
+      </programlisting>
+
+      <para>
+         A newly added alias defined as a element on the deployment acts as a full dependency item. Meaning
+         it won't get registered (installed) until the original bean is installed. What this means is that you can have
+         original beans defined in one deployment and aliases in another, and the order of deployment doesn't matter.
+         When the original bean is uninstalled, the alias gets unregistered (uninstalled) as well.
+         When the alias gets unregistered, all beans that depend on the alias get undeployed as well, regardless of if
+         the original bean is still present.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>Supply and Demand</title>
+
+      <para>
+         There is another useful definition of loosely coupled dependency.
+         Each bean can define which beans should be installed for it to move
+         to certain state.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="TM" class="com.acme.SomeSingleton">
+      <property name="host">http://www.jboss.org</property>
+   </bean>
+
+   <bean name="SM" class="com.acme.AnotherSingleton">
+      <property name="treadSize">10</property>
+   </bean>
+
+   <bean name="Name2" class="com.acme.Example">
+      <property name="threadPool"><inject bean="pool"/></property>
+      <demand state="Start">TM</demand>
+      <demand state="Configure">SM</demand>
+   </bean>
+
+   // Example class
+   public class Example
+   {
+      public void start()
+      {
+         SomeSingleton tm = ...; // should be there!
+      }
+
+      public void setThreadPool(ThreadPool pool)
+      {
+         AnotherSingleton config = ...; // should be there
+         pool.setThreadSize(config.getThreadSize());
+      }
+
+   }
+
+]]>
+      </programlisting>
+
+      <para>
+         On the other hand each bean can also provide additional information
+         what it supplies, apart from it self. The actual supply doesn't need to be
+         bound to the Microcontainer in any way.
+         More about this feature with the actual example.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class FooBarBinder extends JndiBinder
+   {
+      public void start()
+      {
+         FooBar foobar = new FooBar();
+         bindToJndi("fbName", foobar);
+      }
+
+   }
+
+   public class FooBarConsumer
+   {
+      public FooBarConsumer()
+      {
+         FooBar foobar = ...; // get it from jndi. should be there
+      }
+   }
+
+   <bean name="provider" class="com.acme.FooBarBinder">
+      <supply>foobar</supply>
+   </bean>
+
+   <bean name="consumer" class="com.acme.FooBarConsumer">
+      <demand state="Instantiate">foobar</demand>
+   </bean>
+
+]]>
+      </programlisting>
+   </sect2>
+
+   <sect2>
+      <title>Contextual Awareness</title>
+
+      <para>
+         With existing annoyance of using huge amounts of xml to sometimes wire up
+         trivial beans, IoC containers provide a simpler solution called autowiring.
+         Beans, specially singletons, can often be wired with a simple class type knowledge.
+         But with huge systems you should use this feature with care, since it can easly get broken
+         with addition of another bean that would satisfy contextual dependency.
+         The existing 2.0.0 version supports three ways of autowiring:
+         <itemizedlist spacing="compact">
+            <listitem>
+               <para>full bean autowiring</para>
+            </listitem>
+            <listitem>
+               <para>property / parameter injection</para>
+            </listitem>
+            <listitem>
+               <para>callback injection</para>
+            </listitem>
+         </itemizedlist>
+      </para>
+
+      <para>On the other hand, if you don't want a particular bean to be involved as a candidate for
+         autowiring, you can set the bean element's attribute <varname>autowire-candidate</varname> to false.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="ignored" class="com.acme.Example" autowire-candidate="false" />
+
+]]>
+      </programlisting>
+
+      <para>
+         TODO for bean autowiring.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="autowired" class="com.acme.Example" autowire="true" />
+
+]]>
+      </programlisting>
+
+      <para>
+         When doing a propery / parameter injection of some existing bean, you can omit the bean attibute, meaning that the
+         Microcontainer will do the injection based on the information from the property / parameter class type.
+         If no such information is available, an exception will be thrown. If no such bean is eventually available, you can define
+         the behavior after validation. For Strict option the deployment will fail, for Callback see the callback injection below.
+         There is also a way of doing contextual injection based on property name. Property name will be matched against
+         newly wired bean's name.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="pool" class="com.acme.ThreadPoolImpl"/>
+
+   <bean name="propInj" class="com.acme.Example">
+      <property name="threadPool"><inject/></property>
+   </bean>
+
+   <bean name="paramInj" class="com.acme.Example">
+      <constructor>
+         <parameter name="threadPool"><inject/></parameter>
+      </constructor>
+   </bean>
+
+   public class Example
+   {
+      protected ThreadPool pool;
+
+      public Example() {}
+
+      public Example(ThreadPool pool)
+      {
+         this.pool = pool;
+      }
+
+      public void setThreadPool(ThreadPool pool)
+      {
+         this.pool = pool;
+      }
+
+   }
+
+]]>
+      </programlisting>
+
+      <para>
+         Sometimes it is useful to be notified of certain beans being installed / uninstalled by
+         inspecting their class type. In the Microcontainer we call this callbacks.
+         You can define which methods should be used for callback resolution on a particular bean. Usually the method
+         name is sufficient. In the case of having multiple methods with the same name, you can narrow down the
+         exact method by specifying the class type to use for contextual lookup.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="editorHolder" class="com.acme.Example">
+      <incallback method="addEditor" />
+      <uncallback method="removeEditor" />
+   </bean>
+
+   <bean name="fbEditor" class="com.acme.FooEditor"/>
+
+   public class Example
+   {
+      protected Set<Editor> editors = new HashSet<Editor>();
+
+      public Example() {}
+
+      public void addEditor(Editor editor)
+      {
+         editors.add(editor);
+      }
+
+      public void removeEditor(Editor editor)
+      {
+         editors.remove(editor);
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>
+         We can do the same callback injection on a property.
+         And there is also an interesting feature available, though it will probably rarely be used.
+         You can define a Cardinality as a condition when that actual dependency is satisfied and injection
+         can take place.
+         The following examples shows how we need at least 2 Editor instances to satisfy callback dependency.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="editorHolder" class="com.acme.Example">
+      <incallback property="editors" cardinality="2..n" />
+      <uncallback property="editors" />
+   </bean>
+
+   <bean name="fbEditor" class="com.acme.FooEditor"/>
+
+   <bean name="xyzEditor" class="com.acme.XYZEditor"/>
+
+   public class Example
+   {
+      protected Set<Editor> editors;
+
+      public Example() {}
+
+      public void setEditors(Set<Editor> editors)
+      {
+         this.editors = editors;
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>While using callbacks on the Collection subclasses, currently only basic Collection subinterfaces
+         are supported: List, Set and Queue. See BasicCollectionCallbackItemFactory for more details.
+         But you can change the Collection callback behaviour by providing your own CollectionCallbackItemFactory.
+         You do this by setting the System Property <varname>org.jboss.dependency.collectionCallbackItemFactory</varname>
+         and putting the CollectionCallbackItemFactory implementation fully qualified class name as a value.
+      </para>
+
+   </sect2>
+
+   <sect2>
+      <title>Injection from Context</title>
+
+      <para>Even though the Microcontainer is aimed at POJOs, it doesn't mean you are not able to easily get into
+         the underlying architecture of its state machine.
+         Each bean is represented in the Microcontainer's state machine (Controller) as a ControllerContext.
+         The ControllerContext holds various information in order to consistently move between lifecycle states,
+         resolve dependencies, apply instance aspects, annotations, metadata ...
+      </para>
+
+      <para>
+         With the already known injection concept (<varname><![CDATA[<inject />]]></varname>), you can also inject some information from the context.
+         This is what you can currently get a hold on from the underlying context:
+         <itemizedlist>
+            <listitem>
+               <para>name - <varname><![CDATA[<inject fromContext="name"/>]]></varname></para>
+            </listitem>
+            <listitem>
+               <para>aliases - <varname><![CDATA[<inject fromContext="aliases"/>]]></varname></para>
+            </listitem>
+            <listitem>
+               <para>metadata - <varname><![CDATA[<inject fromContext="metadata"/>]]></varname></para>
+            </listitem>
+            <listitem>
+               <para>beaninfo - <varname><![CDATA[<inject fromContext="beaninfo"/>]]></varname></para>
+            </listitem>
+            <listitem>
+               <para>scope - <varname><![CDATA[<inject fromContext="scope"/>]]></varname></para>
+            </listitem>
+            <listitem>
+               <para>id - <varname><![CDATA[<inject fromContext="id"/>]]></varname></para>
+            </listitem>
+            <listitem>
+               <para>context itself - <varname><![CDATA[<inject fromContext="context"/>]]></varname></para>
+            </listitem>
+         </itemizedlist>
+      </para>
+
+      <para>All this information is wrapped into unmodifiable objects, preventing the user to add or set additional
+         information outside the Microcontainer's Controller.
+         As we already know, the <varname><![CDATA[<inject/>]]></varname> element can take a 
+		 <varname>bean</varname> attribute. In this case, if the bean attribute is set,
+         we are not obtaining the target bean's underlying context, but the context that coresponds to the bean being injected.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <bean name="sndBean" 
+     class="org.jboss.test.kernel.deployment.support.NameAwareBean">
+      <property 
+	    name="beaninfo"><inject bean="otherBean" fromContext="beaninfo"/></property>
+   </bean>
+
+]]>
+      </programlisting>
+
+      <para>In this example we inject otherBean's beaninfo information into sndBean bean.</para>
+   </sect2>
+
+</sect1>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/classloader.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/classloader.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/classloader.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="classloader">
+   <title>Classloader module</title>
+
+   <para>
+      Introducing fine grained classloading in Micorcontainer's IoC, better aspect integration, new
+      <xref linkend="vfs"/> and <xref linkend="deployers"/> projects, it was all set to also redo the whole
+      classloding layer for the new Kernel and transitively JBoss5 application server.
+      A whole new Classloder module was created to somehow fix the old API mistakes and to allow a clean and plugable way
+      for existing extensions of default classloading. These extensions range from old concepts of Servlet classloading,
+      runtime AOP weaving, and all the way to new <xref linkend="osgi"/>.
+   </para>
+
+   <para>
+      When designing new API for Classloading, we wanted to expose as little as possible.
+      The concept there was to hide all the "nitty gritty" details and reduce the amount of API users need to
+      apply in order to get the required behaviour.
+      When you were normally dealing with concrete ClassLoader classes, we reduced the implementation detail to
+      only needing to implement your own ClassLoaderPolicy. This includes things like what packages you export,
+      what you import, how to get resources and other things related to defining classes.
+      We'll show the example of the policy later on.
+   </para>
+
+   <para>
+      Additionally, the idea of a LoaderRepository is replaced with a ClassLoaderDomain
+      and a ClassLoaderSystem acting as a factory and a repository of domains.
+      Each ClassLoaderSystem has a "default domain".
+   </para>
+
+   <programlisting>
+      ClassLoaderSystem system = ClassLoaderSystem.getInstance();
+
+      // Define classloader policy
+      MyClassLoaderPolicy myPolicy = ...
+
+      // Register with the default domain,
+      // there are other methods to create
+      // and register with different domains
+      ClassLoader cl = system.registerClassLoaderPolicy(myPolicy);
+   </programlisting>
+
+   <para>
+      This is a simple example of what it comes down to, to create your own Classloader instance that will
+      behave accordingly to the classloader policy.
+   </para>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/conclusion.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/conclusion.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/conclusion.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="conclusion">
+   <title>Conclusion</title>
+
+   <para>The Microcontainer is a powerful replacement for the JBoss's JMX
+      microkernel. It brings the loosely coupled configuration environment of
+      JBoss to POJO environments, adding more control and extra features. Both
+      inside and outside the JBoss Application Server.
+   </para>
+
+   <para></para>
+
+   <para>Going forward these additional features will allow even more advances,
+      including aspectized deployment, on demand services, versioned deployments,
+      etc.
+   </para>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/core.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/core.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/core.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="core">
+   <title>Microcontainer core</title>
+
+   <para>Core ...
+   </para>
+
+   <xi:include href="basics.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="annotations.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="aop.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="javabeans.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="spring.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/deployers.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/deployers.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/deployers.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,340 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="deployers">
+   <title>Deployers module</title>
+
+   <para>
+      With re-writing the new application server Kernel from JMX based to POJO oriented, we also re-wrote the whole
+      Deployer architecture which was also based on the old JMX MBeans. Let's first look at the new concepts and then
+      do an example of each new change.
+   </para>
+
+   <sect1>
+      <title>StructureDeployers</title>
+
+      <para>
+         Combined with the previously mentioned new VFS implementation we introduced a new kind of Deployer, the
+         Structure Deployer. The purpose of Structure Deployer is to recognise the deployment type and prepare this
+         information for the actual Deployers. There are already default implementations for standard types such as
+         JAR, WAR, EAR and specific files. You can simply implement your own StructureDeployer or extend the
+         AbstractStructureDeployer. Or you can use the declarative approach by defining your structure with an XML
+         file - META-INF/jboss-structure.xml. This file will be automatically picked up by DeclarativeStructureDeployer.
+         Let's now look at how to use one of the existing StructureDeployer implementations, write our own or use the
+         declarative one.
+      </para>
+
+      <programlisting></programlisting>
+
+      <para>
+         This is how we can add our own new file support. This one defines that -spring.xml files are also treated
+         as metadata files.
+      </para>
+
+      <programlisting></programlisting>
+
+      <para>
+         This is a simple implementation for our own deployment structure which holds metadata information in mydata
+         directory and has Java classes in myclasses directory.
+      </para>
+
+      <programlisting></programlisting>
+
+      <para>
+         Here we simply write a plain XML file defining where to look for ... TODO
+      </para>
+
+   </sect1>
+
+   <sect1>
+      <title>Deployers</title>
+
+      <para>
+         With the old style of JBoss Deployers, a single deployer implementation would handle all the processing
+         for the matching top level deployment unit. This behaviour was completely changed in the new Deployers
+         architecture. Here we have a new way of handling deployment unit, we call it an aspectized deployment, meaning
+         that each deployer implementation does just one thing. This way it is easier to control how much it gets done
+         and even easier to swap out the behaviour. But what is that one thing? We are all familiar with parsing,
+         creating
+         ClassLoaders, installing services, etc. So, basically any part of the previous deployment process, can be seen as a
+         separate process, parsing the jboss-service.xml file, creating ServiceMetaData, setting up RepositoryCL
+         and finally registring MBeans into the MBeanServer instance.
+      </para>
+
+      <para>
+         Let's see this aspectization in the listing below. This is a real example from the current Microcontainer
+         beans deployment.
+         <itemizedlist>
+            <listitem>Parsing Deployers
+               <itemizedlist>
+                  <listitem>Turns XML into metadata model</listitem>
+                  <listitem>e.g. my-beans.xml -> KernelDeployment</listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>ClassLoading Deployers
+               <itemizedlist>
+                  <listitem>Creates classloaders from metadata</listitem>
+                  <listitem>e.g. Uses the information from StructureDeployers</listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>Component Deployers
+               <itemizedlist>
+                  <listitem>Splits complicated deployments into units</listitem>
+                  <listitem>e.g. KernelDeployment -> BeanMetaDatas</listitem>
+               </itemizedlist>
+            </listitem>
+            <listitem>Real Deployers
+               <itemizedlist>
+                  <listitem>Does the real work of deployment</listitem>
+                  <listitem>e.g. BeanMetaData -> controller.install()</listitem>
+               </itemizedlist>
+            </listitem>
+         </itemizedlist>
+      </para>
+
+   </sect1>
+
+   <sect1>
+      <title>Attachments</title>
+
+      <para>
+         Before we start coding the new Deployers there is another concept that we still need to have a look at.
+         What is the way to store the information between different deployers? We keep this information in so-called
+         Attachments. There are two types of attachments, predetermined and transient. e.g. predetermined can be
+         set by the ProfileService, while we would get the transient one's from parsing the XML file. You must be aware that
+         a predetermined attachment overriddes a transient attachment. This is a simple API to get a hold of the Attachments reference from
+         the underlying DeploymentUnit instance.
+      </para>
+
+      <programlisting>
+ public interface DeploymentUnit extends MutableAttachments
+ {
+ /**
+ * Get all the metadata for the expected type
+ *
+ * @param &lt;T> the type to get
+ * @param type the type
+ * @return a set of metadata matching the type
+ * @throws IllegalArgumentException if the type is null
+ */
+ &lt;T> Set&lt;? extends T> getAllMetaData(Class&lt;T> type);
+
+ /**
+ * Get the transient managed objects
+ *
+ * @return the managed objects
+ */
+ MutableAttachments getTransientManagedObjects();
+
+ ...
+ }
+
+ public interface MutableAttachments extends Attachments
+ {
+ /**
+ * Add attachment
+ *
+ * @param name the name of the attachment
+ * @param attachment the attachment
+ * @return any previous attachment
+ * @throws IllegalArgumentException for a null name or attachment
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ Object addAttachment(String name, Object attachment);
+
+ /**
+ * Add attachment
+ *
+ * @param &lt;T> the expected type
+ * @param name the name of the attachment
+ * @param attachment the attachment
+ * @param expectedType the expected type
+ * @return any previous attachment
+ * @throws IllegalArgumentException for a null name, attachment or expectedType
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ &lt;T> T addAttachment(String name, T attachment, Class&lt;T> expectedType);
+
+ /**
+ * Add attachment
+ *
+ * @param &lt;T> the expected type
+ * @param attachment the attachment
+ * @param type the type
+ * @return any previous attachment
+ * @throws IllegalArgumentException for a null name, attachment or type
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ &lt;T> T addAttachment(Class&lt;T> type, T attachment);
+
+ /**
+ * Remove attachment
+ *
+ * @param name the name of the attachment
+ * @return the attachment or null if not present
+ * @throws IllegalArgumentException for a null name
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ Object removeAttachment(String name);
+
+ /**
+ * Remove attachment
+ *
+ * @param &lt;T> the expected type
+ * @param name the name of the attachment
+ * @return the attachment or null if not present
+ * @param expectedType the expected type
+ * @throws IllegalArgumentException for a null name or expectedType
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ &lt;T> T removeAttachment(String name, Class&lt;T> expectedType);
+
+ /**
+ * Remove attachment
+ *
+ * @param &lt;T> the expected type
+ * @return the attachment or null if not present
+ * @param type the type
+ * @throws IllegalArgumentException for a null name or type
+ */
+ &lt;T> T removeAttachment(Class&lt;T> type);
+
+ /**
+ * Set the attachments
+ *
+ * @param map the new attachments a map of names to attachments
+ * @throws IllegalArgumentException for a null map
+ */
+ void setAttachments(Map&lt;String, Object> map);
+
+ /**
+ * Clear the attachments
+ *
+ * @throws UnsupportedOperationException when not supported by the implementation
+ */
+ void clear();
+
+ /**
+ * Get the number of changes that have happened.
+ *
+ * @return number of adds/removes that have happened since creation or 
+ * clearChangeCount.
+ */
+ int getChangeCount();
+
+ /**
+ * Reset the change count to zero.
+ */
+ void clearChangeCount();
+ }
+
+ public interface Attachments extends Serializable
+ {
+ /**
+ * Get all the attachments
+ *
+ * @return the unmodifiable attachments
+ */
+ Map&lt;String, Object> getAttachments();
+
+ /**
+ * Get attachment
+ *
+ * @param name the name of the attachment
+ * @return the attachment or null if not present
+ * @throws IllegalArgumentException for a null name
+ */
+ Object getAttachment(String name);
+
+ /**
+ * Get attachment
+ *
+ * @param &lt;T> the expected type
+ * @param name the name of the attachment
+ * @param expectedType the expected type
+ * @return the attachment or null if not present
+ * @throws IllegalArgumentException for a null name or expectedType
+ */
+ &lt;T> T getAttachment(String name, Class&lt;T> expectedType);
+
+ /**
+ * Get attachment
+ *
+ * @param &lt;T> the expected type
+ * @param type the type
+ * @return the attachment or null if not present
+ * @throws IllegalArgumentException for a null name or type
+ */
+ &lt;T> T getAttachment(Class&lt;T> type);
+
+ /**
+ * Is the attachment present
+ *
+ * @param name the name of the attachment
+ * @return true when the attachment is present
+ * @throws IllegalArgumentException for a null name
+ */
+ boolean isAttachmentPresent(String name);
+
+ /**
+ * Is the attachment present
+ *
+ * @param name the name of the attachment
+ * @param expectedType the expected type
+ * @return true when the attachment is present
+ * @throws IllegalArgumentException for a null name or expectedType
+ */
+ boolean isAttachmentPresent(String name, Class&lt;?> expectedType);
+
+ /**
+ * Is the attachment present
+ *
+ * @param type the type
+ * @return true when the attachment is present
+ * @throws IllegalArgumentException for a null name or type
+ */
+ boolean isAttachmentPresent(Class&lt;?> type);
+
+ /**
+ * Are there any attachments
+ *
+ * @return true if there are any attachments, false otherwise.
+ */
+ boolean hasAttachments();
+ }
+      </programlisting>
+
+   </sect1>
+
+   <sect1>
+      <title>Ordering</title>
+
+      <para>
+         Since we are now familiar with attachments we can talk about the order of our Deployers.
+         What would be the natural order of our Deployers? Probably the first thing it comes to our mind is a plain
+         number ordering. Old and proven way to do the ordering. But since we waited to introduce the attachments
+         before we talked about ordering there must be something better. We can define the order by simply providing
+         the information about Attachment requirements / demands (inputs) and supplies (outputs). Let's explain this
+         in more detail on the actual example.
+      </para>
+
+      <programlisting>
+         public MyDeployer()
+         {
+         setInputs(SomeMetaData1.class, SomeMetaData2.class);
+         setOutputs(MyOutput.class);
+         }
+      </programlisting>
+
+      <para>
+         Here we can see that our MyDeployer depends on SomeMetaData1 and SomeMetaData2 instance attachments, and
+         provides
+         a further MyOutput instance attachment for next deployers to use. So any deployer that provides
+         SomeMetaData1 and SomeMetaData2 instance attachments should be before our MyDeployer and any one that uses
+         MyOutput instance attachment should be after.
+      </para>
+
+   </sect1>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/examples.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/examples.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/examples.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="examples">
+   <title>Starting Examples</title>
+
+   <section>
+      <title>A Simple IoC Example</title>
+
+      <para>The best way to learn the Microcontainer is through examples. The Microcontainer distribution is bundled
+         with several examples, which we will discuss in later this guide. In this section, let us first have a look at
+         the
+         <varname>simple</varname>
+         example. It shows the structure of a simple Microcontainer application and how to run the application in both
+         standalone and JBoss AS environments.
+      </para>
+
+      <para>The
+         <varname>simple</varname>
+         example is located in the
+         <varname>examples/simple</varname>
+         directory of the Microcontainer distribution. It contains a single class under the
+         <varname>src/main</varname>
+         directory.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   public class SimpleBean
+   {
+      public SimpleBean()
+      {
+         System.out.println("SimpleBean() constructor");
+      }
+   }
+
+]]>
+      </programlisting>
+
+      <para>The
+         <varname>SimpleBean</varname>
+         object prints to the system console when it is instantiated via the default constructor. Now, we need to use
+         the Microcontainer to instantiate a
+         <varname>SimpleBean</varname>
+         POJO. We do this by invoking the Microcontainer with the
+         <varname>src/resources/META-INF/jboss-beans.xml</varname>
+         configuration file.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+      xmlns="urn:jboss:bean-deployer:2.0">
+
+      <bean name="Simple"
+         class="org.jboss.example.microcontainer.simple.SimpleBean"/>
+
+   </deployment>
+
+]]>
+      </programlisting>
+
+      <para>This configuration file tells the Microcontainer to create an instance of the
+         <varname>SimpleBean</varname>
+         POJO and manage it under the name
+         <varname>Simple</varname>
+         . When other objects in the application need to access this
+         <varname>SimpleBean</varname>
+         instance, they can simply ask the Microcontainer API for the
+         <varname>Simple</varname>
+         object. Essentially, we just created a
+         <varname>SimpleBean</varname>
+         singleton instance here. When we run this application, we are expected to see the
+         <varname>"SimpleBean() constructor"</varname>
+         printout on the console when the Microcontainer creates the
+         <varname>Simple</varname>
+         object.
+      </para>
+
+   </section>
+
+   <section>
+      <title>Build and Package the Application</title>
+
+      <para>To build, package, and run the
+         <varname>simple</varname>
+         application, we can simply execute the
+         <varname>ant</varname>
+         command in the
+         <varname>examples/simple</varname>
+         directory. It runs the
+         <varname>build.xml</varname>
+         script, which further invokes the
+         <varname>examples/build-common.xml</varname>
+         script. The
+         <varname>compile</varname>
+         and
+         <varname>dist</varname>
+         tasks in the build script builds the application.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+   <target name="compile">
+
+      <mkdir dir="build"/>
+
+      <javac destdir="build"
+         debug="on"
+         deprecation="on"
+         optimize="on"
+         classpathref="compile.classpath">
+
+         <src path="src"/>
+      </javac>
+
+   </target>
+
+   <target name="dist" depends="compile">
+
+      <copy todir="build">
+         <fileset dir="src/resources"/>
+      </copy>
+
+      <mkdir dir="dist"/>
+
+      <jar jarfile="dist/${ant.project.name}.beans" basedir="build"/>
+
+   </target>
+
+]]>
+      </programlisting>
+
+      <para>The
+         <varname>compile</varname>
+         target compiles the Java source files into class files under the
+         <varname>build</varname>
+         directory. Then, the
+         <varname>dist</varname>
+         target packages the class files and the
+         <varname>META-INF/jboss-beans.xml</varname>
+         file together in a JAR file named
+         <varname>example-simple.jar</varname>
+         in the
+         <varname>dist</varname>
+         directory.
+      </para>
+
+      <para>In the next two sections, let's discuss how to run the newly created
+         application both as a standalone Java SE application and as a service in the JBoss AS.
+      </para>
+
+    <para>This just skims the surface of the Microcontainer, showing the most
+  common usecases. Other more complicated examples can be found in the tests
+  (available in the source code repository).</para>
+
+  </section>
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/glossary.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/glossary.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/glossary.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="glossary">
+   <title>Glossary</title>
+
+   <section>
+      <title>A glossary to start</title>
+
+      <para>
+         The glossary ...
+      </para>
+
+  </section>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/guice.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/guice.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/guice.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="guice">
+   <title>Guice integration</title>
+
+   <para>Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 5 and above,
+      brought to you by Google.
+   </para>
+
+   <para>We've written a piece of integration code that bridges the two IoC frameworks together.
+      You can inject Guice defined beans into the Microcontainer and/or the other way around.
+      See the examples for more details.
+   </para>
+
+   <para>In this example we will define a Guice module, binding a simple Singleton class to one of its
+      instances. We will then do a contextual lookup for the Singleton instance in the SingletonHolder class.
+   </para>
+
+   <programlisting>
+      AbstractBeanMetaData guicePlugin = 
+            new AbstractBeanMetaData(
+                "GuicePlugin", GuiceKernelRegistryEntryPlugin.class.getName());
+      AbstractConstructorMetaData constructor = 
+        new AbstractConstructorMetaData();
+      AbstractArrayMetaData arrayMetaData = new AbstractArrayMetaData();
+      final Singleton singleton = new Singleton();
+      Module module = new AbstractModule()
+      {
+         protected void configure()
+         {
+            bind(Singleton.class).toInstance(singleton);
+         }
+      };
+      arrayMetaData.add(new AbstractValueMetaData(module));
+      constructor.setParameters(
+         Collections.singletonList(
+             (ParameterMetaData)new AbstractParameterMetaData(arrayMetaData)));
+      guicePlugin.setConstructor(constructor);
+
+      public class SingletonHolder
+      {
+         private Singleton singleton;
+
+         @Constructor
+         public SingletonHolder(@Inject Singleton singleton)
+         {
+            this.singleton = singleton;
+         }
+
+         public Singleton getSingleton()
+         {
+            return singleton;
+         }
+      }
+
+      ControllerContext holderContext = controller.getInstalledContext("holder");
+      assertNotNull(holderContext);
+      SingletonHolder holder = (SingletonHolder)holderContext.getTarget();
+      assertNotNull(holder);
+      assertEquals(singleton, holder.getSingleton());
+   </programlisting>
+
+   <para>The detail that is hidden is in GuiceKernelRegistryEntryPlugin, which acts as a intermediate between
+      the Microcontainer's registry and the Guice Injector. But all you need to do is register GuiceKernelRegistryEntryPlugin
+      as a POJO into Microcontainer, providing Guice Modules with its constructor.
+   </para>
+
+   <para>We can also go the other way around. Injecting named beans into the Guice Injector. There are a couple of ways
+      to achieve that. Lets look at them.
+   </para>
+
+   <programlisting>
+      Injector injector = Guice.createInjector(new AbstractModule()
+      {
+         protected void configure()
+         {
+            bind(Controller.class).toInstance(controller);
+            bind(Singleton.class).toProvider(
+               GuiceIntegration.fromMicrocontainer(
+                  Singleton.class, "singleton"));
+            bind(Prototype.class).toProvider(
+               GuiceIntegration.fromMicrocontainer(
+                  Prototype.class, "prototype"));
+         }
+      });
+   </programlisting>
+
+   <programlisting>
+     AbstractBeanMetaData injectorBean = 
+        new AbstractBeanMetaData(
+            "injector", GuiceInjectorFactory.class.getName());
+     AbstractConstructorMetaData constructor = new AbstractConstructorMetaData();
+     constructor.setFactoryClass(GuiceInjectorFactory.class.getName());
+     constructor.setFactoryMethod("createInjector");
+     List&lt;ParameterMetaData> parameters = new ArrayList&lt;ParameterMetaData>();
+     parameters.add(new AbstractParameterMetaData(
+            new AbstractDependencyValueMetaData(KernelConstants.KERNEL_NAME)));
+     AbstractArrayMetaData array = new AbstractArrayMetaData();
+     array.add(new AbstractValueMetaData(GuiceObject.ALL));
+     parameters.add(new AbstractParameterMetaData(array));
+     constructor.setParameters(parameters);
+     injectorBean.setConstructor(constructor);
+     controller.install(injectorBean);
+
+     ControllerContext injectorContext = 
+        controller.getInstalledContext("injector");
+     assertNotNull(injectorContext);
+     Injector injector = (Injector)injectorContext.getTarget();
+   </programlisting>
+
+   <programlisting>
+      &lt;bean name="injector" class="org.jboss.guice.plugins.GuiceInjectorFactory">
+         &lt;constructor 
+                factoryClass="org.jboss.guice.plugins.GuiceInjectorFactory" 
+                factoryMethod="createInjector">
+            &lt;parameter>jboss.kernel:service=Kernel&lt;/parameter>
+            &lt;parameter>
+               &lt;array>
+                  &lt;bean name="BindAll" 
+                        class="org.jboss.guice.plugins.AllGuiceObject">
+                     &lt;constructor 
+                            factoryClass="org.jboss.guice.plugins.AllGuiceObject" 
+                            factoryMethod="getInstance"/>
+                  &lt;/bean>
+               &lt;/array>
+            &lt;/parameter>
+         &lt;/constructor>
+      &lt;/bean>
+   </programlisting>
+
+   <para>Here we saw three ways of using Microcontainer beans to do wiring in Guice. The first and second examples are
+      purely programmatic and you need to provide a Controller instance. The third one is how you would bind all
+      existing installed beans into the Guice Injector via a -beans.xml. Or you can provide a ControllerContextBindFilter
+      instance to the binding methods to filter the beans you want to bind. See the API docs for more details.
+   </para>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/installation.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/installation.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/installation.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="installation">
+   <title>Download and Installation</title>
+
+   <para>First you need to download JBoss Microcontainer release from
+      <ulink
+            url="http://labs.jboss.com/jbossmc/downloads">http://labs.jboss.com/jbossmc/downloads
+      </ulink>
+   </para>
+
+   <para>Unpack the archive which will give you a microcontainer-x.y.z
+      directory with the following subfolders:
+   </para>
+
+   <itemizedlist>
+      <listitem>
+         <para>docs/api - javadocs for the Microcontainer</para>
+      </listitem>
+
+      <listitem>
+         <para>docs/gettingstarted - this getting started documentation</para>
+      </listitem>
+
+      <listitem>
+         <para>docs/licences - the licenses for the software</para>
+      </listitem>
+      <listitem>
+         <para>examples - the examples explained in the next chapter</para>
+      </listitem>
+
+      <listitem>
+         <para>lib - the libraries required to run the Microcontainer</para>
+      </listitem>
+
+   </itemizedlist>
+
+   <para>You will also need a JDK of version 1.4.x+ and a copy of Apache Ant
+      1.6+
+   </para>
+
+   <para>If you want to run the examples inside JBoss AS, you will need to
+      download JBoss AS 5.x
+      <ulink
+            url="http://labs.jboss.com/jbossas/downloads">http://labs.jboss.com/jbossas/downloads
+      </ulink>
+   </para>
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/introduction.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/introduction.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/introduction.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="introduction">
+   <title>Introduction to the JBoss Microcontainer</title>
+
+   <para>The JBoss Microcontainer provides an environment to configure and manage POJOs (plain old java objects). It is
+      designed to reproduce the existing JBoss JMX Microkernel but targeted at POJO environments. As such it can be
+      used standalone outside the JBoss Application Server.
+   </para>
+
+   <para>As we mention JBoss Application Server, while rewriting its Microkernel to a POJO environment, there were other
+      aspects that also needed to be considered while changing the core functionality. New modules or subprojects were
+      introduced to the Microcontainer project to tightly integrate those aspects with the new POJO approach and to
+      eventually solve some of the basic problems that arose over the years with the changes the application server went
+      through.
+      We will discuss these modules and subprojects later on.
+   </para>
+
+   <para>At its core, the JBoss Microcontainer is a generic "dependency injection" framework. Its primary function is
+      to instantiate objects, figure out their dependencies (e.g., object A must be instantiated before object B), and
+      then manage the relationship between those objects (e.g., object A is a property of object B). With the JBoss
+      Microcontainer, you can build applications or shared services using simple POJOs. The JBoss Microcontainer is
+      responsible for assembling the POJOs together according to an externally defined XML configuration file. It
+      decouples the components in an application and makes the application easy to unit-test.
+   </para>
+
+   <para>The JBoss Microcontainer is a big object factory that manages objects. In this sense, it is similar to
+      existing
+      dependency injection frameworks such as the Spring framework and HiveMind framework. However, JBoss
+      Microcontainer
+      also has several important new features that sets it apart from existing frameworks.
+   </para>
+
+   <itemizedlist mark="bullet">
+      <listitem>
+         <para>JBoss Microcontainer supports life cycles for POJO components. It gives you fine-grained control over
+            exactly how the objects are created, instantiated, and destroyed.
+         </para>
+      </listitem>
+      <listitem>
+         <para>JBoss Microcontainer manages dependencies between objects. For instance, you can declare that object A
+            must be instantiated before object B can be created.
+         </para>
+      </listitem>
+      <listitem>
+         <para>JBoss Microcontainer integrates with the JBoss AOP (Aspect Oriented Programming) framework. In the
+            JBoss
+            Microcontainer configuration file, you can easily wire aspects as services to POJOs.
+         </para>
+      </listitem>
+      <listitem>
+         <para>JBoss Microcontainer is used as a replacement for the JMX-based Microkernel in JBoss AS 5.x and above.
+            All
+            the existing features of MBeans are tightly integrated into new Microcontainer based ServiceController.
+         </para>
+      </listitem>
+      <listitem>
+         <para>JBoss Microcontainer is embedded in JBoss AS 4.x. It is the ideal choice if you need to
+            develop shared services in JBoss AS.
+         </para>
+      </listitem>
+   </itemizedlist>
+
+   <para>Of course, you can also run JBoss Microcontainer outside of the JBoss AS. For instance, you can run it in a
+      Java SE (e.g., Swing) application or in the Tomcat servlet container. So, JBoss Microcontainer primarily
+      targets
+      three types of developers.
+   </para>
+
+   <itemizedlist mark="bullet">
+      <listitem>
+         <para>Framework developers can use JBoss Microcontainer to assemble custom server frameworks. For instance,
+            the
+            JBoss embeddable EJB3 framework is based on the Microcontainer.
+         </para>
+      </listitem>
+      <listitem>
+         <para>JBoss application developers can develop POJO services that nicely integrate into the server and can
+            be
+            shared across applications.
+         </para>
+      </listitem>
+      <listitem>
+         <para>Application developers can write lightweight applications that makes use of services from a variety of
+            sources (e.g., transaction service from JBoss, persistence service from Hibernate, and HTTP service from
+            Tomcat).
+         </para>
+      </listitem>
+   </itemizedlist>
+
+   <para>A typical JBoss Microcontainer application or service includes a set of POJOs that complete business tasks,
+      as
+      well as an XML configuration file called
+      <varname>META-INF/jboss-beans.xml</varname>
+      on the class path. The
+      <varname>jboss-beans.xml</varname>
+      file tells the JBoss Microcontianer how to assemble those POJOs together. For deployment, you can JAR the POJO
+      classes, as well as the
+      <varname>META-INF/jboss-beans.xml</varname>
+      file together in a simple .jar archive file (see
+      <xref linkend="packaging"/>
+      ).
+   </para>
+
+   <para>This document takes you through some example deployments into
+      JBoss Microcontainer 2.0 explaining how to configure POJOs and link them together
+      through injection.
+      We will also explain how to use other Microcontainer modules inside JBoss AS 5.x, especially the re-written
+      deployers and classloader modules.  Later, we will discuss how to do the same thing outside the application server.
+   </para>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/javabeans.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/javabeans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/javabeans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<section>
+   <title>Java Beans</title>
+
+   <para>In the Container module there is a simple support for
+      <ulink url="http://java.sun.com/products/javabeans/">JavaBeans</ulink> configuration. When we have some existing
+      JavaBeans XML, we can easily port that bean configuration into Microcontainer beans configuration. Or if all we
+      really need is simple configuration, no dependency, JavaBeans configuration is enough. Let see this
+      in the examples below.
+   </para>
+
+   <programlisting>
+      &lt;javabean xmlns="urn:jboss:javabean:1.0" 
+            class="org.jboss.test.javabean.support.SimpleBean">
+         &lt;property name="AString">StringValue&lt;/property>
+         &lt;property name="AByte">12&lt;/property>
+         &lt;property name="ABoolean">true&lt;/property>
+         &lt;property name="AShort">123&lt;/property>
+         &lt;property name="anInt">1234&lt;/property>
+         &lt;property name="ALong">12345&lt;/property>
+         &lt;property name="AFloat">3.14&lt;/property>
+         &lt;property name="ADouble">3.14e12&lt;/property>
+         &lt;property name="ADate">Jan 01 00:00:00 CET 2001&lt;/property>
+         &lt;property name="ABigDecimal">12e4&lt;/property>
+         &lt;property name="ABigInteger">123456&lt;/property>
+         &lt;property name="abyte">12&lt;/property>
+         &lt;property name="aboolean">true&lt;/property>
+         &lt;property name="ashort">123&lt;/property>
+         &lt;property name="anint">1234&lt;/property>
+         &lt;property name="along">12345&lt;/property>
+         &lt;property name="afloat">3.14&lt;/property>
+         &lt;property name="adouble">3.14e12&lt;/property>
+         &lt;property name="ANumber" class="java.lang.Long">12345&lt;/property>
+         &lt;property name="overloadedProperty">StringValue&lt;/property>
+         &lt;property name="XYZ">XYZ&lt;/property>
+         &lt;property name="abc">abc&lt;/property>
+      &lt;/javabean>
+   </programlisting>
+
+   <para>Simple configuration via JavaBean setters.</para>
+
+   <programlisting>      
+      &lt;javabean xmlns="urn:jboss:javabean:2.0"
+            class="org.jboss.test.javabean.support.SimpleBean">
+          &lt;constructor 
+            factoryClass="org.jboss.test.javabean.support.SimpleBeanFactory"
+              factoryMethod="newInstance">
+              &lt;property name="anObject" 
+                  class="java.lang.Object">anObjectValue&lt;/property>
+              &lt;property name="AString">StringValue&lt;/property>
+              &lt;property name="AByte">12&lt;/property>
+              &lt;property name="ABoolean">true&lt;/property>
+              &lt;property name="ACharacter">x&lt;/property>
+              &lt;property name="AShort">123&lt;/property>
+              &lt;property name="anInt">1234&lt;/property>
+              &lt;property name="ALong">12345&lt;/property>
+              &lt;property name="AFloat">3.14&lt;/property>
+              &lt;property name="ADouble">3.14e12&lt;/property>
+              &lt;property name="ADate">Jan 01 00:00:00 CET 2001&lt;/property>
+              &lt;property name="ABigDecimal">12e4&lt;/property>
+              &lt;property name="ABigInteger">123456&lt;/property>
+              &lt;property name="abyte">12&lt;/property>
+              &lt;property name="aboolean">true&lt;/property>
+              &lt;property name="achar">y&lt;/property>
+              &lt;property name="ashort">123&lt;/property>
+              &lt;property name="anint">1234&lt;/property>
+              &lt;property name="along">12345&lt;/property>
+              &lt;property name="afloat">3.14&lt;/property>
+              &lt;property name="adouble">3.14e12&lt;/property>
+              &lt;property name="ANumber" class="java.lang.Long">12345&lt;/property>
+              &lt;property name="overloadedProperty">StringValue&lt;/property>
+              &lt;property name="XYZ">XYZ&lt;/property>
+              &lt;property name="abc">abc&lt;/property>
+          &lt;/constructor>
+      &lt;/javabean>
+   </programlisting>
+
+   <para>Constructor configuration via factory class static method call.</para>
+
+   <programlisting>      
+      &lt;bean xmlns="urn:jboss:bean-deployer:2.0" class="org.jboss.acme.Example">
+         &lt;property name="PropertyName">
+            &lt;javabean xmlns="urn:jboss:javabean:1.0" 
+               class="org.jboss.test.kernel.deployment.xml.support.SerializableObject"/>
+         &lt;/property>
+      &lt;/bean>
+   </programlisting>
+
+   <para>You can use JavaBean with Microcontainer beans in all cases where you could use plain value.</para>
+
+</section>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/managed.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/managed.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/managed.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="managed">
+   <title>Managed module</title>
+
+   <sect1>
+      <title>Overview</title>
+      <para>
+      The deployers support a management API based on the org.jboss.managed.api
+      classes, and org.jboss.metatype.api.types, org.jboss.metatype.api.values
+      MetaType/MetaValue classes.
+      </para>
+      <sect2>
+         <title>org.jboss.managed.api Classes</title>
+      <simpara>The management API provides an abstraction for editing
+      the metadata of a Deployment. The main management classes include:
+      </simpara>
+      <itemizedlist>
+         <listitem>
+            <para>org.jboss.managed.api.ManagedObject - is the root interface
+            for a manageable element. Its consists of:
+            <itemizedlist>
+               <listitem><simpara>a name/name type for a registry/references
+               </simpara>
+               </listitem>
+               <listitem><simpara>an attachment name to associate the
+               ManagedObject with a deployment attachment
+               </simpara>
+               </listitem>
+               <listitem><simpara>annotations from the metadata making up the ManagedObject
+               </simpara>
+               </listitem>
+               <listitem><simpara>the attachment instance
+               </simpara>
+               </listitem>
+               <listitem><simpara>the ManagedPropertys for the interface
+               </simpara>
+               </listitem>
+               <listitem><simpara>the ManagedOperations for the interface
+               </simpara>
+               </listitem>
+            </itemizedlist>
+            </para>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.ManagedProperty is an interface
+         describing a manageable field in a ManagedObject. Its analogous to the
+         JavaBean property/JMX mbean attribute. Its a type safe wrapper around
+         the Fields interface.
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.ManagedOperation an interface
+            for representing an operation in a management interface.
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.ManagedParameter – a parameter
+            in a ManagedOperation
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.Fields is an interface for a
+            collection of named values that are associated with a managed property
+            or operation.
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.ManagedDeployment is an
+            interface describing a collection of ManagedComponent and structural
+            information about a deployment.
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.ManagedComponent is an
+            interface that extends ManagedObject to define a runtime component
+            associated with a deployment.
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.ComponentType – type/subtype
+            qualification of a ManagedComponent
+         </simpara>
+         </listitem>
+         <listitem><simpara>org.jboss.managed.api.DeploymentTemplateInfo – named
+         collection of ManagedPropertys needed to create a deployment or component
+         </simpara>
+         </listitem>
+      </itemizedlist>
+      </sect2>
+      <sect2>
+         <title>org.jboss.metatype.api.types Classes</title>
+         <simpara>The types classes define an abstraction for the types of values
+            found in the ManagedProperty and ManagedOperation interfaces. The
+            types are essentially simplified types that only rely on basic JDK
+            types. The main types classes include:
+         </simpara>
+         <itemizedlist>
+            <listitem>
+               <simpara>org.jboss.metatype.api.types.MetaType&lt;T extends Serializable&gt; - root interface for meta types</simpara>
+            </listitem>
+            <listitem>
+               <simpara>org.jboss.metatype.api.types.CompositeMetaType - a key/value collection type</simpara>
+            </listitem>
+            <listitem>
+               <simpara>org.jboss.metatype.api.types.TableMetaType - a table structure with the rows being a
+                  CompositeMetaType.</simpara>
+            </listitem>
+            <listitem>
+               <simpara>org.jboss.metatype.api.types.AbstractMetaType&lt;T extends Serializable&gt; - base
+                  abstract class implementing MetaType</simpara>
+            </listitem>
+            <listitem><simpara>org.jboss.metatype.api.types.AbstractCompositeMetaType
+            - base abstract class implementing CompositeMetaType
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.types.ArrayMetaType - an
+            array or Collection of MetaType
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.types.EnumMetaType - java
+            enum type or a fixed set of String values.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.types.GenericMetaType - an opaque pass through wrapper for types that don't fit into another MetaType.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.types.SimpleMetaType - a
+            wrapper type for primatives; BigDecimal, BigInteger, Boolean/boolean,
+            Byte/byte, Character/char, Date, Double/double, Float/float,
+            Integer/int, Long/long, Short/short, String, Void/void.
+            </simpara></listitem>
+         </itemizedlist>
+      </sect2>
+      <sect2>
+         <title>org.jboss.metatype.api.values Classes</title>
+         <simpara>The values API provides an value wrappers for the corresponding
+            MetaTypes. The main values classes include:
+         </simpara>
+         <itemizedlist>
+            <listitem><simpara>org.jboss.metatype.api.values.MetaValue - the base
+            value interface defining a type accessor and clone method.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.ArrayValue&lt;T extends Serializable&gt;
+               - a representation of an array or collection of MetaValues. It supports
+               an index getter as well as Iterable&lt;T&gt;.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.CompositeValue - A represention
+               of a map of MetaValues keyed by a String. CompositeValueSupport
+               is a concrete implementation of CompositeValue.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.EnumValue - A represention
+               of a java.lang.Enum set of values, or a set of Strings. EnumValueSupport
+               is a concrete implementation of EnumValue that represents a single
+               java.lang.Enum value or java.lang.String value.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.GenericValue - A represention
+               of a GenericMetaType. GenericValueSupport
+               is a concrete implementation of GenericValue that represents a single
+               java.io.Serializable value.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.SimpleValue -
+               the SimpleMetaType value. The org.jboss.metatype.api.values.SimpleValueSupport&lt;T extends Serializable&gt;
+               class provides wrap method for generating the correct SimpleValue
+               from the java value object.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.TableValue -
+               the TableMetaType value. The org.jboss.metatype.api.values.TableValueSupport
+               class provides a concrete implementation of TableValue.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.api.values.MetaValueFactory -
+            a factory for converting a java value into the corresponding MetaValue.
+            It support an org.jboss.metatype.spi.values.MetaValueBuilder plugin
+            for controlling how a given java.lang.Class type is converted into
+            a MetaValue.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.metatype.spi.values.MetaValueBuilder -
+               a plugin for converting a MetaType and object instance into a
+               MetaValue.
+            </simpara></listitem>
+         </itemizedlist>
+      </sect2>
+      <sect2>
+         <title>org.jboss.managed.api.annotation Annotations</title>
+         <simpara>The annotations available for defining the management
+         interfaces include:
+         </simpara>
+         <itemizedlist>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementObject -
+               a class level annotation that identifies a metadata class as a ManagedObject.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementObjectID
+            - identifies a ManagedObject key/type qualifier source.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementObjectRef
+               - indicates a property that references another ManagedObject.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementProperty
+               - annotation for describing a ManagedProperty.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementComponent
+               - identifies a property as metadata identifying a ManagedComponent.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementOperation
+               - An annotation for describing a ManagedOperation.
+            </simpara></listitem>
+            <listitem><simpara>org.jboss.managed.api.annotation.ManagementParameter
+            - Annotation for documenting a ManagementOperation parameter.
+            </simpara></listitem>
+         </itemizedlist>            
+         </sect2>
+   </sect1>         
+
+   <sect1>
+      <title>Annotation Examples</title>
+      <simpara></simpara>
+   </sect1>
+   <sect1>
+      <title>Adding ManagedObject Support to Deployers</title>
+      <simpara>Deployer implementors create ManagedObjects for their
+      associated metadata by having the Deployer implement the
+      </simpara>
+   </sect1>
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/mbeans.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/mbeans.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/mbeans.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="mbeans">
+   <title>MBeans extensions</title>
+
+   <para>In previous versions (pre 5.x) of JBoss Application Server, core services were implemented as MBeans.
+      To make things a bit easier, not forcing the requrement for a direct implementation of the
+      DynamicMBean interface, we introduced
+      <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r1/html/ch2.chapter.html#d0e3460">XMBeans</ulink>.
+      But with the change of the underlying Kernel, moving away from an JMX MBeanServer to a plain POJO Controller, we also
+      let the handling of the existing MBeans to the new Controller.
+      Apart from supporting all of the existing XMBean features, we also ported some of the rich features from the new
+      Microcontainer IoC model to the XBeans.
+      We'll show these features in the examples below.
+   </para>
+
+   <programlisting>
+      &lt;mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+         &lt;attribute name="Attribute">
+            &lt;inject bean="TestName" property="getSomething" 
+               state="Instantiated"/>
+         &lt;/attribute>
+      &lt;/mbean>
+   </programlisting>
+
+   <para>Here we transparently add a dependency on a bean named TestName, which must be, in order to be injected,
+      in the Instantiated state. Once the dependency is satisfied, we actually don't inject the bean itself
+      into the attribute, but we inject the return value of getSomething method being executed on TestName bean instance.
+      Property and state attributes are optional, by default the dependant state is Installed.
+   </para>
+
+   <programlisting>
+      &lt;mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode">
+         &lt;alias>BasicBean&lt;/alias>
+         &lt;alias>${system.basic.name}&lt;/alias>
+      &lt;/mbean>
+   </programlisting>
+
+   <para>Here we can see that a MBean can also have alias names.
+      When adding alias you can also use System property replacement.
+   </para>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/modules.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/modules.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/modules.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="modules">
+   <title>New subprojects</title>
+
+   <para>With the new Microcontainer 2.0.0 a lot of new features were added to the Microcontainer core to make
+      integration with new JBoss5 easier and cleaner. Some of the core aspects were entirely re-written.
+      You can see these changes in the subprojects / modules on the figure below.
+   </para>
+
+   <figure>
+      <title>Module dependency</title>
+      <mediaobject>
+         <imageobject>
+            <imagedata fileref="../images/modules.png"/>
+         </imageobject>
+      </mediaobject>
+   </figure>
+
+   <para>Here we can see the modules that make the whole Microcontainer architecture. Most of them are part of
+      Microcontainer project as subprojects, where MBeans resides in JBossAS project and VFS is a separate project.      
+   </para>
+
+   <para>AOP-MC-int and Spring-int are extension parts of the Core (Container, Dependency, Kernel). Using AOP-MC-int
+      features is a matter of configuration, where Spring-int is a simple addon.
+      All other modules are optional, but you must satisfy the dependencies presented to you by directed arrows.
+   </para>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/osgi.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/osgi.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/osgi.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="osgi">
+   <title>OSGi module</title>
+
+   <para>We can see an increased demand for <ulink url="http://www.osgi.org">OSGi</ulink> technology these days.
+      Developers and users especially like the OSGi kind of Classloader wiring. Being able to have a Class dependency defined
+      as a versioned package dependency is something we've been lacking for while now. There are new JSRs in the making,
+      that will eventually solve this problem, but OSGi is here and now.
+   </para>
+
+   <para>Looking at the OSGi framework we saw a lot similarity with what we already have with the Microcontainer. Another
+      aspect of OSGi that is a cruical part of the core Framework is the Service Registry. A simple lookup pattern that
+      takes Classloading wiring into consideration when doing Service lookup. While we already have contextual
+      awareness in tje Microcontainer, implementing this was a matter of a simple <varname>OSGi Facade</varname> over the
+      existing Microcontainer registry. Together with new <xref linkend="classloader"/> there is a fully
+      OSGi r4.1 compatible solution available with the 2.0.0 Microcontainer.
+   </para>
+
+   <para>OSGi usage in Microcontainer falls down to three different aspects:
+      <itemizedlist>
+         <listitem>new OSGi Classloader</listitem>
+         <listitem>declarative or programmatic OSGi services deployment</listitem>
+         <listitem>OBR (OSGi Bundle Repository) usage</listitem>
+      </itemizedlist>
+   </para>
+
+   <para>
+      The new OSGi Classloader is used as a default Classloader, it is backward compatible with the existing UCL.
+   </para>
+
+   <para>
+      For the existing OSGi declarative services or programmatic usage via BundleActivator, there is a full support
+      of the OSGi core API. But for new service declaration, we encourage people to use the much richer Microcontainer
+      IoC features. The Classloading behavior and Service Registry will take new Microcontainer services into
+      consideration.
+   </para>
+
+   <para>
+      OBR usage ...
+   </para>
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/packaging.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/packaging.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/packaging.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="packaging">
+   <title>Packaging</title>
+
+   <para>We had a brief discussion on the
+      <varname>jboss-beans.xml</varname>
+      file in
+      <xref
+            linkend="examples"/>.
+      In this chapter, we will go into more depth on the packaging topic. As
+      we will see later in
+      <xref linkend="standalone"/>
+      , the packaging is more of a convention rather
+      than a requirement. The convention is recommended since it allows "deployments" to be used both
+      standalone and inside JBoss AS.
+   </para>
+
+   <para>The basic structure of Microcontainer deployment is a plain
+      .jar file (see below). The jar archive
+      can also be unpacked in a directory structure that looks
+      the jar file. It contains a
+      <varname>META-INF/jboss-beans.xml</varname>
+      to describe what you
+      want it to do. The contents of this xml file are described in
+      <xref linkend="basics"/>
+      . Finally, the archive contains the classes and any resources just like any other jar file.
+   </para>
+
+   <programlisting>
+      example.jar/
+      example.jar/META-INF/jboss-beans.xml
+      example.jar/com/acme/SomeClass.class
+   </programlisting>
+
+   <para>If you want to include a .jar file in an
+      <varname>.ear</varname>
+      deployment, you will need to reference it in
+      <varname>META-INF/jboss-app.xml</varname>
+      .
+   </para>
+
+   <programlisting>
+<![CDATA[
+
+   <xml version='1.0' encoding='UTF-8'?>
+
+      <!DOCTYPE jboss-app
+         PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
+         "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
+
+      <jboss-app>
+
+         <module>
+            <service>example.jar</service>
+         </module>
+
+      </jboss-app>
+
+]]>
+   </programlisting>
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="reliance">
+   <title>Reliance modules</title>
+
+   <para>In Microcontainer it's all about dependecies. One of the features we promised is the ability to write your own
+      dependency. As a dependency we mean some condition that must be satisfied in order that a state machine lets
+      a node pass to next state. In our case the nodes are our beans, which we eventually want to install into
+      the Microcontainer's registry.
+   </para>
+
+   <para>Almost all component models impose some sort of authentification or authorization. We've added a simple
+      identity module that relies on plain java.security concepts. On top of this we added an extension module
+      where you can define your security requirements via Drools declarative rules. Drools integration is not limited
+      to just security handling, it can be extended to suite any Drools defined rules. More about the subject in
+      the chapters below.
+   </para>
+
+   <para>We've also added a jBPM integration to support long lasting state flow definitions. This integration provides
+      a plugable way of notifying state machine nodes that they can move forward to the next state. We'll show a simple
+      human interaction of accepting state change requests to move beans into the next state.
+   </para>
+
+   <xi:include href="reliance_identity.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="reliance_rules.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="reliance_jbpm.xml"
+               xml:base="./"
+               xmlns:xi="http://www.w3.org/2001/XInclude"/>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_identity.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_identity.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_identity.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<sect1>
+   <title>Reliance identity</title>
+
+   <para>Identity ...
+   </para>
+
+   <sect2>
+      <title>Deployment</title>
+
+      <para>The
+         <varname>deployment</varname>
+         element acts as a container for many beans that are deployed together.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+         <?xml version="1.0" encoding="UTF-8"?>
+
+         <!-- Deployment holds beans -->
+         <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         </deployment>
+
+]]>
+   </programlisting>
+
+   </sect2>
+
+</sect1>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_jbpm.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_jbpm.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_jbpm.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<sect1>
+   <title>Reliance jBPM</title>
+
+   <para>jBPM ...
+   </para>
+
+   <sect2>
+      <title>Deployment</title>
+
+      <para>The
+         <varname>deployment</varname>
+         element acts as a container for many beans that are deployed together.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+         <?xml version="1.0" encoding="UTF-8"?>
+
+         <!-- Deployment holds beans -->
+         <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         </deployment>
+
+]]>
+   </programlisting>
+
+   </sect2>
+</sect1>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_rules.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_rules.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/reliance_rules.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<sect1>
+   <title>Reliance rules</title>
+
+   <para>Drools...
+   </para>
+
+   <sect2>
+      <title>Deployment</title>
+
+      <para>The
+         <varname>deployment</varname>
+         element acts as a container for many beans that are deployed together.
+      </para>
+
+      <programlisting>
+<![CDATA[
+
+         <?xml version="1.0" encoding="UTF-8"?>
+
+         <!-- Deployment holds beans -->
+         <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         <!-- bean part of the deployment -->
+         <bean .../>
+
+         </deployment>
+
+]]>
+   </programlisting>
+
+   </sect2>
+</sect1>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/spring.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/spring.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/spring.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<section>
+   <title>Spring integration</title>
+
+   <para>Spring integration allows Spring XML files to be used for IoC without Spring BeanFactory/ApplicationContext.
+      This is possible as JBoss Microcontainer supports the same set of IoC features as Spring.
+      All you need to do is declare the right namespace: <varname>urn:jboss:spring-beans:2.0</varname>.
+      See the following example for a simple plain Spring XML example.
+   </para>
+
+   <programlisting>
+      &lt;beans xmlns="urn:jboss:spring-beans:2.0">
+
+         &lt;bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+            &lt;constructor-arg index="2">
+               &lt;value>SpringBean&lt;/value>
+            &lt;/constructor-arg>
+            &lt;constructor-arg index="0">
+               &lt;value>1&lt;/value>
+            &lt;/constructor-arg>
+            &lt;constructor-arg index="1">
+               &lt;value>3.14159&lt;/value>
+            &lt;/constructor-arg>
+            &lt;property name="mylist">
+               &lt;list value-type="java.lang.String">
+                  &lt;value>onel&lt;/value>
+                  &lt;value>twol&lt;/value>
+                  &lt;value>threel&lt;/value>
+               &lt;/list>
+            &lt;/property>
+            &lt;property name="myset">
+               &lt;set value-type="java.lang.String">
+                  &lt;value>ones&lt;/value>
+                  &lt;value>twos&lt;/value>
+                  &lt;value>ones&lt;/value>
+               &lt;/set>
+            &lt;/property>
+            &lt;property name="mymap">
+               &lt;map key-type="java.lang.String">
+                  &lt;entry>
+                     &lt;key>
+                        &lt;value>test_key&lt;/value>
+                     &lt;/key>
+                     &lt;value type="java.lang.String">myvalue&lt;/value>
+                  &lt;/entry>
+               &lt;/map>
+            &lt;/property>
+         &lt;/bean>
+
+      &lt;/beans>
+   </programlisting>
+
+   <para>But things would be too easy if we just let get away with plain Spring XML.
+      So what you can do is mix and match Microcontainer beans with Spring beans. It doesn't matter which
+      starting element you choose, as long as your beans have the right namespace.
+      Let see this in the next two examples.
+   </para>
+
+   <programlisting>
+      &lt;deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+         &lt;bean name="oldBean" class="org.jboss.test.spring.support.OldBean">
+            &lt;property name="testBean">
+               &lt;inject/>
+            &lt;/property>
+         &lt;/bean>
+
+         &lt;bean xmlns="urn:jboss:spring-beans:2.0" id="testBean" 
+                 class="org.jboss.test.spring.support.SimpleBean">
+            &lt;property name="mylist">
+               &lt;list value-type="java.lang.String">
+                  &lt;value>onel&lt;/value>
+                  &lt;value>twol&lt;/value>
+                  &lt;value>threel&lt;/value>
+               &lt;/list>
+            &lt;/property>
+         &lt;/bean>
+
+      &lt;/deployment>
+   </programlisting>
+
+   <para>In this example we have a Microcontainer beans at the start (deployment element at the start), and we mix
+      them with Spring beans.
+   </para>
+
+   <programlisting>
+      &lt;beans xmlns="urn:jboss:spring-beans:2.0">
+
+         &lt;bean id="testBean" class="org.jboss.test.spring.support.SimpleBean">
+            &lt;property name="refBean">
+               &lt;ref bean="oldBean"/>
+            &lt;/property>
+         &lt;/bean>
+
+         &lt;bean xmlns="urn:jboss:bean-deployer:2.0" name="oldBean" 
+                      class="org.jboss.test.spring.support.OldBean">
+            &lt;property name="javaBeanString">JavaBean&lt;/property>
+         &lt;/bean>
+
+      &lt;/beans>
+   </programlisting>
+
+   <para>Here we start with Spring XML and add Microcontainer beans.</para>
+
+   <para>As you can see, all you need to change from your existing XML, be it Spring or Microcontainer,
+      is the namespace on the staring Spring beans element or bean element.</para>
+
+</section>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/standalone.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/standalone.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/standalone.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="standalone">
+   <title>Standalone</title>
+
+   <para>In
+      <xref linkend="examples"/>
+      , we briefly discussed how to run a Microcontainer application by loading the
+      <varname>StandaloneBootstrap</varname>
+      class, which in turn wraps the
+      <varname>BasicBootstrap</varname>
+      and
+      <varname>BeanXMLDeployer</varname>
+      utility classes. In this chapter, we will look into the source code of
+      <varname>StandaloneBootstrap</varname>
+      and see exactly how it works. While the
+      <varname>StandaloneBootstrap</varname>
+      class is sufficient for most use case scenarios, you do not have to use it. You can trivially write your own class
+      that uses the
+      <varname>BasicBootstrap</varname>
+      and
+      <varname>BeanXMLDeployer</varname>
+      .
+   </para>
+
+   <programlisting>
+      package org.jboss.kernel.plugins.bootstrap.standalone;
+
+      import java.net.URL;
+      import java.util.Enumeration;
+      import java.util.List;
+      import java.util.ListIterator;
+
+      import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+      import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+      import org.jboss.kernel.spi.deployment.KernelDeployment;
+      import org.jboss.util.collection.CollectionsFactory;
+
+      public class StandaloneBootstrap extends BasicBootstrap
+      {
+      /** The deployer */
+      protected BeanXMLDeployer deployer;
+
+      /** The deployments */
+      protected List deployments = CollectionsFactory.createCopyOnWriteList();
+
+      /** The arguments */
+      protected String[] args;
+
+      /**
+      * Bootstrap the kernel from the command line
+      *
+      * @param args the command line arguments
+      * @throws Exception for any error
+      */
+      public static void main(String[] args) throws Exception
+      {
+      StandaloneBootstrap bootstrap = new StandaloneBootstrap(args);
+      bootstrap.run();
+      }
+
+      /**
+      * Create a new bootstrap
+      */
+      public StandaloneBootstrap(String[] args) throws Exception
+      {
+      super();
+      this.args = args;
+      }
+
+      public void bootstrap() throws Throwable
+      {
+      super.bootstrap();
+
+      deployer = new BeanXMLDeployer(getKernel());
+
+      Runtime.getRuntime().addShutdownHook(new Shutdown());
+
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+      for (Enumeration e =
+      cl.getResources(StandaloneKernelConstants.DEPLOYMENT_XML_NAME);
+      e.hasMoreElements(); )
+      {
+      URL url = (URL) e.nextElement();
+      deploy(url);
+      }
+      for (Enumeration e = cl.getResources("META-INF/" +
+      StandaloneKernelConstants.DEPLOYMENT_XML_NAME);
+      e.hasMoreElements(); )
+      {
+      URL url = (URL) e.nextElement();
+      deploy(url);
+      }
+
+      // Validate that everything is ok
+      deployer.validate();
+      }
+
+      /**
+      * Deploy a url
+      */
+      protected void deploy(URL url) throws Throwable
+      {
+      log.debug("Deploying " + url);
+      KernelDeployment deployment = deployer.deploy(url);
+      deployments.add(deployment);
+      log.debug("Deployed " + url);
+      }
+
+      /**
+      * Undeploy a deployment
+      */
+      protected void undeploy(KernelDeployment deployment)
+      {
+      log.debug("Undeploying " + deployment.getName());
+      deployments.remove(deployment);
+      try
+      {
+      deployer.undeploy(deployment);
+      log.debug("Undeployed " + deployment.getName());
+      }
+      catch (Throwable t)
+      {
+      log.warn("Error during undeployment: " + deployment.getName(), t);
+      }
+      }
+
+      protected class Shutdown extends Thread
+      {
+      public void run()
+      {
+      log.info("Shutting down");
+      ListIterator iterator =
+      deployments.listIterator(deployments.size());
+      while (iterator.hasPrevious())
+      {
+      KernelDeployment deployment =
+      (KernelDeployment) iterator.previous();
+      undeploy(deployment);
+      }
+      }
+      }
+      }
+   </programlisting>
+
+   <para>One way to use this class in your own applications would be:</para>
+
+   <programlisting>
+      import org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap
+
+      public MyMainClass
+      {
+      public static void main(String[] args) throws Exception
+      {
+      StandaloneBootstrap.main(args);
+      // Your stuff here...
+      }
+      }
+   </programlisting>
+
+   <para>So what does the standalone bootstrap do?</para>
+
+   <para>First it does the plain bootstrap to get the "kernel" ready. You can
+      think of this a sophisticated form of
+      <varname>ServerLocator</varname>
+      implementation. It then creates a
+      <varname>BeanXMLDeployer</varname>
+      for deploying XML files. Next it adds a shutdown hook, such that deployments are correctly "undeployed" in reverse
+      order to their deployment. Finally, it scans the classpath for
+      <varname>META-INF/jboss-beans.xml</varname>
+      and deploys every instance of that file it finds to populate the "kernel".
+   </para>
+
+   <para>You can of course choose not to use this helper class and instead
+      implement your own processing rules.
+   </para>
+
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/vfs.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/vfs.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/en-US/src/main/docbook/modules/vfs.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,785 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+      "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="vfs">
+   <title>VFS Configuration and Usage</title>
+   <abstract>
+      <simpara>The virtual file system module provides a read-only
+      abstraction for a file system accessed using a root URI/URL.
+      </simpara>
+   </abstract>
+
+   <sect1>
+      <title>Overview</title>
+      <simpara>The virtual file system module provides a read-only
+         abstraction for a file system accessed using a root URI/URL.
+         The main VFS classes include:
+      </simpara>
+      <itemizedlist>
+         <listitem>
+            <simpara>org.jboss.virtual.VFS - A factory class for creating and
+            finding VirtualFiles.
+            </simpara>
+         </listitem>
+         <listitem>
+            <simpara>org.jboss.virtual.VirtualFile - the encapsulation of an
+            entry in a virtual file system.
+            </simpara>
+         </listitem>
+         <listitem>
+            <simpara>org.jboss.virtual.VirtualFileFilter/VirtualFileFilterWithAttributes
+             - filters that can be used to restrict the VirtualFiles matching
+             a search.
+            </simpara>
+         </listitem>
+         <listitem>
+            <simpara>org.jboss.virtual.VisitorAttributes - attributes that control
+               how a visitation of a VFS root is performed.
+            </simpara>
+         </listitem>
+         <listitem>
+            <simpara>org.jboss.virtual.VirtualFileVisitor - a callback interface
+               used with the VFS/VirtualFile.vist methods.
+            </simpara>
+         </listitem>
+         <listitem>
+            <simpara>
+               org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter - a
+               VirtualFileFilter implementation that accepts any file that ends
+               with one of the filter suffixes.
+            </simpara>
+         </listitem>
+      </itemizedlist>
+      <sect2>
+         <title>VFS Examples</title>
+         <example>
+            <title>Getting a VFS from a root URL</title>
+            <programlisting>
+               URL rootURL = ...;
+               VFS vfs = VFS.getVFS(rootURL);
+               VirtualFile jar = vfs.findChild("outer.jar");               
+            </programlisting>
+         </example>
+         <example>
+            <title>Getting a VFS from a root URI</title>
+            <programlisting>
+               URI rootURI = ...;
+               VFS vfs = VFS.getVFS(rootURI);
+               VirtualFile jar = vfs.findChild("outer.jar");               
+            </programlisting>
+         </example>
+         <example>
+            <title>Accessing a jar manifest</title>
+            <programlisting>
+               URI rootURI = ...;
+               VFS vfs = VFS.getVFS(rootURI);
+               VirtualFile jar = vfs.findChild("outer.jar");               
+               VirtualFile metaInf = jar.findChild("META-INF/MANIFEST.MF");
+               InputStream mfIS = metaInf.openStream();
+               Manifest mf = new Manifest(mfIS);
+               mfIS.close();
+               Attributes mainAttrs = mf.getMainAttributes();
+               String version = mainAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION);
+            </programlisting>
+         </example>
+         <example>
+            <title>Finding all .class files under a VFS root</title>
+            <programlisting><![CDATA[
+               URI rootURI = ...;
+               VFS vfs = VFS.getVFS(rootURI);
+               SuffixMatchFilter classVisitor = new SuffixMatchFilter(".class", VisitorAttributes.RECURSE);
+               List<VirtualFile> classes = vfs.getChildren(classVisitor);
+               int count = 0;
+               for (VirtualFile cf : classes)
+               {
+               ...
+               }                  
+            ]]></programlisting>
+         </example>
+      </sect2>
+      <sect2>
+         <title>org.jboss.virtual Classes</title>
+         <example>
+            <title>org.jboss.virtual.VFS</title>
+            <programlisting><![CDATA[
+public class VFS
+{
+   /**
+    * Get the virtual file system for a root uri
+    * 
+    * @param rootURI the root URI
+    * @return the virtual file system
+    * @throws IOException if there is a problem accessing the VFS
+    * @throws IllegalArgumentException if the rootURL is null
+    */
+   public static VFS getVFS(URI rootURI) throws IOException
+   {
+   }
+
+   /**
+    * Get the root virtual file
+    * 
+    * @param rootURI the root uri
+    * @return the virtual file
+    * @throws IOException if there is a problem accessing the VFS
+    * @throws IllegalArgumentException if the rootURL
+    */
+   public static VirtualFile getRoot(URI rootURI) throws IOException
+   {
+   }
+
+   /**
+    * Get a virtual file
+    * 
+    * @param rootURI the root uri
+    * @param name the path name
+    * @return the virtual file
+    * @throws IOException if there is a problem accessing the VFS
+    * @throws IllegalArgumentException if the rootURL or name is null
+    */
+   public static VirtualFile getVirtualFile(URI rootURI, String name) throws IOException
+   {
+   }
+
+   /**
+    * Get the virtual file system for a root url
+    * 
+    * @param rootURL the root url
+    * @return the virtual file system
+    * @throws IOException if there is a problem accessing the VFS
+    * @throws IllegalArgumentException if the rootURL is null
+    */
+   public static VFS getVFS(URL rootURL) throws IOException
+   {
+   }
+
+   /**
+    * Get the root virtual file
+    * 
+    * @param rootURL the root url
+    * @return the virtual file
+    * @throws IOException if there is a problem accessing the VFS
+    * @throws IllegalArgumentException if the rootURL
+    */
+   public static VirtualFile getRoot(URL rootURL) throws IOException
+   {
+   }
+
+   /**
+    * Get a virtual file
+    * 
+    * @param rootURL the root url
+    * @param name the path name
+    * @return the virtual file
+    * @throws IOException if there is a problem accessing the VFS
+    * @throws IllegalArgumentException if the rootURL or name is null
+    */
+   public static VirtualFile getVirtualFile(URL rootURL, String name) throws IOException
+   {
+   }
+
+   /**
+    * Get the root file of this VFS
+    * 
+    * @return the root
+    * @throws IOException for any problem accessing the VFS
+    */
+   public VirtualFile getRoot() throws IOException
+   {
+   }
+   
+   /**
+    * Find a child from the root
+    * 
+    * @param path the child path
+    * @return the child
+    * @throws IOException for any problem accessing the VFS (including the child does not exist)
+    * @throws IllegalArgumentException if the path is null
+    */
+   public VirtualFile findChild(String path) throws IOException
+   {
+   }
+   
+   /**
+    * Find a child from the root
+    * 
+    * @Deprecated use {@link #findChild(String)}
+    * @param path the child path
+    * @return the child
+    * @throws IOException for any problem accessing the VFS (including the child does not exist)
+    * @throws IllegalArgumentException if the path is null
+    */
+   @Deprecated
+   public VirtualFile findChildFromRoot(String path) throws IOException
+   {
+   }
+   
+   /**
+    * Get the children
+    * 
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the root is a leaf node
+    */
+   public List<VirtualFile> getChildren() throws IOException
+   {
+   }
+
+   /**
+    * Get the children
+    * 
+    * @param filter to filter the children
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the root is a leaf node
+    */
+   public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException
+   {
+   }
+   
+   /**
+    * Get all the children recursively<p>
+    * 
+    * This always uses {@link VisitorAttributes#RECURSE}
+    * 
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the root is a leaf node
+    */
+   public List<VirtualFile> getChildrenRecursively() throws IOException
+   {
+   }
+   
+   /**
+    * Get all the children recursively<p>
+    * 
+    * This always uses {@link VisitorAttributes#RECURSE}
+    * 
+    * @param filter to filter the children
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the root is a leaf node
+    */
+   public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException
+   {
+   }
+   
+   /**
+    * Visit the virtual file system from the root
+    * 
+    * @param visitor the visitor
+    * @throws IOException for any problem accessing the VFS
+    * @throws IllegalArgumentException if the visitor is null
+    * @throws IllegalStateException if the root is a leaf node
+    */
+   public void visit(VirtualFileVisitor visitor) throws IOException
+   {
+      ...
+   }
+
+}
+         ]]></programlisting>
+         </example>
+         <example>
+            <title>org.jboss.virtual.VirtualFile</title>
+            <programlisting><![CDATA[
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.jboss.util.collection.WeakSet;
+import org.jboss.virtual.plugins.vfs.helpers.FilterVirtualFileVisitor;
+import org.jboss.virtual.plugins.vfs.helpers.MatchAllVirtualFileFilter;
+import org.jboss.virtual.spi.VFSContext;
+import org.jboss.virtual.spi.VirtualFileHandler;
+
+/**
+ * A virtual file as seen by the user
+ *
+ * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
+ * @version $Revision: 44334 $
+ */
+public class VirtualFile implements Serializable
+{
+   private static final long serialVersionUID = 1L;
+
+   /** The virtual file handler */
+   private final VirtualFileHandler handler;
+
+   /** Whether we are closed */
+   private AtomicBoolean closed = new AtomicBoolean(false);
+
+   /** The open streams */
+   private transient final Set<InputStream> streams = Collections.synchronizedSet(new WeakSet());
+
+   /**
+    * Create a new VirtualFile.
+    *
+    * @param handler the handler
+    * @throws IllegalArgumentException if the handler is null
+    */
+   public VirtualFile(VirtualFileHandler handler)
+   {
+...
+   }
+
+   /**
+    * Get the virtual file handler
+    *
+    * @return the handler
+    * @throws IllegalStateException if the file is closed
+    */
+   public VirtualFileHandler getHandler()
+   {
+...
+   }
+
+   /**
+    * Get the simple VF name (X.java)
+    *
+    * @return the simple file name
+    * @throws IllegalStateException if the file is closed
+    */
+   public String getName()
+   {
+...
+   }
+
+   /**
+    * Get the VFS relative path name (org/jboss/X.java)
+    *
+    * @return the VFS relative path name
+    * @throws IllegalStateException if the file is closed
+    */
+   public String getPathName()
+   {
+...
+   }
+
+   /**
+    * Get the VF URL (file://root/org/jboss/X.java)
+    *
+    * @return the full URL to the VF in the VFS.
+    * @throws MalformedURLException if a url cannot be parsed
+    * @throws URISyntaxException if a uri cannot be parsed
+    * @throws IllegalStateException if the file is closed
+    */
+   public URL toURL() throws MalformedURLException, URISyntaxException
+   {
+...
+   }
+
+   /**
+    * Get the VF URI (file://root/org/jboss/X.java)
+    *
+    * @return the full URI to the VF in the VFS.
+    * @throws URISyntaxException if a uri cannot be parsed
+    * @throws IllegalStateException if the file is closed
+    * @throws MalformedURLException for a bad url
+    */
+   public URI toURI() throws MalformedURLException, URISyntaxException
+   {
+...
+   }
+
+   /**
+    * When the file was last modified
+    *
+    * @return the last modified time
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public long getLastModified() throws IOException
+   {
+...
+   }
+
+   /**
+    * Returns true if the file has been modified since this method was last called
+    * Last modified time is initialized at handler instantiation.
+    *
+    * @return
+    * @throws IOException
+    */
+   public boolean hasBeenModified() throws IOException
+   {
+...
+   }
+
+   /**
+    * Get the size
+    *
+    * @return the size
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public long getSize() throws IOException
+   {
+...
+   }
+
+   /**
+    * Tests whether the underlying implementation file still exists.
+    * @return true if the file exists, false otherwise.
+    * @throws IOException - thrown on failure to detect existence.
+    */
+   public boolean exists() throws IOException
+   {
+...
+   }
+
+   /**
+    * Whether it is a simple leaf of the VFS,
+    * i.e. whether it can contain other files
+    *
+    * @return true if a simple file.
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public boolean isLeaf() throws IOException
+   {
+...
+   }
+
+   /**
+    * Whether it is hidden
+    *
+    * @return true when hidden
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public boolean isHidden() throws IOException
+   {
+...
+   }
+
+   /**
+    * Access the file contents.
+    *
+    * @return an InputStream for the file contents.
+    * @throws IOException for any error accessing the file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public InputStream openStream() throws IOException
+   {
+...
+   }
+
+   /**
+    * Close the streams
+    */
+   public void closeStreams()
+   {
+...
+   }
+
+   /**
+    * Close the file resources (stream, etc.)
+    */
+   public void close()
+   {
+...
+   }
+
+   /**
+    * Get the VFS instance for this virtual file
+    *
+    * @return the VFS
+    * @throws IllegalStateException if the file is closed
+    */
+   public VFS getVFS()
+   {
+...
+   }
+
+   /**
+    * Get the parent
+    *
+    * @return the parent or null if there is no parent
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public VirtualFile getParent() throws IOException
+   {
+...
+   }
+
+   /**
+    * Get the children
+    *
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public List<VirtualFile> getChildren() throws IOException
+   {
+      return getChildren(null);
+   }
+
+   /**
+    * Get the children
+    *
+    * @param filter to filter the children
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed or it is a leaf node
+    */
+   public List<VirtualFile> getChildren(VirtualFileFilter filter) throws IOException
+   {
+...
+   }
+
+   /**
+    * Get all the children recursively<p>
+    *
+    * This always uses {@link VisitorAttributes#RECURSE}
+    *
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed
+    */
+   public List<VirtualFile> getChildrenRecursively() throws IOException
+   {
+      return getChildrenRecursively(null);
+   }
+
+   /**
+    * Get all the children recursively<p>
+    *
+    * This always uses {@link VisitorAttributes#RECURSE}
+    *
+    * @param filter to filter the children
+    * @return the children
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalStateException if the file is closed or it is a leaf node
+    */
+   public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException
+   {
+...
+   }
+
+   /**
+    * Visit the virtual file system
+    *
+    * @param visitor the visitor
+    * @throws IOException for any problem accessing the virtual file system
+    * @throws IllegalArgumentException if the visitor is null
+    * @throws IllegalStateException if the file is closed or it is a leaf node
+    */
+   public void visit(VirtualFileVisitor visitor) throws IOException
+   {
+...
+   }
+
+   /**
+    * Find a child
+    *
+    * @param path the path
+    * @return the child
+    * @throws IOException for any problem accessing the VFS (including the child does not exist)
+    * @throws IllegalArgumentException if the path is null
+    * @throws IllegalStateException if the file is closed or it is a leaf node
+    */
+   public VirtualFile findChild(String path) throws IOException
+   {
+...
+   }
+
+}
+            ]]></programlisting>
+         </example>
+         <example>
+            <title>org.jboss.virtual.VisitorAttributes</title>
+            <programlisting><![CDATA[
+/**
+ * Attributes used when visiting a virtual file system
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 1.1 $
+ */
+public class VisitorAttributes
+{
+   /** A VirtualFileFilter than accepts any file */
+   public static final AcceptAnyFilter RECURSE_ALL = new AcceptAnyFilter();
+
+   /** The default attributes - visit nothing both leaves, non-leaves, no recursion */
+   public static final VisitorAttributes DEFAULT = new ImmutableVisitorAttributes();
+
+   /** Visit leaves only and do not recurse non-leaf files */
+   public static final VisitorAttributes LEAVES_ONLY = new ImmutableVisitorAttributes(true, null);
+
+   /** Recurse and visit all non-leaf files */
+   public static final VisitorAttributes RECURSE = new ImmutableVisitorAttributes(false, RECURSE_ALL);
+
+   /** Recurse all non-leaf files but only visit leaves */
+   public static final VisitorAttributes RECURSE_LEAVES_ONLY = new ImmutableVisitorAttributes(true, RECURSE_ALL);
+   
+   /** Whether to include the root */
+   private boolean includeRoot;
+
+   /** Whether to only visit leaves */
+   private boolean leavesOnly;
+
+   /** Whether to ignore individual file errors */
+   private boolean ignoreErrors;
+
+   /** Whether to include hidden files */
+   private boolean includeHidden;
+
+   /** A filter used to control whether a non-leaf is recursive visited */
+   private VirtualFileFilter recurseFilter;
+
+   /**
+    * Whether to visit leaves only<p>
+    * 
+    * Default: false
+    * 
+    * @return the visit leaves only.
+    */
+   public boolean isLeavesOnly()
+   {
+      return leavesOnly;
+   }
+
+   /**
+    * Set the leaves only.
+    * 
+    * @param leavesOnly the leaves only
+    * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
+    */
+   public void setLeavesOnly(boolean leavesOnly)
+   {
+      this.leavesOnly = leavesOnly;
+   }
+
+   /**
+    * Whether to recurse into the non-leaf file<p>. If there is a recurse
+    * filter then the result will by its accepts(file) value.
+    * 
+    * Default: false
+    * 
+    * @param file the file
+    * @return the recurse flag.
+    */
+   public boolean isRecurse(VirtualFile file)
+   {
+      boolean recurse = false;
+      if( recurseFilter != null )
+         recurse = recurseFilter.accepts(file);
+      return recurse;
+   }
+
+   /**
+    * Get the recurse filter.
+    * @return the current recurse filter.
+    */
+   public VirtualFileFilter getRecurseFilter()
+   {
+      return recurseFilter;
+   }
+
+   /**
+    * Set the recurse filter.
+    * 
+    * @param filter - the recurse filter.
+    * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
+    */
+   public void setRecurseFilter(VirtualFileFilter filter)
+   {
+      this.recurseFilter = filter;
+   }
+
+   /**
+    * Whether to include the root of the visit<p>
+    * 
+    * Default: false
+    * 
+    * @return the includeRoot.
+    */
+   public boolean isIncludeRoot()
+   {
+      return includeRoot;
+   }
+
+   /**
+    * Set the includeRoot.
+    * 
+    * @param includeRoot the includeRoot.
+    * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
+    */
+   public void setIncludeRoot(boolean includeRoot)
+   {
+      this.includeRoot = includeRoot;
+   }
+
+   /**
+    * Whether to ignore individual errors<p>
+    * 
+    * Default: false
+    * 
+    * @return the ignoreErrors.
+    */
+   public boolean isIgnoreErrors()
+   {
+      return ignoreErrors;
+   }
+
+   /**
+    * Set the ignoreErrors.
+    * 
+    * @param ignoreErrors the ignoreErrors.
+    * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
+    */
+   public void setIgnoreErrors(boolean ignoreErrors)
+   {
+      this.ignoreErrors = ignoreErrors;
+   }
+
+   /**
+    * Whether to include hidden files<p>
+    * 
+    * Default: false
+    * 
+    * @return the includeHidden.
+    */
+   public boolean isIncludeHidden()
+   {
+      return includeHidden;
+   }
+
+   /**
+    * Set the includeHidden.
+    * 
+    * @param includeHidden the includeHidden.
+    * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class
+    */
+   public void setIncludeHidden(boolean includeHidden)
+   {
+      this.includeHidden = includeHidden;
+   }
+
+}
+
+            ]]></programlisting>            
+         </example>
+      </sect2>
+   </sect1>
+
+   <sect1>
+      <title>Configuration</title>
+      <para>TODO:jboss-vfs.jar ...</para>
+   </sect1>
+
+
+</chapter>

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/empty.dir
===================================================================

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.odg
===================================================================
(Binary files differ)


Property changes on: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.odg
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.pdf
===================================================================
(Binary files differ)


Property changes on: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.pdf
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.png
===================================================================
(Binary files differ)


Property changes on: projects/mc-docs/trunk/gettingstarted/en-US/src/main/resources/shared/images/modules.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/mc-docs/trunk/gettingstarted/pom.xml
===================================================================
--- projects/mc-docs/trunk/gettingstarted/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/gettingstarted/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.microcontainer</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.2.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer</groupId>
+  <artifactId>getting-started</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+  <name>JBossMC Getting Started Guide (aggregator)</name>
+  <description>The JBossMC getting started guide (aggregator)</description>
+
+  <modules>
+    <module>en-US</module>
+  </modules>
+  
+</project>
+

Added: projects/mc-docs/trunk/legalnotice.html
===================================================================
--- projects/mc-docs/trunk/legalnotice.html	                        (rev 0)
+++ projects/mc-docs/trunk/legalnotice.html	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE html
+  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head><title xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory">Legal Notice</title><link rel="stylesheet" href="css/jbossorg.css" type="text/css"/><meta xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" name="generator" content="DocBook XSL Stylesheets V1.72.0"/></head><body><div class="legalnotice"><p class="legalnotice-title"><b>Legal Notice</b></p><p>
+		</p><div class="address"><p><br/>
+			<span class="street">1801 Varsity Drive</span><br/>
+			<span class="city">Raleigh</span>, <span class="state">NC</span><span class="postcode">27606-2072</span><span class="country">USA</span><span class="phone">Phone: +1 919 754 3700</span><br/>
+			<span class="phone">Phone: 888 733 4281</span><br/>
+			<span class="fax">Fax: +1 919 754 3701</span><br/>
+			<span class="pob">PO Box 13588</span><span class="city">Research Triangle Park</span>, <span class="state">NC</span><span class="postcode">27709</span><span class="country">USA</span><br/>
+		</p></div><p>
+	</p></div></body></html>
\ No newline at end of file

Added: projects/mc-docs/trunk/pom.xml
===================================================================
--- projects/mc-docs/trunk/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss</groupId>
+    <artifactId>jboss-parent</artifactId>
+    <version>4</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer</groupId>
+  <artifactId>docs</artifactId>
+  <packaging>pom</packaging>
+  <version>2.2.0-SNAPSHOT</version>
+  <name>JBoss MC docs</name>
+  <url>http://www.jboss.org</url>
+  <description>A MC docs</description>
+ <scm>
+    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/mc-docs/trunk</connection>    
+    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/mc-docs/trunk</developerConnection>
+    <url>https://svn.jboss.org/repos/jbossas/projects/mc-docs/trunk</url>
+  </scm>
+  <licenses>
+    <license>
+      <name>lgpl</name>
+      <url>http://repository.jboss.org/licenses/lgpl.txt</url>
+    </license>
+  </licenses>
+  <organization>
+    <name>JBoss, A division of Red Hat, Inc</name>
+    <url>http://www.jboss.org</url>
+  </organization>
+
+  <modules>
+    <!-- module>gettingstarted</module>
+    <module>reference</module -->
+    <module>docbook-xslt</module>
+    <module>userguide</module>
+  </modules>
+
+</project>

Added: projects/mc-docs/trunk/reference/en-US/pom.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.microcontainer</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.2.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer</groupId>
+  <artifactId>reference-docs-${translation}</artifactId>
+  <version>1.0</version>
+  <packaging>jdocbook</packaging>
+  <name>JBossMC Reference Guide (${translation})</name>
+  <description>The JBossMC reference guide (${translation})</description>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.jboss.maven.plugins</groupId>
+        <artifactId>maven-jdocbook-plugin</artifactId>
+        <version>2.0.0</version>
+        <extensions>true</extensions>
+        <configuration>
+          <formats>
+            <format>
+              <formatName>pdf</formatName>
+              <finalName>gettingstarted.pdf</finalName>
+            </format>
+            <format>
+              <formatName>html</formatName>
+              <finalName>index.html</finalName>
+            </format>
+          </formats>
+          <sourceDocumentName>master.xml</sourceDocumentName>
+          <options>
+            <xincludeSupported>true</xincludeSupported>
+          </options>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <properties>
+    <translation>en_US</translation>
+  </properties>
+  
+</project>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/master.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/master.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/master.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding="iso-8859-1"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+Id
+Generate html using:   mvn docbkx:generate-html
+-->
+<book lang="en">
+   <bookinfo>
+      <title>JBoss Microcontainer Reference</title>
+      <subtitle>A Reference for Developers</subtitle>
+      <releaseinfo>2.0.0</releaseinfo>
+   </bookinfo>
+    
+   <toc/>
+    
+   <preface id="target" revision="1">
+      <title>Target Audience</title>
+
+      <para>
+      This reference is aimed at microcontainer developers.
+      </para>
+      <para>
+      It aims at describing how the microcontainer is constructed, the
+      design decisions made and how to extend or develop it.
+      </para>
+
+   </preface>
+
+  <preface id="preface" revision="1">
+    <title>Preface</title>
+
+    <para>Commercial development support, production support and training for
+    the JBoss Microcontainer is available through <ulink
+    url="http://www.jboss.com">JBoss Inc.</ulink> The JBoss Microcontainer is
+    a project of the JEMS product suite.</para>
+
+    <para>Authors: <itemizedlist spacing="compact">
+        <listitem>
+          <para>Adrian Brock - JBoss Microcontainer Project Lead and Chief Scientist of JBoss Inc.</para>
+          <para>Scott Stark - VP Architecture &amp; Technology</para>
+          <para>Kabir Khan - JBoss AOP Project Lead</para>
+          <para>Ales Justin - JBoss Core Developer</para>
+        </listitem>
+      </itemizedlist></para>
+  </preface>
+  
+
+   <!-- Temp outline of book organization -->
+   <xi:include href="modules/outline.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+   <!-- Collection of wiki links -->
+   <xi:include href="modules/wikilinks.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   
+   <xi:include href="modules/introduction.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/reflection.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/joinpoint.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/dependencycontroller.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/dependencyinfo.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/bootstrap.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/registry.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/bus.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/beaninfo.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/metadata.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/configuration.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/dependency.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/deployment.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+   <xi:include href="modules/events.xml"
+      xml:base="./"
+      xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
+</book>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/beaninfo.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/beaninfo.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/beaninfo.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="beaninfo">
+  <title>Describing a Bean</title>
+
+  <para>The BeanInfo provides a description of a POJO. This information allows
+  the microcontainer to know what can be done with the bean.</para>
+
+  <para>This is similar to the BeanInfo provided by the java.beans package but
+  some java environments like J2ME do not include this package because it has
+  dependencies on AWT.</para>
+
+  <sect1 id="beaninfofactory-overview" revision="1">
+    <title>BeanInfoFactory - retrieveing bean descriptions</title>
+
+    <para>The <literal>BeanInfoFactory</literal> is used to create BeanInfos for a given class.
+    <programlisting>BeanInfo getBeanInfo(String className)</programlisting>
+    The default implementation is the IntrospectionBeanInfoFactory which uses
+    reflection.</para>
+  </sect1>
+
+  <sect1 id="beaninfo-overview" revision="1">
+    <title>BeanInfo - information about a bean</title>
+
+    <para>The BeanInfo provides top level information and access to the more
+    detailed information about the bean.</para>
+  </sect1>
+
+  <sect1 id="propertyinfo-overview" revision="1">
+    <title>PropertyInfo - information about a property</title>
+
+    <para>The PropertyInfo describes an property, i.e. something that
+    follows the <programlisting>Type getX(); void setX(Type x)</programlisting>
+    javabean pattern.</para>
+  </sect1>
+
+  <sect1 id="eventinfo-overview" revision="1">
+    <title>EventInfo - information about an event</title>
+
+    <para>The EventInfo describes an event.</para>
+  </sect1>
+
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bootstrap.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bootstrap.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bootstrap.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="bootstrap">
+  <title>Bootstrapping the Kernel</title>
+
+  <para>The bootstrap provides a simple mechanism for bootstrapping the microcontainer.</para>
+
+  <sect1 id="bootstrap-overview">
+    <title>Bootstrap - bootstrapping</title>
+
+    <para>This bootstrap creates and configures the microcontainer. This
+    involves creating a KernelConfig
+    from which the KernelFactory
+    can be instantiated using the KernelInstantiator.</para>
+  </sect1>
+
+  <sect1 id="config-overview">
+    <title>Config - bootstrap configuration</title>
+
+    <para>This KernelConfig provides the mechanism to configure the bootstrap
+    including how the core kernel services are instantiated and
+    configured.</para>
+  </sect1>
+
+  <sect1 id="kernelfactory-overview">
+    <title>KernelFactory - kernel instantiation</title>
+
+    <para>The KernelFactory is responsible for initializing and configuring
+    the kernel services using information provided by the KernelConfig.</para>
+  </sect1>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bus.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bus.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/bus.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="bus">
+  <title>The Invocation Bus</title>
+
+  <para>The invocation bus provides detyped, named access to the objects in
+  the registry.</para>
+
+  <sect1 id="bus-overview" revision="1">
+    <title>Bus - invoking objects by name</title>
+
+    <para>The invocation bus provides <itemizedlist spacing="compact">
+        <listitem><para>
+           Detyped invocations - the beans operations can be invoked by name using 
+        </para></listitem>
+
+        <listitem><para>
+           Named endpoints - the target bean is specified by a name registered in the registry
+        </para></listitem>
+      </itemizedlist></para>
+  </sect1>
+
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/classadapter.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/classadapter.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/classadapter.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="classadapter">
+  <title>ClassAdapter</title>
+
+  <para>WARNING: The classadapter model is subject to change without notice.
+  It is currently under developement as issues with AOP integration and using
+  the Microcontainer in more constrained environments are investigated.</para>
+
+  <para>The class adapter abstraction provides a mechanism to override a class
+  or a specific instance of a class in a given context.</para>
+
+  <section>
+    <title>Aims</title>
+
+    <section>
+      <title>AOP Integration</title>
+
+      <para>The main of the classadapter is to provide an integration point
+      for AOP and the microcontainer. It represents a class instance before it
+      is constructed or maybe even before the class has been deployed. AOP can
+      override the joinpoints to add extra work during construction.</para>
+    </section>
+
+    <section>
+      <title>Overridding annotations</title>
+
+      <para>The microcontainer allows annotations to be overridden on a
+      specific bean deployment. These are passed to AOP.</para>
+    </section>
+
+    <section>
+      <title>Obtaining AOP dependencies</title>
+
+      <para>The microcontainer uses the classadapter to learn what
+      cross-cutting AOP dependencies are required before any attempt is made
+      to construct the object.</para>
+    </section>
+  </section>
+
+  <section>
+    <title>Issues</title>
+
+    <section>
+      <title>AOP Integration</title>
+
+      <para>The AOP integration is currently being finalized as part of
+      AOP2.0</para>
+    </section>
+  </section>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/configuration.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/configuration.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/configuration.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+   
+<chapter id="configuration">
+   
+    <title>Bean Configuration - instantiating and configuring beans</title>
+
+    <para>
+    The kernel configurator provides a service to instantiate and configure
+    beans.
+    </para>
+
+   <sect1 id="configurator-overview" revision="1">
+      <title>KernelConfigurator - configuring beans</title>
+      <para>
+      This service is used by the
+      <link linkend="controller-overview">Controller</link>
+      once it knows the dependencies have been satisfied.
+         ControllerContext
+      </para>
+   </sect1>
+
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependency.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependency.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependency.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="dependency">
+  <title>Bean Dependency - wiring beans together</title>
+
+  <para>The POJO controller extends the dependency controller to provide a
+  specific lifecycle for POJOs.</para>
+
+  <sect1 id="controller-overview" revision="1">
+    <title>KernelController - wiring beans</title>
+
+    <para>The POJO controller defines the following state operations for
+    </para>
+
+    <para>describe: determines the dependencies from the bean metadata</para>
+
+    <para>instantiate: invokes the constructor or factory</para>
+
+    <para>configure: configures the bean </para>
+
+    <para>create: invokes any "create()" method </para>
+
+    <para>start: invokes any "start()" method</para>
+
+    <para>install: registers the bean with the registry</para>
+  </sect1>
+
+  <sect1>
+    <title>KernelController - demand and supply</title>
+
+    <para>The POJO controller acts as a Registry plugin to handle demand and
+    supply.</para>
+  </sect1>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencycontroller.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencycontroller.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencycontroller.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="dependencycontroller">
+  <title>Dependency Controller</title>
+
+  <para>WARNING: The dependency controller is subject to change without notice. It
+  is currently under developement as issues with the integration of the JMX microkernel
+  and microcontainer are resolved.</para>
+
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencyinfo.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencyinfo.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/dependencyinfo.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="dependencyinfo">
+    <title>Dependency Info - describing dependencies</title>
+
+  <para>WARNING: The dependency controller is subject to change without notice. It
+  is currently under developement as issues with the integration of the JMX microkernel
+  and microcontainer are resolved.</para>
+
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/deployment.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/deployment.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/deployment.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="deployment">
+  <title>Bean Deployment - deploying beans</title>
+  <authorblurb>
+    <simpara>
+      <author>
+        <firstname>Scott</firstname>
+        <surname>Stark</surname>
+      </author>
+    </simpara>
+  </authorblurb>
+
+  <para>The bean deployer provides routines for deploying beans. TODO:
+    translate/expand the wiki into this doc.
+    <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5DeploymentFramework">JBoss5DeploymentFramework</ulink>
+  </para>
+  
+  <sect1>
+    <title>Design Overview</title>
+    <para>
+    The JBoss5 virtual deployemnt framework takes the aspect oriented design of
+    many of the earlier JBoss containers and applies it to the deployment layer.
+    It is also based on the POJO microntainer rather than JMX as in previous
+    releases. For an overview of the classes as a UML diagram see
+    JBoss5DeploymentFrameworkClasses. The key classes in that diagram are:
+    <variablelist>
+      <varlistentry>
+        <term>MainDeployer</term>
+        <listitem><para>this interface defines the contract for the MainDeployer.
+        The MainDeployer handles parsing of deployment archives into Deployment
+        instances and deployment of those instances into the microcontainer.
+        This in is an update of the JMX based MainDeployer from earlier versions
+        to a one based on the Microcontainer, JBoss5VirtualFileSystem, and
+        Virtual Deployment Framework(VDF). Deployers are registered with the
+        MainDeployer as an ordered list of deployers. MainDeployer contains two
+        sets of deployers:
+          <itemizedlist>
+            <listitem><para>StructureDeployers : used to analyze the structure
+            of a DeploymentContext when addDeploymentContext(DeploymentContext)
+            is invoked. For each StructureDeployer the
+            determineStructure(DeploymentContext) method is invoked to analyze
+            the deployment. A StructureDeployer? returns true to indicate that
+            the deployment was recognized and no further StructureDeployer
+            should analyze the DeploymentContext.
+            </para></listitem>
+            <listitem><para>Deployers used to translate a DeploymentUnit into a
+            runtime kernel beans when the MainDeployer.process is run. The
+            Deployer methods are:
+            
+            <itemizedlist>
+              <listitem><para>boolean isRelevant() :does the deployer want to process the unit</para></listitem>
+              <listitem><para>prepareDeploy() : take the new deployment to the ready stage</para></listitem>
+              <listitem><para>prepareUndeploy() : get ready to undeploy</para></listitem>
+              <listitem><para>handoff(new, old) : handover control from new to old</para></listitem>
+              <listitem><para>commitDeploy() : new deployment is now in control</para></listitem>
+              <listitem><para>commitUndeploy() : old deployment is out of here</para></listitem>
+              <listitem><para>getRelativeOrder() : specify the relative order of the deployer in a chain</para></listitem>            
+            </itemizedlist>
+              </para></listitem>
+            </itemizedlist>
+        </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>DeploymentUnit</term>
+        <listitem><para>a representation of a runtime unit of work a Deployer operates on.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>DeploymentContext</term>
+        <listitem><para>a representation of structural aspects of deployable content.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>ManagedObject</term>
+        <listitem><para>a representation of the manageable properties for a deployment.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>VFS</term>
+        <listitem><para>the api for representing the read-only file system of the deployment.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>VirtualFile</term>
+        <listitem><para>the api for a file in the deployment.</para></listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>DomainClassLoader</term>
+        <listitem><para>A generalization of the legacy JMX based unified class loading model. This is still in progress. The org.jboss.vfs.classloding.</para></listitem>
+      </varlistentry>
+    </variablelist>
+    </para>      
+  </sect1>
+
+  <sect1>
+    <title>Current StructureDeployers
+      <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5StructureDeployerClasses">JBoss5StructureDeployerClasses</ulink></title>
+
+    <para>
+      <itemizedlist>
+        <listitem><para>org.jboss.deployers.plugins.structure.vfs.AbstractStructureDeployer</para></listitem>
+        <listitem><para>org.jboss.deployers.plugins.structure.vfs.explicit.DeclaredStructure</para></listitem>
+        <listitem><para>org.jboss.deployers.plugins.structure.vfs.file.FileStructure</para></listitem>
+        <listitem><para>org.jboss.deployers.plugins.structure.vfs.jar.JARStructure</para></listitem>
+        <listitem><para>org.jboss.deployers.plugins.structure.vfs.war.WARStructure</para></listitem>
+        <listitem><para>org.jboss.deployment.EARStructure</para></listitem>
+      </itemizedlist>        
+    </para>      
+  </sect1>
+
+  <sect1>
+    <title>Current Deployers</title>
+    
+      <para>
+        <itemizedlist>
+          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.BeanDeployer</para></listitem>
+          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.KernelDeploymentDeployer</para></listitem>
+          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer</para></listitem>
+          <listitem><para>org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer</para></listitem>
+          <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=ServiceDeployments">ServiceDeployments</ulink>
+            <itemizedlist>
+              <listitem><para>org.jboss.system.deployers.SARDeployer</para></listitem>
+              <listitem><para>org.jboss.system.deployers.ServiceClassLoaderDeployer</para></listitem>
+              <listitem><para>org.jboss.system.deployers.ServiceDeploymentDeployer</para></listitem>
+              <listitem><para>org.jboss.system.deployers.ServiceDeployer</para></listitem>
+            </itemizedlist>
+            </para>
+            </listitem>
+            <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5WebDeployments">JBoss5WebDeployments</ulink>
+              <itemizedlist>
+                <listitem><para>org.jboss.deployment.WebAppParsingDeployer</para></listitem>
+                <listitem><para>org.jboss.deployment.JBossWebAppParsingDeployer</para></listitem>
+                <listitem><para>org.jboss.web.tomcat.tc6.deployers.TomcatDeployer</para></listitem>
+              </itemizedlist>
+              </para>
+              </listitem>
+              <listitem><para>org.jboss.resource.deployers.RARDeployer</para></listitem>
+              <listitem><para>org.jboss.resource.deployers.RARParserDeploye</para></listitem>              
+      </itemizedlist>
+      </para>
+  </sect1>
+  
+  <sect1>
+    <title> Deployer Helper/Base Classes JBoss5BaseDeployerClasses</title>
+
+    <para></para>
+    <sect2>
+      <title>AbstractDeployer</title>
+      <para></para>
+    </sect2>
+  </sect1>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/events.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/events.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/events.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="events">
+  <title>Events - notifications from the microcontainer and services</title>
+
+  <para>The event subsystem allows services to produce and consume
+  events.</para>
+
+  <sect1 id="event-overview" revision="1">
+    <title>Event - event abstraction</title>
+
+    <para>The Event class is intended to abstract the different event
+    mechanisms used by different software.</para>
+  </sect1>
+
+  <sect1 id="eventemitter-overview" revision="1">
+    <title>EventEmitter - producting events</title>
+
+    <para>Event emitters produce events and send them to their registered
+    <link linkend="eventlistener-overview">listeners</link>.</para>
+
+    <para>Listeners can be registered with a <link
+    linkend="eventfilter-overview">filter</link> to filter the events they are
+    interested in before they are sent.</para>
+  </sect1>
+
+  <sect1 id="eventlistener-overview" revision="1">
+    <title>EventListener - consuming events</title>
+
+    <para>Event listeners consume events from <link
+    linkend="eventemitter-overview">emitters</link>.</para>
+  </sect1>
+
+  <sect1 id="eventfilter-overview" revision="1">
+    <title>EventFilter - filtering events</title>
+
+    <para>A filter allows events to filtered before they are sent. This is can
+    be more efficient than filtering the event in the <link
+    linkend="eventlistener-overview">listener</link>.</para>
+  </sect1>
+
+  <sect1 id="eventmanager-overview" revision="1">
+    <title>EventManager - named listening</title>
+
+    <para>The event manager allows <link
+    linkend="eventemitter-overview">emitters</link> and <link
+    linkend="eventlistener-overview">listeners</link> to be more detached from
+    each other. Instead of direct registration, the names of the objects in
+    the registry are used.</para>
+  </sect1>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/introduction.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/introduction.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/introduction.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!-- Id: -->
+<chapter id="introduction">
+  <title>Introduction to the JBoss Microcontainer</title>
+
+  <para>The JBoss Microcontainer (MC) provides an environment to configure and
+  manage POJOs (plain old java objects). It is designed to reproduce the
+  existing JBoss JMX Microkernel but targetted at POJO environments. As such
+  it can be used standalone outside the JBoss Application Server.</para>
+
+  <para>The 2.0.x release provides a set of features to support POJO
+  deployment in JBossAS-5.0.x, JBossESB, and the bootstrap of services used by
+  standalone projects like embedded EJB3.</para>
+
+  <para></para>
+
+  <para>This document takes you through the design of the microcontainer
+  including design decisions and future directions.
+  </para>
+
+  <sect1>
+      <title>JBoss Microcontainer Highlights</title>
+      <para>The primary focus of the MC is as a framework for
+      building server kernels. It replaces the legacy JMX based kernel
+      found in JBossAS4.x and earlier with a POJO based kernel that
+      has been generalized to better support extensibility along the
+      primary aspects required for a server type of environment: aop, metadata,
+      class loading, deployments, state management, lifecycle/dependcies, configuration,
+      and management. The use of the term server should not be correlated with
+      large memory/cpu requirment environments of typical application/web servers.
+      A server in the context of the MC is just a kernel for plugging POJO
+      container models into. The MC can be configured for extremely lightweight
+      application type setups like a junit testcase as well as full feature
+      application servers.
+      </para>
+
+      <para>
+          
+      </para>
+  </sect1>
+
+  <sect1>
+      <title>Information and Roadmaps</title>
+      <para>A high level roadmap for the MC and status can be found in the
+          wiki page <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMicrocontainerHighLevelRoadMap">JBossMicrocontainerHighLevelRoadMap</ulink>.
+          A more detailed roadmap of the issues going into releases can be found
+          in the   
+          <ulink url="http://jira.jboss.com/jira/browse/JBMICROCONT?report=com.atlassian.jira.plugin.system.project:roadmap-panel">MC JIRA</ulink>
+          project page.
+      </para>
+      <para>Design discussion occur in the <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=main&amp;c=18">JBoss POJO Developers Forums</ulink>.
+          This currently includes 3 sub-forums:
+          <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=204">Design the new POJO MicroContainer</ulink>
+          (the core MC projects independent of any particular usage),
+          <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=208">Design of POJO Server</ulink>
+          (discussions related to application server environments like JBossAS, JBossESB),
+          <ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewforum&amp;f=256">Design of OSGi Integration</ulink>
+          (discussion of how a kernel/framework like OSGi should integrate with the MC). 
+      </para>
+  </sect1>
+
+  <sect1 id="mc-modules">
+      <title>An overview of the MC modules</title>
+      <para>This section introduces the various MC modules</para>
+      <sect2>
+          <title>aop-mc-int</title>
+          <para>Integration between the JBossAOP and MC projects</para>
+      </sect2>
+      <sect2>
+          <title>container</title>
+          <para>A better name would be joinpoint. This module contains:
+          reflection, the integration point for manipulating class information at runtime,
+          e.g. overriding annotations or obtaining an aop instance advisor.
+          joinpoint, the joinpoint model including the join point factory.
+          classadaptor, the integration and configuration spi.
+          metadata, base metadata types and repository
+          </para>
+      </sect2>
+      <sect2>
+          <title>dependency</title>
+          <para>Dependency management is handled by the controller. The
+          controller is the core component for keeping track
+          of contexts to make sure the configuration and lifecycle are
+          done in the correct order including dependencies and
+          classloading considerations. 
+          </para>
+      </sect2>
+      <sect2>
+          <title>deployers</title>
+          <para>Deployers load components from various models, POJOs, JMX, Spring,
+          Java EE, etc. into the MC runtime.  
+          </para>
+      </sect2>
+      <sect2>
+          <title>kernel</title>
+          <para>The kernel defines the core kernel spi including, boostrap,
+              configuration, POJO deployments, dependency, events, bean
+              metadata, and bean registry.
+          </para>
+      </sect2>
+      <sect2>
+          <title>managed</title>
+          <para>The managed module defines the base objects defining the
+              management view of a component. 
+          </para>
+      </sect2>
+      <sect2>
+          <title>metatype</title>
+          <para>The metatype module defines the base types found in the
+              management view of a component.
+          </para>
+      </sect2>
+      <sect2>
+          <title>osgi-int</title>
+          <para>This contains the integration classes that adapt the OSGi
+              model onto the MC.
+          </para>
+      </sect2>
+      <sect2>
+          <title>spring-int</title>
+          <para>This contains the integration classes that adapt the spring
+              model onto the MC.
+          </para>
+      </sect2>
+      
+  </sect1>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/joinpoint.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/joinpoint.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/joinpoint.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="joinpoint">
+  <title>Joinpoint - Accessing a Bean</title>
+
+  <para>WARNING: The joinpoint model is subject to change without notice. It
+  is currently under developement as issues with AOP integration and using the
+  Microcontainer in more constrained environments are investigated.</para>
+
+  <para>The joinpoint model provides a mechanism to access class operations in
+  a standard way.</para>
+
+  <section>
+    <title>Aims</title>
+
+    <section>
+      <title>Stanardize reflection operations</title>
+
+      <para>There are many places that use reflection within JBoss. The
+      joinpoint provides a mechansim to deal with reflection dispatching
+      without having worry about all the standard error handling, etc.</para>
+    </section>
+
+    <section>
+      <title>Overridding Definition</title>
+
+      <para>The joinpoint allows the mechanism of dispatch to be overridden
+      either through configuration or implementation. Examples would be not
+      using get/set to define a property either because it is a different
+      method name or it should use direct field access.</para>
+    </section>
+  </section>
+
+  <section>
+    <title>Issues</title>
+
+    <section>
+      <title>javabean versus object</title>
+
+      <para>Much of the javabean abstraction has moved the BeanInfo model, it
+      is questionable whether the ability to override on a plain object is
+      still required.</para>
+    </section>
+
+    <section>
+      <title>Alternative implementations</title>
+
+      <para>One use of this abstraction would be to precompile reflection
+      objects using javassist for use in environments where dynamic reflection
+      is not supported.</para>
+    </section>
+
+    <section>
+      <title>AOP</title>
+
+      <para>Another potential other use is to "optimize away" reflection when
+      already dispatching requests through AOP.</para>
+    </section>
+  </section>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/kernel.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/kernel.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/kernel.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="kernel">
+    <title>The Core Kernel</title>
+
+    <para>
+    Kernel provides access to the kernel services.
+    </para>
+
+   <sect1 id="kernel-overview" revision="1">
+      <title>Kernel - getting access to kernel services</title>
+      <para>
+      The static method 
+      <programlisting>Kernel getKernel()</programlisting>
+      provides access to the kernel for the current context.
+      The context is determined by the  
+      <link linkend="manager-overview">KernelManager</link>.
+      </para>
+      <para>
+      The services provided by the kernel are:
+         <itemizedlist spacing="compact">
+            <listitem>
+            <link linkend="bus-overview">The invocation bus</link>.
+            </listitem>
+            <listitem>
+            <link linkend="config-overview">The kernel configuration</link>.
+            </listitem>
+            <listitem>
+            <link linkend="configurator-overview">The bean configurator</link>.
+            </listitem>
+            <listitem>
+            <link linkend="controller-overview">The kernel controller</link>.
+            </listitem>
+            <listitem>
+            <link linkend="eventmanager-overview">The event manager</link>.
+            </listitem>
+            <listitem>
+            <link linkend="registry-overview">The registry</link>.
+            </listitem>
+         </itemizedlist>
+      </para>
+   </sect1>
+
+   <sect1 id="manager-overview" revision="1">
+      <title>KernelManager - controlling context</title>
+      <para>
+      The kernel manager decides which kernel is relevent
+      for the given context. e.g. it could use a singleton
+      kernel or it could provide a different kernel
+      based on classloading domain.
+      </para>
+   </sect1>
+
+   <sect1>
+      <para>
+         <itemizedlist>
+            <listitem>
+               <u
+            </listitem>
+         </itemizedlist>
+      </para>
+   </sect1>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/metadata.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/metadata.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/metadata.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="beanmetadata">
+  <title>Decribing Beans</title>
+
+  <para>The BeanMetaData provides configuration used to deploy beans.</para>
+
+  <para>This is similar to the -service.xml files in JBoss4.</para>
+
+  <sect1 id="beanmetadata-overview" revision="1">
+    <title>BeanMetaData - deploying a single bean</title>
+
+    <para>The BeanMetaData provides top level information and access to the
+    more detailed information about the bean deployment.</para>
+  </sect1>
+
+  <sect1 id="classloadermetadata-overview" revision="1">
+    <title>ClassLoaderMetaData - configuring a classloader</title>
+
+    <para>The classloader metadata is used to configure the classloader
+    for an individual bean or a whole deployment.</para>
+  </sect1>
+
+  <sect1 id="propertymetadata-overview" revision="1">
+    <title>PropertyMetaData - configuring properties</title>
+
+    <para>The property metadata is used to configure individual bean
+    property with values.</para>
+  </sect1>
+
+  <sect1 id="parametermetadata-overview" revision="1">
+    <title>ParameterMetaData - configuring values passed to constructors or
+    methods</title>
+
+    <para>The parameter metadata is used to pass values to constructors and
+    methods.</para>
+  </sect1>
+
+  <sect1 id="supplymetadata-overview" revision="1">
+    <title>SupplyMetaData - specifying the bean supplies a demand</title>
+
+    <para>The supply metadata is used to define what the bean supplies.</para>
+  </sect1>
+
+  <sect1 id="demandmetadata-overview" revision="1">
+    <title>DemandMetaData - specifying the bean demands a dependency</title>
+
+    <para>The demand metadata is used to define what the bean demands.</para>
+  </sect1>
+
+  <sect1 id="valuemetadata-overview" revision="1">
+    <title>ValueMetaData - configuring values</title>
+
+    <para>The value metadata is used to define values.</para>
+  </sect1>
+
+  <sect1 id="dependencyvaluemetadata-overview" revision="1">
+    <title>DependencyValueMetaData - defining named dependencies</title>
+
+    <para>An extension to the value metadata that treats the underlying value
+    as the name of an entry in the Registry and returns the registry's
+    registered object when asked for the value.</para>
+  </sect1>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/outline.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/outline.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/outline.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="outline">
+  <title>Outline of Reference Guide</title>
+
+  <para>An outline of the topics/order we should cover.
+  <itemizedlist>
+    <listitem>
+      <para>
+        Introduction of the JBoss Microcontainer and its purpose.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        Overview of the JBoss Microcontainer modules and what the various dependencies between
+        them are.
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        Setup/bootstrap of a kernel. Discussion of various bootstrap coding/configuration
+        to setup a kernel for different environments/purposes. This should be
+        somewhat of a deeper dive overview in that it will reference other modules
+        and SPIs that are used for the setup.
+        <itemizedlist>
+          <listitem>
+            <para>
+              Unit testing
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              Embedded J2SE
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              Embedded (EJB3, JBPM, SEAM, ...).
+              How other projects can leverage the JBoss Microcontainer for configuration, IoC, ...
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              JBossAS
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              JBossESB
+            </para>
+          </listitem>
+        </itemizedlist>
+      </para>
+    </listitem>
+    <listitem>
+      <para>
+        Overview of the JBoss Microcontainer core apis and their relations;
+        <itemizedlist>
+          <listitem>
+            <para>
+              container: Configuration, ClassAdapter, ControllerContex, BeanInfo, Joinpoint, MetaDataRepository, MetaData, ...
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              dependency: Controller, ControllerContex, DependencyInfo, DependencyItem, ...
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              kernel: Kernel, KernelFactory, KernelConfigurator, KernelController,
+              KernelControllerContext, KernelDeployment, KernelInitializer,
+              KernelEventManager, KernelMetaDataRepository, KernelBus
+              KernelRegistry
+              ...
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              aop-mc-int: AOPJoinpointFactory, AspectBinding, Aspect, MixinBinding, StackBinding, lifecycle stuff,
+              ...
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              deployers: MainDeployer, Deployer, DeploymentUnit, Attachments,
+              DeploymentContext, StructureMetaData, StructuredDeployers,
+              StructureBuilder, ManagedObjectBuilder, ...
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              managed/metatype: ManagedObject, ManagedProperty, Fields,
+              MetaType, SimpleMetaType, CompositeMetaType, MetaValue, ...
+            </para>
+          </listitem>
+        </itemizedlist>
+      </para>
+    </listitem>
+
+  </itemizedlist>
+  </para>
+
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/reflection.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/reflection.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/reflection.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="reflection">
+  <title>Reflection Model</title>
+
+  <para>WARNING: The reflection model is subject to change without notice. It
+  is currently under developement as issues with AOP integration and using the
+  Microcontainer in more constrained environments are investigated.</para>
+
+  <para>The reflection model provides an abstraction over java.lang.reflect.
+  It exists in the container module in package org.jboss.reflect.</para>
+
+  <section>
+    <title>Aims</title>
+
+    <section>
+      <title>Cache</title>
+
+      <para>Reflection can be a bottleneck unless the information is cached.
+      This package provides a single stop cache for reflection data rather
+      than repeating this behaviour throughout JBoss.</para>
+    </section>
+
+    <section>
+      <title>Abstraction</title>
+
+      <para>It is anticapted that the reflection model can be improved in
+      different circumstances or environments. This module aims to be the one
+      place where those issues are resolved.</para>
+    </section>
+
+    <section>
+      <title>Hide implementation</title>
+
+      <para>Under AOP, classes can change their characteristics usually
+      through some sort of bytecode manipulation. This module aims to "hide"
+      some of these details from routines that "don't care" about these
+      implementation details.</para>
+    </section>
+  </section>
+
+  <section>
+    <title>Issues</title>
+
+    <section>
+      <title>Java5</title>
+
+      <para>Complete the support for annotations and generics.</para>
+    </section>
+
+    <section>
+      <title>Lazy Cache</title>
+
+      <para>Improve the lazy cache implementation. Details should only be
+      retrieved when accessed.</para>
+    </section>
+
+    <section>
+      <title>AOP</title>
+
+      <para>It is still an open issue whether this implementation can be used
+      by AOP or whether the ClassAdapter is a better place.</para>
+    </section>
+
+    <section>
+      <title>Javassist</title>
+
+      <para>The current implementation just uses simple reflection. Javassist
+      can proably provide a better implementation including supporting
+      annotations before java5?</para>
+    </section>
+  </section>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/registry.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/registry.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/registry.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<chapter id="registry">
+  <title>Registering Objects</title>
+
+  <para>The registry is used to register objects against logical names.</para>
+
+  <para>Beans can either be registered directly with the registry or <link
+  linkend="registryfactory-overview">KernelRegistryPlugin</link>s can be
+  registered to supply objects from other registries, e.g. JNDI.</para>
+
+  <sect1 id="registry-overview" revision="1">
+    <title>KernelRegistry - retrieving named objects</title>
+
+    <para>The kernel registry is used to register and retrieve objects against
+    a logical name.</para>
+
+    <para>When the object registered is an instance of <link
+    linkend="registryfactory-overview">KernelRegistryPlugin</link> it will be
+    asked for an entry if it is not directly registered with the registry. The
+    registry factories are asked in turn in the order they were
+    registered.</para>
+  </sect1>
+
+  <sect1 id="registryfactory-overview" revision="1">
+    <title>KernelRegistryPlugin - helpers for the registry</title>
+
+    <para>A registry factory allows other registry domains (such as JMX or
+    JNDI) to be inserted into the kernel registry.</para>
+
+    <para>To insert a registry factory into the registry, simply register it
+    like any other object.</para>
+  </sect1>
+</chapter>
\ No newline at end of file

Added: projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/wikilinks.xml
===================================================================
--- projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/wikilinks.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/en-US/src/main/docbook/modules/wikilinks.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+
+<chapter id="wiki-links">
+    <title>Wiki Links</title>
+    <para>A collection of useful wiki/forum links to help pull together
+    content.
+    </para>
+
+    <itemizedlist>
+        <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMicrocontainerHighLevelRoadMap">MC High Level Road Map</ulink></para></listitem>
+        <listitem><para><ulink url="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=59868">Executive Overview</ulink></para></listitem>
+        <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMicrocontainer">JBossMicrocontainer</ulink></para></listitem>
+        <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossController">JBossController</ulink></para></listitem>
+        <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5HighLevelRoadMap">JBoss5 High Level Road Map</ulink></para></listitem>
+        <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5DeploymentFramework">JBossAS5 Virtual Deployment Framework</ulink></para></listitem>
+        <listitem><para><ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMicrocontainerFAQ">FAQ</ulink></para></listitem>
+    </itemizedlist>
+</chapter>

Added: projects/mc-docs/trunk/reference/en-US/src/main/resources/shared/images/empty.dir
===================================================================

Added: projects/mc-docs/trunk/reference/pom.xml
===================================================================
--- projects/mc-docs/trunk/reference/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/reference/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss.microcontainer</groupId>
+    <artifactId>docs</artifactId>
+    <version>2.2.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss.microcontainer</groupId>
+  <artifactId>reference-docs</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+  <name>JBossMC Reference Guide (aggregator)</name>
+  <description>The JBossMC reference guide (aggregator)</description>
+
+  <modules>
+    <module>en-US</module>
+  </modules>
+  
+</project>
+

Added: projects/mc-docs/trunk/userguide/pom.xml
===================================================================
--- projects/mc-docs/trunk/userguide/pom.xml	                        (rev 0)
+++ projects/mc-docs/trunk/userguide/pom.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,86 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.jboss.microcontainer</groupId>
+    <artifactId>user-guide-${translation}</artifactId>
+    <version>2.2.0-SNAPSHOT</version>
+    <packaging>jdocbook</packaging>
+    <name>User Guide (${translation})</name>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.jboss.maven.plugins</groupId>
+                <artifactId>maven-jdocbook-plugin</artifactId>
+                <version>2.1.2</version>
+                <extensions>true</extensions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.jboss</groupId>
+                        <artifactId>jbossorg-docbook-xslt</artifactId>
+                        <version>1.1.0</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.jboss</groupId>
+                        <artifactId>jbossorg-jdocbook-style</artifactId>
+                        <version>1.1.0</version>
+                        <type>jdocbook-style</type>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.jboss.microcontainer</groupId>
+                        <artifactId>docbook-xslt</artifactId>
+                        <version>1.1.0-SNAPSHOT</version>
+                    </dependency>
+                </dependencies>
+                <configuration>
+                    <sourceDocumentName>User_Guide.xml</sourceDocumentName>
+                    <!-- imageResource>
+                        <directory>src/main/docbook</directory>
+                        <includes>
+                          <include>images/*.png</include>
+                        </includes>
+                    </imageResource>
+                    <cssResource>
+                        <directory>src/main/css</directory>
+                    </cssResource>-->
+                    <formats>
+                        <format>
+                            <formatName>pdf</formatName>
+                            <stylesheetResource>classpath:/xslt/org/jboss/microcontainer/pdf.xsl</stylesheetResource>
+			    <finalName>User_Guide.pdf</finalName>
+                        </format>
+                        <format>
+                            <formatName>html</formatName>
+			    <stylesheetResource>classpath:/xslt/org/jboss/microcontainer/xhtml.xsl</stylesheetResource>
+                            <finalName>index.html</finalName>
+                        </format>
+                        <format>
+                            <formatName>html_single</formatName>
+                            <stylesheetResource>classpath:/xslt/org/jboss/microcontainer/xhtml-single.xsl</stylesheetResource>
+                            <finalName>index.html</finalName>
+                        </format>
+                        <format>
+                            <formatName>eclipse</formatName>
+                            <stylesheetResource>classpath:/xslt/org/jboss/microcontainer/eclipse.xsl</stylesheetResource>
+                            <finalName>index.html</finalName>
+                        </format>
+                    </formats>
+                    <options>
+                        <xincludeSupported>true</xincludeSupported>
+                        <xmlTransformerType>saxon</xmlTransformerType>
+                        <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+                        <!--     could also locate the docbook dependency and inspect its version... -->
+                        <docbookVersion>1.72.0</docbookVersion>
+                    </options>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+    <properties>
+        <translation>en-US</translation>
+    </properties> 
+</project>

Added: projects/mc-docs/trunk/userguide/src/main/docbook/Author_Group.xml
===================================================================
--- projects/mc-docs/trunk/userguide/src/main/docbook/Author_Group.xml	                        (rev 0)
+++ projects/mc-docs/trunk/userguide/src/main/docbook/Author_Group.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<authorgroup>
+  <corpauthor>Mark Newton</corpauthor>
+  <corpauthor>Aleš Justin</corpauthor>
+  <corpauthor>Kabir Khan</corpauthor>
+  <corpauthor>Flavia Rainone</corpauthor>
+  <corpauthor>Thomas Diesler</corpauthor>
+</authorgroup>

Added: projects/mc-docs/trunk/userguide/src/main/docbook/Legal_Notice.xml
===================================================================
--- projects/mc-docs/trunk/userguide/src/main/docbook/Legal_Notice.xml	                        (rev 0)
+++ projects/mc-docs/trunk/userguide/src/main/docbook/Legal_Notice.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,17 @@
+<?xml version='1.0'?>
+<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+<legalnotice id="Book-Legal_Notice">
+	<title>Legal Notice</title>
+	<para>
+		<address>
+			<street>1801 Varsity Drive</street>
+			<city>Raleigh</city>, <state>NC</state><postcode>27606-2072</postcode><country>USA</country><phone>Phone: +1 919 754 3700</phone>
+			<phone>Phone: 888 733 4281</phone>
+			<fax>Fax: +1 919 754 3701</fax>
+			<pob>PO Box 13588</pob><city>Research Triangle Park</city>, <state>NC</state><postcode>27709</postcode><country>USA</country>
+		</address>
+	</para>
+</legalnotice>
+

Added: projects/mc-docs/trunk/userguide/src/main/docbook/User_Guide.xml
===================================================================
--- projects/mc-docs/trunk/userguide/src/main/docbook/User_Guide.xml	                        (rev 0)
+++ projects/mc-docs/trunk/userguide/src/main/docbook/User_Guide.xml	2009-05-21 12:52:11 UTC (rev 89249)
@@ -0,0 +1,3699 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!ENTITY % RH-ENTITIES SYSTEM "Common_Config/rh-entities.ent">
+]>
+<book>
+  <bookinfo>
+    <title>JBoss Microcontainer 2.0.0 Beta9</title>
+    <subtitle>User Guide</subtitle>
+    <issuenum> 2.0</issuenum>
+    <productnumber>2</productnumber>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Author_Group.xml"/>
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Legal_Notice.xml"/>
+  </bookinfo>
+  <preface>
+    <title>What this Book Covers</title>
+    <para>This book aims to help you become familiar with  JBoss Microcontainer in order that you can use it to develop your own services or applications.</para>
+    <para>Part I &apos;Getting Started&apos; introduces  the technology and explains how it relates to Java development in general. It then goes on to cover a complete use-case so that you can quickly see how the microcontainer works in real-life.</para>
+    <para>Part II &apos;POJO Development&apos; takes a look at the various methods you can use  to construct POJOs and wire them together using injection together with   other features.</para>
+    <para>Part III &apos;AOP Development&apos; goes on to look at how you can add behaviour to your POJOs using aspects and modify the deployment/undeployment process with lifecycle callbacks.</para>
+    <para> Part IV &apos;Extending the Microcontainer&apos; shows how you can write your own extensions by creating new dependencies and gives some examples of how this has already been done.</para>
+  </preface>
+  <part>
+    <title>Getting Started</title>
+    <chapter id="overview">
+      <title>Introduction</title>
+      <para>The Java  platform has traditionally been distributed  in 3 editions, each  providing a different type of runtime environment: </para>
+      <itemizedlist>
+        <listitem>
+          <para>Java ME (Micro Edition) - Mobile or other embedded devices</para>
+        </listitem>
+        <listitem>
+          <para>Java SE (Standard Edition) - Desktop machines or servers (typically running 2-tier applications)</para>
+        </listitem>
+        <listitem>
+          <para>Java EE (Enterprise Edition) - Servers (typically running 3-tier applications)</para>
+        </listitem>
+      </itemizedlist>
+      <para>Each environment aims to provide a base level of functionality on top of which  developers can add their own code to create applications. For example Java SE provides networking and security libraries together with graphical user interface toolkits to facilitate the development of desktop   and simple client-server applications. Java EE takes this a stage further by adding a number of &apos;enterprise  services&apos; such as transactions, messaging, and persistence that allow much more robust and scalable &apos;enterprise applications&apos; to be developed.  These services are  typically combined together inside a JEE application server in order to provide a standard runtime environment for enterprise applications but it is often the case that some are never used.</para>
+      <para>Services that are never used  are undesirable as they can  take  up valuable resources such as CPU and memory resulting in lower performance. They may also clutter up the environment with redundant configuration files,  complicating maintenance and   adding unnecessary complexity.   Given these drawbacks it would   be better if there was a   way to create a custom runtime environment containing only those services  that were needed. You would then be able to create your own custom &apos;Java Edition&apos; tailored to your requirements.</para>
+      <para>JBoss Microcontainer aims to provide  these capabilities by allowing services, created using Plain Old Java Objects (POJOs), to be deployed into a standard Java SE runtime environment in a controlled manner to create a customized  environment  for your applications. Dependencies are fully managed to ensure that new services cannot be deployed until services they depend on have first been deployed. Where it makes sense to do so you can even redeploy services at runtime providing that you access them via the microcontainer bus. Undeploying a service  causes all dependent services to be undeployed first in order  to maintain the integrity of the system. </para>
+      <para>JBoss Application Server   5.0 uses the microcontainer to integrate enterprise services together with a Servlet/JSP container, EJB container, deployers and management utilities in order to     provide a standard Java EE environment. If you need additional services then you can simply deploy these on top of Java EE to provide the functionality you need. Likewise you are free to remove any services that you don&apos;t need simply by changing the  configuration. You can even use the microcontainer to do this in other   environments such as Tomcat and GlassFish since you can plug in different classloading models  during the service deployment phase.</para>
+      <para>Since  JBoss Microcontainer is very lightweight and deals with POJOs it can also be used to deploy services into a Java ME runtime environment. This opens up new possibilities for mobile applications that can now take advantage of  enterprise services without requiring a full JEE application server. </para>
+      <para>In common with other lightweight containers JBoss Microcontainer uses  dependency injection to wire individual POJOs together to create services.  Configuration is performed using either annotations or XML depending on where the information is best located. Finally unit testing is made extremely simple thanks to a helper class that extends JUnit to setup the test environment, allowing you to access  POJOs and services from your test methods using just a few lines of code.</para>
+    </chapter>
+    <chapter>
+      <title>Download and Installing</title>
+      <para>JBoss Microcontainer 2.0.0 is currently only available as a beta release via Maven2. This means that you need to install and configure Maven before you can begin development. Once this is done then you can create a maven project that depends on the JBoss Microcontainer JARs in order to download and install them into your local maven repository. You can then create an assembly for your final application in order to package the relevant JARs into a distributable format.</para>
+      <para>The examples created for this User Guide use Maven2 to achieve exactly this so it is highly recommended that you <ulink url="http://labs.jboss.com/file-access/default/members/jbossmc/downloads/userGuide-examples-13112007.zip">download</ulink> these first and take a look at how they work.</para>
+      <note>
+        <para>To build and run the examples you first need to install and configure Maven 2.0.7 available from <ulink url="http://maven.apache.org/">http://maven.apache.org/</ulink></para>
+        <para>Installation is performed by downloading and unzipping the  maven-2.0.7-bin.zip file to a convenient location on your local disk. Configuration  consists of adding $MAVEN_HOME/bin to your path and adding the following profile to your ~/.m2/settings.xml file:</para>
+        <programlisting role="XML">&lt;settings&gt;
+  &lt;profiles&gt;
+    &lt;profile&gt;
+      &lt;id&gt;jboss.repository&lt;/id&gt;
+      &lt;activation&gt;
+        &lt;property&gt;          
+          &lt;name&gt;!jboss.repository.off&lt;/name&gt;
+        &lt;/property&gt;
+      &lt;/activation&gt;
+      &lt;repositories&gt;
+        &lt;repository&gt;
+          &lt;id&gt;snapshots.jboss.org&lt;/id&gt;
+          &lt;url&gt;http://snapshots.jboss.org/maven2&lt;/url&gt;
+          &lt;snapshots&gt;
+            &lt;enabled&gt;true&lt;/enabled&gt;
+          &lt;/snapshots&gt;
+        &lt;/repository&gt;
+        &lt;repository&gt;
+          &lt;id&gt;repository.jboss.org&lt;/id&gt;
+          &lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;
+          &lt;snapshots&gt;
+            &lt;enabled&gt;false&lt;/enabled&gt;
+          &lt;/snapshots&gt;
+        &lt;/repository&gt;
+      &lt;/repositories&gt;
+      &lt;pluginRepositories&gt;
+        &lt;pluginRepository&gt;
+          &lt;id&gt;repository.jboss.org&lt;/id&gt;
+          &lt;url&gt;http://repository.jboss.org/maven2&lt;/url&gt;
+          &lt;snapshots&gt;
+            &lt;enabled&gt;false&lt;/enabled&gt;
+          &lt;/snapshots&gt;
+        &lt;/pluginRepository&gt;
+        &lt;pluginRepository&gt;
+          &lt;id&gt;snapshots.jboss.org&lt;/id&gt;
+          &lt;url&gt;http://snapshots.jboss.org/maven2&lt;/url&gt;
+          &lt;snapshots&gt;
+            &lt;enabled&gt;true&lt;/enabled&gt;
+          &lt;/snapshots&gt;
+        &lt;/pluginRepository&gt;
+      &lt;/pluginRepositories&gt;
+    &lt;/profile&gt;
+  &lt;/profiles&gt;
+&lt;/settings&gt;</programlisting>
+        <para>This profile informs maven of the two JBoss repositories (snapshots and releases) that are needed to download the JBoss Microcontainer and dependant JARs.</para>
+      </note>
+      <para>Once you have configured Maven and downloaded the examples then you can go to one of the following subdirectories in the <code>examples/User_Guide</code> directory and enter <code>mvn install</code> to perform a build:</para>
+      <itemizedlist>
+        <listitem>
+          <para>gettingStarted -  projects for creating and using a service together with AOP</para>
+        </listitem>
+        <listitem>
+          <para>pojoDevelopment -  examples of creating and configuring POJOs using XML and annotations</para>
+        </listitem>
+        <listitem>
+          <para>aopDevelopment - examples of using AOP to add behaviour to POJOs</para>
+        </listitem>
+        <listitem>
+          <para>extending - examples of how we  created various extensions to the microcontainer by creating new dependencies</para>
+        </listitem>
+      </itemizedlist>
+      <para>Instructions on how to run the individual examples can be found in the corresponding parts of this guide.</para>
+    </chapter>
+    <chapter>
+      <title>Building services</title>
+      <para>Before we talk about building services using POJOs it is necessary to define what we mean by these terms.</para>
+      <para><emphasis role="bold">
+          <emphasis role="underline">POJOs</emphasis>
+        </emphasis></para>
+      <para>The term POJO is an acronym for Plain Old Java Object and was first coined while Rebecca Parsons, Josh MacKenzie, and Martin Fowler were preparing for a talk at a conference in September 2000. It describes the practice of encoding  business logic in regular java objects instead of components such as EJB 2.1 Entity Beans.  The benefit of this approach is that you&apos;re not required to implement any special interfaces. This not only keeps your code simple but allows it to be used in a wider variety of environments and makes it   easy to unit test.</para>
+      <para><emphasis role="bold">Definition:</emphasis> <emphasis role="italic">A POJO declares business methods, which define behaviour, and properties, which represent state. Some properties represent associations to other POJOs.</emphasis></para>
+      <para>For experienced developers this should sound  familiar as it mimicks almost exactly the proposals set out in the JavaBeans specification. JavaBeans describes a component model for User Interface development emphasizing simplicity and standardized naming conventions for property accessor methods. The idea was that this would allow automatic discovery of an object&apos;s properties so that an instance could easily be created and populated with state at runtime.  The main use case was creating  and configuring visual user interface components such as text boxes,  buttons, and tables from within an Integrated Development Environment (IDE).</para>
+      <para><emphasis role="bold">Definition:</emphasis> <emphasis role="italic">A Java Bean is a reusable software component that can be manipulated visually in a builder tool.</emphasis></para>
+      <para> Importantly a Java Bean is not required to inherit from any particular base class or interface. Also while Java Beans are  primarily targeted at builder tools they are entirely usable by programmers with conventional text editors.</para>
+      <para>Strictly speaking a Java Bean should include support for events and persistence but in many cases developers choose not to implement these features and simply follow the standardized naming conventions for property accessor methods; i.e. get and set. This &apos;lightweight&apos; form of Java Bean is commonly referred to as simply a &apos;bean&apos; and is semantically equivalent to a POJO.</para>
+      <para>The terms POJO and bean are therefore interchangeable and you will encounter both in the microcontainer documentation and configuration files.</para>
+      <para><emphasis role="bold">
+          <emphasis role="underline">Services</emphasis>
+        </emphasis></para>
+      <para>The word &apos;service&apos;  has many definitions in the English language  but in the context of developing Java applications it is helpful to define it as follows:</para>
+      <orderedlist>
+        <listitem>
+          <para>A service  should perform  work that is useful to multiple   clients, thereby preventing each client from having to perform the work themselves.</para>
+        </listitem>
+        <listitem>
+          <para>A service should have a name that  clients  can lookup at runtime to gain access. This provides a standard way to access different kinds of services and  removes the need for clients to explicitly create them  before they can be used.   </para>
+        </listitem>
+        <listitem>
+          <para>Internal changes to a service should not affect any clients.  In practice this means that clients should  access a service using a well defined interface so that the  implementation can be changed without having to recompile any clients.  </para>
+        </listitem>
+      </orderedlist>
+      <para>Using this definition  we can now answer some simple questions:</para>
+      <para>Q) Is a POJO a service?</para>
+      <para>A) No, because although it performs work that is useful to multiple clients you cannot access it using a name. Also clients have to explicitly create a POJO themselves either directly using the <code>new</code> operator or indirectly using a factory. </para>
+      <para>Q) Does a  class have to implement an interface in order  to provide a &apos;well-defined&apos; interface?</para>
+      <para>A) Not necessarily. Providing that we don&apos;t remove fields or methods from a class, or restrict access to them,  we can always change  its implementation without needing to recompile any clients. See the  section entitled <ulink url="http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html#44524">Resolution of Symbolic References</ulink> from the Java Language Specification for more details.</para>
+      <para>The  &apos;well-defined&apos; interface in this respect is composed from  the original class&apos;s fields and methods together with their access modifiers.</para>
+      <note>
+        <para>Implementing an  interface is  only necessary  if we want to allow a client to <emphasis role="bold">choose</emphasis> between <emphasis role="bold">alternative implementations</emphasis>. i.e. if the client is compiled against an interface then we can provide as many different implementations of the interface as we like without having to recompile the client. This is because the interface ensures that the method signatures do not change.</para>
+      </note>
+      <para>What then must we do in order to create a service using a POJO? The answer is to provide a naming mechanism that allows us to register a reference to the POJO  instance with a name. Clients can then lookup the POJO reference using the name at runtime and use it to perform work. The POJO class is not required to implement an interface unless it is important that the client can choose between alternative implementations. </para>
+      <para>JBoss Microcontainer provides such a naming mechanism in the form of a Controller so that we can  deploy our POJO  services into a runtime environment such as Java SE and look them up from within our applications.</para>
+      <para>Since robust implementations of Java EE services  are already available from  JBoss.org and other communities it is common for companies to focus on creating more &apos;business-oriented&apos; services. For this reason we shall look at creating, configuring and testing a simple Human Resources service that could potentially be used  by a number of different applications.</para>
+      <section>
+        <title>Creating POJOs</title>
+        <para>The example that relates to this section can be found in the <code>examples/User_Guide/gettingStarted/humanResourcesService</code> directory. The directory layout, as with all of the examples for the User Guide,  follows the <ulink url="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html">Maven Standard Directory Layout</ulink>.</para>
+        <para><programlisting>humanResourcesService/pom.xml
+                     /src/main/java
+                         /test/java
+                         /test/resources</programlisting></para>
+        <para>Java source files are located in packages beneath the src/main/java directory:</para>
+        <para><programlisting>org/jboss/example/service/Address.java
+                         /Employee.java
+                         /HRManager.java
+
+org/jboss/example/service/util/SalaryStrategy.java
+                              /AgeBasedSalaryStrategy.java
+                              /LocationBasedSalaryStrategy.java</programlisting></para>
+        <para>Each of these classes represents a simple POJO that doesn&apos;t implement any special interfaces. The most important class is HRManager as this represents the service entry point  providing all of the public methods that clients will call.</para>
+        <itemizedlist>
+          <listitem>
+            <para>addEmployee(Employee employee)</para>
+          </listitem>
+          <listitem>
+            <para>removeEmployee(Employee employee)</para>
+          </listitem>
+          <listitem>
+            <para>getEmployee(String firstName, String lastName)</para>
+          </listitem>
+          <listitem>
+            <para>getEmployees()</para>
+          </listitem>
+          <listitem>
+            <para>getSalary(Employee employee)</para>
+          </listitem>
+          <listitem>
+            <para>setSalary(Employee employee, Integer newSalary)</para>
+          </listitem>
+          <listitem>
+            <para>isHiringFreeze()</para>
+          </listitem>
+          <listitem>
+            <para>setHiringFreeze(boolean hiringFreeze)</para>
+          </listitem>
+          <listitem>
+            <para>getSalaryStrategy()</para>
+          </listitem>
+          <listitem>
+            <para>setSalaryStrategy(SalaryStrategy strategy)</para>
+          </listitem>
+        </itemizedlist>
+        <para>The Human Resources Service is therefore composed of a handful of classes which work together to allow a list of employees, together with details of their addresses and salaries, to be maintained by an HRManger. Thanks to the SalaryStrategy interface it is possible to configure the HRManager so that different salary strategy implementations are used. These place minimum and maximum limits on the salaries that can be awarded to employees depending on various rules.</para>
+        <para>To compile the source code you simply need to enter <code>mvn compile</code> from the <code>humanResourcesService/</code> directory. This will create a new directory  called <code>target/classes</code>  containing the compiled code. To clean up the project and remove the <code>target</code> directory simply enter <code>mvn clean</code>. </para>
+        <para>Now that we  have compiled our classes we  need to create instances of them. This is done by creating an XML deployment descriptor  that contains a list of beans representing individual instances. Each bean is given a name so that the instance can be looked up at runtime by clients.</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+            xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+            xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+   &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;/&gt;
+      
+&lt;/deployment&gt;</programlisting>
+        <para>Here we have declared that we want to create an instance of the HRManager class and register it with the name HRService. This file is  passed to  an XML deployer associated with the microcontainer at runtime to perform the actual deployment and instantiate the beans.</para>
+      </section>
+      <section>
+        <title>Wiring POJOs together </title>
+        <para>So far we have seen how to  create POJOs and declare instances of them together with names in an XML deployment descriptor. However, individual POJO instances  can only provide relatively simple behaviour. Things really get interesting when we combine POJOs together to perform more complex tasks. In our example we know that we can choose different salary strategy implementations for the HRManager so how do we go about wiring the POJOs together?</para>
+        <para>The answer is to use the XML deployment descriptor again as follows:</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+            xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+            xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+   &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;&gt;
+     &lt;property name=&quot;salaryStrategy&quot;&gt;<emphasis>&lt;inject bean=&quot;AgeBasedSalary&quot;/&gt;</emphasis>&lt;/property&gt;
+   &lt;/bean&gt;
+
+   &lt;bean name=&quot;AgeBasedSalary&quot;
+         class=&quot;org.jboss.example.service.util.AgeBasedSalaryStrategy&quot;/&gt;
+       
+&lt;/deployment&gt;</programlisting>
+        <para>We first need to create an instance of our chosen salary strategy implementation by including an additional &lt;bean&gt; element. Here we have chosen the AgeBasedSalaryStrategy. Next we need to inject a reference to this bean into the instance of HRManager created using the HRService bean. Injection is possible  as the HRManager class contains a <code>setSalaryStrategy(SalaryStrategy strategy)</code> method. Behind the scenes JBoss Microcontainer will call this method on the newly created HRManager instance and pass in a reference to the AgeBasedSalaryStrategy instance.</para>
+        <para>In other words the XML deployment descriptor causes the same sequence of events to occur as if you had written the following code:</para>
+        <programlisting role="JAVA">HRManager hrService = new HRManager();
+AgeBasedSalaryStrategy ageBasedSalary = new AgeBasedSalaryStrategy();
+hrService.setSalaryStrategy(ageBasedSalary);</programlisting>
+        <para>In addition to performing injection via property setter methods JBoss Microcontainer can also perform injection via constructor parameters if necessary. For more details please see the &apos;Injection&apos; chapter in Part II &apos;POJO Development&apos;. </para>
+        <note>
+          <para>Although we can create instances of classes using the &lt;bean&gt; element in the deployment descriptor it is not always appropriate to do so. For example we do not need to create instances of the Employee and Address classes since these will be created by the client in response to input from the user. As such they remain part of the service but are not mentioned in the deployment descriptor. </para>
+        </note>
+        <note>
+          <para>Also note that it is possible to define multiple beans within a deployment descriptor providing that each has a unique name. The names are required in order to perform injection as shown above.  However this does not mean to say  that all of the beans represent services. While a service could be implemented using a single bean it is most often the case that multiple beans are used together as in our example. In these cases there is usually one bean that represents the service entry point containing the public methods intended for the clients to call. In our example this is the HRService bean. Notice that there is nothing in the XML deployment descriptor  to say which beans represent a service or indeed which bean if any is the service entry point (a service may run autonomously in which case it is its own client). Care must therefore be taken when creating deployment descriptors to ensure that sufficient comments are included to describe what the beans are u!
 sed for. Alternatively a naming convention such as ending  each bean name that represents a service entry point  with &apos;Service&apos; can be used instead, e.g. HRService.</para>
+        </note>
+      </section>
+      <section>
+        <title>Configuring a service</title>
+        <para>Injecting references between POJO instances is one way of configuring a service however we can also inject values into POJO properties. The following deployment descriptor shows how we can configure the HRManager instance to have a hiring freeze and the AgeBasedSalaryStrategy to have new minimum and maximum salary values:</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+            xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+            xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+   &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;&gt;
+     <emphasis>&lt;property name=&quot;hiringFreeze&quot;&gt;false&lt;/property&gt;</emphasis>
+     &lt;property name=&quot;salaryStrategy&quot;&gt;&lt;inject bean=&quot;AgeBasedSalary&quot;/&gt;&lt;/property&gt;
+   &lt;/bean&gt;
+
+   &lt;bean name=&quot;AgeBasedSalary&quot; class=&quot;org.jboss.example.service.util.AgeBasedSalaryStrategy&quot;&gt;
+     <emphasis>&lt;property name=&quot;minSalary&quot;&gt;1000&lt;/property&gt; &lt;property name=&quot;maxSalary&quot;&gt;80000&lt;/property&gt;</emphasis>
+   &lt;/bean&gt;
+       
+&lt;/deployment&gt;</programlisting>
+        <para>As with wiring POJOs together the classes need to have public setter methods for the relevant properties so that values can be injected. For example the HRManager class has a <code>setHiringFreeze(boolean hiringFreeze)</code> method and the AgeBasedSalaryStrategy class has <code>setMinSalary(int minSalary)</code> and <code>setMaxSalary(int maxSalary)</code> methods.</para>
+        <para>The values in the deployment descriptor are converted from strings into the relevant types (boolean, int etc...) by JavaBean <ulink url="http://java.sun.com/j2se/1.5.0/docs/api/java/beans/PropertyEditor.html">PropertyEditors</ulink>. A large number of these  are provided by default for standard types but you can easily create your own if necessary. See the Properties chapter in Part II &apos;POJO Development&apos; for more details.</para>
+      </section>
+      <section>
+        <title>Testing a service</title>
+        <para>We should now have a good idea about how to create POJOs and configure them using an XML deployment descriptor so how do we go about testing them? Thankfully JBoss Microcontainer makes it extremely easy to unit test individual POJOs as well as POJOs that are wired together through the use of a MicrocontainerTest class.</para>
+        <para>The org.jboss.test.kernel.junit.MicrocontainerTest class inherits from junit.framework.TestCase and as such it sets up each test by bootstrapping JBoss Microcontainer and adding a BasicXMLDeployer. It then looks on the classpath for an XML deployment descriptor with the same name as the test class ending in .xml and residing in a directory structure representing the class&apos;s package name. Any beans found in this file are deployed and can then be accessed using a convenience method called <code>getBean(String name)</code>. </para>
+        <para>You can see examples of these deployment descriptors in the src/test/resources directory:</para>
+        <programlisting>org/jboss/example/service/HRManagerTestCase.xml
+                         /HRManagerAgeBasedTestCase.xml
+                         /HRManagerLocationBasedTestCase.xml
+
+org/jboss/example/service/util/AgeBasedSalaryTestCase.xml
+                              /LocationBasedSalaryTestCase.xml</programlisting>
+        <para>The  test   code is located in the src/test/java directory:</para>
+        <programlisting>org/jboss/example/service/HRManagerTestCase.java
+                         /HRManagerAgeBasedTestCase.xml
+                         /HRManagerLocationBasedTestCase.xml
+                         /HRManagerTest.java
+                         /HRManagerTestSuite.java
+
+org/jboss/example/service/util/AgeBasedSalaryTestCase.java
+                              /LocationBasedSalaryTestVase.java
+                              /SalaryStrategyTestSuite.java</programlisting>
+        <para>The HRManagerTest class extends MicrocontainerTest in order to set up a number of employees to use as the basis for the tests.  Individual test cases then subclass this to perform the actual work. You can also see a couple of TestSuite classes that are used to group individual test cases together for convenience.</para>
+        <para>To run the tests simply enter <code>mvn test</code> from the <code>humanResourcesService/</code> directory. You should see some DEBUG log output which shows  JBoss Microcontainer booting up and deploying beans from the relevant XML file before running each test. At the end of the test it then undeploys the beans and shuts down the microcontainer.</para>
+        <note>
+          <para>Some of the tests such as HRManagerTestCase, AgeBasedSalaryTestCase and LocationBasedSalaryTestCase simply unit test individual POJOs whilst other tests such as HRManagerAgeBasedTestCase and HRManagerLocationBasedTestCase unit test the whole service  consisting of multiple POJOs wired together. Either way the method for conducting the tests remains the same. Thanks to the MicrocontainerTest class it is trivial to set up and conduct comprehensive tests for any part of your code.</para>
+          <para>Finally note that we didn&apos;t unit test the Address or Employee classes here. They were deliberately left out as they only contain trivial logic which is very unlikely to break.</para>
+        </note>
+      </section>
+      <section>
+        <title>Packaging a service</title>
+        <para>Now that we have successfully created and tested our service it is time to package it up so that others can use it. The simplest way to do this is to create a JAR containing all of the classes. You can  choose to  include the  deployment descriptor if there is a sensible default way to configure the service but you are not required to do so.</para>
+        <para>If you do choose to include the deployment descriptor then by convention you should call it <code>jboss-beans.xml</code> and put it in a META-INF directory. This helps if you want to later deploy the service in JBoss AS 5 as the  JAR deployer recognises this layout by default and will automatically perform the deployment.</para>
+        <para>In our case we will not include it as we want to configure the service by editing the descriptor directly as a separate file. To generate a JAR in the <code>target</code> directory containing all of the compiled classes simply enter <code>mvn package</code> from the <code>humanResourcesService/</code> directory. </para>
+        <para>To make the JAR available to other maven projects you then need to enter <code>mvn install</code> in order to copy it to your local maven repository.</para>
+        <para>The final layout of the JAR is as follows:</para>
+        <programlisting>org/jboss/example/service/Address.class
+                         /Employee.class
+                         /HRManager.class
+org/jboss/example/service/util/AgeBasedSalaryStrategy.class
+                              /LocationBasedSalaryStrategy.class
+                              /SalaryStrategy.class
+META-INF/MANIFEST.MF
+META-INF/maven/org.jboss.microcontainer.examples/humanResourcesService/pom.xml
+                                                                      /pom.properties</programlisting>
+        <para>The META-INF/maven directory is automatically produced by maven and is required so that other maven projects can use this JAR as a dependency. If you are not using maven as your build system then you will not have this directory.</para>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Using services </title>
+      <para>In the previous chapter we looked at how to create, configure, test and package a service. It is now time to move on and create a client so that we can use the service to perform actual work.</para>
+      <para>In order to keep things simple the client uses a Text User Interface (TUI) to accept input from the user and output results. In the real-world  a Graphical User Interface (GUI) would almost certainly be used but here we are more concerned with demonstrating how the client interacts with the service than showing how to develop a rich desktop application.</para>
+      <para>You will find all of the necessary files in the <code>examples/User_Guide/gettingstarted/commandLineClient</code> directory.  As with the previous example this follows the Maven Standard Directory Layout: </para>
+      <programlisting>commandLineClient/pom.xml
+                 /src/main/assembly
+                     /main/config
+                     /main/java
+                     /main/resources
+                     /test/java
+                     /test/resources</programlisting>
+      <para>The client consists of 3 classes and 1 interface, located in the <code>src/main/java</code> directory:</para>
+      <programlisting>org/jboss/example/client/Client.java
+                        /ConsoleInput.java
+                        /EmbeddedBootstrap.java
+                        /UserInterface.java</programlisting>
+      <para>UserInterface describes methods that the client will call at runtime to request data from the user. ConsoleInput is an  implementation of this  that creates a TUI allowing the user to operate the client from the command line. The advantage of this design is that we can easily create a Swing implementation of UserInterface  at a later date and replace the TUI with a GUI if we decide to improve usability. We can also create a mock implementation for testing purposes that simulates a user entering data. This allows us to check the behaviour of the client automatically using conventional JUnit test cases as demonstrated by the code in the <code>src/test/java</code> directory:</para>
+      <programlisting>org/jboss/example/client/ClientTestCase.java
+                        /ClientTestSuite.java
+                        /MockUserInterface.java</programlisting>
+      <para>To compile the source code, run the unit tests, build a client JAR  and assemble a distribution containing all of the necessary files simply type <code>mvn package</code> from the <code>commandLineClient</code> directory.   </para>
+      <warning>
+        <para>For the build to work you must first have built and installed  auditAspect.jar from the  <code>examples/User_Guide/gettingStarted/auditAspect</code> directory using the <code>mvn install</code> command. This is because we actually create a number of different  client distributions including one based on  AOP which relies on auditAspect.jar being available in the local maven repositiory.</para>
+        <para>If you previously typed <code>mvn install</code> from the <code>examples/User_Guide/gettingStarted</code> directory then you will have already built and installed   humanResourcesService.jar together with  auditAspect.jar and the client will have already been packaged so this step will not be necessary.</para>
+      </warning>
+      <para>Once you have successfully compiled and packaged the client you will find the following subdirectories  in the <code>commandLineClient/target</code> directory:</para>
+      <itemizedlist>
+        <listitem>
+          <para>client-pojo.dir - used to call the service without any AOP</para>
+        </listitem>
+        <listitem>
+          <para>client-cl.dir - used to demonstrate classloading features</para>
+        </listitem>
+        <listitem>
+          <para>client-aop.dir - used in Chapter 5. Adding behaviour through AOP</para>
+        </listitem>
+      </itemizedlist>
+      <para>Each of these represents a different distribution containing all of the shell scripts, JARs,  and XML deployment descriptors that we need to run the client in different configurations. For the moment we will use the client-pojo distribution which can be found in the client-pojo.dir subdirectory:</para>
+      <programlisting>run.sh
+client-1.0.0.jar
+jboss-beans.xml
+lib/concurrent-1.3.4.jar
+   /humanResourcesService-1.0.0.jar
+   /jboss-common-core-2.0.4.GA.jar
+   /jboss-common-core-2.2.1.GA.jar
+   /jboss-common-logging-log4j-2.0.4.GA.jar
+   /jboss-common-logging-spi-2.0.4.GA.jar
+   /jboss-container-2.0.0.Beta6.jar
+   /jboss-dependency-2.0.0.Beta6.jar
+   /jboss-kernel-2.0.0.Beta6.jar
+   /jbossxb-2.0.0.CR4.jar
+   /log4j-1.2.14.jar
+   /xercesImpl-2.7.1.jar</programlisting>
+      <para>To run the client simply <code>cd</code> into client-pojo.dir and type <code>./run.sh</code>. You will then be presented with the following menu of options:  </para>
+      <mediaobject>
+        <imageobject>
+          <imagedata align="center" fileref="images/tuiMenu.png"/>
+        </imageobject>
+      </mediaobject>
+      <para>To select an option enter the  letter shown on the left-hand side and press return. For example to redisplay the menu options enter &apos;m&apos; followed by return. This is useful  if they scroll off the top of the screen as you input data and read results. Entering more than one letter or entering an invalid option will result in an appropriate error message.</para>
+      <important>
+        <para>The run.sh script sets up the runtime environment by  adding all of the JARs found in the <code>lib</code> directory to the  classpath using the <code>java.ext.dirs</code> system property. It also adds the current directory and the client-1.0.0.jar using the <code>-cp</code> flag so that the jboss-beans.xml deployment descriptor can be found at runtime together with the org.jboss.example.client.Client class which is called to start the application.</para>
+      </important>
+      <section>
+        <title>Bootstrapping the microcontainer</title>
+        <para>Before we use the client to deploy and call our service, lets take a closer look at what  happened during its construction:</para>
+        <programlisting role="JAVA">public Client(final boolean useBus) throws Exception {
+    this.useBus = useBus;
+
+    ClassLoader cl = Thread.currentThread().getContextClassLoader();
+    url = cl.getResource(&quot;jboss-beans.xml&quot;);
+
+    // Start JBoss Microcontainer
+    bootstrap = new EmbeddedBootstrap();
+    bootstrap.run();
+
+    kernel = bootstrap.getKernel();
+    controller = kernel.getController();
+    bus = kernel.getBus();
+ }</programlisting>
+        <para>First of all a url representing the jboss-beans.xml deployment descriptor was created. This is required later on by the XML deployer so that we can deploy and undeploy beans declared in the file. Here we have chosen to use the getResource() method of the application classloader as we deliberately placed the jboss-beans.xml file  on the classpath.  However, this is not a requirement  and you are free to call the deployment descriptor anything you like and place it anywhere you want provided that the URL is valid and reachable.</para>
+        <para>Next we created an instance of JBoss Microcontainer together with an XML deployer. This process  is called bootstrapping and for convenience a  BasicBootstrap class is provided  as part of the microcontainer to allow for configuration via system properties. To add an XML deployer we simply extend BasicBootstrap to create an EmbeddedBootstrap class  and override the protected bootstrap() method as follows:</para>
+        <programlisting role="JAVA">public class EmbeddedBootstrap extends BasicBootstrap {
+
+    protected BasicXMLDeployer deployer;
+
+    public EmbeddedBootstrap() throws Exception {
+        super();
+    }
+
+    public void bootstrap() throws Throwable {
+        super.bootstrap();
+        deployer = new BasicXMLDeployer(getKernel());
+        Runtime.getRuntime().addShutdownHook(new Shutdown());
+    }
+
+    public void deploy(URL url) {
+        ...
+        deployer.deploy(url);
+        ...
+    }
+
+    public void undeploy(URL url) {
+        ...
+        deployer.undeploy(url);
+        ...
+    }
+
+    protected class Shutdown extends Thread {
+        public void run() {
+            log.info(&quot;Shutting down&quot;);
+            deployer.shutdown();
+        }
+    }
+}</programlisting>
+        <para>The shutdown hook ensures that when the JVM is exited all of the beans are undeployed in the correct order. The public deploy/undeploy methods simply delegate to the BasicXMLDeployer so that we can deploy and undeploy beans declared in our jboss-beans.xml file.</para>
+        <para>Finally we stored references to the microcontainer controller and bus so that we can lookup bean references by name and access them directly or indirectly as necessary.</para>
+      </section>
+      <section>
+        <title>Deploying the service</title>
+        <para>Once the client has been created we can proceed to deploy the Human Resources service. This is done by entering the &apos;d&apos; option. You should see the following log output indicating that the BasicXMLDeployer has parsed the <emphasis>
+            <property>jboss-beans.xml</property>
+          </emphasis> file using the url and instantiated the beans found within.</para>
+        <mediaobject>
+          <imageobject>
+            <imagedata align="center" fileref="images/deployOutput.png"/>
+          </imageobject>
+        </mediaobject>
+        <note>
+          <para>The microcontainer is able to instantiate the beans as their classes are available in the extension classpath inside the <code>lib/humanResourcesService.jar</code> file. We could have equally placed these classes in an exploded directory structure and added this to the application classpath but in general you will package them in a JAR for convenience. </para>
+        </note>
+        <para>Notice that our deployment descriptor is entirely separate from the humanResourcesService.jar file. This is done on purpose so that you can easily edit it and test your changes by redeploying the service. The jboss-beans.xml file in the example contains some commented out fragments of XML that you can uncomment to configure it  in different ways:</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+            xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+            xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;&gt;
+        &lt;!-- &lt;property name=&quot;hiringFreeze&quot;&gt;true&lt;/property&gt;
+        &lt;property name=&quot;salaryStrategy&quot;&gt;&lt;inject bean=&quot;AgeBasedSalary&quot;/&gt;&lt;/property&gt; --&gt;
+    &lt;/bean&gt;
+
+    &lt;!-- &lt;bean name=&quot;AgeBasedSalary&quot; class=&quot;org.jboss.example.service.util.AgeBasedSalaryStrategy&quot;&gt;
+        &lt;property name=&quot;minSalary&quot;&gt;1000&lt;/property&gt;
+        &lt;property name=&quot;maxSalary&quot;&gt;80000&lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;bean name=&quot;LocationBasedSalary&quot;
+class=&quot;org.jboss.example.service.util.LocationBasedSalaryStrategy&quot;&gt;
+        &lt;property name=&quot;minSalary&quot;&gt;2000&lt;/property&gt;
+        &lt;property name=&quot;maxSalary&quot;&gt;90000&lt;/property&gt;
+    &lt;/bean&gt; --&gt;
+
+&lt;/deployment&gt;</programlisting>
+        <important>
+          <para>Depending on how you access the service at runtime you may need to shutdown the application and restart it again to  redeploy the service and see your changes. This reduces the flexibility of the application but  results in faster performance at runtime.  Alternatively you may be able to simply redeploy the service whilst the application is running. This increases  flexilibity but results in slower runtime performance. Careful consideration of these tradeoffs must   be made  before deciding on the approach you will take.</para>
+        </important>
+      </section>
+      <section>
+        <title>Direct access</title>
+        <para>If no parameter is given to the <code>run.sh</code> script when  the client is started then a reference to the HRService bean is looked up using the microcontainer controller once the service is deployed:</para>
+        <programlisting role="JAVA">private HRManager manager;
+...
+private final static String HRSERVICE = &quot;HRService&quot;;
+
+...
+
+void deploy() {
+    bootstrap.deploy(url);
+    if (!useBus &amp;&amp; manager == null) {
+        ControllerContext context = controller.getInstalledContext(HRSERVICE);
+        if (context != null) { manager = (HRManager) context.getTarget(); }
+    }
+}</programlisting>
+        <para>Rather than immediately looking up a reference to the bean instance we first lookup a reference to a <code>ControllerContext</code>. We then obtain a reference to the bean instance from the context using the <code>getTarget()</code> method.  The reason for this is because the bean can exist in many states within the microcontainer e.g. NOT_INSTALLED, DESCRIBED, INSTANTIATED, CONFIGURED, INSTALLED. In order to keep track of which state the bean is in we need to wrap it in another object called a context that describes the current state. The name of the context is the same as the bean name. Once a context reaches the INSTALLED state then the bean it represents is considered to be deployed.</para>
+        <para>Now that we have a reference to the bean instance representing our service entry point we can call methods on it to perform work:</para>
+        <programlisting role="JAVA">@SuppressWarnings(&quot;unchecked&quot;)
+Set&lt;Employee&gt; listEmployees() {
+    if (useBus)
+        ...
+    else
+        return manager.getEmployees();
+}</programlisting>
+        <para>The client is said to be accessing the service directly since it&apos;s using a reference to the actual bean instance.   Performance is good as each method call goes directly to the bean but  what happens if we want to reconfigure the service and redeploy it whilst the application is running? </para>
+        <para>Reconfiguration as we know is achieved by making changes to the XML deployment descriptor and saving the file but in order to redeploy the service we must first undeploy the current one. During undeployment the microcontainer  controller releases its reference to the bean instance together with any beans that depend on it. The intention is that these beans will subsequently become available for garbage collection as they are no longer required by the application. Deploying the service again creates  new bean  instances representing the new configuration. Any subsequent lookups from clients will then retrieve references to these new instances and  they will be able to access the reconfigured service.</para>
+        <para>The problem is that  we  cache the reference to the bean instance representing our service entry point in our client when we deploy the service for the first time. Undeploying the service therefore has no affect as the bean instance can still be accessed using the cached reference and it will not be garbage collected until the client releases it. Similarly deploying the service again will not cause another lookup as the client already has a cached reference. It will therefore continue to use the bean instance representing the initial service configuration.</para>
+        <note>
+          <para>You can test this behaviour for yourself by typing  &apos;u&apos; followed by return to undeploy the current service. You should still be able to access the service from the client even though it is &apos;undeployed&apos;. Now make some changes to the configuration using the jboss-beans.xml file and deploy it again using the &apos;d&apos; option (remember to save any changes you make to jboss-beans.xml first). Printing out the status of the service using the &apos;p&apos; option should allow you to see that the client is still accessing the initial instance of the service that was deployed.</para>
+        </note>
+        <warning>
+          <para>Even if we change our client so that we lookup a new reference each time the service is redeployed there is nothing to prevent new developers from coming along and mistakedly handing out copies of this reference to other objects. If all of these references are not cleaned up during redeployment then this then puts us in the same situation as before with access to older instances of the service still possible.</para>
+        </warning>
+        <para>To reliably redeploy the reconfigured service you must therefore shutdown the application completely using the &apos;q&apos; option and restart it again using the <code>run.sh</code> script. For enterprise  services such as transactions, messaging and persistance this is perfectly acceptable since they are  generally always in use. As such they cannot be redeployed at runtime and benefit from the high performance given by using direct access. If your service falls into this category then you too should consider using direct access via the microcontainer controller.</para>
+      </section>
+      <section>
+        <title>Indirect access</title>
+        <para>The <code>run.sh</code> script can be called with an optional parameter &apos;bus&apos; to specify that calls to the Human Resources service should take place using the microcontainer bus:</para>
+        <programlisting>./run.sh bus</programlisting>
+        <para>Instead of using a direct reference to the bean instance obtained from the microcontainer controller we now call an invoke() method on the bus passing in the bean name, method name, method arguments and method types. The bus takes this information and uses it to call the bean on the client&apos;s behalf.</para>
+        <programlisting role="JAVA">private final static String HRSERVICE = &quot;HRService&quot;;
+
+...
+
+ at SuppressWarnings(&quot;unchecked&quot;)
+Set&lt;Employee&gt; listEmployees() {
+    if (useBus)
+        return (Set&lt;Employee&gt;) invoke(HRSERVICE, &quot;getEmployees&quot;, new Object[] {}, new String[] {});
+    else
+        return manager.getEmployees();
+}
+
+private Object invoke(String serviceName, String methodName, Object[] args, String[] types) {
+    Object result = null;
+    try {
+        result = bus.invoke(serviceName, methodName, args, types);
+    } catch (Throwable t) {
+        t.printStackTrace();
+    }
+    return result;
+}</programlisting>
+        <para>Behind the scenes the bus looks up the reference to the bean instance specified by the bean name and calls the chosen method using reflecton. Since the client never has a direct reference to the bean instance we say that it accesses the service &apos;indirectly&apos;. As the bus does not cache the reference we can  safely make changes to our service configuration and redeploy it at runtime. Subsequent calls by the client will then result in the new reference to the service being used as expected.   In technical terms we say that the client and service have been decoupled.</para>
+        <note>
+          <para>You can test this behaviour for yourself by deploying the service and using the &apos;p&apos; option to print out the status. Undeploy the service using the &apos;u&apos; option and check that you cannot access it anymore. Now make some changes to the configuration using the jboss-beans.xml file and deploy it again using the &apos;d&apos; option (remember to save any changes you make to jboss-beans.xml first). Printing out the status again using the &apos;p&apos; option should reveal that the client is accessing the new service configuration.</para>
+        </note>
+        <para>As the bus uses reflection to call bean instances it is slower than using direct access. The benefit however is that only the bus has references to the bean instances. This means that when a service is redeployed we can clean up all of the existing references and replace them with new ones, allowing us to reliably redeploy a service at runtime. Services that are not used very often or that are specific to certain applications are good candidates for indirect access using the microcontainer bus. This is either because the reduction in performance does not matter if the service is used rarely or the service can be deployed and undeployed together with the relevant applications to keep the runtime environment clean.</para>
+      </section>
+      <section>
+        <title>Dynamic classloading</title>
+        <para>So far we have been using the extension and application classloaders to load all of the classes in our application. The application classpath  was setup by the <code>run.sh</code> script using the -cp flag to include the current directory and the client-1.0.0.jar.</para>
+        <programlisting>java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1</programlisting>
+        <para>For convenience the JARs in the lib directory were added to the extenion classloader&apos;s classpath  using the <code>java.ext.dirs</code> system property as this prevents us from having to list the full path to each of the JARs after the -cp flag. Since the extension classloader is the parent of the application classloader our client classes can find all of the microcontainer classes together with the Human Resources service classes at runtime.</para>
+        <note>
+          <para>If you are using Java 6+ then you can use a wildcard to include all JARs in a directory with the -cp flag.<programlisting>java -cp `pwd`/lib/*:.:client-1.0.0.jar org.jboss.example.client.Client $1</programlisting>This means that all of the classes in our application will be added to the application classloader&apos;s classpath and the extension classloader&apos;s classpath will retain its default value.</para>
+        </note>
+        <para>This is all well and good but what happens if we now want to deploy an additional service at runtime? If the new service is packaged in a JAR file then it needs to be visible to a classloader before any of its classes can be loaded.   The trouble is we have already setup the classpath for the application classloader (and extension classloader) on startup so we cannot easily add the url of the JAR. The same situation applies if the service classes are contained in a directory structure. Unless the top-level directory is located in the current directory (which is on the application classpath) then the classes will not be found by the application classloader.</para>
+        <para>It&apos;s also possible that  we may wish to redeploy an existing service with changes to some of its classes. Since it is forbidden for an existing classloader to reload classes due to security constraints how can this be done?</para>
+        <para>What we need is the ability to create a new classloader that knows the location of the new service&apos;s classes, or that can load new versions of an existing service&apos;s classes,  so that we can  deploy the service&apos;s beans. JBoss Microcontainer allows us to do this using the &lt;classloader&gt; element in the  deployment descriptor.</para>
+        <para>The client-cl distribution in the <code>commandLineClient/target/client-cl.dir</code> directory contains the following files that demonstrate how this works: </para>
+        <programlisting>run.sh
+client-1.0.0.jar
+jboss-beans.xml
+lib/concurrent-1.3.4.jar
+   /jboss-common-core-2.0.4.GA.jar
+   /jboss-common-core-2.2.1.GA.jar
+   /jboss-common-logging-log4j-2.0.4.GA.jar
+   /jboss-common-logging-spi-2.0.4.GA.jar
+   /jboss-container-2.0.0.Beta6.jar
+   /jboss-dependency-2.0.0.Beta6.jar
+   /jboss-kernel-2.0.0.Beta6.jar
+   /jbossxb-2.0.0.CR4.jar
+   /log4j-1.2.14.jar
+   /xercesImpl-2.7.1.jar
+otherLib/humanResourcesService-1.0.0.jar</programlisting>
+        <para>As you can see the humanResourcesService.jar file has been moved to a new subdirectory called <code>otherLib</code>. In this location it is no longer available to either the extension or application classloaders whose classpaths are setup in the <code>run.sh</code> script:</para>
+        <programlisting>java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1</programlisting>
+        <para>We must therefore create a new classloader during the deployment of the service so that we can load in the service classes and create instances of the beans. You can see how this is done by looking at the contents of the jboss-beans.xml file:</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;            
+                              xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+                              xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+  &lt;bean name=&quot;URL&quot; class=&quot;java.net.URL&quot;&gt;
+    &lt;constructor&gt;
+&lt;parameter&gt;file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar&lt;/parameter&gt;
+    &lt;/constructor&gt;
+  &lt;/bean&gt;
+
+  &lt;bean name=&quot;customCL&quot; class=&quot;java.net.URLClassLoader&quot;&gt;
+    &lt;constructor&gt;
+      &lt;parameter&gt;
+        &lt;array&gt;
+          &lt;inject bean=&quot;URL&quot;/&gt; 
+        &lt;/array&gt;
+      &lt;/parameter&gt;
+    &lt;/constructor&gt;
+  &lt;/bean&gt;
+
+  &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;&gt;
+    &lt;classloader&gt;&lt;inject bean=&quot;customCL&quot;/&gt;&lt;/classloader&gt;
+    &lt;!-- &lt;property name=&quot;hiringFreeze&quot;&gt;true&lt;/property&gt;
+    &lt;property name=&quot;salaryStrategy&quot;&gt;&lt;inject bean=&quot;AgeBasedSalary&quot;/&gt;&lt;/property&gt; --&gt;
+  &lt;/bean&gt;
+
+   &lt;!-- &lt;bean name=&quot;AgeBasedSalary&quot; class=&quot;org.jboss.example.service.util.AgeBasedSalaryStrategy&quot;&gt;
+    &lt;property name=&quot;minSalary&quot;&gt;1000&lt;/property&gt;
+    &lt;property name=&quot;maxSalary&quot;&gt;80000&lt;/property&gt;
+  &lt;/bean&gt;
+
+  &lt;bean name=&quot;LocationBasedSalary&quot; class=&quot;org.jboss.example.service.util.LocationBasedSalaryStrategy&quot;&gt;
+    &lt;property name=&quot;minSalary&quot;&gt;2000&lt;/property&gt;
+    &lt;property name=&quot;maxSalary&quot;&gt;90000&lt;/property&gt;
+  &lt;/bean&gt; --&gt;
+
+&lt;/deployment&gt;</programlisting>
+        <para>First of all we create an instance of  java.net.URL called URL using  parameter injection in the constructor to specify the location of the humanResourcesService.jar file on our local filesystem. Then we create an instance of a URLClassLoader by  injecting the URL bean into the constructor as the only element in an array. Once this is done then we simply include a &lt;classloader&gt; element in our HRService bean definition and inject the customCL bean. This specifies that the HRManager class needs to be loaded by the customCL classloader.</para>
+        <para>But how do we know which classloader to use for the other beans in the deployment?</para>
+        <para>The answer is that all beans in the deployment use the current thread&apos;s context classloader. In our case the thread that handles deployment is the main thread of the application which has its context classloader set to the application classloader on startup. If you wish, you can choose to specify a different classloader for the entire deployment using a  &lt;classloader&gt; element as follows:</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;            
+                              xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+                              xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+  &lt;classloader&gt;&lt;inject bean=&quot;customCL&quot;/&gt;&lt;/classloader&gt;
+
+  &lt;bean name=&quot;URL&quot; class=&quot;java.net.URL&quot;&gt;
+    &lt;constructor&gt;
+&lt;parameter&gt;file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar&lt;/parameter&gt;
+    &lt;/constructor&gt;
+  &lt;/bean&gt;
+
+  &lt;bean name=&quot;customCL&quot; class=&quot;java.net.URLClassLoader&quot;&gt;
+    &lt;constructor&gt;
+      &lt;parameter&gt;
+        &lt;array&gt;
+          &lt;inject bean=&quot;URL&quot;/&gt; 
+        &lt;/array&gt;
+      &lt;/parameter&gt;
+    &lt;/constructor&gt;
+  &lt;/bean&gt;
+
+  ...
+
+&lt;/deployment&gt;</programlisting>
+        <para>This would be necessary for example if you wished to reconfigure the service by uncommenting the AgeBasedSalary or LocationBasedSalary beans. As you might expect, classloaders specified at the bean level override the deployment level classloader and if you wish to ignore the deployment level classloader altogether, and use the default classloader for a bean, then you can use the &lt;null/&gt; value as follows:</para>
+        <programlisting role="XML">  &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;&gt;
+    &lt;classloader&gt;&lt;null/&gt;&lt;/classloader&gt;
+  &lt;/bean&gt;</programlisting>
+        <warning>
+          <para>If you decide to create a new classloader for your service using the deployment descriptor then be aware that you may not be able to access classes loaded by it from the application classloader anymore. In our example this means that the client will no longer be able to cache a direct reference to the bean instance when using the microcontainer controller. You can see this for yourself by starting the client using the <code>run.sh</code> command and then trying to deploy the service. You should see that a java.lang.NoClassDefFoundError exception is thrown and the application will then exit.</para>
+          <para>You must therefore use the bus to access the service indirectly and provide access to any classes shared by the client in the application classpath. In our example this means the Address, Employee, and SalaryStrategy classes.</para>
+        </warning>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Adding behaviour with AOP</title>
+      <para>Object Oriented Programming (OOP) contains many useful techniques for software development including encapsulation, inheritance, and polymorphism but does not solve the problem of how to address logic that  is often repeated in many different classes. Examples of this include logging, security, and transactional logic  which is traditionally hard-coded into each class making the source code difficult to maintain. We call logic of this nature a  &apos;cross-cutting concern&apos; as it typically applies across class hierarchies.</para>
+      <para>Aspect Oriented Programming (AOP) provides a  solution to this by allowing cross-cutting concerns to be applied to classes after they have been compiled. This keeps  the source code free of logic which is not central to the  main purpose of the class and aids maintenance. The way it is done varies depending on the AOP implementation. Typically if a class implements an interface then  all method calls to an instance of the class first pass through a proxy that implements the same interface and adds in the required behaviour. Alternatively, if an interface is not used, then  the java bytecode of the compiled class is modified so that the original methods  are renamed and replaced by methods that implement the cross-cutting logic. These  new methods  then call the original methods  after the cross-cutting logic has been executed. The same result can be achieved by modifying the bytecode to create a subclass of the original class that overrides its methods. The over!
 riden methods then execute the cross-cutting logic before calling the corresponding methods of the super class. </para>
+      <para>JBoss AOP is a framework for Aspect-Oriented Programming that allows you to create cross-cutting concerns using conventional java classes and methods. In AOP terminology each concern is represented by an aspect that you implement using a simple POJO. Behaviour is provided by methods within the aspect  called advices that follow certain rules for their parameter and return types together with any exceptions that they throw. Other than this you are free to use conventional object-oriented notions such as inheritance, encapsulation, and composition in order to make your cross-cutting concerns as maintainable as possible.  Aspects are applied to code using an expression language that allows you to specify which constructors, methods and even fields to target. This means that you can quickly change the behaviour of a number of classes simply by editing a configuration file. </para>
+      <para>In this chapter we are going to look at using JBoss AOP together with the microcontainer to create and apply an auditing aspect to the Human Resources Service. We could choose to place auditing code within the  HRManager class but it would detract from the main purpose of the class and add unnecessary complexity. The design of the aspect will ensure that it can also be used with other classes if our requirements change at a later date.</para>
+      <para>We shall also look at how AOP can be used to apply additional behaviour during the deployment phase. Specifically we will show how you can create and bind a proxy to a bean instance into a basic JNDI service so that you can access it using a JNDI lookup instead of the microcontainer controller.</para>
+      <section>
+        <title>Creating an aspect</title>
+        <para>The <code>examples/User_Guide/gettingStarted/auditAspect</code> directory contains all the files you need to create the aspect.</para>
+        <programlisting>auditAspect/pom.xml
+           /src/main/java/org/jboss/example/aspect/AuditAspect.java</programlisting>
+        <para>As you can see from the source code below all we need is a simple POJO.</para>
+        <programlisting role="JAVA">public class AuditAspect {
+
+    private String logDir;
+    private BufferedWriter out;
+
+    public AuditAspect() {
+        logDir = System.getProperty(&quot;user.dir&quot;) + &quot;/log&quot;;
+
+        File directory = new File(logDir);
+        if (!directory.exists()) {
+            directory.mkdir();
+        }
+    }
+
+    public Object audit(ConstructorInvocation inv) throws Throwable {
+        SimpleDateFormat formatter = new SimpleDateFormat(&quot;ddMMyyyy-kkmmss&quot;);
+        Calendar now = Calendar.getInstance();
+        String filename = &quot;auditLog-&quot; + formatter.format(now.getTime());
+
+        File auditLog = new File(logDir + &quot;/&quot; + filename);
+        auditLog.createNewFile();
+        out = new BufferedWriter(new FileWriter(auditLog));
+        return inv.invokeNext();
+    }
+
+    public Object audit(MethodInvocation inv) throws Throwable {
+        String name = inv.getMethod().getName();
+        Object[] args = inv.getArguments();
+        Object retVal = inv.invokeNext();
+
+        StringBuffer buffer = new StringBuffer();
+        for (int i=0; i &lt; args.length; i++) {
+            if (i &gt; 0) {
+                buffer.append(&quot;, &quot;);
+            }
+            buffer.append(args[i].toString());
+        }
+
+        if (out != null) {
+            out.write(&quot;Method: &quot; + name);
+            if (buffer.length() &gt; 0) {
+                out.write(&quot; Args: &quot; + buffer.toString());
+            }
+            if (retVal != null) {
+                 out.write(&quot; Return: &quot; + retVal.toString());
+            }
+            out.write(&quot;\n&quot;);
+            out.flush();
+        }
+        return retVal;
+    }
+}</programlisting>
+        <para>The constructor checks for the presence of a <code>log</code> directory in the current working directory and creates one if not found. After this we define an advice that will be called whenever the constructor of our target class is called. The purpose of this is to create a new log file within the log directory so that we can record method calls made on different instances of our target class in separate files. Finally we define an advice that will apply to each method call made on the target class. Here we store the method name and arguments together with the return value so that we can construct an audit record and write it to the current log file. Notice how each advice calls <code>inv.invokeNext()</code>. This is required in order to call the  next advice, if more than one cross-cutting concern has been applied, or to call the target constructor/method.</para>
+        <note>
+          <para>Each advice is implemented using a method that takes an invocation object as a parameter, throws Throwable and returns  Object. This is necessary as we do not know at design time which constructors or methods  our advices will be applied to  so the types must be as generic as possible. For more information on creating aspects and advices together with additional examples of how to apply them to various classes please consult the JBoss AOP project documentation.</para>
+        </note>
+        <para>To compile the class and create an auditAspect.jar file that can be used by  other examples simply type <code>mvn install</code> from the auditAspect directory.</para>
+      </section>
+      <section>
+        <title>Configuring the microcontainer</title>
+        <para>Before we can apply the audit aspect to our service we must first add a number of JARs to the extension classpath. These can be found in the <code>lib</code> subdirectory of the  client-aop distribution located in the <code>examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir</code> directory:</para>
+        <programlisting>run.sh
+client-1.0.0.jar
+jboss-beans.xml
+lib/<code>auditAspect-1.0.0.jar</code>
+   /concurrent-1.3.4.jar
+   /humanResourcesService-1.0.0.jar
+   /<code>javassist-3.6.0.GA.jar</code>
+   /<code>jboss-aop-2.0.0.beta1.jar</code>
+   /<code>jboss-aop-mc-int-2.0.0.Beta6.jar</code>
+   /jboss-common-core-2.0.4.GA.jar
+   /jboss-common-core-2.2.1.GA.jar
+   /jboss-common-logging-log4j-2.0.4.GA.jar
+   /jboss-common-logging-spi-2.0.4.GA.jar
+   /jboss-container-2.0.0.Beta6.jar
+   /jboss-dependency-2.0.0.Beta6.jar
+   /jboss-kernel-2.0.0.Beta6.jar
+   /jbossxb-2.0.0.CR4.jar
+   /log4j-1.2.14.jar
+   /<code>trove-2.1.1.jar</code>
+   /xercesImpl-2.7.1.jar</programlisting>
+        <para>First of all we need to include the <code>auditAspect</code> jar  as we need to create an instance of our aspect at runtime in order to execute the logic.  We then need to include the jar file for JBoss AOP  (<code>jboss-aop</code>) together with its dependencies; <code>javassist</code> and <code>trove</code>.  Finally we need to add the<code> jboss-aop-mc-int</code> jar as this contains an XML schema definition that allows us to define aspects inside our XML deployment descriptor. It also contains integration code to create dependencies between normal beans and aspect beans within the microcontainer so that we can add behaviour during the deployment and undeployment phases.</para>
+        <note>
+          <para>Since we are using Maven2 to assemble the client-aop distribution we can easily add these JAR files by declaring the appropriate dependencies in our <code>pom.xml</code> file and creating a valid assembly descriptor. If you are using Ant to perform your build then you will need to do this in a different way.</para>
+        </note>
+      </section>
+      <section>
+        <title>Applying an aspect</title>
+        <para>Now that we have a valid distribution containing everything we need we can configure our jboss-beans.xml file to apply the audit aspect. This can be found in the <code>examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir</code> directory:</para>
+        <programlisting role="XML">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+
+&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+            xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+            xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;AspectManager&quot; class=&quot;org.jboss.aop.AspectManager&quot;&gt;
+        &lt;constructor factoryClass=&quot;org.jboss.aop.AspectManager&quot;
+                             factoryMethod=&quot;instance&quot;/&gt;
+    &lt;/bean&gt;
+
+    &lt;aop:aspect xmlns:aop=&quot;urn:jboss:aop-beans:1.0&quot;
+                       name=&quot;AuditAspect&quot; class=&quot;org.jboss.example.aspect.AuditAspect&quot;
+                       method=&quot;audit&quot; pointcut=&quot;execution(public org.jboss.example.service.HRManager-&gt;new(..)) OR                                        execution(public * org.jboss.example.service.HRManager-&gt;*(..))&quot;&gt;
+    &lt;/aop:aspect&gt;
+
+    ...
+
+&lt;/deployment&gt;</programlisting>
+        <para>Before we can apply our aspect to any classes we need to create an instance of org.jboss.aop.AspectManager using a &lt;bean&gt; element. We use a factory method instead of calling a conventional constructor as we only want one instance of the AspectManager in the JVM at runtime i.e. it is a singleton.</para>
+        <para>Next we create an instance of our aspect called AuditAspect using the &lt;aop:aspect&gt; element. This looks much like the &lt;bean&gt; element as it has <code>name</code> and <code>class</code> attributes that you can use in the same way.  However it also has <code>method</code> and <code>pointcut</code> attributes that you can use to apply or &apos;bind&apos;  an advice within the aspect to constructors and methods within other classes. We use these attributes to bind the audit advice to all public constructors and methods within the HRManager class. We only need to specify one method called audit as we have overloaded this method within our AuditAspect class with different parameters. JBoss AOP knows at runtime which one to select based on whether a constructor or method invocation is being made.</para>
+        <para>This additional configuration is all we need to apply the audit aspect at runtime and add auditing behaviour to the Human Resources service. You can test this out for yourself by running the client using the <code>run.sh</code> script. A <code>log</code> directory will be created on startup alongside the <code>lib</code> directory as the AuditAspect bean is created by the microcontainer. Each deployment of the Human Resources service will then cause a new log file to appear within the <code>log</code> directory containing a record of any calls made from the client to the service:</para>
+        <programlisting>log/auditLog-28112007-163902
+   /auditLog-28112007-164055
+   /auditLog-28112007-164108</programlisting>
+        <para>The audit records inside the log files will look something like this:</para>
+        <programlisting>Method: getEmployees Return: []
+Method: addEmployee Args: (Santa Claus, 1 Reindeer Avenue, Lapland City - 25/12/1860) Return: true
+Method: getSalary Args: (Santa Claus, null - Birth date unknown) Return: 10000
+Method: getEmployees Return: [(Santa Claus, 1 Reindeer Avenue, Lapland City - 25/12/1860)]
+Method: isHiringFreeze Return: false
+Method: getEmployees Return: [(Santa Claus, 1 Reindeer Avenue, Lapland City - 25/12/1860)]
+Method: getSalaryStrategy</programlisting>
+        <para>If you wish to remove the auditing behaviour then you can simply comment out the relevant fragments of XML in the deployment descriptor and restart the application.</para>
+        <warning>
+          <para>The order of deployment for aspects declared in this way relative to normal beans matters in the deployment descriptor. Specifically each aspect must be declared before the beans that it applies to so that the microcontainer deploys them in that order. This is because the microcontainer may need to alter the bytecode of the normal bean class in order to add the cross-cutting logic before it creates an instance and stores a  reference to it in the controller. If a normal bean instance has already been created then this is not possible. </para>
+        </warning>
+      </section>
+      <section>
+        <title>Lifecycle callbacks</title>
+        <para>In addition to applying aspects to beans that we instantiate using the microcontainer we can also add behaviour during the deployment and undeployment process. As you may recall from the Direct access section of Chapter 4, a bean goes through several different states as it is deployed. These include:<itemizedlist>
+            <listitem>
+              <para>NOT_INSTALLED - the deployment descriptor containing the bean has been parsed along with any annotations on the bean itself.</para>
+            </listitem>
+            <listitem>
+              <para>DESCRIBED - any dependencies created by AOP have been added to the bean and custom annotations have been processed.</para>
+            </listitem>
+            <listitem>
+              <para>INSTANTIATED - an instance of the bean has been created.</para>
+            </listitem>
+            <listitem>
+              <para>CONFIGURED - properties have been injected into the bean along with any references to other beans.</para>
+            </listitem>
+            <listitem>
+              <para>CREATE - the create method, if defined on the bean,  has been called.</para>
+            </listitem>
+            <listitem>
+              <para>START - the start method, if defined on the bean, has been called.</para>
+            </listitem>
+            <listitem>
+              <para>INSTALLED - any custom install actions that were defined in the deployment descriptor have been executed and the bean is ready to access.</para>
+            </listitem>
+          </itemizedlist></para>
+        <important>
+          <para>The CREATE and START states are included in order to allow services that used to be implemented as MBeans in JBoss AS 3.x and 4.x to function correctly when implemented as beans in JBoss AS 5.x. If you do not define any corresponding create/start methods in your bean then it will simply pass straight through these states.</para>
+        </important>
+        <para>Together these states represent the bean&apos;s lifecycle and using an additional set of &lt;aop&gt; elements you can define a number of callbacks to be applied to any point:</para>
+        <programlisting>&lt;aop:lifecycle-describe&gt; - applied when entering/leaving the DESCRIBED state
+&lt;aop:lifecycle-instantiate&gt; - applied when entering/leaving the INSTANTIATED state
+&lt;aop:lifecycle-configure&gt; - applied when entering/leaving the CONFIGURED state
+&lt;aop:lifecycle-create&gt; - applied when entering/leaving the CREATE state
+&lt;aop:lifecycle-start&gt; - applied when entering/leaving the START state
+&lt;aop:lifecycle-install&gt; - applied when entering/leaving the INSTALLED state</programlisting>
+        <para>Just like the &lt;bean&gt; element and the &lt;aop:aspect&gt; element the &lt;aop:lifecycle-&gt; elements contain <code>name</code> and <code>class</code> attributes. These allow the microcontainer to create an instance of the callback class and give it a name so that it can be used as beans enter/leave the relevant state during deployment and undeployment. You can specify which beans are affected by the callback using the <code>classes</code> attribute:</para>
+        <programlisting role="XML">&lt;aop:lifecycle-install xmlns:aop=&quot;urn:jboss:aop-beans:1.0&quot;
+    name=&quot;InstallAdvice&quot;
+    class=&quot;org.jboss.test.microcontainer.support.LifecycleCallback&quot;
+    classes=&quot;@org.jboss.test.microcontainer.support.Install&quot;&gt;
+&lt;/aop:lifecycle-install&gt;</programlisting>
+        <para>Here we have specified that additional logic in the LifecycleCallback class should be applied  to any bean classes that are annotated with @org.jboss.test.microcontainer.support.Install before they enter and after they leave the INSTALLED state. </para>
+        <para>In order for the callback class to work it must contain <code>install</code> and <code>uninstall</code> methods  that take ControllerContext as a parameter:</para>
+        <programlisting role="JAVA">import org.jboss.dependency.spi.ControllerContext;
+
+public class LifecycleCallback {
+
+    public void install(ControllerContext ctx) {
+        System.out.println(&quot;Bean &quot; + ctx.getName() + &quot; is being installed&quot;;
+    }
+
+    public void uninstall(ControllerContext ctx) {
+        System.out.println(&quot;Bean &quot; + ctx.getName() + &quot; is being uninstalled&quot;;
+    }
+} </programlisting>
+        <para>The install method will be called during the bean&apos;s deployment and the uninstall method during its undeployment.</para>
+        <note>
+          <para>Although we are adding behaviour to the deployment and undeployment process using callbacks we are not actually using AOP to achieve this. The reason we have included them in this section, and the reason why they are part of the aop XML schema, is that they use the pointcut expression functionality of JBoss AOP to determine which bean classes they should apply to. We have already shown how the <code>classes</code> attribute allows you to write a shorthand pointcut expression to target annotated bean classes. Later in Part III - AOP Development we will show how it is possible to use regular pointcut expressions to target classes in a much more powerful way.</para>
+        </note>
+      </section>
+      <section>
+        <title>Adding service lookup through JNDI</title>
+        <para>Until now we have looked up references to bean instances representing services through the microcontainer controller. Whilst there is nothing wrong with this it is not ideal since we must first have a reference to the microcontainer kernel before we can access the controller: </para>
+        <programlisting role="JAVA">private HRManager manager;
+
+private EmbeddedBootstrap bootstrap;
+private Kernel kernel;
+private KernelController controller;
+
+private final static String HRSERVICE = &quot;HRService&quot;;
+
+...
+
+// Start JBoss Microcontainer
+bootstrap = new EmbeddedBootstrap();
+bootstrap.run();
+
+kernel = bootstrap.getKernel();
+controller = kernel.getController();
+
+...
+
+ControllerContext context = controller.getInstalledContext(HRSERVICE);
+if (context != null) { manager = (HRManager) context.getTarget(); }</programlisting>
+        <para>Handing out kernel references to every client that looks up a service represents a significant risk as it provides wide-spread access to the microcontainer configuration. It would be better to apply the ServiceLocator pattern and have a class that performs lookups on behalf of the clients. Better still we could pass the bean references, together with their names, to  the ServiceLocator at deployment time using a lifecycle callback so that it could look them up without knowing about the microcontainer at all. Undeployment would subsequently remove the bean references from the ServiceLocator to prevent further lookups. </para>
+        <para>While it would not be too difficult to write our own ServiceLocator implementation we can save time  by integrating an existing one such as JBoss Naming Service (JBoss NS). This has the additional benefit of complying to  the Java Naming and Directory Interface (JNDI) specification. JNDI enables clients to access different, possibly multiple, naming services using a common API.  </para>
+        <para>All that we need to do is create an instance of  JBoss NS using the microcontainer and then add a lifecycle callback to perform the binding and unbinding of our bean references during deployment/undeployment. We can then  mark  the bean classes that we wish to bind references for using annotations and find them at runtime using the shorthand pointcut expression as shown earlier.</para>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Advanced deployment</title>
+      <para>Mention the need for a main deployer and explain how we add various deployers to this.</para>
+      <section>
+        <title>Deployment stages and actions</title>
+        <para>Give example of using aspectized bean deployer and show how it&apos;s the same as the BasicXMLDeployer.</para>
+      </section>
+      <section>
+        <title>Changing the descriptor file format</title>
+        <para>Give an example where we move the jboss-beans.xml file out of the META-INF directory and change the location of the classes.</para>
+      </section>
+      <section>
+        <title>Changing the archive structure</title>
+        <para>Give an example of changing the jboss-beans.xml file for a jboss-beans.properties file.</para>
+      </section>
+      <section>
+        <title>Changing the classloader</title>
+        <para/>
+      </section>
+      <section>
+        <title>Adding a deployment action</title>
+        <para/>
+      </section>
+    </chapter>
+  </part>
+  <part>
+    <title>POJO Development</title>
+    <chapter>
+      <title>Introduction</title>
+      <para>In Part I of this guide we looked at a complete use-case showing how to  develop a service using POJOs and access it from one or more clients. This should have given you a good overview of how the microcontainer is intended to be used in   real applications. In Part II we look more closely at the various features available for creating POJOs, wiring them together, deploying them into the runtime environment, and managing their dependencies.  With this knowledge you should be able to create flexible and reusable services that can be integrated together to provide a custom runtime suited to your needs.</para>
+    </chapter>
+    <chapter>
+      <title>Running the examples</title>
+      <para>You can find examples of how to use each of the features described here  in the <code>examples/User_Guide/pojoDevelopment</code> directory:</para>
+      <programlisting>alias
+annotations
+autowiring
+classloader
+collections
+constructor
+demand
+factory
+injection
+installation
+javabeans
+lifecycle
+locator
+properties
+simple
+spring
+supply</programlisting>
+      <para>To build these simply <command>cd</command> to this directory and enter <command>mvn package</command>. A <code>target</code> directory will then be created in each subdirectory as follows:</para>
+      <programlisting>target/archive-tmp
+      /classes
+      /&lt;exampleName&gt;-1.0.0.jar
+      /&lt;exampleName&gt;-dist.dir</programlisting>
+      <para>The contents of the &lt;exampleName&gt;-dist.dir will be similar for each example:</para>
+      <programlisting>&lt;exampleName&gt;-1.0.0.jar
+log4j.properties
+lib/concurrent-1.3.4.jar
+   /jboss-common-core-2.0.4.GA.jar
+   /jboss-common-core-2.2.1.GA.jar
+   /jboss-common-logging-log4j-2.0.4.GA.jar
+   /jboss-common-logging-spi-2.0.4.GA.jar
+   /jboss-container-2.0.0.Beta6.jar
+   /jboss-dependency-2.0.0.Beta6.jar
+   /jboss-kernel-2.0.0.Beta6.jar
+   /jbossxb-2.0.0.CR4.jar
+   /log4j-1.2.14.jar
+   /xercesImpl-2.7.1.jar</programlisting>
+      <para>If you previously used the examples from Part I you will notice that we no longer have a <code>run.sh</code> script.  Instead we have made  &lt;exampleName&gt;-1.0.0.jar  executable. This means that it contains a META-INF/MANIFEST.MF file with Main-Class and Class-Path attributes:</para>
+      <programlisting>Main-Class: org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap
+Class-Path: .
+            lib/jboss-common-core-2.0.4.GA.jar
+            lib/junit-3.8.1.jar
+            l ib/jboss-common-logging-spi-2.0.4.GA.jar
+            lib/xercesImpl-2.7.1.jar
+            lib /ant-1.6.5.jar
+            lib/jboss-container-2.0.0.Beta6.jar
+            lib/jboss-common-c ore-2.2.1.GA.jar
+            lib/dtdparser121-1.2.1.jar
+            lib/jbossxb-2.0.0.CR4.jar 
+            lib/jboss-aop-2.0.0.beta1.jar
+            lib/jboss-common-logging-log4j-2.0.4.G A.jar
+            lib/activation-1.0.2.jar
+            lib/jboss-test-1.0.4.GA.jar
+            lib/xml-ap is-2.7.1.jar
+            lib/concurrent-1.3.4.jar
+            lib/webdavlib-2.0.jar
+            lib/jboss -profiler-jvmti-1.0.0.CR5.jar
+            lib/jboss-kernel-2.0.0.Beta6.jar
+            lib/jb oss-managed-2.0.0.Beta6.jar
+            lib/jboss-metatype-2.0.0.Beta6.jar
+            lib/co mmons-httpclient-2.0.2.jar
+            lib/javassist-3.6.0.GA.jar
+            lib/jboss-loggi ng-spi-2.0.3.GA.jar
+            lib/log4j-1.2.14.jar
+            lib/jboss-dependency-2.0.0.B eta6.jar
+            lib/ant-junit-1.6.5.jar</programlisting>
+      <note>
+        <para>Certain JAR files included in the Class-Path attribute are not present in the <code>lib</code> directory. This is because the maven-jar-plugin is creating the Class-Path  value using its internal dependency resolution mechanism and including JARs that are not actually needed at runtime. This is the fault of  the pom.xml descriptors in  projects such as jbossxb, which the microcontainer depends on, that do not currently mark their dependencies as optional. For clarity we have prevented all of these JARs appearing in the lib directory of the distribution by explicitly listing only those that are required in the <code>examples/User_Guide/pojoDevelopment/<code>dist.xml</code></code> file which is passed to the maven-assembly-plugin. </para>
+        <para>Once we have fixed  the  pom.xml files in the projects that the microcontainer depends on then this filtering will no longer be necessary. </para>
+      </note>
+      <para>The Main-Class attribute contains the name of a StandaloneBootstrap class that is provided with the microcontainer. This class is very similar to the EmbeddedBootstrap class that we used in Part I with the addition of a main() method so that it can be called from the command line:</para>
+      <programlisting role="JAVA">public class StandaloneBootstrap extends BasicBootstrap
+{
+   protected BasicXMLDeployer deployer;
+   protected String[] args;
+   
+   public static void main(String[] args) throws Exception {
+      StandaloneBootstrap bootstrap = new StandaloneBootstrap(args);
+      bootstrap.run();
+   }
+
+   public StandaloneBootstrap(String[] args) throws Exception {
+      super();
+      this.args = args;
+   }
+   
+   public void bootstrap() throws Throwable {
+      super.bootstrap();
+      
+      deployer = new BasicXMLDeployer(getKernel());
+      
+      Runtime.getRuntime().addShutdownHook(new Shutdown());
+      
+      ClassLoader cl = Thread.currentThread().getContextClassLoader();
+      for (Enumeration e = cl.getResources(StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) {
+         URL url = (URL) e.nextElement();
+         deploy(url);
+      }
+      for (Enumeration e = cl.getResources(&quot;META-INF/&quot; + StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) {
+         URL url = (URL) e.nextElement();
+         deploy(url);
+      }
+      
+      // Validate that everything is ok
+      deployer.validate();
+   }
+   
+   protected void deploy(URL url) throws Throwable {
+      deployer.deploy(url);
+   }
+   
+   protected void undeploy(URL url) {
+      try {
+         deployer.undeploy(url);
+      }  catch (Throwable t) {
+         log.warn(&quot;Error during undeployment: &quot; + url, t);
+      }
+   }
+   
+   protected class Shutdown extends Thread  {
+      public void run()  {
+         log.info(&quot;Shutting down&quot;);
+         deployer.shutdown();
+      }
+   }
+}
+</programlisting>
+      <para>The bootstrap() method also includes code to automatically scan the classpath for files called jboss-beans.xml (the value of StandaloneKernelConstants.DEPLOYMENT_XML_NAME) that may or may not reside in a META-INF directory. If any such files are found then their URLs are passed to the BasicXMLDeployer to deploy any beans declared inside. In our examples we place a jboss-beans.xml file  into the META-INF directory of our &lt;exampleName&gt;-1.0.0.jar so that it can be found in this way.</para>
+      <important>
+        <para>To run any of the examples simply  <command>cd</command> to the relevant <code>target/&lt;exampleName&gt;-dist.dir</code> directory and execute the JAR file using the  <command>java -jar &lt;exampleName&gt;-1.0.0.jar</command> command, replacing &lt;exampleName&gt;  with the name of the example you are running, .e.g <command>java -jar constructor-1.0.0.jar</command></para>
+      </important>
+      <para>Running an example causes the following sequence of events to occur:</para>
+      <orderedlist>
+        <listitem>
+          <para>The &lt;exampleName&gt;-1.0.0.jar is executed. </para>
+        </listitem>
+        <listitem>
+          <para>The StandaloneBootstrap class defined in the Main-Class attribute of the META-INF/MANIFEST.MF file within the JAR  is run which bootstraps the microcontainer and searches the classpath for files called jboss-beans.xml.</para>
+        </listitem>
+        <listitem>
+          <para>The META-INF/jboss-beans.xml file in the &lt;exampleName&gt;-1.0.0.jar is found and the beans declared within it are deployed.</para>
+        </listitem>
+        <listitem>
+          <para>The main() method of the StandaloneBootstrap class ends and the JVM shuts down undeploying the beans in reverse order.</para>
+        </listitem>
+      </orderedlist>
+      <para>If you would like to use the StandaloneBootstrap class within your own applications to deploy beans on startup then you can do so as follows:</para>
+      <programlisting role="JAVA">import org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap;
+
+public class MyApp {
+    public static void main(String[] args) throws Exception
+    {
+        StandaloneBootstrap.main(args);
+        // your application code...
+    }
+}</programlisting>
+      <note>
+        <para>Because the deploy() and undeploy() methods of the StandaloneBootstrap are protected you will not be able to call them from your application after the initial startup. If you wish to deploy and undeploy beans at runtime then the EmbeddedBootstrap class may be a better choice. Alternatively you are free to create your own bootstrap class that uses BasicBootstrap and BasicXMLDeployer to provide whatever functionality you need.</para>
+      </note>
+    </chapter>
+    <chapter>
+      <title>Configuring POJOs</title>
+      <para>In accordance with modern  development  methods JBoss Microcontainer supports POJO configuration via annotations and/or deployment descriptors. The decision to use one or the other depends on what you are trying to achieve. If there is a sensible default configuration for your POJOs then it may be worthwhile defining this using annotations so that users do not have to maintain a separate deployment descriptor. Since annotations are overriden by deployment descriptors at runtime it is always possible for users to  change the default configuration using a descriptor if necessary.</para>
+      <important>
+        <para>Annotations are overriden by deployment descriptors at runtime.</para>
+      </important>
+      <para>If there is no sensible default configuration then it may be worthwhile using a deployment descriptor instead of annotations. This  keeps the source code free of potentially redundant information and allows for easy customization since the initial deployment descriptor acts as a template for further changes.</para>
+      <para>Sometimes a mixture of annotations and a deployment descriptor is best. It&apos;s up to you to discover what makes most sense for your particular situation. </para>
+      <section>
+        <title>Using annotations</title>
+        <para>With the notable exception of defining classloaders nearly all of the microcontainer features can be used  by adding annotations to your POJO classes. </para>
+        <note>
+          <para>We are not able to define classloaders using annotations for the simple reason that in order to read any annotations we must first load the class. Once the class is loaded we cannot change its classloader so a classloader annotation would be useless.</para>
+        </note>
+        <para>The microcontainer annotations live in the <code>org.jboss.beans.metadata.api.annotations</code> package and to use them you need Java 1.5 or above.</para>
+        <para>If you are using Java 1.4 or below then JBoss Microcontainer allows you to define a subset of the annotations in the XML deployment descriptor.  The caveat is that these apply to bean instances instead of bean classes. As with normal annotations you are free to add as many as necessary at a single point. However you must always specify the fully-qualified class name since there is no way to &apos;import&apos; packages in XML. Currently you can place annotations inside the following elements:</para>
+        <itemizedlist>
+          <listitem>
+            <para>&lt;deployment&gt; -all beans in the deployment inherit this annotation </para>
+            <programlisting role="XML">&lt;deployment name=&quot;SimpleDeployment&quot; xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+    &lt;annotation&gt;@org.jboss.test.TestAnnotation&lt;/annotation&gt;
+&lt;/deployment&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>&lt;bean&gt;</para>
+            <programlisting role="XML">&lt;bean name=&quot;example&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;annotation&gt;@org.jboss.test.TestAnnotation1&lt;/annotation&gt;
+    &lt;annotation&gt;@org.jboss.test.TestAnnotation2&lt;/annotation&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>&lt;constructor&gt;</para>
+            <programlisting role="XML">&lt;bean name=&quot;example&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;constructor&gt;
+        &lt;annotation&gt;@org.jboss.test.TestAnnotation&lt;/annotation&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt; </programlisting>
+          </listitem>
+          <listitem>
+            <para>&lt;create&gt;, &lt;start&gt;, &lt;stop&gt;, &lt;destroy&gt;</para>
+            <programlisting role="XML">&lt;bean name=&quot;example&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;create&gt;
+        &lt;annotation&gt;@org.jboss.test.TestAnnotation&lt;/annotation&gt;
+    &lt;/create&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>&lt;install&gt;, &lt;uninstall&gt;</para>
+            <programlisting role="XML">&lt;bean name=&quot;example&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;install method=&quot;someMethod&quot;&gt;
+        &lt;annotation&gt;@org.jboss.test.TestAnnotation&lt;/annotation&gt;
+    &lt;/install&gt;
+&lt;/bean&gt; </programlisting>
+          </listitem>
+          <listitem>
+            <para>&lt;incallback&gt;, &lt;uncallback&gt;</para>
+            <programlisting role="XML"/>
+          </listitem>
+          <listitem>
+            <para>&lt;value&gt;</para>
+            <programlisting role="XML">&lt;bean name=&quot;example&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;property name=&quot;PropertyName&quot;&gt;
+        &lt;annotation&gt;@org.jboss.test.TestAnnotation&lt;/annotation&gt;
+        &lt;value&gt;123&lt;/value&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+        </itemizedlist>
+        <important>
+          <para>Annotations declared in XML apply to bean instances instead of bean classes.</para>
+        </important>
+        <para>Examples of how to use both normal and XML annotations will be given in the following sections.</para>
+      </section>
+      <section>
+        <title>Writing deployment descriptors</title>
+        <para>Deployment descriptors externalize the configuration of POJOs into one or more files that are separate from the source code. This means that changes can be made without having to recompile any classes. The usual way to define a deployment descriptor is using the bean-deployer XML schema whose root element is &lt;deployment&gt;. This is used to group multiple beans together so that they are deployed as a unit:</para>
+        <programlisting role="XML">&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+                    xsi:schemaLocation=&quot;urn:jboss:bean-deployer bean-deployer_2_0.xsd&quot;
+                    xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;!-- Bean definitions --&gt;
+
+&lt;/deployment&gt;</programlisting>
+        <para>The bean definitions are created using &lt;bean&gt; elements that each describe a single POJO instance. Each bean is given a name so that it can be referenced elsewhere in the deployment descriptor or looked up by a client at runtime.</para>
+        <programlisting role="XML">&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+                    xsi:schemaLocation=&quot;urn:jboss:bean-deployer bean-deployer_2_0.xsd&quot;
+                    xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;Person&quot; class=&quot;org.jboss.example.microcontainer.PersonBean&quot;/&gt;
+
+    &lt;bean name=&quot;Address&quot; class=&quot;org.jboss.example.microcontainer.AddressBean&quot;/&gt;
+
+&lt;/deployment&gt; </programlisting>
+        <para>The name of the file containing these elements can be anything you like providing that a deployer can access it and parse the contents correctly. By convention it is called jboss-beans.xml as anything that ends in -beans.xml is found by default using the FileStructure deployer.</para>
+        <note>
+          <para>Although deployment descriptors are usually created using the bean-deployer XML schema it is also possible to use other XML schemas or even Java properties as shown in the following sections.</para>
+        </note>
+      </section>
+      <section>
+        <title>Using JavaBean XML</title>
+        <para>Together with the bean-deployer XML schema the microcontainer also contains a javabean XML schema. This is a lightweight version of  bean-deployer that allows for  the construction and configuration of   <ulink url="http://java.sun.com/products/javabeans/">JavaBeans</ulink> without any advanced features like bean injection, callbacks or dependencies. It is intended to be used in situations where the microcontainer has been customised to remove all of the advanced functionality so that it can be bootstrapped in very small runtime environments. </para>
+        <para>Construction of POJOs is performed using either a normal constructor or a static factory method. In either case constructor or method parameters can be added as necessary:  </para>
+        <itemizedlist>
+          <listitem>
+            <para>Default constructor</para>
+            <programlisting role="XML">&lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;/&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>Contructor with parameters</para>
+            <programlisting role="XML">&lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;property name=&quot;ABoolean&quot;&gt;true&lt;/property&gt;
+        &lt;property name=&quot;ACharacter&quot;&gt;x&lt;/property&gt;
+        &lt;property name=&quot;AShort&quot;&gt;123&lt;/property&gt; 
+    &lt;/constructor&gt;
+&lt;/javabean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>Static factory method</para>
+            <programlisting role="XML">&lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;&gt;
+    &lt;constructor factoryClass=&quot;org.jboss.test.javabean.support.SimpleBeanFactory&quot;
+                 factoryMethod=&quot;newInstance&quot;/&gt;
+&lt;/javabean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>Static factory method with parameters</para>
+            <programlisting role="XML">&lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;&gt;
+    &lt;constructor factoryClass=&quot;org.jboss.test.javabean.support.SimpleBeanFactory&quot;
+                 factoryMethod=&quot;newInstance&quot;&gt;
+        &lt;property name=&quot;AString&quot;&gt;StringValue&lt;/property&gt;
+        &lt;property name=&quot;AByte&quot;&gt;12&lt;/property&gt;
+    &lt;/constructor&gt;
+&lt;/javabean&gt;</programlisting>
+          </listitem>
+        </itemizedlist>
+        <note>
+          <para>JavaBean declarations do not include a <code>name</code> attribute which means that you cannot inject references into other JavaBeans or lookup a reference to a JavaBean instance from a client at runtime.</para>
+        </note>
+        <para>Once a JavaBean has been constructed then simple injection of property values is possible using the &lt;property&gt; element: </para>
+        <programlisting role="XML">&lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;&gt;
+    &lt;property name=&quot;ADouble&quot;&gt;3.14e12&lt;/property&gt;
+    &lt;property name=&quot;ADate&quot;&gt;Jan 01 00:00:00 CET 2001&lt;/property&gt;
+    &lt;property name=&quot;ABigDecimal&quot;&gt;12e4&lt;/property&gt;
+    &lt;property name=&quot;ABigInteger&quot;&gt;123456&lt;/property&gt;
+    &lt;property name=&quot;abyte&quot;&gt;12&lt;/property&gt; 
+&lt;/javabean&gt;</programlisting>
+        <para>As with properties defined using the bean-deployer XML schema the string values are converted into objects of the correct type using JavaBean <ulink url="http://java.sun.com/j2se/1.5.0/docs/api/java/beans/PropertyEditor.html">PropertyEditors</ulink>. For cases where the type is ambiguous, e.g. when defining numbers, you can specify the required type by including a <code>class</code> attribute: </para>
+        <programlisting role="XML">&lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;&gt;
+    &lt;property name=&quot;ANumber&quot; class=&quot;java.lang.Long&quot;&gt;12345&lt;/property&gt; 
+&lt;/javabean&gt;</programlisting>
+        <important>
+          <para>Beans created using the bean-deployer XML schema  can include JavaBeans  created using the javabean XML schema instead of string values. This provides a simple way to inject objects composed of multiple values into a bean property without having to write a complicated property editor:</para>
+          <programlisting role="XML">&lt;bean name=&quot;example&quot; class=&quot;org.jboss.acme.Example&quot;&gt;
+    &lt;property name=&quot;myProperty&quot;&gt;
+        &lt;javabean xmlns=&quot;urn:jboss:javabean:1.0&quot; class=&quot;org.jboss.test.javabean.support.SimpleBean&quot;&gt;
+            &lt;property name=&quot;ADate&quot;&gt;Jan 01 00:00:00 CET 2001&lt;/property&gt;
+            &lt;property name=&quot;ABigDecimal&quot;&gt;12e4&lt;/property&gt;
+        &lt;/javabean&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        </important>
+      </section>
+      <section>
+        <title>Using Spring XML</title>
+        <para>Spring like JBoss Microcontainer allows POJOs to be created and configured using an XML schema. As the microcontainer largely supports the same set of features as Spring it is possible to  use the spring-beans  schema to define beans instead of the bean-deployer schema. This makes migrating services built and tested using Spring to JBoss Microcontainer very straightforward.</para>
+        <para>To define beans using the spring-beans schema you need to include <code>spring-int.jar</code> on the microcontainer classpath. You can then create a deployment descriptor containing a &lt;beans&gt; element at the root instead of the usual &lt;deployment&gt; element:</para>
+        <programlisting role="XML">&lt;beans xmlns=&quot;urn:jboss:spring-beans:2.0&quot;&gt;
+    &lt;bean id=&quot;testBean&quot; class=&quot;org.jboss.test.spring.support.SimpleBean&quot;&gt;
+        &lt;constructor-arg index=&quot;2&quot;&gt;
+            &lt;value&gt;SpringBean&lt;/value&gt;
+        &lt;/constructor-arg&gt;
+        &lt;constructor-arg index=&quot;0&quot;&gt;
+            &lt;value&gt;1&lt;/value&gt;
+        &lt;/constructor-arg&gt;
+        &lt;constructor-arg index=&quot;1&quot;&gt;
+            &lt;value&gt;3.14159&lt;/value&gt;
+        &lt;/constructor-arg&gt;
+
+        &lt;property name=&quot;mylist&quot;&gt;
+            &lt;list value-type=&quot;java.lang.String&quot;&gt;
+                &lt;value&gt;onel&lt;/value&gt;
+                &lt;value&gt;twol&lt;/value&gt;
+                &lt;value&gt;threel&lt;/value&gt;
+            &lt;/list&gt;
+        &lt;/property&gt;
+
+        &lt;property name=&quot;myset&quot;&gt;
+            &lt;set value-type=&quot;java.lang.String&quot;&gt;
+                &lt;value&gt;ones&lt;/value&gt;
+                &lt;value&gt;twos&lt;/value&gt;
+                &lt;value&gt;ones&lt;/value&gt;
+            &lt;/set&gt;
+        &lt;/property&gt;
+
+        &lt;property name=&quot;mymap&quot;&gt;
+            &lt;map key-type=&quot;java.lang.String&quot;&gt;
+                &lt;entry&gt;
+                    &lt;key&gt;
+                        &lt;value&gt;test_key&lt;/value&gt;
+                    &lt;/key&gt;
+                    &lt;value type=&quot;java.lang.String&quot;&gt;myvalue&lt;/value&gt;
+                &lt;/entry&gt;
+            &lt;/map&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+&lt;/beans&gt;</programlisting>
+        <para>The namespace declaration <code>xmlns=&quot;urn:jboss:spring-beans:2.0&quot;</code> tells the microcontainer that it should interpret the XML according to the spring-bean schema.</para>
+        <para>You can even mix beans declared using the bean-deployer schema with those declared using the spring-beans schema just like we did with the javabean schema. All that you need to do is include the correct namespace declarations in the relevant elements:</para>
+        <itemizedlist>
+          <listitem>
+            <para>JBoss Microcontainer deployment containing Spring defined beans</para>
+            <programlisting role="XML">&lt;deployment xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;oldBean&quot; class=&quot;org.jboss.test.spring.support.OldBean&quot;&gt;
+        &lt;property name=&quot;testBean&quot;&gt;
+            &lt;inject/&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;bean xmlns=&quot;urn:jboss:spring-beans:2.0&quot; id=&quot;testBean&quot; class=&quot;org.jboss.test.TestBean&quot;&gt;
+        &lt;property name=&quot;mylist&quot;&gt;
+            &lt;list value-type=&quot;java.lang.String&quot;&gt;
+                &lt;value&gt;onel&lt;/value&gt;
+                &lt;value&gt;twol&lt;/value&gt;
+                &lt;value&gt;threel&lt;/value&gt;
+            &lt;/list&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+
+&lt;/deployment&gt; </programlisting>
+          </listitem>
+          <listitem>
+            <para>Spring defined deployment containing JBoss Microcontainer beans</para>
+            <programlisting role="XML">&lt;beans xmlns=&quot;urn:jboss:spring-beans:2.0&quot;&gt;
+
+    &lt;bean id=&quot;testBean&quot; class=&quot;org.jboss.test.spring.support.SimpleBean&quot;&gt;
+        &lt;property name=&quot;refBean&quot;&gt;
+            &lt;ref bean=&quot;oldBean&quot;/&gt;
+        &lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;bean xmlns=&quot;urn:jboss:bean-deployer:2.0&quot; name=&quot;oldBean&quot; class=&quot;org.jboss.test.spring.support.OldBean&quot;&gt;
+        &lt;property name=&quot;myString&quot;&gt;I&apos;m an old bean&lt;/property&gt;
+    &lt;/bean&gt;
+
+&lt;/beans&gt;</programlisting>
+          </listitem>
+        </itemizedlist>
+        <note>
+          <para>Adding  <code>spring-int.jar</code> to the microcontainer classpath simply adds the ability to define beans using the spring-beans XML schema. It does not integrate JBoss Microcontainer with Spring libraries.</para>
+        </note>
+      </section>
+      <section>
+        <title>Using Java Properties</title>
+        <para>Using XML schemas to create deployment descriptors provides us wth a powerful way to express complex configuration information. However  the XML parsers that are needed to interpret this information are often large in size which doesn&apos;t help when  bootstrapping the microcontainer in small runtime environments. For this reason you can also choose to create deployment descriptors using Java properties.</para>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Creating POJOs</title>
+      <section>
+        <title>Defining classloaders</title>
+        <para>In order to create POJO instances we must first load the corresponding POJO classes into the JVM using a classloader. JBoss Microcontainer does this by using  the classloader associated with the current thread of execution, i.e. the thread context classloader. But what do we mean by the current thread of execution and who sets its context  classloader?</para>
+        <para>In all of our examples so far we have created applications that only use a  single thread. This is the &apos;primordial&apos; thread created by the main() function:</para>
+        <programlisting role="JAVA">public static void main(String[] args) {}</programlisting>
+        <para>As the only thread in the application (other than the garbage collecton thread which is created for every Java application) this executes all of the code including calling the deploy()  method of our BasicXMLDeployer:</para>
+        <programlisting role="JAVA">public class BasicXMLDeployer extends BasicKernelDeployer
+{
+    ...
+    public KernelDeployment deploy(final URL url) throws Throwable
+   {
+       ...
+
+        long start = System.currentTimeMillis();
+
+        Unmarshaller unmarshaller = factory.newUnmarshaller();
+        KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver);
+         if (deployment == null)
+            throw new RuntimeException(&quot;The xml &quot; + url + &quot; is not well formed!&quot;);
+        deployment.setName(url.toString());
+
+        if (trace)
+        {
+            long now = System.currentTimeMillis();
+            log.trace(&quot;Parsing &quot; + url + &quot; took &quot; + (now-start) + &quot; milliseconds&quot;);
+        }
+
+        <emphasis>deploy(deployment);</emphasis>
+
+        if (trace)
+        {
+            long now = System.currentTimeMillis();
+            log.trace(&quot;Deploying &quot; + url + &quot; took &quot; + (now-start) + &quot; milliseconds&quot;);
+        }
+
+        return deployment;
+    }
+
+    ...
+}</programlisting>
+        <para>The deploy() method takes a URL representing the location of an XML deployment descriptor and passes it as a string to an unmarshaller. The unmarshaller parses the XML,  converts it into an object representation called a  KernelDeployment and sets its name. The KernelDeployment object is  then passed to the deploy() method of the superclass BasicKernelDeployer. This iterates through all of the beans in the deployment   creating a context for each one which it subsequently passes to the contoller&apos;s install() method to peform the deployment. The controller then performs actions on each context to take the bean from one state to another: NOT_INSTALLED, DESCRIBED, CONFIGURED, INSTANTIATED, CREATE, START, INSTALLED. Once a bean reaches the INSTALLED state then it&apos;s considered to be deployed.</para>
+        <important>
+          <para>During the deployment process, as the controller performs the Instantiate action, the thread context classloader is used to load the bean&apos;s class into the JVM.  As all of the controller code is executed by the thread that calls controller.install() we refer to this as the  current thread of execution.</para>
+        </important>
+        <para>Therefore when using the BasicXMLDeployer the classloader used to load bean classes is retrieved from the thread that calls the BasicXMLDeployer&apos;s deploy() method as this goes on to call controller.install() which subsequently executes the Instantiate action. For all of our examples this is the primordial thread whose context classloader is set on startup to the classloader that loaded the application, i.e. the application classloader. This means that in our examples the microcontainer can load any bean classes present on the application, extension or boot classpaths.</para>
+        <para>What happens though if we create our own threads in the application and use these to call the deploy() method of our BasicXMLDeployer?</para>
+        <para>If you create a thread then by default its context classloader will be set to the parent thread&apos;s context classloader. As any hierarchy of threads is ultimately rooted at the primordial thread this means that by default they will all use the application classloader. To change this you simply need to call setContextClassLoader() on a thread at runtime. This is typically done on the current thread using <code>Thread.currentThread().setContextClassloader()</code>.</para>
+        <note>
+          <para>If you choose not to use the BasicXMLDeployer and instead use the equivalent aspectized deployer then the  classloader used to load bean classes is taken from the thread that calls the process() method of the MainDeployer.  This is because the MainDeployer process() method iterates through all of the registered deployers calling their process() methods which in turn call controller.install() to perform the deployment. </para>
+        </note>
+        <para>Now that we know the default classloader comes from the current thread of execution, which if not set explicitly is set on startup to be the application classloader, how can we change it to load bean classes from other locations?</para>
+        <para>If you are using the BasicXMLDeployer or its equivalent aspectized deployer then you can define classloaders for entire deployments or individual beans by including &lt;classloader&gt; elements within the XML deployment descriptor. To specify a different classloader for all the beans in a deployment you need to include a &lt;classloader&gt; element above all of the &lt;bean&gt; elements:</para>
+        <programlisting role="XML">&lt;deployment&gt;
+    &lt;classloader&gt;&lt;inject bean=&quot;deploymentCL&quot;/&gt;&lt;/classloader&gt;
+
+    &lt;bean name=&quot;Bean1&quot; ... &gt;
+        ...
+    &lt;/bean&gt;
+
+    &lt;bean name=&quot;Bean2&quot; ... &gt;
+        ...
+    &lt;/bean&gt;
+
+&lt;/deployment&gt;</programlisting>
+        <para>If instead you wish to override either the default classloader or a deployment classloader for a particular bean then you need to include a &lt;classloader&gt; element within the &lt;bean&gt; definition itself:</para>
+        <programlisting role="XML">&lt;deployment&gt;
+    &lt;classloader&gt;&lt;inject bean=&quot;deploymentCL&quot;/&gt;&lt;/classloader&gt;
+
+    &lt;bean name=&quot;Bean1&quot; ... &gt;
+        &lt;classloader&gt;&lt;inject bean=&quot;beanCL&quot;/&gt;&lt;/classloader&gt;
+        ...
+    &lt;/bean&gt;
+
+    &lt;bean name=&quot;Bean2&quot; ... &gt;
+        ...
+    &lt;/bean&gt;
+
+&lt;/deployment&gt;</programlisting>
+        <para>Finally you can choose to use the default classloader for  a bean instead of the deployment classloader, if one is defined, by including a &lt;classloader&gt; element with a &lt;/null&gt; value:</para>
+        <programlisting role="XML">&lt;deployment&gt;
+    &lt;classloader&gt;&lt;inject bean=&quot;deploymentCL&quot;/&gt;&lt;/classloader&gt;
+
+    &lt;bean name=&quot;Bean1&quot; ... &gt;
+        &lt;classloader&gt;&lt;inject bean=&quot;beanCL&quot;/&gt;&lt;/classloader&gt;
+        ...
+    &lt;/bean&gt;
+
+    &lt;bean name=&quot;Bean2&quot; ... &gt;
+        &lt;classloader&gt;&lt;/null&gt;&lt;/classloader&gt;
+        ...
+    &lt;/bean&gt;
+
+&lt;/deployment&gt;</programlisting>
+        <para>The classloader beans that you inject must be deployed in the runtime environment before bean classes can be loaded. Typically this is done by also declaring them in the XML deployment descriptor:</para>
+        <programlisting role="XML">&lt;deployment xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+            xsi:schemaLocation=&quot;urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd&quot;
+            xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;URL&quot; class=&quot;java.net.URL&quot;&gt;
+        &lt;constructor&gt;
+       &lt;parameter&gt;file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar&lt;/parameter&gt;
+        &lt;/constructor&gt;
+    &lt;/bean&gt;
+
+    &lt;bean name=&quot;customCL&quot; class=&quot;java.net.URLClassLoader&quot;&gt;
+        &lt;constructor&gt;
+            &lt;parameter&gt;
+                &lt;array&gt;
+                    &lt;inject bean=&quot;URL&quot;/&gt;
+                &lt;/array&gt;
+            &lt;/parameter&gt;
+        &lt;/constructor&gt;
+    &lt;/bean&gt;
+
+    &lt;bean name=&quot;HRService&quot; class=&quot;org.jboss.example.service.HRManager&quot;&gt;
+        &lt;classloader&gt;&lt;inject bean=&quot;customCL&quot;/&gt;&lt;/classloader&gt;
+        ...
+&lt;/bean&gt;</programlisting>
+        <para>If a classloader is not available for a bean when an attempt is made to deploy it then the bean will remain in a pre INSTANTIATED state. Once the classloader is deployed then the bean will automatically continue to deploy. This means that you can define classloaders in the deployment descriptor after beans that depend on them and everything will deploy as expected.</para>
+        <note>
+          <para>User defined classloaders are detected by the microcontainer during the deployment process as the controller performs the Instantiate action.  They are used instead of the default classloader by calling setContextClassLoader() on the current thread. In this way they can be subsequently retrieved by code that loads the bean class using Thread.currentThread().getContextClassLoader(). After the bean class has been loaded the default classloader is put back by calling setContexClassLoader() again.</para>
+        </note>
+      </section>
+      <section>
+        <title>Calling constructors</title>
+        <para>Creating POJO instances is performed either by calling a constructor or using a factory method. The &lt;constructor&gt; element is used in both cases and parameters can be passed if necessary using nested &lt;parameter&gt; elements. Annotations also exist for either case with parameter values represented as annotations of the constructor parameters themselves.</para>
+        <important>
+          <para>At present it is not possible to create a POJO instance only using annotations. This is because classes are not automatically loaded and scanned whenever they are added to the classpath. Doing so would significantly reduce the performance of the deployment process as all classes would need to be loaded, even if they were not yet required. Instead you must always define beans using a deployment descriptor as  this tells the  microcontainer which classes to load. These classes are subsequently scanned for annotations such as @Constructor and @Factory to discover how to create  instances.</para>
+          <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;/&gt;</programlisting>
+        </important>
+        <itemizedlist>
+          <listitem>
+            <para>Default constructor</para>
+            <programlisting role="JAVA">@Constructor
+public TestConstructorBean() {
+ ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;Test&quot; class=&quot;org.jboss.example.constructor.TestConstructorBean&quot;/&gt;       </programlisting>
+          </listitem>
+          <listitem>
+            <para>Constructor with parameters</para>
+            <programlisting role="JAVA">@Constructor
+public TestConstructorBean(@StringValue(&quot;this is a test contructor&quot;) String testString, @StringValue(&quot;25&quot;) int testNumber) {
+ ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;Test&quot; class=&quot;org.jboss.example.constructor.TestConstructorBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;this is a test constructor&lt;/parameter&gt;
+        &lt;parameter&gt;25&lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>Choosing between two constructors with the same number of parameters</para>
+            <programlisting role="JAVA">public TestConstructorBean(String testString, int testNumber) {
+    ...
+}
+
+ at Constructor
+public TestConstructorBean(@StringValue(&quot;this is a test constructor&quot;) String testString, @StringValue(value=&quot;25&quot;, type=&quot;long&quot;) long testNumber) {
+    ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;Test&quot; class=&quot;org.jboss.example.constructor.TestConstructorBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;this is a test constructor&lt;/parameter&gt;
+        &lt;parameter class=&quot;long&quot;&gt;25&lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt;</programlisting>
+            <note>
+              <para>You only need to include the  <code>class</code> attribute on enough parameters to resolve the ambiguity.</para>
+            </note>
+          </listitem>
+        </itemizedlist>
+        <para>You can also specify javabeans as parameters if required using the @JavaBeanValue annotation or &lt;javabean&gt; element. In this particular case the annotation is not very useful as it can only call the default constructor of the javabean class to create an instance. If you want to use a different constructor or inject properties then you should use the XML element instead.</para>
+        <programlisting role="JAVA">@Constructor
+public TestConstructorBean(@StringValue(&quot;this is a test constructor&quot;) String testString, @JavaBeanValue(&quot;org.jboss.test.Person&quot;) Person testPerson) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Test&quot; class=&quot;org.jboss.example.constructor.TestConstructorBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;this is a test constructor&lt;/parameter&gt;
+        &lt;parameter&gt;
+            &lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;org.jboss.test.Person&quot;&gt;
+                &lt;constructor&gt;
+                    &lt;property name=&quot;age&quot;&gt;21&lt;/property&gt;
+                &lt;/constructor&gt;
+                &lt;property name=&quot;firstName&quot;&gt;Mark&lt;/property&gt;
+                &lt;property name=&quot;lastName&quot;&gt;Newton&lt;/property&gt;
+            &lt;/javabean&gt;
+        &lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Finally you can inject references to other beans or their properties into constructor parameters giving you complete control of the construction of your POJOs.</para>
+        <programlisting role="JAVA">@Constructor
+public TestConstructorBean(@Inject(bean=&quot;TestPerson&quot;) Person testPerson, @Inject(bean=&quot;TestAddress&quot;, property=&quot;street&quot;) String street) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Test&quot; class=&quot;org.jboss.example.constructor.TestConstructorBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;
+            &lt;inject bean=&quot;TestPerson&quot;/&gt;
+        &lt;/parameter&gt;
+        &lt;parameter&gt;
+            &lt;inject bean=&quot;TestAddress&quot; property=&quot;street&quot;/&gt;
+        &lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt;</programlisting>
+      </section>
+      <section>
+        <title>Using factories</title>
+        <para>If you have a number of classes that share the same interface then you may want to use a factory to create your POJO instances. JBoss Microcontainer provides support for static or non-static factory methods which can also take parameters if necessary.</para>
+        <itemizedlist>
+          <listitem>
+            <para>Static factory method</para>
+            <programlisting role="JAVA">@Factory (factoryClass=&quot;org.jboss.example.MyFactory&quot;,
+          factoryMethod=&quot;newInstance&quot;)
+public class SimpleBean {
+   ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;constructor factoryClass=&quot;org.jboss.example.MyFactory&quot;
+                 factoryMethod=&quot;newInstance&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+          </listitem>
+          <listitem>
+            <para>Static factory method with parameters</para>
+            <programlisting role="JAVA">@Factory (factoryClass=&quot;org.jboss.example.MyFactory&quot;,
+          factoryMethod=&quot;newInstance&quot;,
+          parameters={@Value(string=@StringValue(&quot;a string&quot;)), at Value(string=@StringValue(&quot;7&quot;))})
+public class SimpleBean {
+   ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;constructor factoryClass=&quot;org.jboss.example.MyFactory&quot;
+                 factoryMethod=&quot;newInstance&quot;&gt;
+        &lt;parameter&gt;a string&lt;/parameter&gt;
+        &lt;parameter&gt;7&lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt; </programlisting>
+          </listitem>
+          <listitem>
+            <para>Non-static factory method</para>
+            <programlisting role="JAVA">@Factory (factory=@Value(javabean=@JavaBeanValue(&quot;org.jboss.example.MyOtherFactory&quot;)),
+          factoryMethod=&quot;createBean&quot;)
+public class SimpleBean {
+    ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;MyOtherFactory&quot; class=&quot;org.jboss.example.MyOtherFactory&quot;/&gt;
+
+&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;constructor factoryMethod=&quot;createBean&quot;&gt;
+        &lt;factory bean=&quot;MyOtherFactory&quot;/&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>Non-static factory method with parameters</para>
+            <programlisting role="JAVA">@Factory (factory=@Value(javabean=@JavaBeanValue(&quot;org.jboss.example.MyOtherFactory&quot;)),
+          factoryMethod=&quot;createBean&quot;,
+          parameters={@Value(string=@StringValue(&quot;a string&quot;)), at Value(string=@StringValue(&quot;7&quot;))})
+public class SimpleBean {
+    ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;MyOtherFactory&quot; class=&quot;org.jboss.example.MyOtherFactory&quot;/&gt;
+
+&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;constructor factoryMethod=&quot;createBean&quot;&gt;
+        &lt;factory bean=&quot;MyOtherFactory&quot;/&gt;
+        &lt;parameter&gt;a string&lt;/parameter&gt;
+        &lt;parameter&gt;7&lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+        </itemizedlist>
+        <para>For the special case where a bean implements its own  static factory method in order to create itself then you can also use a shorthand notation:</para>
+        <itemizedlist>
+          <listitem>
+            <para>Bean implementing its own static factory method</para>
+            <programlisting role="JAVA">public class SimpleBean {
+
+    @FactoryMethod
+    public static newInstance(@StringValue(&quot;a string&quot;) String name, @StringValue(&quot;5&quot;) int level) {
+        ...
+    }
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;constructor factoryMethod=&quot;newInstance&quot;&gt;
+        &lt;parameter&gt;a string&lt;/parameter&gt;
+        &lt;parameter&gt;5&lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt; </programlisting>
+            <para>Note that the @FactoryMethod annotation doesn&apos;t have a parameter attribute as the method parameters themselves are annotated.</para>
+          </listitem>
+        </itemizedlist>
+        <note>
+          <para>Factory method parameters can also be configured using JavaBeans and injected bean references if necessary just like constructor parameters. </para>
+        </note>
+      </section>
+      <section>
+        <title>Creating bean aliases</title>
+        <para>By default each bean declared in the deployment descriptor has a unique name that is used to inject it into other beans or to  provide a reference to clients at runtime. Sometimes however it is useful to define additional names or aliases. This can be done using the @Aliases annotation or &lt;alias&gt; XML element. System property replacement is used by default to change the value of the alias at runtime but you can disable this if required. </para>
+        <itemizedlist>
+          <listitem>
+            <para>Defining extra bean names</para>
+            <programlisting role="JAVA">@Aliases({&quot;MyAlias&quot;, &quot;Test: ${test.name}&quot;})
+public class SimpleBean {
+    ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;MyBean&quot; class=&quot;org.acme.SimpleBean&quot;&gt;
+    &lt;alias&gt;MyAlias&lt;/alias&gt;
+    &lt;alias&gt;Test: ${test.name}&lt;/alias&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+          <listitem>
+            <para>Disabling System property replacement</para>
+            <programlisting role="JAVA">@Aliases({&quot;MyAlias&quot;, &quot;Test: ${test.name}&quot;} replace=&quot;false&quot;)
+public class SimpleBean {
+    ...
+}</programlisting>
+            <programlisting role="XML">&lt;bean name=&quot;MyBean&quot; class=&quot;org.acme.SimpleBean&quot;&gt;
+    &lt;alias&gt;MyAlias&lt;/alias&gt;
+    &lt;alias replace=&quot;false&quot;&gt;Test: ${test.name}&lt;/alias&gt;
+&lt;/bean&gt;</programlisting>
+          </listitem>
+        </itemizedlist>
+        <para>The type of an alias doesn&apos;t have to be a string. If you want to choose a different type then you can specify a <code>class</code> attribute in the &lt;alias&gt; XML element. At present you cannot do this using the @Aliases annotation.</para>
+        <itemizedlist>
+          <listitem>
+            <para>Choosing a different alias type</para>
+            <programlisting role="XML">&lt;bean name=&quot;MyBean&quot; class=&quot;org.acme.SimpleBean&quot;&gt;
+    &lt;alias class=&quot;java.lang.Integer&quot;&gt;12345&lt;/alias&gt; 
+&lt;/bean&gt;</programlisting>
+          </listitem>
+        </itemizedlist>
+        <para>Sometimes you may wish to define an alias for a bean after it has been deployed. This can be done using the standalone  &lt;alias&gt; element in the deployment descriptor. There is no equivalent annotation in this case as there is no sensible place to put it.</para>
+        <itemizedlist>
+          <listitem>
+            <para>Defining a standalone alias</para>
+            <programlisting role="XML">&lt;deployment name=&quot;FirstDeployment&quot; xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;Bean1&quot; class=&quot;java.lang.Object&quot;/&gt;
+    &lt;bean name=&quot;Bean2&quot; class=&quot;java.lang.Object&quot;/&gt;
+
+&lt;/deployment&gt;
+
+&lt;deployment name=&quot;SecondDeployment&quot; xmlns=&quot;urn:jboss:bean-deployer:2.0&quot;&gt;
+
+    &lt;bean name=&quot;Xyz1&quot; class=&quot;java.lang.Object&quot;&gt;
+        &lt;property name=&quot;locker1&quot;&gt;&lt;inject name=&quot;Lock1&quot;&gt;&lt;/property&gt;
+        &lt;property name=&quot;locker2&quot;&gt;&lt;inject name=&quot;Lock2&quot;&gt;&lt;/property&gt;
+    &lt;/bean&gt;
+
+    &lt;alias name=&quot;Bean1&quot;&gt;Lock1&lt;/alias&gt;
+    &lt;alias name=&quot;Bean2&quot;&gt;Lock2&lt;/alias&gt;
+
+&lt;/deployment&gt; </programlisting>
+          </listitem>
+        </itemizedlist>
+        <note>
+          <para>Standalone aliases behave just like normal beans with respect to dependencies. Specifically they won&apos;t be deployed until the beans that they represent have been deployed first. Likewise when a bean is undeployed then any corresponding standalone aliases are undeployed first.</para>
+          <para>Furthermore if any beans depend on a standalone alias then they will not be deployed until the alias is deployed first. Similarly undeploying a standalone alias will cause all dependent beans to be undeployed, regardless of whether  the bean that it represents remains deployed.  </para>
+        </note>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Injecting properties</title>
+      <section>
+        <title>Using values</title>
+        <para>Once a POJO instance has been created then it can be configured by injecting property values. Like most other features this can be done using either annotations or a deployment descriptor. For each property that you wish to inject the bean must define an appropriate setter method for the microcontainer to call.</para>
+        <programlisting role="JAVA">public class PropertiesBean {
+
+    public void setTitle(@StringValue(&quot;JBoss Microcontainer&quot;) String title) {
+        ...
+   }
+
+    public void setLink(@StringValue(&quot;http://www.jboss.org&quot;) URL link) {
+        ...
+    }
+
+    public void setNumber(@StringValue(&quot;4&quot;) int number) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropertiesBean&quot; class=&quot;org.jboss.example.microcontainer.properties.PropertiesBean&quot;&gt;
+    &lt;property name=&quot;title&quot;&gt;JBoss Microcontainer&lt;/property&gt;
+    &lt;property name=&quot;link&quot;&gt;http://www.jboss.org&lt;/property&gt;
+    &lt;property name=&quot;number&quot;&gt;4&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>As you have probably noticed we are required to enter all of our values as strings since we are dealing with text files. These strings are converted into objects of the correct type using JavaBean <ulink url="http://java.sun.com/j2se/1.5.0/docs/api/java/beans/PropertyEditor.html">PropertyEditors</ulink>. If the property takes an interface or abstract class then you can pass a specific implementation using a <code>type</code> or  <code>class</code> attribute depending on whether you&apos;re using annotations or XML.</para>
+        <programlisting role="JAVA">public class PropertiesBean {
+    public void setNumber(@StringValue(value=&quot;4&quot;, type=&quot;java.lang.Long&quot;) Number number) {
+        ...
+   }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropertiesBean&quot; class=&quot;org.jboss.example.microcontainer.properties.PropertiesBean&quot;&gt;
+    &lt;property name=&quot;number&quot; class=&quot;java.lang.Long&quot;&gt;4&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Sometimes you may want to pass in a value that isn&apos;t of the same type as the property but can be progressed into it. Progression is typically used for converting numbers from one type to another, e.g. Short to Int or Float to Double. JBoss Microcontainer by default will automatically perform progression using a <code>SimpleProgressionConverter</code> implementation.</para>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.test.SimpleBean&quot;&gt;
+    &lt;property name=&quot;anInt&quot;&gt;
+        &lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;java.lang.Double&quot;&gt;
+            &lt;constructor&gt;
+                &lt;property name=&quot;aDouble&quot;&gt;123.456&lt;/property&gt;
+            &lt;/constructor&gt;
+        &lt;/javabean&gt;
+    &lt;/property&gt;
+    &lt;property name=&quot;aShort&quot;&gt;
+        &lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;java.lang.Float&quot;&gt;
+            &lt;constructor&gt;
+                &lt;property name=&quot;aFloat&quot;&gt;987.6543&lt;/property&gt;
+            &lt;/constructor&gt;
+        &lt;/javabean&gt;
+    &lt;/property&gt;
+    &lt;property name=&quot;aFloat&quot;&gt;
+        &lt;javabean xmlns=&quot;urn:jboss:javabean:2.0&quot; class=&quot;java.lang.Integer&quot;&gt;
+            &lt;constructor&gt;
+                &lt;property name=&quot;anInt&quot;&gt;314159&lt;/property&gt;
+            &lt;/constructor&gt;
+        &lt;/javabean&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>You can replace  the default progression converter implementation with one of your own by setting the <code>org.jboss.reflect.plugins.progressionConverter</code> system property using a fully-qualified class name. If you want to prevent progression from occuring altogether then you can use the <code>NullProgressionConverter</code> which is also provided.</para>
+        <programlisting>-Dorg.jboss.reflect.plugins.progressionConverter=org.jboss.reflect.plugins.NullProgressionConvertor</programlisting>
+        <para>If you want to use a null value then you need to use the @NullValue annotation or &lt;null/&gt; element. This is so we can differentiate it from the string &apos;null&apos;.</para>
+        <programlisting role="JAVA">public void setTitle(@NullValue String title) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropertiesBean&quot; class=&quot;org.jboss.example.microcontainer.properties.PropertiesBean&quot;&gt;
+    &lt;property name=&quot;title&quot;&gt;&lt;null/&gt;&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Similarly if you want to refer to the current object then you  should use the @ThisValue annotation or &lt;this/&gt; element.</para>
+        <programlisting role="JAVA">public void setObject(@ThisValue Object target) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropertiesBean&quot; class=&quot;org.jboss.example.microcontainer.properties.PropertiesBean&quot;&gt;
+    &lt;property name=&quot;target&quot;&gt;&lt;this/&gt;&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Property values can also be defined using a longer form of XML if you prefer.</para>
+        <programlisting role="XML">&lt;bean name=&quot;PropertiesBean&quot; class=&quot;org.jboss.example.microcontainer.properties.PropertiesBean&quot;&gt;
+    &lt;property name=&quot;number&quot;&gt;
+        &lt;value class=&quot;java.lang.Long&quot;&gt;4&lt;/value&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>This is primarily used when configuring values representing collections such as lists, sets and arrays. Elements of a collection are defined by listing annotations or nesting &lt;value&gt; elements as follows:</para>
+        <programlisting role="JAVA">@CollectionValue(elementClass=&quot;java.lang.String&quot;,
+                 {@Value(string=@StringValue(&quot;string1&quot;)),
+                  @Value(string=@StringValue(&quot;string2&quot;)),
+                  @Value(string=@StringValue(&quot;string3&quot;)),
+                  @Value(string=@StringValue(&quot;string4&quot;))})
+public void setCollection(Collection collection) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;collection&quot;&gt;
+        &lt;collection elementClass=&quot;java.lang.String&quot;&gt;
+            &lt;value&gt;string1&lt;/value&gt;
+            &lt;value&gt;string2&lt;/value&gt;
+            &lt;value&gt;string3&lt;/value&gt;
+            &lt;value&gt;string4&lt;/value&gt;
+       &lt;/collection&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>The <code>elementClass</code> attribute specifies the default class for the values. This can be overriden for individual values using the <code>type</code> or <code>class</code> attributes.</para>
+        <programlisting role="JAVA">@CollectionValue(elementClass=&quot;java.lang.String&quot;,
+                 {@Value(string=@StringValue(&quot;string1&quot;)),
+                  @Value(string=@StringValue(&quot;string2&quot;)),
+                  @Value(string=@StringValue(value=&quot;3.0&quot;, type=&quot;java.lang.Float&quot;)),
+                  @Value(string=@StringValue(value=&quot;4&quot;, type=&quot;java.lang.Integer&quot;))})
+public void setCollection(Collection collection) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;collection&quot;&gt;
+        &lt;collection elementClass=&quot;java.lang.String&quot;&gt;
+            &lt;value&gt;string1&lt;/value&gt;
+            &lt;value&gt;string2&lt;/value&gt;
+            &lt;value class=&quot;java.lang.Float&quot;&gt;3.0&lt;/value&gt;
+            &lt;value class=&quot;java.lang.Integer&quot;&gt;4&lt;/value&gt;
+       &lt;/collection&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <warning>
+          <para>The type of each value must be specified using either the <code>elementClass</code> or <code>type/class</code> attribute in order for the collection to be created.</para>
+        </warning>
+        <para>Lists, sets and arrays take the same form as the collection annotation and XML element. </para>
+        <programlisting role="JAVA">@ListValue(elementClass=&quot;java.lang.String&quot;,
+           {@Value(string=@StringValue(&quot;my first string&quot;)),
+            @Value(string=@StringValue(&quot;my second string&quot;))})
+public void setList(List list) {
+    ...
+}
+
+ at SetValue(elementClass=&quot;java.lang.Integer&quot;,
+          {@Value(string=@StringValue(&quot;50&quot;)),
+           @Value(string=@StringValue(&quot;55&quot;))})
+public void setSet(Set set) {
+    ...
+}
+
+ at ArrayValue(elementClass=&quot;java.lang.Float&quot;,
+            {@Value(string=@StringValue(&quot;1.0&quot;)),
+             @Value(string=@StringValue(&quot;2.0&quot;))})
+public void setArray(Object[] array) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;list&quot;&gt;
+        &lt;list elementClass=&quot;java.lang.String&quot;&gt;
+            &lt;value&gt;my first string&lt;/value&gt;
+            &lt;value&gt;my second string&lt;/value&gt;
+        &lt;/list&gt;
+    &lt;/property&gt;
+
+    &lt;property name=&quot;set&quot;&gt;
+        &lt;set elementClass=&quot;java.lang.Integer&quot;&gt;
+            &lt;value&gt;50&lt;/value&gt;
+            &lt;value&gt;55&lt;/value&gt;
+        &lt;/set&gt;
+    &lt;/property&gt;
+
+    &lt;property name=&quot;array&quot;&gt;
+        &lt;array elementClass=&quot;java.lang.Float&quot;&gt;
+            &lt;value&gt;1.0&lt;/value&gt;
+            &lt;value&gt;2.0&lt;/value&gt;
+        &lt;/array&gt;
+    &lt;/array&gt;
+&lt;/bean&gt; </programlisting>
+        <para>They can even be nested within one another if required. </para>
+        <programlisting role="JAVA">@ListValue(elementClass=&quot;java.lang.String&quot;,
+           {@Value(string=@StringValue(&quot;my first string&quot;)),
+            @Value(string=@SetValue(elementClass=&quot;java.lang.Integer&quot;,
+                                    {@Value(string=@StringValue(&quot;1&quot;)),
+                                     @Value(string=@StringValue=&quot;2&quot;))})
+                  )})
+public void setList(List list) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;list&quot;&gt;
+        &lt;list elementClass=&quot;java.lang.String&quot;&gt;
+            &lt;value&gt;my first string&lt;/value&gt;
+            &lt;value&gt;
+                &lt;set elementClass=&quot;java.lang.Integer&quot;&gt;
+                    &lt;value&gt;1&lt;/value&gt;
+                    &lt;value&gt;2&lt;/value&gt;
+                &lt;/set&gt;
+            &lt;/value&gt;
+        &lt;/list&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Maps can also be created using multiple entries of key/value pairs. As we now have two types to consider we must use the <code>keyClass</code> and <code>valueClass</code> attributes to specify the default classes for each entry. Again these can be overriden for individual entries if necessary.</para>
+        <programlisting role="JAVA">@MapValue(keyClass=&quot;java.lang.String&quot;,
+          valueClass=&quot;java.lang.String&quot;,
+          {@EntryValue(key=@Value(string=@StringValue(&quot;foo.bar.key&quot;)),
+                       value=@Value(string=@StringValue(&quot;QWERT&quot;))),
+           @EntryValue(key=@Value(string=@StringValue(&quot;xyz.key&quot;)),
+                       value=@Value(string=@StringValue(&quot;QWERTY&quot;)))
+          })
+public void setMap(Map&lt;String, String&gt; map) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;map&quot;&gt;
+        &lt;map keyClass=&quot;java.lang.String&quot; valueClass=&quot;java.lang.String&quot;&gt;
+            &lt;entry&gt;
+                &lt;key&gt;foo.bar.key&lt;/key&gt;
+                &lt;value&gt;QWERT&lt;/value&gt;
+            &lt;/entry&gt;
+            &lt;entry&gt;
+                &lt;key&gt;xyz.key&lt;/key&gt;
+                &lt;value&gt;QWERTY&lt;/value&gt;
+            &lt;/entry&gt;
+        &lt;/map&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>So far we have defined collections, lists, sets, arrays and maps but all of these have multiple implementations, e.g. java.util.ArrayList, java.util.LinkedList,  so which are we using at runtime? By default JBoss Microcontainer will look for an existing instance using the corresponding getter method for the property. If one is found then it is used. If not then the type of the property is analysed and providing that it represents a class (not an interface) then this is used to create a new instance. Failing that a default instance will be created as follows:</para>
+        <itemizedlist>
+          <listitem>
+            <para>Collection - java.util.ArrayList</para>
+          </listitem>
+          <listitem>
+            <para>List - java.util.ArrayList</para>
+          </listitem>
+          <listitem>
+            <para>Set - java.util.HashSet</para>
+          </listitem>
+          <listitem>
+            <para>Array - java.lang.Object[]</para>
+          </listitem>
+          <listitem>
+            <para>Map - java.util.HashMap</para>
+          </listitem>
+        </itemizedlist>
+        <para>If you want to override this behaviour and specify your own class then you can simply add a <code>clazz</code> attribute to your annotation or <code>class</code> attribute to your XML element containing the fully-qualified class name. This causes the microcontainer to create a new instance using the specified class.</para>
+        <programlisting role="JAVA">@SetValue(clazz=&quot;java.util.TreeSet&quot;,
+          elementClass=&quot;java.lang.Integer&quot;,
+          {@Value(string=@StringValue(&quot;50&quot;)),
+           @Value(string=@StringValue(&quot;55&quot;))})
+public void setSet(Set set) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot;
+ class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;set&quot;&gt;
+        &lt;set class=&quot;java.util.TreeSet&quot; elementClass=&quot;java.lang.Integer&quot;&gt;
+            &lt;value&gt;50&lt;/value&gt;
+            &lt;value&gt;55&lt;/value&gt;
+        &lt;/set&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <note>
+          <para>If you don&apos;t specify a <code>clazz</code><code>/class</code> attribute but you want to ensure that a new instance is created then you can prevent the microcontainer from looking for a existing instance by specifying a <code>preinstantiate</code> attribute in the &lt;property&gt; element. Currently this cannot be achieved using annotations.</para>
+          <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;property name=&quot;list&quot; preinstantiate=&quot;false&quot;&gt;
+        &lt;list elementClass=&quot;java.lang.String&quot;&gt;
+            &lt;value&gt;string1&lt;/value&gt;
+            &lt;value&gt;string2&lt;/value&gt;
+        &lt;/list&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        </note>
+        <note>
+          <para>If you want to define a <code>clazz</code><code>/class</code> attribute for an array then you must use the following syntax:</para>
+          <para> <code>[L</code><emphasis>&lt;fully-qualified class name&gt;</emphasis><code>;</code></para>
+          <para>e.g. an array of strings - [Ljava.lang.String;</para>
+          <para>or an array of integers - [Ljava.lang.Integer;</para>
+        </note>
+      </section>
+      <section>
+        <title>Calling methods</title>
+        <para>Using PropertyEditors to create instances of objects from strings is fine in many situations but sometimes you need to inject a return value from a method call. As the method is responsible for creating the value we refer to it as a value factory. Hence the @ValueFactory annotation or &lt;value-factory&gt; element can be used in place of @StringValue or &lt;value&gt; to call a method and inject the returned value during deployment.</para>
+        <programlisting role="JAVA">@ValueFactory(bean=&quot;SimpleBean&quot;,
+              method=&quot;getFullName&quot;)
+public void setName(String name) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropHolder&quot; class=&quot;org.jboss.test.kernel.config.support.PropHolder&quot;&gt;
+    &lt;property name=&quot;name&quot;&gt;
+        &lt;value-factory bean=&quot;SimpleBean&quot; method=&quot;getFullName&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>If you need to pass any parameters to the method then you can use multiple  @Parameter annotations or nested &lt;parameter&gt; elements. </para>
+        <programlisting role="JAVA">@ValueFactory(bean=&quot;SimpleBean&quot;,
+              method=&quot;getFullName&quot;,
+              parameters=&quot;{@Parameter(string=@StringValue(&quot;Bob&quot;)),
+                           @Parameter(string=@StringValue(&quot;Smith&quot;))}&quot;)
+public void setName(String name) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropHolder&quot; class=&quot;org.jboss.test.kernel.config.support.PropHolder&quot;&gt;
+    &lt;property name=&quot;name&quot;&gt;
+        &lt;value-factory bean=&quot;SimpleBean&quot; method=&quot;getFullName&quot;&gt;
+            &lt;parameter&gt;Bob&lt;/parameter&gt;
+            &lt;parameter&gt;Smith&lt;/parameter&gt;
+        &lt;/value-factory&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Alternatively if only one parameter is required then you can use the <code>parameter</code> attribute to create a shorthand version. However this only works for values that can be created from strings.</para>
+        <programlisting role="JAVA">@ValueFactory(bean=&quot;SimpleBean&quot;,
+              method=&quot;getFullName&quot;,
+              parameter=&quot;@Parameter(string=@StringValue(&quot;Bob&quot;))&quot;)
+public void setName(String name) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropHolder&quot; class=&quot;org.jboss.test.kernel.config.support.PropHolder&quot;&gt;
+    &lt;property name=&quot;name&quot;&gt;
+        &lt;value-factory bean=&quot;SimpleBean&quot; method=&quot;getFullName&quot; parameter=&quot;Bob&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>It is also possible to specify a default value to use in case the method returns null. This is done using the <code>defaultValue</code>/<code>default</code> attribute which like the <code>parameter</code> attribute  only accepts values created using strings. </para>
+        <programlisting role="JAVA">@ValueFactory(bean=&quot;SimpleBean&quot;,
+              method=&quot;getFullName&quot;,
+              defaultValue=&quot;Mark Newton&quot;)
+public void setName(String name) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;PropHolder&quot; class=&quot;org.jboss.test.kernel.config.support.PropHolder&quot;&gt;
+    &lt;property name=&quot;name&quot;&gt;
+        &lt;value-factory bean=&quot;SimpleBean&quot; method=&quot;getFullName&quot; default=&quot;Mark Newton&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+      </section>
+      <section>
+        <title>Using bean references</title>
+        <para>Injecting string-based properties or the return values of method calls into individual beans allows us to perform simple configurations. To create more complex configurations we need to wire beans together by injecting references using the @Inject annotation or &lt;inject&gt; element. </para>
+        <programlisting role="JAVA">@Inject(bean = &quot;Name1&quot;)
+public void setSimpleBean(SimpleBean bean) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.test.SimpleBean&quot;&gt;
+    &lt;property name=&quot;simpleBean&quot;&gt;
+        &lt;inject bean=&quot;Name1&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Bean injections can be used anywhere a string value is used but you must ensure that the type of bean being injected is compatible with the type of property being set. It is also possible to inject a property from  one bean into another  using the <code>property</code> attribute.</para>
+        <programlisting role="JAVA">@Inject(bean = &quot;Name1&quot;, property=&quot;age&quot;)
+public void setAge(Integer age) {
+    ...
+} </programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.test.SimpleBean&quot;&gt;
+    &lt;property name=&quot;age&quot;&gt;
+        &lt;inject bean=&quot;Name1&quot; property=&quot;age&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Although injection is simple to use it provides a very powerful way to create  arbitrary relationships between POJO instances. The dependencies that are formed by these relationships are discussed in the next chapter &apos;Defining Dependencies&apos;.</para>
+        <note>
+          <para>Sometimes you may wish to declare a bean simply so that you can inject it into a single property. In this case you can replace the &lt;inject&gt; element with the bean declaration itself to reduce the amount of XML required. This is not possible using annotations as there is no annotation to declare a bean.</para>
+          <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.test.SimpleBean&quot;&gt;
+    &lt;property name=&quot;testBean&quot;&gt;
+        &lt;bean=&quot;TestBean&quot; class=&quot;org.jboss.test.TestBean&quot;&gt;
+            &lt;property name=&quot;age&quot;&gt;25&lt;/property&gt;
+        &lt;/bean&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        </note>
+      </section>
+      <section>
+        <title>Injecting context information</title>
+        <para>You may recall that inside the microcontainer each bean is represented by a context which holds amongst other things the bean&apos;s current state. This context information can be injected into bean properties or constructor/factory-method parameters using the @Inject annotation or &lt;inject&gt; element together with a <code>fromContext</code> attribute.</para>
+        <programlisting role="JAVA">@Inject(bean=&quot;otherBean&quot;,
+        fromContext=&quot;beanInfo&quot;)
+public void setBeanInfo(BeanInfo beanInfo) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;sndBean&quot; class=&quot;org.jboss.test.NameAwareBean&quot;&gt;
+    &lt;property name=&quot;beaninfo&quot;&gt;
+        &lt;inject bean=&quot;otherBean&quot; fromContext=&quot;beaninfo&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>If you want to inject information about the current bean&apos;s context then you can simply omit the <code>bean</code> attribute.</para>
+        <programlisting role="JAVA">@Inject(fromContext=&quot;beanInfo&quot;)
+public void setBeanInfo(BeanInfo beanInfo) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;sndBean&quot; class=&quot;org.jboss.test.NameAwareBean&quot;&gt;
+    &lt;property name=&quot;beaninfo&quot;&gt;
+        &lt;inject fromContext=&quot;beaninfo&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>The <code>fromContext</code> attribute can take the following values:</para>
+        <itemizedlist>
+          <listitem>
+            <para>name - the name of the bean</para>
+          </listitem>
+          <listitem>
+            <para>aliases - a list of the bean&apos;s other names</para>
+          </listitem>
+          <listitem>
+            <para>metadata - information about the bean from  annotations or deployment descriptors</para>
+          </listitem>
+          <listitem>
+            <para>beaninfo - information about the bean from the bean class</para>
+          </listitem>
+          <listitem>
+            <para>scope - the microcontainer scope that the bean belongs to</para>
+          </listitem>
+          <listitem>
+            <para>id - the internal id of the bean within the microcontainer</para>
+          </listitem>
+          <listitem>
+            <para>context - the bean context</para>
+          </listitem>
+        </itemizedlist>
+        <important>
+          <para>All context information is wrapped into  unmodifiable objects to prevent the user from changing anything outside of the microcontainer&apos;s control.  </para>
+        </important>
+      </section>
+      <section>
+        <title>Auto-wiring</title>
+        <para>Having to write large amounts of configuration information just to wire together sometimes trivial beans can often be frustrating. For this reason JBoss Microcontainer provides the ability to autowire beans. Auto-wiring means that a bean&apos;s properties or constructor/factory-method parameters are set by automatically searching for matching beans. The benefit is that you don&apos;t have to specify the names of the beans  to inject yourself but the drawback is that this only works reliably for small environments. If you have an environment where more than one bean matches the property or parameter being set then it becomes unclear from the configuration information which one will be chosen during deployment. </para>
+        <para>To use auto-wiring you simply need to specify an @Inject annotation or &lt;inject&gt; element without a <code>bean</code> attribute for the parameter or property that you wish to set.</para>
+        <programlisting role="JAVA">@Inject
+public class Example(ThreadPool pool) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;paramInj&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter name=&quot;threadPool&quot;&gt;&lt;inject/&gt;&lt;/parameter&gt;
+    &lt;/constructor&gt;
+&lt;/bean&gt; </programlisting>
+        <programlisting role="JAVA">@Inject
+public void setThreadPool(ThreadPool pool) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;propInj&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;property name=&quot;threadPool&quot;&gt;&lt;inject/&gt;&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>By default the microcontainer will search for a bean whose class matches that of the parameter/property. However you can change this behaviour when auto-wiring properties so that the microcontainer searches for a bean whose name matches the property name. This is done using the <code>type</code> attribute of the &lt;inject&gt; element.</para>
+        <programlisting role="JAVA">@Inject(type=&quot;ByName&quot;)
+public void setThreadPool(ThreadPool pool) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;propInj&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;property name=&quot;threadPool&quot;&gt;&lt;inject type=&quot;ByName&quot;/&gt;&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>If no match is found then by default the deployment will fail but for certain properties it may be acceptable for injection to occur after deployment. In these cases you can specify that a property should be set using a callback mechanism whenever a suitable bean becomes available. This is done using the <code>option</code> attribute.</para>
+        <programlisting role="JAVA">@Inject(type=&quot;ByName&quot;, option=&quot;Callback&quot;)
+public void setThreadPool(ThreadPool pool) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;propInj&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;property name=&quot;threadPool&quot;&gt;&lt;inject type=&quot;ByName&quot; option=&quot;Callback&quot;/&gt;&lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Sometimes you may want to prevent a bean from being injected automatically using auto-wiring. In these situations you can set its <code>autowire-candidate</code> attribute to false so that it&apos;s not included in the search for matching beans. This is not currently possible using annotations as there is no annotation to declare a bean.</para>
+        <programlisting role="XML">&lt;bean name=&quot;ignored&quot; class=&quot;com.acme.Example&quot; autowire-candidate=&quot;false&quot; /&gt;</programlisting>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Defining dependencies</title>
+      <section>
+        <title>POJO dependencies</title>
+        <para>Dependencies between beans (POJO instances) are created when they are wired together through the use of the @Inject annotation or &lt;inject&gt; element. Specifically a bean which has another bean injected into it is said to be dependent on the other bean. For example here we have a Person bean that is dependent on an Address bean.</para>
+        <programlisting role="JAVA">public class Person {
+    @Inject(bean=&quot;AddressBean&quot;)
+    public void setAddress(Address address) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Person&quot; class=&quot;org.jboss.test.Person&quot;&gt;
+    &lt;property name=&quot;address&quot;&gt;
+        &lt;inject bean=&quot;AddressBean&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>The reason for the dependency is because the address property of the Person bean cannot be configured until the Address bean has been deployed. Internally JBoss Microcontainer enforces this by moving each bean through a series of states during deployment. Consequently the Person bean will be prevented from moving to the CONFIGURED state until the Address bean has reached the INSTALLED state representing a deployed bean.</para>
+        <para>By default there are 8 states that a bean can be in during deployment and undeployment:</para>
+        <itemizedlist>
+          <listitem>
+            <para>NOT_INSTALLED - Metadata describing the bean has been parsed from annotations or a deployment descriptor.</para>
+          </listitem>
+          <listitem>
+            <para>PRE_INSTALL - the scope of the bean within the microcontainer has been discovered and classloading dependencies have been resolved.</para>
+          </listitem>
+          <listitem>
+            <para>DESCRIBED - Any AOP dependencies have been added.</para>
+          </listitem>
+          <listitem>
+            <para>INSTANTIATED -All dependencies have been resolved to construct the bean. These include; a classloader exists, the class can be found, a constructor or factory method can be found and any parameter injections can be resolved.</para>
+          </listitem>
+          <listitem>
+            <para>CONFIGURED - All the property injections can be resolved. This includes any injections within collections.</para>
+          </listitem>
+          <listitem>
+            <para>CREATE - All the beans metioned in the @Depends annotation or &lt;depends&gt; element have reached the CREATE state including any parameter injections in the create method.</para>
+          </listitem>
+          <listitem>
+            <para>START - All the beans metioned in the @Depends annotation or &lt;depends&gt; element have reached the START state including any parameter injections in the start method.</para>
+          </listitem>
+          <listitem>
+            <para>INSTALLED - Any deployment actions have been processed and the bean has been added to the list of items that the controller supplies.</para>
+          </listitem>
+        </itemizedlist>
+        <para>You may notice that we refer to injections being resolved in the above list. This is a shorthand way of saying that an injected bean has reached a certain state. In our simple example we can say that the injected Address bean has been resolved when it reaches the INSTALLED state. If necessary you can change the state that an injected bean must reach before being considered resolved by using the <code>dependentState</code>/<code>state</code> attribute.</para>
+        <programlisting role="JAVA">public class Person {
+    @Inject(bean=&quot;OtherBean&quot;,
+            dependentState=&quot;Instantiated&quot;)
+    public void setAddress(Address address) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Person&quot; class=&quot;org.jboss.test.Person&quot;&gt;
+    &lt;property name=&quot;address&quot;&gt;
+        &lt;inject bean=&quot;Address&quot; state=&quot;Instantiated&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Here we are saying the Address bean needs to reach the INSTANTIATED state before the Person bean can use it to configure the address property and thus move to the CONFIGURED state. Be aware that setting the state value to <code>Described</code> in this case would not be appropriate since we must first have an instance of the Address bean before we can inject a reference to it into another bean.</para>
+        <note>
+          <para>The following six values can be used for the <code>dependentState</code>/<code>state</code> attribute to control injection. If no value is specified then by default the Installed state is used.</para>
+          <itemizedlist>
+            <listitem>
+              <para>Described</para>
+            </listitem>
+            <listitem>
+              <para>Instantiated</para>
+            </listitem>
+            <listitem>
+              <para>Configured</para>
+            </listitem>
+            <listitem>
+              <para>Create</para>
+            </listitem>
+            <listitem>
+              <para>Start</para>
+            </listitem>
+            <listitem>
+              <para>Installed</para>
+            </listitem>
+          </itemizedlist>
+        </note>
+        <para>The ability to control when injection occurs is especially useful when dealing with circular dependencies. A circular dependency happens when one bean depends on another which in turn depends on the first bean:</para>
+        <programlisting role="XML">&lt;bean name=&quot;Circular1&quot; class=&quot;org.jboss.example.InjectionBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;Circular1&lt;/parameter&gt;
+    &lt;/constructor&gt;
+
+    &lt;property name=&quot;other&quot;&gt;
+        &lt;inject bean=&quot;Circular2&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;
+
+&lt;bean name=&quot;Circular2&quot; class=&quot;org.jboss.example.InjectionBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;Circular2&lt;/parameter&gt;
+    &lt;/constructor&gt;
+
+    &lt;property name=&quot;other&quot;&gt;
+        &lt;inject bean=&quot;Circular1&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt; </programlisting>
+        <para>In this configuration the microcontainer is unable to deploy either bean since each one is waiting in the INSTANTIATED state waiting for the other to reach the INSTALLED state. To solve this we can use the <code>state</code> attribute to  specify that Circular1 can be injected into Circular2 as soon as it reaches the INSTANTIATED state. </para>
+        <programlisting role="XML">&lt;bean name=&quot;Circular1&quot; class=&quot;org.jboss.example.InjectionBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;Circular1&lt;/parameter&gt;
+    &lt;/constructor&gt;
+
+    &lt;property name=&quot;other&quot;&gt;
+        &lt;inject bean=&quot;Circular2&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;
+
+&lt;bean name=&quot;Circular2&quot; class=&quot;org.jboss.example.InjectionBean&quot;&gt;
+    &lt;constructor&gt;
+        &lt;parameter&gt;Circular2&lt;/parameter&gt;
+    &lt;/constructor&gt;
+
+    &lt;property name=&quot;other&quot;&gt;
+        &lt;inject bean=&quot;Circular1&quot; state=&quot;Instantiated&quot;/&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Circular2 can thus progress to the INSTALLED state whereupon Circular1 will inject it into its <code>other</code> property and continue deploying.</para>
+      </section>
+      <section>
+        <title>Supply and Demand</title>
+        <para>Sometimes dependencies may exist between beans that are not wired together using injections. One example would be a bean representing a service that requires a transaction manager to be present in JNDI before it can  start. In these situations we can use a @Demand annotation or &lt;demand&gt; element to specify that we need another bean to be deployed before we can reach a certain state.</para>
+        <programlisting role="JAVA">@Demands(@Demand(&quot;TransactionManager&quot;))
+public class Example {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;TransactionManager&quot; class=&quot;com.acme.TransactionManager&quot;/&gt;
+
+&lt;bean name=&quot;Name2&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;demand&gt;TransactionManager&lt;/demand&gt;
+&lt;/bean&gt;</programlisting>
+        <para>By default the bean declaring the demand will wait until the beans it requires have been deployed before it moves to the INSTANTIATED state. However you can change this using the <code>whenRequired</code>/<code>state</code> attribute to specify a different state that can only be reached once all the beans listed as demands have been deployed.</para>
+        <programlisting role="JAVA">@Demands(@Demand(&quot;TransactionManager&quot;, whenRequired=&quot;Start&quot;))
+public class Example {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;TransactionManager&quot; class=&quot;com.acme.TransactionManager&quot;/&gt;
+
+&lt;bean name=&quot;Name2&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;demand state=&quot;Start&quot;&gt;TransactionManager&lt;/demand&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Here we are stating that the TransactionManager bean must be deployed before the Name2 bean can reach the Start state. To specify multiple dependencies on other beans you simply need to list @Demand annotations or nest &lt;demand&gt; elements:</para>
+        <programlisting role="JAVA">@Demands(@Demand(&quot;TransactionManager&quot;, whenRequired=&quot;Start&quot;),
+         @Demand(&quot;OtherBean&quot;))
+public class Example {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;TransactionManager&quot; class=&quot;com.acme.SomeSingleton&quot;&gt;
+    &lt;property name=&quot;host&quot;&gt;http://www.jboss.org&lt;/property&gt;
+&lt;/bean&gt;
+
+&lt;bean name=&quot;Name2&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;demand state=&quot;Start&quot;&gt;TransactionManager&lt;/demand&gt;
+    &lt;demand&gt;OtherBean&lt;/demand&gt;
+&lt;/bean&gt;</programlisting>
+        <para>In addition to specifying dependencies on other beans you can also specify dependencies on arbitrary objects that other beans supply. This can be useful if a bean depends on something  that is provided by multiple beans but doesn&apos;t necessarily care which one provides it. To create these arbitrary objects you need to use the @Supply annotation or &lt;supply&gt; element.</para>
+        <programlisting role="JAVA">@Supplies(@Supply(&quot;SomethingUseful&quot;))
+public class Provider {
+    ...
+}
+
+ at Demands(@Demand(&quot;SomethingUseful&quot;))
+public class Consumer {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Provider&quot; class=&quot;com.acme.Provider&quot;&gt;
+    &lt;supply&gt;SomethingUseful&lt;/supply&gt;
+&lt;/bean&gt;
+
+&lt;bean name=&quot;Consumer&quot; class=&quot;com.acme.Consumer&quot;&gt;
+    &lt;demand&gt;SomethingUseful&lt;/demand&gt;
+&lt;/bean&gt; </programlisting>
+        <para>A bean can also supply multiple objects if necessary:</para>
+        <programlisting role="JAVA">@Supplies(@Supply(&quot;SomethingUseful&quot;),
+          @Supply(&quot;SomethingElse&quot;))
+public class Provider {
+    ...
+}
+
+ at Demands(@Demand(&quot;SomethingUseful&quot;))
+public class Consumer {
+    ...
+}
+
+ at Demand(@Demand(&quot;SomethingElse&quot;))
+public class OtherConsumer {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Provider&quot; class=&quot;com.acme.Provider&quot;&gt;
+    &lt;supply&gt;SomethingUseful&lt;/supply&gt;
+    &lt;supply&gt;SomethingElse&lt;/supply&gt;
+&lt;/bean&gt;
+
+&lt;bean name=&quot;Consumer&quot; class=&quot;com.acme.Consumer&quot;&gt;
+    &lt;demand&gt;SomethingUseful&lt;/demand&gt;
+&lt;/bean&gt;
+
+&lt;bean name=&quot;OtherConsumer&quot; class=&quot;com.acme.Consumer&quot;&gt;
+    &lt;demand&gt;SomethingElse&lt;/demand&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Behind the scenes JBoss Microcontainer creates a bean of type java.lang.Object for each @Supply annotation or &lt;supply&gt; element named after its value. These beans are then moved automatically through all of the states to reach the INSTALLED state and become deployed. From this point onwards the @Demand annotation and &lt;demand&gt; element work in exactly the same way as before, checking to see if the named bean has been deployed before allowing the bean declaring the demand/s to move to a certain state.</para>
+      </section>
+      <section>
+        <title>Service dependencies</title>
+        <para>So far we have considered how POJOs depend on each other either explictly through injections or implicitly through the use of arbitrary objects supplied during deployment. These dependencies help us to assemble POJOs in a well defined order to create services but what about when one service depends on another?</para>
+        <para>Services typically consist of many individual POJOs wired together in order to perform a well-defined function. Once a service is deployed it can be stopped and started as many times as necessary in order to make best use of valuable resources such as CPU and memory. This is possible thanks to the service lifecycle:</para>
+        <itemizedlist>
+          <listitem>
+            <para>create - the service has been deployed</para>
+          </listitem>
+          <listitem>
+            <para>start - the service is started</para>
+          </listitem>
+          <listitem>
+            <para>stop - the service is stopped</para>
+          </listitem>
+          <listitem>
+            <para>destroy - the service is being undeployed</para>
+          </listitem>
+        </itemizedlist>
+        <para>If one service depends on another then we need someway to ensure that they are created and started in the correct order. Similarly we also need to ensure that they are stopped and destroyed correctly. This is done by adding a @Depends annotation or &lt;depends&gt; element to the POJO that defines a service&apos;s public methods and specifying the name of the bean that represents the other service.</para>
+        <programlisting role="JAVA">@Depends(&quot;AnotherBean&quot;)
+public class MyBean {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;AnotherBean&quot; class=&quot;org.jboss.test.Example&quot;/&gt;
+
+&lt;bean name=&quot;MyBean&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;depends&gt;AnotherBean&lt;/depends&gt;
+&lt;/bean&gt;</programlisting>
+        <para>The microcontainer will then ensure that the beans, representing the two services, are deployed in the correct order. Specifically the beans named in the @Depends or &lt;depends&gt; values will reach their CREATE states before the bean declaring the dependencies reaches its CREATE state. The same is true for the START, STOP and DESTROY states. It&apos;s possible to define multiple dependencies on other services simply by listing names or nesting &lt;depends&gt; elements:</para>
+        <programlisting role="JAVA">@Depends(&quot;AnotherBean&quot;, &quot;YetAnotherBean&quot;)
+public class MyBean {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;AnotherBean&quot; class=&quot;org.jboss.test.Example&quot;/&gt;
+
+&lt;bean name=&quot;MyBean&quot; class=&quot;org.jboss.test.Example&quot;&gt;
+    &lt;depends&gt;AnotherBean&lt;/depends&gt;
+    &lt;depends&gt;YetAnotherBean&lt;/depends&gt;
+&lt;/bean&gt;</programlisting>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Adding deployment behaviour</title>
+      <section>
+        <title>Deployment actions</title>
+        <para>In Part I - Getting Started we covered how to add behaviour to beans during the deployment and undeployment process using AOP lifecycle callbacks. This gave us a powerful way to apply common logic to a number of beans, identified using pointcut expressions, at various points in their lifecycles. However setting up AOP lifecycle callbacks for occasions when an individual bean needs to call arbitrary methods  before deployment or after undeployment can be time consuming. Fortunately JBoss Microcontainer provides an alternative way to do this using deployment/undeployment actions.</para>
+        <para>To specify a method within a bean that should be called after the bean reaches the START state you should use the @InstallMethod annotation or &lt;install&gt; element as follows:</para>
+        <programlisting role="JAVA">@InstallMethod
+public String doSomething() {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;install method=&quot;doSomething&quot;/&gt;
+&lt;/bean&gt;</programlisting>
+        <para>Parameters can also be passed in using nested &lt;parameter&gt; elements or by defining values with annotations.</para>
+        <programlisting role="JAVA">@InstallMethod
+public String doSomething(@StringValue(&quot;10&quot;) Integer integer, @StringValue(&quot;my string&quot;) String string) {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;install method=&quot;doSomething&quot;&gt;
+        &lt;parameter&gt;10&lt;/parameter&gt;
+        &lt;parameter&gt;my string&lt;/parameter&gt;
+    &lt;/install&gt;
+&lt;/bean&gt;</programlisting>
+        <para>If necessary multiple install methods can be defined. They will be called in the order in which they appear as annotations or in the deployment descriptor.</para>
+        <programlisting role="JAVA">@InstallMethod
+public String doSomething() {
+    ...
+}
+
+ at InstallMethod
+public String doSomethingElse() {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;install method=&quot;doSomething&quot;/&gt;
+    &lt;install method=&quot;doSomethingElse&quot;/&gt;
+&lt;/bean&gt;</programlisting>
+        <para>During undeployment uninstall methods can also be defined which will be called before the bean reaches the STOP state.</para>
+        <programlisting role="JAVA">@UninstallMethod
+public String doSomething() {
+    ...
+}
+
+ at UninstallMethod
+public String doSomethingElse() {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;uninstall method=&quot;doSomething&quot;/&gt;
+    &lt;uninstall method=&quot;doSomethingElse&quot;/&gt;
+&lt;/bean&gt;</programlisting>
+        <para>If you want a bean to call a method on another bean during deployment or undeployment then you can use the @ExternalInstalls/@ExternalUninstalls annotations or the  <code>bean</code> attribute of the &lt;install&gt;/&lt;uninstall&gt; elements. You can also define parameters to pass in if necessary.</para>
+        <programlisting role="JAVA">@ExternalInstalls(@ExternalInstall(bean=&quot;OtherBean&quot;, method=&quot;doWork&quot;)
+ at ExternalUninstalls(@ExternalInstall(bean=&quot;OtherBean&quot;, method=&quot;doBye&quot;, parameters=&quot;{@Value(string=@StringValue(&quot;Goodbye&quot;)), at Value(string=@StringValue(&quot;Saturday&quot;))}&quot;))
+public class MyBean {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;install bean=&quot;OtherBean&quot; method=&quot;doWork&quot;/&gt;
+    &lt;uninstall bean=&quot;OtherBean&quot; method=&quot;doBye&quot;&gt;
+        &lt;parameter name=&quot;message&quot;&gt;Goodbye&lt;/parameter&gt;
+        &lt;parameter name=&quot;day&quot;&gt;Saturday&lt;/parameter&gt;
+    &lt;/uninstall&gt;
+&lt;/bean&gt;</programlisting>
+        <note>
+          <para>Currently both the @ExternalInstalls and @ExternalUninstalls annotations take a list of @ExternalInstall annotations. </para>
+        </note>
+        <para>By default the other bean must have reached the INSTALLED state before its method will be called. This can be changed by using the <code>dependentState</code>/<code>state</code> attribute.</para>
+        <programlisting role="JAVA">@ExternalInstalls(@ExternalInstall(bean=&quot;OtherBean&quot;, method=&quot;doWork&quot;, dependentState=&quot;Configured&quot;)
+public class MyBean {
+    ...
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;SimpleBean&quot; class=&quot;org.jboss.example.SimpleBean&quot;&gt;
+    &lt;install bean=&quot;OtherBean&quot; method=&quot;doWork&quot; state=&quot;Configured&quot;/&gt;
+&lt;/bean&gt;</programlisting>
+      </section>
+      <section>
+        <title>Deployment callbacks</title>
+        <para>Sometimes it is useful for a bean to know when other beans have been deployed. For example a manager bean might want to keep a list of all of the beans it manages. Rather than placing code into each managed bean to register itself with the manager when deployed, it would be better if the manager was automatically  called back each time to notify it. JBoss Microcontainer allows such callbacks to occur during deployment and undeployment using the @Install/@Uninstall annotations and &lt;incallback&gt;/&lt;uncallback&gt; elements.</para>
+        <note>
+          <para>&lt;incallback&gt; is an abbreviation of installCallback and &lt;uncallback&gt; is an abbreviation of uninstallCallback.</para>
+        </note>
+        <programlisting role="JAVA">public class Example {
+    @Install
+    public void addEditor(Editor editor) {
+        ...
+    }
+
+    @Uninstall
+    public void removeEditor(Editor editor) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;editorHolder&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;incallback method=&quot;addEditor&quot;/&gt;
+    &lt;uncallback method=&quot;removeEditor&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>In the above example the addEditor method of the editorHolder bean will be called each time a bean of class Editor is deployed. Similarly the removeEditor method will be called each time a bean of class Editor is undeployed. By default the bean class to look for is determined by the class of the parameter in the callback method. If there are multiple methods with the same name but different parameter types then you can  add a <code>signature</code> attribute to the &lt;incallback&gt;/&lt;uncallback&gt; element to specify the correct one. This is not required when using annotations as we simply annotate the method we want.</para>
+        <programlisting role="JAVA">public class Example {
+    public void addEditor(Editor editor) {
+        ...
+    }
+
+    @Install
+    public void addEditor(DifferentEditor editor) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;editorHolder&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;incallback method=&quot;addEditor&quot; signature=&quot;org.jboss.example.DifferentEditor&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Multiple callback methods can be defined per bean. They will be called in the order that they appear as annotations or in the deployment descriptor.</para>
+        <programlisting role="JAVA">public class Example {
+    @Install
+    public void addEditor(Editor editor) {
+        ...
+    }
+
+    @Install
+    public void addViewer(Viewer viewer) {
+        ...
+    }
+
+    @Uninstall
+    public void removeEditor(Editor editor) {
+        ...
+    }
+
+    @Uninstall
+    public void removeViewer(Viewer viewer) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;editorHolder&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;incallback method=&quot;addEditor&quot;/&gt;
+    &lt;incallback method=&quot;addViewer&quot;/&gt;
+    &lt;uncallback method=&quot;removeEditor&quot;/&gt;
+    &lt;uncallback method=&quot;removeViewer&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>By default each callback will be executed when beans matching the parameter types reach the INSTALLED state. This can be changed if necessary using the <code>dependentState</code>/<code>state</code> attribute.</para>
+        <programlisting role="JAVA">public class Example {
+    @Install(dependentState=&quot;Configured&quot;)
+    public void addEditor(Editor editor) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;editorHolder&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;incallback method=&quot;addEditor&quot; state=&quot;Configured&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Here we are declaring that the addEditor method of the editorHolder bean should be called when any beans of class Editor reach the CONFIGURED state.</para>
+        <para>It is also possible to  configure when the callback methods are executed during the deployment of the bean using the <code>whenRequired</code> attribute.</para>
+        <programlisting role="JAVA">public class Example {
+    @Install(whenRequired=&quot;Installed&quot;)
+    public void addEditor(Editor editor) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;editorHolder&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;incallback method=&quot;addEditor&quot; whenRequired=&quot;Installed&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Here we are declaring that the addEditor method will be called before the editorHolder bean reaches the INSTALLED state. By default the callbacks are exceuted before the bean reaches the CONFIGURED state.</para>
+        <para>Finally we can also control when the callback methods are executed depending on how many beans matching the parameter class have been deployed. This is done using the <code>cardinality</code> attribute.</para>
+        <programlisting role="JAVA">public class Example {
+    @Install(cardinality=&quot;2..n&quot;)
+    public void addEditor(Editor editor) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;editorHolder&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;incallback method=&quot;addEditor&quot; cardinality=&quot;2..n&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Here we are declaring that the addEditor method of the editorHolder bean will only be called when two or more  beans of class Editor have been deployed.</para>
+        <note>
+          <para>When using callbacks with collection classes as parameters only the following basic interfaces are currently supported; List, Set and Queue. This is done using the <code>BasicCollectionCallbackItemFactory</code> implementation. You can change this if required by setting the <code>org.jboss.dependency.collectionCallbackItemFactory</code> system property to the fully-qualified class name of your <code>CollectionCallbackItemFactory</code> implementation.</para>
+        </note>
+      </section>
+      <section>
+        <title>Service lifecycle</title>
+        <para>So far we have discussed how to define deployment/undeployment actions for beans together with callback methods for notification when other beans have been deployed/undeployed. These features are useful for adding behaviours to POJOs but what about adding behaviour to services?</para>
+        <para>As explained in the previous chapter services have a lifecycle consisting of 4 stages; create, start, stop and destroy. The reason for this is because we want the ability to start and stop a deployed service repeatably at runtime to make best use of valuable resources such as CPU and memory. At each point in this lifecycle the microcontainer will look for a method to call in order to perform appropriate actions. For example starting a service may require that an object is bound into JNDI. By default these methods are named after the lifecycle stage that they represent.</para>
+        <programlisting role="JAVA">public class LifecycleBean {
+    public void create() {
+        ...
+    }
+
+    public void start() {
+        ...
+    }
+
+    public void stop() {
+        ...
+    }
+
+    public void destroy() {
+        ...
+    }
+} </programlisting>
+        <para>If methods like these are defined in your bean then they will be called as the bean is deployed and undeployed. Specifically the create and start methods are called as the bean reaches the CREATE and START states during deployment. The stop and destroy methods are called when the bean passes through the START and CREATE states during undeployment. Only those methods that are defined will be called. For example if you omit the start method then the bean will move to the START state without anything happening.</para>
+        <para>If you want a different method to be called for any of the  stages then you can provide an annotation or XML element to specify which one to use.</para>
+        <programlisting role="JAVA">public class Example {
+    @Create
+    public void initialize() {
+        ...
+    }
+
+    @Start
+    public void go() {
+        ...
+    }
+
+    @Stop
+    public void halt() {
+        ...
+    }
+
+    @Destroy
+    public void remove() {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Name1&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;create method=&quot;initialize&quot;/&gt;
+    &lt;start method=&quot;go&quot;/&gt;
+    &lt;stop method=&quot;halt&quot;/&gt;
+    &lt;destroy method=&quot;remove&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+        <para>You can also specify parameters if necessary.</para>
+        <programlisting role="JAVA">public class Example {
+    @Start
+    public void go(@StringValue(&quot;MyService&quot;) String serviceName,
+                   @StringValue(&quot;5&quot;) Integer priority) {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Name1&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;start method=&quot;go&quot;&gt;
+        &lt;parameter&gt;MyService&lt;/parameter&gt;
+        &lt;parameter&gt;5&lt;/parameter&gt;
+    &lt;/start&gt;
+&lt;/bean&gt; </programlisting>
+        <para>Sometimes you may want lifecycle methods to be ignored. This can be done using the <code>ignore</code> attribute which if set to true prevents the microcontainer from calling the method when the corresponding lifecycle stage is reached.</para>
+        <programlisting role="JAVA">public class Example {
+    @Stop(ignored=&quot;true&quot;)
+    public void halt() {
+        ...
+    }
+}</programlisting>
+        <programlisting role="XML">&lt;bean name=&quot;Name1&quot; class=&quot;com.acme.Example&quot;&gt;
+    &lt;start method=&quot;stop&quot; ignored=&quot;true&quot;/&gt;
+&lt;/bean&gt; </programlisting>
+      </section>
+    </chapter>
+  </part>
+  <part>
+    <title>AOP Development</title>
+    <chapter>
+      <title>Introduction</title>
+    </chapter>
+    <chapter>
+      <title>Configuration</title>
+    </chapter>
+    <chapter>
+      <title>Using Aspects</title>
+    </chapter>
+    <chapter>
+      <title>Using Lifecycle Callbacks</title>
+    </chapter>
+    <chapter>
+      <title>AOP Dependencies</title>
+    </chapter>
+  </part>
+  <part>
+    <title>The Deployment Framework</title>
+    <chapter>
+      <title>Introduction</title>
+      <para>JBoss Microcontainer at its core allows POJOs to be deployed into a runtime environment. It  does this using a state machine to ensure that any dependencies on classloaders or other POJOs are satisfied  before progressing through the various stages of creation and configuration.  By design the state machine and dependency mechanisms are generic which means that we can also use them to deploy other types of runtime components such as MBeans or OSGi bundles. In order to do this we need a generic deployment framework to  create the relevant metadata, handle different kinds of deployable components, and deal with any nested deployments.</para>
+      <para>To understand why we cannot achieve this using the  BasicXMLDeployer let&apos;s take a closer look at what it actually does:</para>
+      <programlisting role="JAVA">public class BasicXMLDeployer extends BasicKernelDeployer
+{
+   ...
+
+   public KernelDeployment deploy(final URL url) throws Throwable
+   {
+      final boolean trace = log.isTraceEnabled();
+
+      if (url == null)
+         throw new IllegalArgumentException(&quot;Null url&quot;);
+
+      if (trace)
+         log.trace(&quot;Parsing &quot; + url);
+
+      long start = System.currentTimeMillis();
+   
+      Unmarshaller unmarshaller = factory.newUnmarshaller();
+      KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver);
+
+      if (deployment == null)
+          throw new RuntimeException(&quot;The xml &quot; + url + &quot; is not well formed!&quot;); 
+
+      deployment.setName(url.toString());
+
+      if (trace)
+      {
+         long now = System.currentTimeMillis();
+         log.trace(&quot;Parsing &quot; + url + &quot; took &quot; + (now-start) + &quot; milliseconds&quot;);
+      }
+
+      deploy(deployment);
+
+      if (trace)
+      {
+         long now = System.currentTimeMillis();
+         log.trace(&quot;Deploying &quot; + url + &quot; took &quot; + (now-start) + &quot; milliseconds&quot;);
+      }
+
+      return deployment;
+   }
+
+   ...
+}</programlisting>
+      <para>Once we call the deploy() method with a URL to the XML deployment descriptor an unmarshaller is created to convert the XML into an object representation of type KernelDeployment. We then process the KernelDeployment using the deploy() method of the superclass BasicKernelDeployer: </para>
+      <programlisting role="JAVA">public class BasicKernelDeployer extends AbstractKernelDeployer
+{
+    ...
+
+   public void deploy(KernelDeployment deployment) throws Throwable
+   {
+      ...
+      super.deploy(deployment);
+      deployments.add(deployment);
+      ...
+   }
+
+    ...
+
+   public void shutdown()
+   {
+      ListIterator iterator = deployments.listIterator(deployments.size());
+      while (iterator.hasPrevious())
+      {
+         KernelDeployment deployment = (KernelDeployment) iterator.previous();
+         undeploy(deployment);
+      }
+   }
+}</programlisting>
+      <para>As you can see the BasicKernelDeployer simply calls the deploy() method of its superclass AbstractKernelDeployer before adding the deployment to a list.</para>
+      <note>
+        <para>The reason for having  BasicKernelDeployer is that it contains a shutdown() method which undeploys all the deployments in reverse order. This allows the microcontainer to shutdown gracefully.</para>
+      </note>
+      <programlisting role="JAVA">public class AbstractKernelDeployer
+{
+    ...
+   public void deploy(final KernelDeployment deployment) throws Throwable
+   {
+      if (deployment.isInstalled())
+         throw new IllegalArgumentException(&quot;Already installed &quot; + deployment.getName());
+
+      try
+      {
+         deployBeans(controller, deployment);
+         deployment.setInstalled(true);
+      }
+      catch (Throwable t)
+      {
+         undeploy(deployment);
+         throw t;
+      }
+   }
+
+   ...
+
+   protected void deployBeans(KernelController controller, KernelDeployment deployment) throws Throwable
+   {
+      List&lt;BeanMetaData&gt; beans = deployment.getBeans();
+      if (beans != null)
+      {
+         for (BeanMetaData metaData : beans)
+         {
+            KernelControllerContext context = deployBean(controller, deployment, metaData);
+            deployment.addInstalledContext(context);
+         }
+      }
+   }
+
+   protected KernelControllerContext deployBean(KernelController controller, KernelDeployment deployment, BeanMetaData bean) throws Throwable
+   {
+      KernelControllerContext context = new AbstractKernelControllerContext(null, bean, null);
+      if (requiredState != null)
+         context.setRequiredState(requiredState);
+      if (mode != null)
+         context.setMode(mode);
+      // Use any deployment classloader if present and the bean doesn&apos;t have one
+      ClassLoaderMetaData beanClassLoader = bean.getClassLoader();
+      if (beanClassLoader == null &amp;&amp; deployment != null)
+      {
+         ClassLoaderMetaData deploymentClassLoader = deployment.getClassLoader();
+         if (deploymentClassLoader != null)
+            bean.setClassLoader(deploymentClassLoader);
+      }
+      controller.install(context);
+      return context;
+   }
+
+    ...
+}</programlisting>
+      <para>The deploy() method in AbstractKernelDeployer performs a check to see if the deployment has already been installed before calling deployBeans() to split it up into the individual BeanMetaData instances. These are then deployed into the runtime environment using the deployBean() method which creates a KernelControllerContext for each BeanMetaData and installs it into the controller. It also takes care of deciding which classloader to use based on information  contained in the KernelDeployment object. For example if the bean doesn&apos;t declare a classloader of its own then the deployment classloader (if defined) is used instead.</para>
+      <para>The type hierarchy of BasicXMLDeployer  restricts it to processing bean deployments of type KernelDeployment where each bean is represented by an instance of BeanMetaData. If we want to deploy other runtime components such as MBeans or OSGi bundles then we need to deal with other types of metadata and find a generic way to represent deployments containing them. Furthermore we need to find a flexibile way to process these deployments since each would have its own set of actions that need to take place. For example MBeans need to be registered with an MBean server before they can be considered &apos;deployed&apos;.</para>
+      <para>It turns out that we can use the state machine to meet these requirements by creating a DeploymentControllerContext to represent a deployment in the same way that a KernelControllerContext represents a POJO. This allows us to associate a number of deployment actions to different stages of the deployment process:</para>
+      <itemizedlist>
+        <listitem>
+          <para>PARSE - convert one or more  deployment descriptors into object representations containing metadata</para>
+        </listitem>
+        <listitem>
+          <para>DESCRIBE - determine any dependencies</para>
+        </listitem>
+        <listitem>
+          <para>CLASSLOADER - create classloaders</para>
+        </listitem>
+        <listitem>
+          <para>POST_CLASSLOADER - apply AOP changes together with any other bytecode manipulations</para>
+        </listitem>
+        <listitem>
+          <para>REAL - process the deployment components</para>
+        </listitem>
+      </itemizedlist>
+      <para>As the state machine controller takes a DeploymentControllerContext through each of these stages it calls the associated actions to perform the relevant work. For example we could create multiple parsing actions; one to parse XML files and another to parse Java property files. Depending on the file suffix of the deployment descriptor; .xml or .property we can then choose which one to use during the PARSE stage.</para>
+      <para>Deployments are represented by  DeploymentContexts  which can be formed into  a hierarchy to represent  nested deployments of any depth. A reference to the top-level DeploymentContext is contained in the DeploymentControllerContext:</para>
+      <programlisting role="JAVA">public class DeploymentControllerContext extends AbstractControllerContext
+{
+   /** The deployment context */
+   private DeploymentContext deploymentContext;
+   
+   public DeploymentControllerContext(DeploymentContext context, DeployersImpl deployers)
+   {
+      super(context.getName(), deployers);
+      this.deploymentContext = context;
+      setMode(ControllerMode.MANUAL);
+   }
+
+   public DeploymentContext getDeploymentContext()
+   {
+      return deploymentContext;
+   }
+}</programlisting>
+      <warning>
+        <para>Be careful not to get confused with the names of these types; DeploymentControllerContext and DeploymentContext, as they are very similar. </para>
+      </warning>
+      <para>As deployment descriptors do not always describe runtime components directly, the notion of a deployment component is defined. For example an EJB deployment descriptor may describe a number of EJB containers from which individual EJBs are created. Here we refer to both the EJB containers and EJBs as  <emphasis>deployment components</emphasis> but   only the EJBs are thought of as  <emphasis>runtime components</emphasis>. Deployment components are represented by an implementation of DeploymentContext called ComponentDeploymentContext which allows  them to be hierarchical to any depth. For example an EJB container ComponentDeploymentContext could have multiple child ComponentDeploymentContexts representing its EJBs. Deployment components are added/removed to and from  their containing deployment or parent deployment component and retrieved for processing using the following methods:</para>
+      <programlisting role="JAVA">public class ComponentDeploymentContext implements DeploymentContext
+{
+   ...
+
+   boolean isComponent() {
+      return true;
+   }
+   
+   List&lt;DeploymentContext&gt; getComponents() {
+      return Collections.unmodifiableList(components);
+   }
+
+   void addComponent(DeploymentContext component) {
+      ...
+      components.add(component);
+   }
+
+
+   boolean removeComponent(DeploymentContext component) {
+      ...
+      boolean result = components.remove(component);
+      component.cleanup();
+      return result;
+   }
+
+   ...
+}</programlisting>
+      <para>The deployment framework is therefore a collection of packages and classes that provides a generic way to represent deployments containing arbitrary <emphasis>deployment components</emphasis>. These  could be  runtime components such as POJOs, MBeans, and EJBs or non-runtime components such as EJB containers which act as factories for the EJBs. Deployments and deployment components can be  nested within one another to any depth providing maximum flexibility during deployment.</para>
+      <para>Consequently it&apos;s possible to use the deployment framework instead of the BasicXMLDeployer to deploy POJO-based services specified with XML deployment descriptors. So why then do we need a BasicXMLDeployer? The answer is because the deployment framework itself a POJO-based service specified with  an XML deployment descriptor (usually called <emphasis>bootstrap-beans.xml</emphasis>). We therefore need the BasicXMLDeployer to deploy it  when the microcontainer is booted up. Once deployed then the framework is used to deploy everything else including any other POJO-based services.</para>
+      <para>Now that you understand the reasoning for the deployment framework and how it relates to the BasicXMLDeployer  the following sections go on the cover the various parts in more detail.</para>
+    </chapter>
+    <chapter>
+      <title>The Virtual File System</title>
+      <para>When you think about it all deployments can be broken down into three types of data: </para>
+      <itemizedlist>
+        <listitem>
+          <para>Deployment descriptors - contain configuration information</para>
+        </listitem>
+        <listitem>
+          <para>Java classes - contain compiled Java bytecode</para>
+        </listitem>
+        <listitem>
+          <para>Resources - any other files that are required at runtime</para>
+        </listitem>
+      </itemizedlist>
+      <para>Sometimes only a single deployment descriptor is required although more often you create a deployment archive containing one or more descriptors together with a number of classes. In the case of a Web Archive (WAR) we also include any  resources that are to be hosted by the web server.</para>
+      <para>During development it is convenient to be able to deploy such archives in an unpackaged rather than a packaged  state. This means that files can be freely edited in their  directories  and the deployment processed again without having to re-package everything each time. Packaging is usually more appropriate during the  test phase or when going to production as a way of keeping everything together.</para>
+      <para>Depending on the layout of the development, test or production system it&apos;s helpful to allow the deployment of packaged or unpackaged archives both locally, on the computer&apos;s hard drive, or remotely over a network. Support for nested deployments is also important so that related items can be deployed together.</para>
+      <para>To allow all of these concerns to be addressed in a maintainable and extendable way the deployment framework uses a Virtual File System (VFS).  This provides a way to represent a deployment as a read-only hierarchical file system regardless of whether it is packaged or not. It also allows deployments to be accessed both locally and remotely using a pluggable  design so that new protocols can easily be added to those supplied by default:</para>
+      <itemizedlist>
+        <listitem>
+          <para>File - </para>
+        </listitem>
+        <listitem>
+          <para>JAR - </para>
+        </listitem>
+        <listitem>
+          <para>Memory - </para>
+        </listitem>
+      </itemizedlist>
+      <para>Finally the VFS takes care of generating physical URLs for classloading and debugging. Logical URLs can also be generated for configuration purposes, or codebase protection domains.</para>
+    </chapter>
+    <chapter>
+      <title>Identifying the deployment structure</title>
+      <para>Before we can begin to process a deployment we must first determine its structure. This means finding out if it contains any deployment descriptors and/or classes, and if so where they are located relative to the deployment&apos;s root. Nested deployments must also be detected and their structures determined in the same way. The purpose of this is to help the parsing  actions locate the deployment descriptors in a standard way and to assist in the creation of classloaders. Since we wish to  use the Virtual File System (VFS) to represent our deployment we must first create a VFSDeployment using the deployment URI or URL:</para>
+      <programlisting role="JAVA">VirtualFile root = VFS.getRoot(deploymentURL);     
+VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+Deployment deployment = deploymentFactory.createVFSDeployment(root);</programlisting>
+      <para>The deployment framework then determines the structure of the <emphasis>Deployment</emphasis> using classes that implement the <emphasis>StructureDeployer</emphasis> interface:</para>
+      <programlisting role="JAVA">public interface StructureDeployer extends Ordered
+{
+boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException;
+}</programlisting>
+      <para>As a deployment can contain nested deployments the determineStructure() method is meant to be called recursively. The <emphasis>root</emphasis> parameter represents the root of the top-level deployment, the <emphasis>file</emphasis> parameter represents the root of the current (possibly nested) deployment being analyzed and the <emphasis>parent</emphasis> parameter its parent (or null if it is the top-level). The <emphasis>deployers</emphasis> parameter represents a class containing a list of all the <emphasis>StructureDeployer</emphasis> implementations and is needed in order to process any nested deployments.</para>
+      <para>As each deployment is found  a <emphasis>ContextInfo</emphasis> object is created to store the paths to any  deployment descriptors and/or classes. These are then added to the <emphasis>StructureMetaData</emphasis> parameter so that the structure of the entire deployment is recorded. For example if we had a top-level deployment containing 2 nested deployments then we would create 3 <emphasis>ContextInfo</emphasis> objects, one for each deployment, and add these to the <emphasis>StructureMetaData</emphasis> object.</para>
+      <section>
+        <title>Deployment Descriptors</title>
+        <para>Deployment descriptors are files containing  configuration information for deployments. They are detected using the <emphasis>FileStructure</emphasis> class by matching the file suffix or using a <emphasis>FileMatcher</emphasis>. Default file suffixes include:</para>
+        <itemizedlist>
+          <listitem>
+            <para>-beans.xml - contains  bean definitions</para>
+          </listitem>
+          <listitem>
+            <para>-aop.xml - contains  aspect definitions</para>
+          </listitem>
+          <listitem>
+            <para>-service.xml - contains mbean definitions</para>
+          </listitem>
+          <listitem>
+            <para>-ds.xml - contains JCA datasource definitions</para>
+          </listitem>
+        </itemizedlist>
+        <para>Each <emphasis>FileMatcher</emphasis> must implement the following interface:</para>
+        <programlisting role="JAVA">public interface FileMatcher
+{
+   boolean isDeployable(VirtualFile file);
+}</programlisting>
+        <para>Default implementations are:</para>
+        <itemizedlist>
+          <listitem>
+            <para>BshFileMatcher - checks whether the filename ends with .bsh (Bean Shell)</para>
+          </listitem>
+        </itemizedlist>
+        <para>The purpose of the <emphasis>FileStructure</emphasis> class is to detect deployments that consist  of a single deployment descriptor.  As such it creates a single <emphasis>ContextInfo</emphasis> object when a known file is found and adds this to the <emphasis>StructureMetaData</emphasis>. Since no classes are present the list of classpaths within the <emphasis>ContextInfo</emphasis> is set to null.</para>
+        <warning>
+          <para>Currently any top-level deployment that consists of a single file is always identified as a known deployment descriptor. This is done to avoid having to specify all of the known file suffixes in a configuration file. The file suffix and FileMatcher checks are only performed for nested deployments.</para>
+          <para>As the FileStructure class has a relative order of Integer.MAX_VALUE it is always called after any other <emphasis>StructureDeployer</emphasis> implementations such as JARStructure. This means that a deployment  consisting of a single JAR file will be detected correctly. </para>
+        </warning>
+        <para>Deployment descriptors that form part of a deployment together with other files, such as classes or resources are detected by other implementations of <emphasis>StructureDeployer</emphasis> such as<emphasis>JARStructure</emphasis> which is described next.</para>
+      </section>
+      <section>
+        <title>Java Archives (JARs)</title>
+        <para>The <emphasis>JARStructure</emphasis> class determines whether a deployment, in the form of a file or a directory, represents a packaged or unpackaged JAR archive. If the deployment is a single file then the filename suffix is checked against a list contained in the <emphasis>JarUtils</emphasis> class:</para>
+        <itemizedlist>
+          <listitem>
+            <para>.zip - a standard archive</para>
+          </listitem>
+          <listitem>
+            <para>.jar - a java archive (defined by the Java SE specification)</para>
+          </listitem>
+          <listitem>
+            <para>.ear - an enterprise archive (defined by the Java EE specification)</para>
+          </listitem>
+          <listitem>
+            <para>.rar - a resource archive (defined by the Java EE specification)</para>
+          </listitem>
+          <listitem>
+            <para>.war - a web archive (defined by the Java EE specification)</para>
+          </listitem>
+          <listitem>
+            <para>.sar - a service archive (defined by JBoss)</para>
+          </listitem>
+          <listitem>
+            <para>.har - a hibernate archive (defined by JBoss)</para>
+          </listitem>
+          <listitem>
+            <para>.aop - an aspect archive (defined by JBoss)</para>
+          </listitem>
+        </itemizedlist>
+        <para>If the deployment is a directory then the same check is performed using the directory name. If a match is found in either case then the deployment is determined to represent a JAR archive.</para>
+        <note>
+          <para>A top-level directory whose name doesn&apos;t match any of the file suffixes is still considered  an unpackaged JAR archive as this allows it to be used as a container for multiple nested deployments.</para>
+        </note>
+        <para>In order to detect nested JAR deployments we iterate through all subdirectories checking whether their names end in a known suffix or if they contain META-INF directories. The check for a META-INF directory is required otherwise every subdirectory without a known filename would be classified as a nested deployment.</para>
+        <para>For each JAR deployment found we create a new <emphasis>ContextInfo</emphasis> object with its metadata path set to META-INF and the classpath set to the deployment root.</para>
+      </section>
+      <section>
+        <title>Nested deployments</title>
+        <para>Nested deployments are found by calling the addAllChildren() method in <emphasis>AbstractStructureDeployer</emphasis> and passing in a reference to the deployment root and the current nested deployment along with the <emphasis>StructureMetaData</emphasis> and  <emphasis>VFSStructuralDeployers</emphasis> references: </para>
+        <programlisting role="JAVA">public abstract class AbstractStructureDeployer implements StructureDeployer
+{
+    ...
+
+   protected void addAllChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers) throws Exception
+   {
+      addChildren(root, parent, metaData, deployers, null);
+   }
+
+   protected void addChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception
+   {
+      if (parent == null)
+         throw new IllegalArgumentException(&quot;Null parent&quot;);
+      
+      VirtualFileVisitor visitor = candidateStructureVisitorFactory.createVisitor(root, parent, metaData, deployers, attributes);
+      parent.visit(visitor);
+   }
+
+    ...
+}</programlisting>
+        <para>This in turn calls the addChildren() method which creates a <emphasis>VirtualFileVisitor</emphasis> that is passed to the virtual file representing the current deployment. Each child file or directory of the current deploment is then visited using the visitor which use the <emphasis>VFSStructuralDeployers</emphasis> object to iterate through the list of <emphasis>StructureDeployers</emphasis>. These then  determine whether the child represents a nested deployment. If a nested deployment is found then the process is repeated in order to recurse through the entire directory structure. This happens regardless of whether the deployment is packaged or unpackaged as the Virtual File System takes care of accessing the actual files.</para>
+        <para>Due to this recursive algorithm you can freely nest any type of deployment within any other type of deployment to any level. There is one exection to this with WAR archives which cannot contain nested deployments. All you need to ensure is that you have defined a <emphasis>StructureDeployer</emphasis> implementation capable of recognising your deployment.</para>
+      </section>
+      <section>
+        <title>Declaring a custom deployment structure</title>
+        <para>JBoss Microcontainer provides two <emphasis>StructureDeployer</emphasis> implementations out-of-the-box to recognise the most common forms of deployments; standalone deployment descriptors and packaged/unpackaged JAR archives. In addition it also includes a third implementation called <emphasis>DeclaredStructure</emphasis>.</para>
+        <para><emphasis>DeclaredStructure</emphasis> allows you to specify the structure of a deployment, including any nested deployments, using an XML file called <emphasis>jboss-structure.xml</emphasis> placed in the  deployment&apos;s META-INF directory. The contents of this file are:</para>
+        <programlisting role="XML">&lt;structure&gt;
+    &lt;context&gt;
+        &lt;path name=&quot;&quot;/&gt;
+        &lt;metaDataPath&gt;
+            &lt;path name=&quot;OTHER-DIR&quot;/&gt;
+        &lt;/metaDataPath&gt;
+        &lt;classpath&gt;
+            &lt;path name=&quot;&quot;/&gt;
+        &lt;/classpath&gt;
+    &lt;/context&gt;
+&lt;/structure&gt;</programlisting>
+        <para>This describes a top-level deployment and specifies that deployment descriptors can be found in the <emphasis>OTHER-DIR</emphasis> directory and classes in the root directory. If you want to describe nested deployments then you simply need to create additional &lt;context&gt; elements and specify their  paths relative to the root deployment:</para>
+        <programlisting role="XML">&lt;structure&gt;
+    &lt;context&gt;
+        &lt;path name=&quot;&quot;/&gt;
+        &lt;metaDataPath&gt;
+            &lt;path name=&quot;OTHER-DIR&quot;/&gt;
+        &lt;/metaDataPath&gt;
+        &lt;classpath&gt;
+            &lt;path name=&quot;&quot;/&gt;
+        &lt;/classpath&gt;
+    &lt;/context&gt;
+    &lt;context&gt;
+        &lt;path name=&quot;nestedDeployment1&quot;/&gt;
+        &lt;metaDataPath&gt;
+            &lt;path name=&quot;descriptors/xml/&quot;/&gt;
+        &lt;/metaDataPath&gt;
+        &lt;classpath&gt;
+            &lt;path name=&quot;classes&quot;/&gt;
+            &lt;path name=&quot;thirdParty/classes&quot;/&gt;
+        &lt;/classpath&gt;
+    &lt;/context
+    &lt;context&gt;
+        &lt;path name=&quot;utils/nestedDeployment2&quot;/&gt;
+        &lt;metaDataPath&gt;
+            &lt;path name=&quot;META-INF&quot;/&gt;
+            &lt;path name=&quot;config/descs/&quot;/&gt;
+        &lt;/metaDataPath&gt;
+        &lt;classpath&gt;
+            &lt;path name=&quot;lib&quot;/&gt;
+        &lt;/classpath&gt;
+    &lt;/context
+&lt;/structure&gt;</programlisting>
+        <para>Here we&apos;ve added two nested deployments, one directly underneath the top-level deployment and another in a subdirectory called utils. The first nested deployment has deployment descriptors located in its <emphasis>descriptors/xml</emphasis> directory and classes  in either the <emphasis>classes</emphasis> or <emphasis>thirdParty/classes</emphasis> directories. The second nested deployment has deployment descriptors in either the <emphasis>META-INF</emphasis> or <emphasis>config/descs</emphasis> directories and classes in the <emphasis>lib</emphasis> directory.</para>
+        <note>
+          <para>In order to ensure that any JAR files that you add META-INF/jboss-structure.xml to are correctly recognised by  <emphasis>DeclaredStructure</emphasis>  instead of  <emphasis>JARStructure</emphasis> the DeclaredStructure  has a relativeOrder of 0 and the JARStructure a relativeOrder of 10000. This means that the DeclaredStructure class will be consulted first when determining the structure of a deployment.</para>
+        </note>
+        <para>If you use the <emphasis>DeclaredStructure</emphasis> approach then you must specify all nested deployments in the <emphasis>META-INF/jboss-structure.xml</emphasis> file. This is because no recursion takes place once the structure has been determined. If you want the ability to nest other kinds of deployments within your custom deployment structure then it may be easier to create your own <emphasis>StructureDeployer</emphasis> implementation. Doing so will allow you to call the addAllChildren() method to perform the recursion. </para>
+      </section>
+      <section>
+        <title>Determining the deployment structure programmatically</title>
+        <para>Using the <emphasis>DeclaredStructure</emphasis> approach is convenient if you have an unusual deployment structure and don&apos;t mind adding the <emphasis>META-INF/jboss-structure.xml</emphasis> file to your deployment. However, if you have many deployments and want to avoid adding this file each time, or  you want to nest arbitrary deployments inside your custom structure then you are better off creating your own <emphasis>StructureDeployer</emphasis> implementation.</para>
+        <para>The easiest way to do this is by extending the <emphasis>AbstractStructureDeployer</emphasis> class which already implements the <emphasis>StructureDeployer</emphasis> interface:</para>
+        <programlisting role="JAVA">public abstract class AbstractStructureDeployer implements StructureDeployer
+{
+   ...
+}</programlisting>
+        <para>This includes helper methods to see if a VirtualFile represents a file or a directory and whether it corresponds to a top-level deployment. It also has methods to recurse through all of the files within a deployment to find nested deployments and to create <emphasis>ContextInfo</emphasis> objects for each one found. The only method that you need to implement is the one defined by the <emphasis>StructureDeployer</emphasis> interface:</para>
+        <programlisting role="JAVA">public interface StructureDeployer extends Ordered
+{
+   boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException;
+}</programlisting>
+        <para>If you recognise the structure of the deployment then you must create a <emphasis>ContextInfo</emphasis> object containing the details and add it to the <emphasis>StructureMetaData</emphasis>. If you extend AbstractStructureDeployer then you can use the createContext() and addClassPath() helper methods to help do this. You must then return true to prevent any other <emphasis>StructureDeployer</emphasis> from analysing the deployment again.</para>
+        <para>If you want to control when your <emphasis>StructureDeployer</emphasis> is called you can use the <emphasis>relativeOrder</emphasis> property. By default this is set to <code>Integer.MAX_VALUE</code> in <emphasis>AbstractStructureDeployer</emphasis>. Implementations with a lower value are called before those with a higher value. If two values are the same then the return values of each implementation&apos;s toString() method are compared.  The relativeOrder values for the out-of-the-box <emphasis>StructureDeployer</emphasis> implementations are:</para>
+        <itemizedlist>
+          <listitem>
+            <para>DeclaredStructure - 0</para>
+          </listitem>
+          <listitem>
+            <para>JARStructure - 10000</para>
+          </listitem>
+          <listitem>
+            <para>FileStructure - Integer.MAX_VALUE</para>
+          </listitem>
+        </itemizedlist>
+        <para>This means that DeclaredStructure is always called first followed by JARStructure and finally FileStructure.</para>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Creating Deployment Contexts</title>
+      <section>
+        <title>Introduction</title>
+        <para>Once the structure of a deployment has been determined then the next step is to create a number of <emphasis>DeploymentContext</emphasis> objects. A <emphasis>DeploymentContext</emphasis> is required for each deployment, whether top-level or nested, in order to store information such as:</para>
+        <itemizedlist>
+          <listitem>
+            <para>the location of any deployment descriptors - the metadata path</para>
+          </listitem>
+          <listitem>
+            <para>the location of any classes - the classpath</para>
+          </listitem>
+          <listitem>
+            <para>the relative path to the top-level deployment - the relative path</para>
+          </listitem>
+          <listitem>
+            <para>the deployment name</para>
+          </listitem>
+          <listitem>
+            <para>the order it should be deployed in relative to other  deployments - the relative order</para>
+          </listitem>
+          <listitem>
+            <para>a list of deployment types that it represents (including nested deployments) - the types</para>
+          </listitem>
+          <listitem>
+            <para>the state of the deployment - whether it is deployed or not</para>
+          </listitem>
+          <listitem>
+            <para>the deployment class loader</para>
+          </listitem>
+          <listitem>
+            <para>the deployment resource loader</para>
+          </listitem>
+          <listitem>
+            <para>dependencies on other deployments or runtime components</para>
+          </listitem>
+          <listitem>
+            <para>references to any components that it deploys - POJOs, MBeans etc...</para>
+          </listitem>
+          <listitem>
+            <para>references to any nested (child) deployments or the parent deployment</para>
+          </listitem>
+        </itemizedlist>
+        <para>Since the <emphasis>StructureMetaData</emphasis> object created using the <emphasis>StructureDeployer</emphasis> implementations already contains some of this information we subsequently pass it to  a <emphasis>StructureBuilder</emphasis> together with a reference to the original <emphasis>Deployment</emphasis> to populate the deployment with a tree of DeploymentContexts:</para>
+        <programlisting role="JAVA">public interface StructureBuilder
+{
+   DeploymentContext populateContext(Deployment deployment, StructureMetaData metaData) throws DeploymentException;
+}</programlisting>
+        <para>During this method call the information contained within the <emphasis>ContextInfo</emphasis> objects, found inside the <emphasis>StructureMetaData</emphasis>, is transferred to new instances of <emphasis>DeploymentContext</emphasis> that are assembled into a hierarchy. A  reference to the top-level <emphasis>DeploymentContext</emphasis> is then returned.</para>
+      </section>
+      <section>
+        <title>Accessing a deployment</title>
+        <para>The deployment framework uses  <emphasis>DeploymentContext</emphasis> objects to access the internal details of a deployment during processing. However, if you wish to access a deployment yourself then you should use a wrapper called <emphasis>DeploymentUnit</emphasis>.</para>
+        <para>This prevents  you from getting or setting  the deployment state, changing the deployment classloader if it already exists,  changing any parent/child relationships between nested deployments and  accessing any exceptions that have occurred during deployment. You are also prevented from calling the visit() method that allows you to visit all of the contexts in the hierarchy or the cleanup() method that removes deployment metadata from the metadata repository.</para>
+      </section>
+      <section>
+        <title>Attaching extra information</title>
+        <para>Since each instance of <emphasis>DeploymentContext</emphasis> contains generic deployment information we need a way to store and retrieve additional information generated during the deployment process. This is done using the <emphasis>DeploymentUnit</emphasis> wrapper which extends the <emphasis>MutableAttachments</emphasis> interface:</para>
+        <programlisting role="JAVA">public interface DeploymentUnit extends MutableAttachments
+{
+    ...
+}</programlisting>
+        <programlisting role="JAVA">public interface MutableAttachments extends Attachments
+{
+   Object addAttachment(String name, Object attachment);
+   &lt;T&gt; T addAttachment(String name, T attachment, Class&lt;T&gt; expectedType);
+   &lt;T&gt; T addAttachment(Class&lt;T&gt; type, T attachment);
+
+   Object removeAttachment(String name);
+   &lt;T&gt; T removeAttachment(String name, Class&lt;T&gt; expectedType);
+   &lt;T&gt; T removeAttachment(Class&lt;T&gt; type);
+
+   void setAttachments(Map&lt;String, Object&gt; map);
+
+   void clear();
+
+   int getChangeCount();
+   void clearChangeCount();
+}</programlisting>
+        <para>As you can see the <emphasis>MutableAttachments</emphasis> operations allow you to store arbitrary objects (referred to as attachments) inside a map using a <emphasis>String</emphasis> for the key.  For convenience you can pass in the type of the object instead of a string and the return value of type.getName()   will be used as the key. If you pass in a type for the key, or you specify an expectedType argument, then the return value will be cast to an object of that type.</para>
+        <para>If you wish to retrieve any objects then you can use operations from the <emphasis>Attachments</emphasis> interface:</para>
+        <programlisting role="JAVA">public interface Attachments extends Serializable
+{
+   Map&lt;String, Object&gt; getAttachments();
+
+   Object getAttachment(String name);
+   &lt;T&gt; T getAttachment(String name, Class&lt;T&gt; expectedType);
+   &lt;T&gt; T getAttachment(Class&lt;T&gt; type);
+   
+   boolean isAttachmentPresent(String name);
+   boolean isAttachmentPresent(String name, Class&lt;?&gt; expectedType);   
+   boolean isAttachmentPresent(Class&lt;?&gt; type);
+
+   boolean hasAttachments();
+}</programlisting>
+        <para>Again if you pass a type for the key, or specify an expectedType argument, then the return value will be cast to an object of that type. In the case of the isAttachmentPresent() methods the return value is only true if both the object can be located using the key and it can be cast to the specified type.</para>
+        <para><emphasis>DeploymentUnit</emphasis> also contains a convenience method that allows you to retrieve all objects of a particular type from the map of attachments:</para>
+        <programlisting role="JAVA">public interface DeploymentUnit extends MutableAttachments
+{
+    ...
+   &lt;T&gt; Set&lt;? extends T&gt; getAllMetaData(Class&lt;T&gt; type);
+    ...
+}</programlisting>
+      </section>
+      <section>
+        <title>Deployment components</title>
+        <para>Deployments usually contain one or more runtime components in addition to configuration information and resource files. By runtime components we mean any classes that require a container in which to run. Containers take care of controlling a component&apos;s lifecycle in addition to providing  common behaviours so that  component developers do not have to do this themselves. By leveraging the work of the container,  components allow you to concentrate on developing the business logic of your application without having to continually write code for common tasks. This typically  reduces the time needed to develop systems with advanced behaviour.</para>
+        <para>The simplest example of a component is  a POJO. In this case the container controls when the POJO is created based on when a client performs a lookup. It can also take care of wiring different POJOs together based on information in a deployment descriptor so that the developer doesn&apos;t have to hard-code any relationships. This makes configuration of the runtime environment easier to change.</para>
+        <para>Another example is an MBean. Here the container (an MBeanServer) takes care of routing all method calls through a bus so that clients never reference the MBean directly. This allows MBeans to be replaced at runtime without impacting any clients. It also allows the management interface of an MBean, the attributes and operations exposed to clients, to change at runtime without needing to redeploy it.</para>
+        <para>A further example is an OSGi service bundle. Here the container ensures that the classes required by the bundle are available in the runtime before the service is started. It also takes care of making classes within the bundle available to others when deployed and removing them again when undeployed. This makes the runtime environment easier to construct and maintain with fewer classloading issues.</para>
+        <para>In order to provide support for deploying different types of runtime components, JBoss Microcontainer requires that each one is represented by its own <emphasis>ComponentDeploymentContext</emphasis>:</para>
+        <programlisting role="JAVA">public class ComponentDeploymentContext implements DeploymentContext
+{
+    ...
+}</programlisting>
+        <para>This is similer to a normal <emphasis>DeploymentContext</emphasis> implementation but with some important differences:</para>
+        <itemizedlist>
+          <listitem>
+            <para>Components always have a relative order of 0</para>
+          </listitem>
+          <listitem>
+            <para>Components do not have a metadata path</para>
+          </listitem>
+          <listitem>
+            <para>Components always use the classloader of the containing deployment</para>
+          </listitem>
+          <listitem>
+            <para>Components cannot change their  parent once constructed</para>
+          </listitem>
+          <listitem>
+            <para>Components can contain other components</para>
+          </listitem>
+          <listitem>
+            <para>Components are never considered top-level deployments</para>
+          </listitem>
+        </itemizedlist>
+        <para>In addition ComponentDeploymentContexts delegate to their parent <emphasis>DeploymentContext</emphasis> for information such as:</para>
+        <itemizedlist>
+          <listitem>
+            <para>simple name</para>
+          </listitem>
+          <listitem>
+            <para>relative path</para>
+          </listitem>
+          <listitem>
+            <para>deployment types</para>
+          </listitem>
+          <listitem>
+            <para>deployment state</para>
+          </listitem>
+          <listitem>
+            <para>class loader</para>
+          </listitem>
+          <listitem>
+            <para>Resource class loader</para>
+          </listitem>
+          <listitem>
+            <para>Deployment Resource Loader</para>
+          </listitem>
+          <listitem>
+            <para>Dependency Info</para>
+          </listitem>
+          <listitem>
+            <para>get/setProblem</para>
+          </listitem>
+        </itemizedlist>
+        <para>The reason we use the <emphasis>DeploymentContext</emphasis> interface is so that we can process  components together with normal deployments. This ensures that when a deployment is deployed any components that it contains are deployed  with it. Similarly undeploying a deployment causes its components to be undeployed at the same time.</para>
+        <important>
+          <para>An additional motivation is that we can easily create separate ControllerContexts for each component which we can then process using the state machine. This allows us to perform a well-defined set of deployment actions to deploy/undeploy each component in and out of the runtime.</para>
+          <para>Having separate ControllerContexts for each component also allows you to manage the components individually, possibly via an Admin console. Furthermore each component can have its own dependencies allowing fine-grained control of how the runtime is constructed and destructed. </para>
+        </important>
+        <para>ComponentDeploymentContexts are added to a <emphasis>DeploymentUnit</emphasis> using the addComponent() method whenever a component is discovered during the deployment process:</para>
+        <programlisting role="JAVA">public class AbstractDeploymentUnit extends AbstractMutableAttachments implements DeploymentUnit
+{
+    ...
+
+   public DeploymentUnit addComponent(String name)
+   {
+      DeploymentContext component = createComponentDeploymentContext(name, deploymentContext);
+      DeploymentUnit unit = createComponentDeploymentUnit(component);
+      component.setDeploymentUnit(unit);
+      deploymentContext.addComponent(component);
+      return unit;
+   }
+
+   ...
+
+   protected DeploymentContext createComponentDeploymentContext(String name, DeploymentContext parent)
+   {
+      return new ComponentDeploymentContext(name, parent);
+   }
+
+    ...
+}</programlisting>
+        <para>As components are usually accessed with the <emphasis>DeploymentUnit</emphasis> interface they can also have attachments just like any other deployment:</para>
+        <programlisting role="JAVA">public interface DeploymentUnit extends MutableAttachments
+{
+    ...
+}
+
+public interface MutableAttachments extends Attachments
+{
+    ...
+
+   Object addAttachment(String name, Object attachment);
+
+    ...
+}</programlisting>
+        <para>An attachment may well be metadata associated with the component. In this way the metadata can be processed using deployment actions as the component&apos;s <emphasis>ControllerContext</emphasis> passes through the state machine.</para>
+      </section>
+      <section>
+        <title>Deployment dependencies</title>
+        <para>Sometimes a deployment may have dependencies on other deployments or on a runtime component such as a classloader. In these cases we need to be able to define the dependencies so that the state machine can decide whether or not to progress the deployment to the next stage. This is done using the following methods of the <emphasis>DeploymentUnit</emphasis> interface:</para>
+        <programlisting role="JAVA">public interface DeploymentUnit extends MutableAttachments
+{
+    ...
+
+   DependencyInfo getDependencyInfo();
+   void addIDependOn(DependencyItem dependency);
+   void removeIDependOn(DependencyItem dependency);
+}</programlisting>
+        <para><emphasis>AbstractDeploymentUnit</emphasis> delegates these calls to the <emphasis>DeploymentContext</emphasis> implementation that it wraps:</para>
+        <programlisting role="JAVA">public class AbstractDeploymentUnit extends AbstractMutableAttachments implements DeploymentUnit
+{
+   ...
+
+   public void addIDependOn(DependencyItem dependency)
+   {
+      getDependencyInfo().addIDependOn(dependency);
+   }
+
+   public DependencyInfo getDependencyInfo()
+   {
+      return deploymentContext.getDependencyInfo();
+   }
+
+   public void removeIDependOn(DependencyItem dependency)
+   {
+      getDependencyInfo().removeIDependOn(dependency);
+   }
+
+   ...
+}</programlisting>
+        <para>This in turn delegates them to the corresponding <emphasis>ControllerContext</emphasis> implementation which is stored as an attachment:</para>
+        <programlisting role="JAVA">public class AbstractDeploymentContext extends ManagedObjectsWithTransientAttachmentsImpl implements DeploymentContext
+{
+   ...
+
+   public DependencyInfo getDependencyInfo()
+   {
+      ControllerContext controllerContext = getTransientAttachments().getAttachment(ControllerContext.class);
+      if (controllerContext != null)
+         return controllerContext.getDependencyInfo();
+      else
+      {
+         DeploymentContext parent = getParent();
+         if (parent == null)
+            throw new IllegalStateException(&quot;Deployment ControllerContext has not been set&quot;);
+         return parent.getDependencyInfo();
+      }
+   }
+
+   ...
+}</programlisting>
+        <para>If a <emphasis>ControllerContext</emphasis> object is not found within the deployment&apos;s attachments then the parent deployment is tried. In this way  DependencyItems  are added/removed to the  underlying <emphasis>ControllerContext</emphasis> implementation for the deployment. </para>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Processing a deployment</title>
+      <section>
+        <title>Introduction</title>
+        <para>So far we have established the structure of a deployment using <emphasis>StructureDeployer</emphasis> classes and created a corresponding <emphasis>DeploymentContext</emphasis> using a <emphasis>StructureBuilder</emphasis>.  Nested deployments have been dealt with by creating additional DeploymentContexts and adding these as children of the parent <emphasis>DeploymentContext</emphasis>.</para>
+        <para>The next step in the deployment framework is to process the deployment. The objective being to extract any metadata from the deployment descriptors and create a classloader. Components must also be identified during this process and  a <emphasis>ComponentDeploymentContext</emphasis> created for each one  so that they can be deployed into the runtime.</para>
+        <para>The <emphasis>Deployers</emphasis> interface defines the operations that need to take place:</para>
+        <programlisting role="JAVA">public interface Deployers
+{
+   ...
+   
+   void process(List&lt;DeploymentContext&gt; deploy, List&lt;DeploymentContext&gt; undeploy);
+
+   void checkComplete(Collection&lt;DeploymentContext&gt; errors, Collection&lt;Deployment&gt; missingDeployer) throws DeploymentException;
+
+   void checkComplete(DeploymentContext... contexts) throws DeploymentException;
+
+   void checkStructureComplete(DeploymentContext... contexts) throws DeploymentException;
+}</programlisting>
+        <para>In the default implementation <emphasis>DeployersImpl</emphasis> the process() method creates new DeploymentControllerContexts for each <emphasis>DeploymentContext</emphasis> in the deploy list and installs them into the microcontainer controller:</para>
+        <programlisting role="JAVA">public class DeployersImpl implements Deployers, ControllerContextActions
+{
+    ...
+
+   public void process(List&lt;DeploymentContext&gt; deploy, List&lt;DeploymentContext&gt; undeploy)
+   {
+        ...
+
+      // There is something to deploy
+      if (deploy != null &amp;&amp; deploy.isEmpty() == false)
+      {
+         // Create the controller contexts
+         for (DeploymentContext context : deploy)
+         {
+            DeploymentControllerContext deploymentControllerContext = new DeploymentControllerContext(context, this);
+            try
+            {
+               controller.install(deploymentControllerContext);
+               context.setState(DeploymentState.DEPLOYING);
+               ...
+               context.getTransientAttachments().addAttachment(ControllerContext.class, deploymentControllerContext);
+               ...
+            }
+            catch (Throwable t)
+            {
+               // Set the error on the parent
+               context.setState(DeploymentState.ERROR);
+               context.setProblem(t);
+               // Set the children to not deployed
+               setState(context, DeploymentState.UNDEPLOYED, DeploymentState.DEPLOYING);
+            }
+         }
+
+         // Go through the states in order
+         List&lt;ControllerState&gt; states = controller.getStates();
+         for (ControllerState state : states)
+         {
+            for (DeploymentContext context : deploy)
+            {
+               if (DeploymentState.ERROR.equals(context.getState()) == false)
+               {
+                  DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class);
+                  try
+                  {
+                     controller.change(deploymentControllerContext, state);
+                  }
+                  catch (Throwable t)
+                  {
+                     context.setState(DeploymentState.ERROR);
+                     context.setProblem(t);
+                  }
+               }
+            }
+         }
+       }
+    }
+
+    ...
+}</programlisting>
+        <para>Notice that a reference to the <emphasis>DeploymentControllerContext</emphasis> is stored as an attachment to the <emphasis>DeploymentContext</emphasis> so that it can be retrieved later and passed to the controller.install() method.</para>
+        <para>Undeployment happens in a similar way. First of all the DeploymentControllerContexts associated with the DeploymentContexts in the undeploy list are extracted into a separate list. The microcontainer controller is then used again to push them through  the deployment states in reverse order. Finally the DeploymentControllerContexts are removed from the <emphasis>DeploymentContext</emphasis> attachments where they were initially stored and uninstalled from the controller:</para>
+        <programlisting role="JAVA">public class DeployersImpl implements Deployers, ControllerContextActions
+{
+    ...
+
+   public void process(List&lt;DeploymentContext&gt; deploy, List&lt;DeploymentContext&gt; undeploy)
+   {
+      // There is something to undeploy
+      if (undeploy != null &amp;&amp; undeploy.isEmpty() == false)
+      {
+         // Build a list in reverse order
+         List&lt;DeploymentControllerContext&gt; toUndeploy = new ArrayList&lt;DeploymentControllerContext&gt;();
+         for (int i = undeploy.size()-1; i &gt;= 0; --i)
+         {
+            DeploymentContext context = undeploy.get(i);
+            if (DeploymentState.ERROR.equals(context.getState()) == false)
+               context.setState(DeploymentState.UNDEPLOYING);
+            ...
+            DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class);
+            if (deploymentControllerContext == null)
+            {
+               log.debug(&quot;DeploymentContext has no DeploymentControllerContext during undeploy request, ignoring: &quot; + context);
+            }
+            else
+            {
+               toUndeploy.add(deploymentControllerContext);
+            }
+         }
+
+         // Go through the states in reverse order
+         List&lt;ControllerState&gt; states = controller.getStates();
+         for (int i = states.size()-1; i &gt;= 0; --i)
+         {
+            ControllerState state = states.get(i);
+            for (DeploymentControllerContext deploymentControllerContext : toUndeploy)
+            {
+               DeploymentContext context = deploymentControllerContext.getDeploymentContext();
+               if (ControllerState.ERROR.equals(context.getState()) == false)
+               {
+                  try
+                  {
+                     controller.change(deploymentControllerContext, state);
+                  }
+                  catch (Throwable t)
+                  {
+                     ...
+                     context.setState(DeploymentState.ERROR);
+                     context.setProblem(t);
+                  }
+               }
+            }
+         }
+
+         // Uninstall the contexts
+         for (DeploymentControllerContext deploymentControllerContext : toUndeploy)
+         {
+            DeploymentContext context = deploymentControllerContext.getDeploymentContext();
+            context.getTransientAttachments().removeAttachment(ControllerContext.class);
+            try
+            {
+               controller.uninstall(deploymentControllerContext.getName());
+               setState(context, DeploymentState.UNDEPLOYED, null);
+               ...
+               cleanup(context);
+              ...
+            }
+            catch (Throwable t)
+            {
+               ...
+               context.setState(DeploymentState.ERROR);
+               context.setProblem(t);
+            }
+         }
+      }
+
+      ...
+   }
+
+   ...
+}
+</programlisting>
+        <note>
+          <para>Undeployments are actually processed before deployments to ensure that we don&apos;t end up in a situation where a deployment that depends on a subsequently undeployed deployment has to be undeployed again straight away.</para>
+        </note>
+        <para>You should hopefully see from this breakdown that each deployment is processed by creating a <emphasis>DeploymentControllerContext</emphasis> that is then installed into the microcontainer controller and pushed through a series of deployment stages. What these stages are and how they are created is the subject of the next section.</para>
+      </section>
+      <section>
+        <title>Deployment stages</title>
+        <para>  By default the <emphasis>DeployersImpl</emphasis> class creates the following deployment stages on construction:</para>
+        <itemizedlist>
+          <listitem>
+            <para>NOT_INSTALLED - the deployment is ready to be installed or has been uninstalled</para>
+          </listitem>
+          <listitem>
+            <para>PARSE -  deployment descriptors are parsed into deployment metadata</para>
+          </listitem>
+          <listitem>
+            <para>DESCRIBE - dependencies on other deployments or runtime components are determined</para>
+          </listitem>
+          <listitem>
+            <para>CLASSLOADER - a classloader for the deployment is created</para>
+          </listitem>
+          <listitem>
+            <para>POST_CLASSLOADER - </para>
+          </listitem>
+          <listitem>
+            <para>REAL - components are deployed into the runtime</para>
+          </listitem>
+          <listitem>
+            <para>INSTALLED - the deployment is fully deployed</para>
+          </listitem>
+        </itemizedlist>
+        <para>Each <emphasis>DeploymentStage</emphasis> has a name and indicates which stages it comes before and after: </para>
+        <programlisting role="JAVA">public class DeploymentStage
+{
+   private String name;
+   
+   private String after;
+   
+   private String before;
+
+   ...
+}</programlisting>
+        <para>This allows a new <emphasis>ControllerState</emphasis> to be created for each <emphasis>DeploymentStage</emphasis> which can then be added in the correct place to the list of ControllerStates associated with the controller:</para>
+        <programlisting role="JAVA">public class DeployersImpl implements Deployers, ControllerContextActions
+{
+    ...
+
+   public DeployersImpl(AbstractController controller, Set&lt;Deployer&gt; deployers)
+   {
+      if (controller == null)
+         throw new IllegalArgumentException(&quot;Null controller&quot;);
+      this.controller = controller;
+      
+      // Add the standard stages
+      addDeploymentStage(DeploymentStages.NOT_INSTALLED);
+      addDeploymentStage(DeploymentStages.PARSE);
+      addDeploymentStage(DeploymentStages.DESCRIBE);
+      addDeploymentStage(DeploymentStages.CLASSLOADER);
+      addDeploymentStage(DeploymentStages.POST_CLASSLOADER);
+      addDeploymentStage(DeploymentStages.REAL);
+      addDeploymentStage(DeploymentStages.INSTALLED);
+
+      ...
+   }
+
+   ...
+
+   protected synchronized void addDeploymentStage(DeploymentStage stage)
+   {
+      if (stage == null)
+         throw new IllegalArgumentException(&quot;Null stage&quot;);
+            // Already done?
+      String stageName = stage.getName();
+      if (stages.containsKey(stageName))
+         return;
+
+      ControllerState preceeds = null;
+      String before = stage.getBefore();
+      String after = stage.getAfter();
+      if (before != null || after != null)
+      {
+         // Determine where to put the stage
+         List&lt;ControllerState&gt; states = controller.getStates();
+         for (int i = 0; i &lt; states.size(); ++i)
+         {
+            ControllerState state = states.get(i);
+            String stateName = state.getStateString();
+            if (before != null &amp;&amp; before.equals(stateName))
+            {
+               preceeds = state;
+               break;
+            }
+            if (after != null &amp;&amp; after.equals(stateName))
+            {
+               if (i &lt; states.size()-1)
+               {
+                  preceeds = states.get(i+1);
+                  break;
+               }
+            }
+         }
+      }
+
+      controller.addState(new ControllerState(stageName), preceeds);
+      stages.put(stageName, stage);
+      ...
+   }
+
+   ...
+}</programlisting>
+        <para>The DeploymentStages are also stored in a map, using the stage name as a key, to prevent duplicate stages from being added.</para>
+      </section>
+      <section>
+        <title>Deployment actions</title>
+        <para/>
+      </section>
+      <section>
+        <title>Ordering (Inputs and outputs)</title>
+        <para/>
+      </section>
+      <section>
+        <title>Deploying components</title>
+        <para/>
+      </section>
+    </chapter>
+    <chapter>
+      <title>Putting it all together</title>
+      <section>
+        <title>Introduction</title>
+      </section>
+      <section>
+        <title>Defining the deployment framework</title>
+      </section>
+      <section>
+        <title>Defining deployment structures</title>
+      </section>
+      <section>
+        <title>Defining deployment actions</title>
+      </section>
+    </chapter>
+  </part>
+  <part>
+    <title>Managing Deployments</title>
+  </part>
+  <part>
+    <title>Classloading</title>
+    <chapter>
+      <title>Defining Policies</title>
+    </chapter>
+  </part>
+  <part>
+    <title>Developing OSGi services</title>
+  </part>
+  <part>
+    <title>Extending the Microcontainer</title>
+    <chapter>
+      <title>Introduction</title>
+    </chapter>
+    <chapter>
+      <title>Guice Extension</title>
+    </chapter>
+    <chapter>
+      <title>Identity Extension</title>
+    </chapter>
+    <chapter>
+      <title>jBPM Extension</title>
+    </chapter>
+    <chapter>
+      <title>Drools Extension</title>
+    </chapter>
+  </part>
+  <appendix>
+    <title>Additional Resources</title>
+    <section>
+      <title>Wiki</title>
+    </section>
+    <section>
+      <title>Forums</title>
+    </section>
+  </appendix>
+</book>

Added: projects/mc-docs/trunk/userguide/src/main/docbook/images/deployOutput.png
===================================================================
(Binary files differ)


Property changes on: projects/mc-docs/trunk/userguide/src/main/docbook/images/deployOutput.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: projects/mc-docs/trunk/userguide/src/main/docbook/images/tuiMenu.png
===================================================================
(Binary files differ)


Property changes on: projects/mc-docs/trunk/userguide/src/main/docbook/images/tuiMenu.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the jboss-cvs-commits mailing list