[jboss-cvs] JBossAS SVN: r105405 - in projects/docs/enterprise/EAP/trunk/5.x: JBoss_Microcontainer_User_Guide and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon May 31 02:20:53 EDT 2010


Author: misty at redhat.com
Date: 2010-05-31 02:20:47 -0400 (Mon, 31 May 2010)
New Revision: 105405

Added:
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Adding_Behavior_with_AOP.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Concepts.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Dependency_Injection_And_IoC.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Author_Group.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Book_Info.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Building_Services.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Chapter.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/ClassLoading.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Intro.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.ent
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Models.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Preface.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Revision_History.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Tutorial.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Using_Services.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/VFS.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Virtual_Deployment_Framework.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AOP_via_Descriptor.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AbstractController.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Applying_An_Aspect.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Autowiring.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanAccessMode.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanMetaDataBuilder.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Aliases.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Controller_Mode.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycle_Separation.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycles.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bootstrapping_the_Microcontainer.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BuilderUtil.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callback_Classes.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callbacks.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Calling_Methods_On_Bean_Instance.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy_with_Encryption_Support.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_CB2_Bean_Test.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_Per_Bean.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoading_API.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_DefaultDomain.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_OSGi.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_domain-level_isolation.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_import_export_modules.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_isolation_with_specific_parent.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_class.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_deployer.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Create_Pojo.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Creating_Instances_Of_Classes.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Deployment_Stages.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Editor_Parser.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EmbeddedBootstrap.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EncryptedService.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean_With_Annotation.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Extended_BeanFactory_Usage.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Field_Bean_Class.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/GenericBeanFactory.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Configure_Beans.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Descriptor.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Microcontainer_Integration.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_Assembled_VirtualFileHandlers.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_In-Memory_VirtualFileHandlers.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Include_and_Exclude_with_Autowiring.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Injecting_Values_Into_POJO_Properties.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Invoking_Methods_In_Different_States.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Lazy_Mock.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Legacy_Beans.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_Reference_to_HRService.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_References_To_Beans.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Descriptor.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Example.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Parser_Checker.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Plain_POJO_Descriptor.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/PortsConfig_Bean.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Prototype_Creator.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Recursively_Gathering_Resources.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegExpService.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegexpClassLoaderPolicy.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Resource_Duplication_Problem.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer_Descriptor.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Specifying_a_Different_Classloader.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Static_Code_Usage.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/StopWatchInterceptor.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/String_Set_To_Private.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Testing_Guice_Functionality.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Callback_Class.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Classes_Attribute.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_getVFS.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Default_Classloader_per_Bean.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Invoke_Method.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VFS_Class.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Value_Factory.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VirtualFile_Resource.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.java
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-beans.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-classloading.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-dependency.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-deployment.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-scanning.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-structure.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/new-classloader-via-jboss-beans.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/non-j2seClassLoadingCompliance.xml
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/images/
   projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/publican.cfg
Log:
Added JBoss Microcontainer User Guide


Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Adding_Behavior_with_AOP.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Adding_Behavior_with_AOP.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Adding_Behavior_with_AOP.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,307 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-Adding_Behavior_with_AOP">
+	<title>Adding Behavior with AOP</title>
+	<para>
+		Object Oriented Programming (OOP) contains many useful techniques for software development including encapsulation, inheritance, and polymorphism. However, it does not solve the problem of addressing 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. This type of logic is called a <firstterm>cross-cutting concern</firstterm>.
+	</para>
+	<para>
+		<firstterm>Aspect Oriented Programming (AOP)</firstterm> works to allow 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 streamlines maintenance. The method depends on the AOP implementation. Typically if a class implements an interface, each method call to an instance of the class first passes through a proxy. This proxy implements the same interface, adding the required behavior. Alternatively, if an interface is not used, then the java bytecode of the compiled class is modified: 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. Another method to achieve the same result is modifying the bytecode to create a subclass of the original class that overrides its methods. The overridden methods then execute !
 the cross-cutting logic before calling the corresponding methods of the super class.
+	</para>
+	<para>
+		<application>JBoss AOP</application> is a framework for AOP. Using it, you can create cross-cutting concerns using conventional java classes and methods. In AOP terminology each concern is represented by an <firstterm>aspect</firstterm> that you implement using a simple POJO. Behavior is provided by methods within the aspect called <firstterm>advices</firstterm>. These advices follow certain rules for their parameter, and return types and any exceptions that they throw. Within this framework, you can use conventional object-oriented notions such as inheritance, encapsulation, and composition to make your cross-cutting concerns easy to maintain. Aspects are applied to code using an expression language that allows you to specify which constructors, methods and even fields to target. You can quickly change the behavior of multiple classes by editing a configuration file.
+	</para>
+	<para>
+		This chapter contains examples which demonstrate how to use JBoss AOP alongside the Microcontainer to create and apply an auditing aspect to the Human Resources Service. The auditing code could be placed within the <classname>HRManager</classname> class, but it would clutter the class with code which is not relevant to its central purpose, bloating it and making it harder to maintain. The design of the aspect also provide modularity, making it easy to audit other classes in the future, if the scope of the project changes.
+	</para>
+	<para>
+		AOP can also be used to apply additional behavior during the deployment phase. This example will create and bind a proxy to a bean instance into a basic JNDI service, allowing it to be accessed using a JNDI look-up instead of the Microcontainer controller.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-Adding_Behavior_with_AOP-Creating_An_Aspect">
+		<title>Creating An Aspect</title>
+		<para>
+			The <filename>examples/User_Guide/gettingStarted/auditAspect</filename> directory contains all the files needed to create the aspect.
+		</para>
+		<itemizedlist>
+			<listitem>
+				<para>
+					<filename>auditAspect/pom.xml</filename>
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					<filename>auditAspect/src/main/java/org/jboss/example/aspect/AuditAspect.java</filename>
+				</para>
+			</listitem>
+		</itemizedlist>
+		<para>
+			This code creates our POJO:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Create_Pojo.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			The constructor checks for the presence of a <filename>log</filename> directory in the current working directory, and creates one if not found. After this an advice is defined. This advice will be called whenever the constructor of the target class is called. This creates a new log file within the <filename>log</filename> directory to record method calls made on different instances of the target class in separate files. Finally another advice is defined. This advice applies to each method call made on the target class.The method name and arguments are stored, along with the return value. This information is used to construct an audit record and write it to the current log file. Each advice calls <methodname>inv.invokeNext()</methodname>. This chains the advices together, 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 <returnvalue>Throwable</returnvalue> and returns <returnvalue>Object</returnvalue>. At design time you don't know which constructors or methods these advices will be applied to, so the types must be as generic as possible. For more information on creating aspects and advices, and for additional examples of how to apply them to various classes, consult the JBoss AOP project documentation.
+			</para>
+		</note>
+		<para>
+			To compile the class and create an <filename>auditAspect.jar</filename> file that can be used by other examples, type <command>mvn install</command> from the <filename>auditAspect</filename> directory.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Adding_Behavior_with_AOP-Configuring_the_Microcontainer_for_AOP">
+		<title>Configuring the Microcontainer for AOP</title>
+		<para>
+			Before applying the audit aspect to the HR Service, a number of JARs must be added to the extension classpath. They are in the <filename>lib</filename> sub-directory of the <filename>client-aop</filename> distribution located in the <filename>examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir</filename> directory:
+		</para>
+		
+<screen>
+      run.sh
+      client-1.0.0.jar
+      jboss-beans.xml
+      lib/auditAspect-1.0.0.jar
+        /concurrent-1.3.4.jar
+	/humanResourcesService-1.0.0.jar
+	/javassist-3.6.0.GA.jar
+	/jboss-aop-2.0.0.beta1.jar
+	/jboss-aop-mc-int-2.0.0.Beta6.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
+	/trove-2.1.1.jar
+	/xercesImpl-2.7.1.jar
+</screen>
+		<para>
+			First, <filename>lib/auditAspect-1.0.0.jar</filename> is needed, for creating an instance of the aspect at run-time, in order to execute the logic. Next the jar file for JBoss AOP (jboss-aop) is needed, along with its dependencies; javassist and trove. Finally the jboss-aop-mc-int jar is required because it contains an XML schema definition that allows you to define aspects inside an XML deployment descriptor. It also contains integration code to create dependencies between normal beans and aspect beans within the Microcontainer, allowing you to add behavior during the deployment and undeployment phases.
+		</para>
+		<note>
+			<para>
+				Because you are using Maven2 to assemble the client-aop distribution, you add these JAR files by declaring the appropriate dependencies in your <filename>pom.xml</filename> 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 id="sect-JBoss_Microcontainer_User_Guide-Adding_Behavior_with_AOP-Applying_An_Aspect">
+		<title>Applying An Aspect</title>
+		<para>
+			Now that you have a valid distribution containing everything you need, you can configure <filename>jboss-beans.xml</filename> to apply the audit aspect. It is in <filename>examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir</filename>.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Applying_An_Aspect.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Before you can apply your aspect to any classes, you need to create an instance of <classname>org.jboss.aop.AspectManager</classname> using a &lt;bean&gt; element. A factory method is used here instead of calling a conventional constructor, since only one instance of the AspectManager in the JVM is necessary at run-time.
+		</para>
+		<para>
+			Next an instance of our aspect called AuditAspect is created, using the &lt;aop:aspect&gt; element. This looks similar to the &lt;bean&gt; element because it has <property>name</property> and <property>class</property> attributes that are used in the same way. However it also has <property>method</property> and <property>pointcut</property> attributes that you can use to apply or bind an advice within the aspect to constructors and methods within other classes. These attributes bind the audit advice to all public constructors and methods within the <classname>HRManager</classname> class. Only the <methodname>audit</methodname> method needs to be specified, since it has been overloaded within the <classname>AuditAspect</classname> class with different parameters. JBoss AOP knows at run-time which to select, depending on whether a constructor or method invocation is being made.
+		</para>
+		<para>
+			This additional configuration is all that is needed to apply the audit aspect at run-time, adding auditing behavior to the <application>Human Resources</application> service. You can test this by running the client using the <filename>run.sh</filename> script. A <filename>log</filename> directory is created on start-up alongside the <filename>lib</filename> directory when the <classname>AuditAspect</classname> bean is created by the Microcontainer. Each deployment of the Human Resources service causes a new log file to appear within the <filename>log</filename> directory. The log file contains a record of any calls made from the client to the service:
+		</para>
+		
+<screen>
+      <filename>log/auditLog-28112007-163902</filename>
+         <filename>/auditLog-28112007-164055</filename>
+         <filename>/auditLog-28112007-164108</filename>
+</screen>
+		<para>
+			The audit records inside the log files will look something like this:
+		</para>
+		
+<screen>
+      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
+</screen>
+		<para>
+			To remove the auditing behavior, comment out the relevant fragments of XML in the deployment descriptor and restart the application.
+		</para>
+		<warning>
+			<para>
+				The order of deployment matters. 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 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, this is not possible.
+			</para>
+		</warning>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Adding_Behavior_with_AOP-Lifecycle_Callbacks">
+		<title>Lifecycle Callbacks</title>
+		<para>
+			In addition to applying aspects to beans that we instantiate using the Microcontainer we can also add behavior 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:
+		</para>
+		<variablelist>
+			<varlistentry>
+				<term>NOT_INSTALLED</term>
+				<listitem>
+					<para>
+						the deployment descriptor containing the bean has been parsed, along with any annotations on the bean itself.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>DESCRIBED</term>
+				<listitem>
+					<para>
+						any dependencies created by AOP have been added to the bean, and custom annotations have been processed.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>INSTANTIATED</term>
+				<listitem>
+					<para>
+						an instance of the bean has been created.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>CONFIGURED</term>
+				<listitem>
+					<para>
+						properties have been injected into the bean, along with any references to other beans.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>CREATE</term>
+				<listitem>
+					<para>
+						the <methodname>create</methodname> method, if defined in the bean, has been called.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>START</term>
+				<listitem>
+					<para>
+						the <methodname>start</methodname> method, if defined in the bean, has been called.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>INSTALLED</term>
+				<listitem>
+					<para>
+						any custom install actions that were defined in the deployment descriptor have been executed and the bean is ready to access.
+					</para>
+				</listitem>
+			</varlistentry>
+		</variablelist>
+		<important>
+			<para>
+				The <systemitem>CREATE</systemitem> and <systemitem>START</systemitem> states are included for legacy purposes. This allows services that were 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, it will pass straight through these states.
+			</para>
+		</important>
+		<para>
+			These states represent the bean's lifecycle. You can define a number of callbacks to be applied to any point by using an additional set of &lt;aop&gt; elements:
+		</para>
+		<variablelist>
+			<varlistentry>
+				<term>&lt;aop:lifecycle-describe&gt;</term>
+				<listitem>
+					<para>
+						applied when entering/leaving the DESCRIBED state
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>&lt;aop:lifecycle-instantiate&gt;</term>
+				<listitem>
+					<para>
+						applied when entering/leaving the INSTANTIATED state
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>&lt;aop:lifecycle-configure&gt;</term>
+				<listitem>
+					<para>
+						applied when entering/leaving the CONFIGURED state
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>&lt;aop:lifecycle-create&gt;</term>
+				<listitem>
+					<para>
+						applied when entering/leaving the CREATE state
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>&lt;aop:lifecycle-start&gt;</term>
+				<listitem>
+					<para>
+						applied when entering/leaving the START state
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>&lt;aop:lifecycle-install&gt;</term>
+				<listitem>
+					<para>
+						applied when entering/leaving the INSTALLED state
+					</para>
+				</listitem>
+			</varlistentry>
+		</variablelist>
+		<para>
+			Just as the &lt;bean&gt; element and the &lt;aop:aspect&gt; element, the &lt;aop:lifecycle-&gt; elements contain <property>name</property> and <property>class</property> attributes. The Microcontainer uses these attributes to create an instance of the <methodname>callback</methodname> class, naming it so that it can be used as beans enter or leave the relevant state during deployment and undeployment. You can specify which beans are affected by the callback using the classes attribute:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Using_The_Classes_Attribute.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This code specifies that additional logic in the <classname>lifecycleCallback</classname> class is applied to any bean classes that are annotated with <parameter>@org.jboss.test.microcontainer.support.Install</parameter> before they enter and after they leave the <systemitem>INSTALLED</systemitem> state.
+		</para>
+		<para>
+			For the callback class to work, it must contain <methodname>install</methodname> and <methodname>uninstall</methodname> methods that take <parameter>ControllerContext</parameter> as a parameter:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Using_The_Callback_Class.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			The <methodname>install</methodname> method is called during the bean's deployment, and the <methodname>uninstall</methodname> method during its undeployment.
+		</para>
+		<note>
+			<para>
+				Although behavior is being added to the deployment and undeployment process using callbacks, AOP is not actually used here. They do use the pointcut expression functionality of JBoss AOP to determine which bean classes they should apply to, so they are interesting here. 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 id="sect-JBoss_Microcontainer_User_Guide-Adding_Behavior_with_AOP-Adding_Service_Look_ups_Through_JNDI">
+		<title>Adding Service Look-ups Through JNDI</title>
+		<para>
+			Until now, you have used the Microcontainer to look up references to bean instances which represent represent services. This is not ideal, because it requires a reference to the Microcontainer kernel before the controller can be accessed:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Looking_Up_References_To_Beans.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Handing out kernel references to every client that looks up a service is a security risk. It provides wide-spread access to the Microcontainer configuration. It would be more secure to apply the ServiceLocator pattern and use a class to performs look-ups on behalf of the clients. An even better option is to pass the bean references, along with their names, to the ServiceLocator at deployment time, using a lifecycle callback. 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 look-ups.
+		</para>
+		<para>
+			It would not be difficult to write your own ServiceLocator implementation. Integrating an existing one such as JBoss Naming Service (JBoss NS) is even quicker, and 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>
+			First, you need to create an instance of JBoss NS using the Microcontainer. next, add a lifecycle callback to perform the binding and unbinding of the bean references during deployment/undeployment. Then, mark the bean classes for which you wish to bind references using annotations, and find them at run-time using the shorthand pointcut expression as shown earlier.
+		</para>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Concepts.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Concepts.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Concepts.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<part id="part-JBoss_Microcontainer_User_Guide-Advanced_Concepts_with_the_Microcontainer">
+	<title>Advanced Concepts with the Microcontainer</title>
+	<xi:include href="Models.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Advanced_Dependency_Injection_And_IoC.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="VFS.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="ClassLoading.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Virtual_Deployment_Framework.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</part>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Dependency_Injection_And_IoC.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Dependency_Injection_And_IoC.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Advanced_Dependency_Injection_And_IoC.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,278 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC">
+	<title>Advanced Dependency Injection and IoC</title>
+	<para>
+		Today, <firstterm>Dependency injection (DI)</firstterm>, also called <firstterm>Inversion of Control (IoC)</firstterm>, lies at the core of many frameworks that embrace the notion of a container or a component model. Component models were discussed in a previous chapter. JBoss JMX kernel, the precursor to the Microcontainer, provided only lightweight DI/IoC support. It was limited primarily due to the limitations of accessing MBeans through the MBeans server. However with the new POJO-based component model, several new and interesting features are available.
+	</para>
+	<para>
+		This chapter shows how you can apply different DI concepts with the help of the JBoss Microcontainer. These concepts will be expressed via XML code, but you can also apply most of these features using annotations.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Value_Factory">
+		<title>Value Factory</title>
+		<para>
+			A value factory is a bean which has one or more methods devoted to generating values for you. Here is such a bean:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Value_Factory.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Here we can see how the PortsConfig bean is using Binding bean to get its values via getPort method invocation.
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/PortsConfig_Bean.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Callbacks">
+		<title>Callbacks</title>
+		<para>
+			Sometimes you need to 'collect' all beans of a certain type. You might even limit the number of matching beans that makes sense for your bean.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Callbacks.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			In this case we have a Parser that collects all Editors. We see this from the method's signature:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Editor_Parser.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Notice that <classname>incallback</classname> and <classname>uncallback</classname> match via method name.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Callback_Classes.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			And we also put a bottom limit on how many editors actually make this bean progress from a Configured state: <code>cardinality=4..n/&gt;</code>
+		</para>
+		<para>
+			Eventually, Checker gets created and checks the parser
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Parser_Checker.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Bean_Access_Mode">
+		<title>Bean Access Mode</title>
+		<para>
+			By default a bean's fields are not inspected; however, if you specify a different BeanAccessMode, the fields are part of the bean's properties.
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/BeanAccessMode.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Here, a String value is set to a private String field:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/String_Set_To_Private.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Field_Bean_Class.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Bean_Alias">
+		<title>Bean Alias</title>
+		<para>
+			Each bean can have any number of aliases. Since Microcontainer component names are treated as Objects, the alias type is not limited. By default a system property replacement is not done; you need to set the replace flag explicitly.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Bean_Aliases.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-XML_or_MetaData_annotations_support">
+		<title>XML (or MetaData) annotations support</title>
+		<para>
+			AOP support is a prime feature in JBoss Microcontainer, so of course you can mix and match AOP aspects and plain beans. This example attempts to intercept a method invocation based on an annotation. The best part is that it is unimportant where this annotation comes from. It could be a true class annotation or an annotation added through the xml configuration.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/AOP_via_Descriptor.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/StopWatchInterceptor.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<example id="exam-JBoss_Microcontainer_User_Guide-XML_or_MetaData_annotations_support-A_true_class_annotated_executor">
+			<title>A true class annotated executor</title>
+			
+<programlisting language="XML" role="XML"><xi:include href="extras/Annotated_Executor.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Annotated_Executor.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<example id="exam-JBoss_Microcontainer_User_Guide-XML_or_MetaData_annotations_support-Simple_executor_with_XML_annotation">
+			<title>Simple executor with XML annotation</title>
+			
+<programlisting language="XML" role="XML"><xi:include href="extras/Simple_Executor_with_XML_Annotations.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Simple_Executor_with_XML_Annotations.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			After adding executor invoker beans, you can see the executors in action during employment:
+		</para>
+		
+<screen>
+      JBoss-MC-Demo  INFO [15-12-2008 13:57:39] StopWatch - Invocation [org.jboss.demos.ioc.annotations.AnnotatedExecutor at 4d28c7] start: 1229345859234
+      JBoss-MC-Demo  INFO [15-12-2008 13:57:39] StopWatch - Invocation [org.jboss.demos.ioc.annotations.AnnotatedExecutor at 4d28c7] time: 31
+      JBoss-MC-Demo  INFO [15-12-2008 13:57:39] StopWatch - Invocation [org.jboss.demos.ioc.annotations.SimpleExecutor at 1b044df] start: 1229345859265
+      JBoss-MC-Demo  INFO [15-12-2008 13:57:39] StopWatch - Invocation [org.jboss.demos.ioc.annotations.SimpleExecutor at 1b044df] time: 47
+</screen>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Autowire">
+		<title>Autowire</title>
+		<para>
+			Autowiring, or contextual injection, is a common feature with IoC frameworks. The following shows you how to use or exclude beans with autowiring.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Include_and_Exclude_with_Autowiring.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			In both cases - <package>ShapeUser</package> and <package>ShapeChecker</package> - only <package>Circle</package> should be used, since <package>Square</package> is excluded in the contextual binding.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Bean_Factory">
+		<title>Bean Factory</title>
+		<para>
+			When you want more than one instance of a particular bean, you need to use the bean factory pattern. The job of the Microcontainer is to configure and install the bean factory as if it were a plain bean. Then you need to invoke the bean factory's <methodname>createBean</methodname> method.
+		</para>
+		<para>
+			By default, the Microcontainer creates a <classname>GenericBeanFactory</classname> instance, but you can configure your own factory. The only limitation is that its signature and configuration hooks are similar to the one of <classname>AbstractBeanFactory</classname>.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/GenericBeanFactory.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Here you can see an example of such extended BeanFactory usage:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Extended_BeanFactory_Usage.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Prototype_Creator.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Bean_Metadata_Builder">
+		<title>Bean Metadata Builder</title>
+		<para>
+			When using the Microcontainer in your code, use <classname>BeanMetaDataBuilder</classname> to create and configure your bean metadata.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/BeanMetaDataBuilder.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Using this concept, you don't expose your code to any Microcontainer implementation details.
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/BuilderUtil.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Custom_ClassLoader">
+		<title>Custom ClassLoader</title>
+		<para>
+			In the Microcontainer you can even define a custom ClassLoader per bean. When defining a classloader for the whole deployment, make sure you don't create a cyclic dependency -- for instance, a newly defined classloader that depends on itself.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/ClassLoader_Per_Bean.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Here is a test to verify that the CB2 bean uses a custom ClassLoader, which limits the loadable package scope:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/ClassLoader_CB2_Bean_Test.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Controller_Mode">
+		<title>Controller Mode</title>
+		<para>
+			By default, the Microcontainer uses the <property>AUTO</property> controller mode. It pushes beans as far as they go with respect to dependencies. But there are two other modes: <property>MANUAL</property> and <property>ON_DEMAND</property>.
+		</para>
+		<para>
+			If the bean is marked as <property>ON_DEMAND</property>, it will not be used or installed installed until some other bean explicitly depends on it. In <property>MANUAL</property> mode, the Microcontainer user must push the bean forward and backward along the state ladder.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Bean_Controller_Mode.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<note>
+			<para>
+				See <classname>inject</classname>'s <property>fromContext</property> attribute. Here, you can inject not only beans, but their unmodifiable Microcontainer component representation as well.
+			</para>
+		</note>
+		<para>
+			Review the code of <classname>OptionalServiceUser</classname> and <classname>ManualServiceUser</classname> for how to use the Microcontainer API for <property>ON_DEMAND</property> and <property>MANUAL</property> bean handling.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Cycle">
+		<title>Cycle</title>
+		<para>
+			Sometimes beans depend on each other in a cycle. For instance, <package>A</package> depends on <package>B</package> at construction, but <package>B</package> depends on <package>A</package> at setter. Because of the Microcontainer’s fine-grained state lifecycle separation, this problem can be solved easily.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Bean_Lifecycle_Separation.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Demand_and_Supply">
+		<title>Demand and Supply</title>
+		<para>
+			Sometimes, such as with an injection, a dependency is not explicitly obvious. However, there may still be a dependency between two beans, such as in the case of static code usage. This should be expressed in a clear way:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Static_Code_Usage.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Installs">
+		<title>Installs</title>
+		<para>
+			As a bean moves through different states, you might want to invoke some methods on other beans or the same bean. This example shows how <classname>Entry</classname> invokes <classname>RepositoryManager</classname>'s <methodname>add</methodname> and <methodname>removeEntry</methodname> methods to register and unregister itself.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Invoking_Methods_In_Different_States.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Lazy_Mock">
+		<title>Lazy Mock</title>
+		<para>
+			You might have a dependency on a bean that is rarely used, but takes a long time to configure. You can use a lazy mock of the bean, so that the dependency gets resolved. When you actually need the bean, invoke and use the target bean, hoping it has been installed by then.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Lazy_Mock.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Lifecycle">
+		<title>Lifecycle</title>
+		<para>
+			By default the Microcontainer uses <methodname>create</methodname>, <methodname>start</methodname>, and <methodname>destroy</methodname> methods when it moves through the various states. However, you may not want the Microcontainer to invoke them. For this reason, an <property>ignore</property> flag is available.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Bean_Lifecycles.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Advanced_Dependency_Injection_and_IoC-Conclusion">
+		<title>Conclusion</title>
+		<para>
+			This chapter has been a summary of how to apply different DI concepts with the help of the JBoss Microcontainer. The Microcontainer provides a comprehensive range of DI/IoC capabilities.
+		</para>
+		<para>
+			Joining these capabilities with a modular design, a clean split into metadata driven deployment, and an extensible state machine, you can nicely integrate any additional features you feel are missing.
+		</para>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Author_Group.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Author_Group.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Author_Group.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,30 @@
+<?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>
+	<author>
+		<firstname>Mark</firstname>
+		<surname>Newton</surname>
+		<affiliation>
+			<orgname>Red Hat</orgname>
+		</affiliation>
+		<email>mark.newton at jboss.org</email>
+	</author>
+	<author>
+		<firstname>Aleš</firstname>
+		<surname>Justin</surname>
+		<affiliation>
+			<orgname>Red Hat</orgname>
+		</affiliation>
+		<email>ajustin at redhat.com</email>
+	</author>
+	<editor>
+		<firstname>Misty</firstname>
+		<surname>Stanley-Jones</surname>
+		<affiliation>
+			<orgname>Red Hat</orgname>
+		</affiliation>
+		<email>misty at redhat.com</email>
+	</editor>
+</authorgroup>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Book_Info.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Book_Info.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Book_Info.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,26 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<bookinfo id="book-JBoss_Microcontainer_User_Guide-JBoss_Microcontainer_User_Guide">
+	<title>JBoss Microcontainer User Guide</title>
+	<subtitle>A Guide to Programming with the JBoss Microcontainer in EAP 5.1.</subtitle>
+	<productname>Documentation</productname>
+	<productnumber>5.1</productnumber>
+	<edition>0</edition>
+	<pubsnumber>0</pubsnumber>
+	<abstract>
+		<para>
+			This guide is intended for Java developers who wish to use the JBoss Microcontainer to deploy customized, modular Java environments for their applications.
+		</para>
+	</abstract>
+	<corpauthor>
+		<inlinemediaobject>
+			<imageobject>
+				<imagedata fileref="Common_Content/images/title_logo.svg" format="SVG" />
+			</imageobject>
+		</inlinemediaobject>
+	</corpauthor>
+	<xi:include href="Common_Content/Legal_Notice.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Author_Group.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</bookinfo>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Building_Services.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Building_Services.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Building_Services.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,423 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-Building_Services">
+	<title>Building Services</title>
+	<para>
+		Services are pieces of code which perform work needed by multiple clients. For our purposes, we will put some additional constraints on the definition of a service. Services should have unique names which can be referenced, or called, by clients. The internals of a service should be invisible and unimportant to clients. This is the "black box" concept of object-oriented programming (OOP). In OOP, each object is independent, and no other object needs to know how it does its job.
+	</para>
+	<para>
+		In the context of the Microcontainer, services are built from POJOs. A POJO is nearly a service in its own right, but it can't be accessed by a unique name, and it must be created by the client that needs it.
+	</para>
+	<para>
+		Although a POJO must be created at run-time by the client, it does not need to be implemented by a separate class in order to provide a well-defined interface. As long as fields and methods are not removed, and access to them is not restricted, there is no need to recompile clients to use a newly-created POJO.
+	</para>
+	<note>
+		<para>
+			Implementing an interface is only necessary in order to allow a client to choose between <emphasis>alternative implementations</emphasis>. If the client is compiled against an interface, many different implementations of the interface can be provided without having to recompile the client. The interface ensures that the method signatures do not change.
+		</para>
+	</note>
+	<para>
+		The remainder of this guide consists of creating a Human Resources service, using the Microcontainer to capture and modularize the business logic of the application. After the Microcontainer is installed, the example code is located in <filename>examples/User_Guide/gettingStarted/humanResourcesService</filename>.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-Building_Services-Introduction_to_the_Human_Resources_Example">
+		<title>Introduction to the Human Resources Example</title>
+		<para>
+			As you familiarize yourself with the directory structure of the files in the example, note that it uses the <ulink url="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html">Maven Standard Directory Layout</ulink>.
+		</para>
+		<para>
+			The Java source files are located in packages beneath the <filename>src/main/java directory</filename>. Each of these classes represents a simple POJO that doesn't implement any special interfaces. The most important class is <classname>HRManager</classname>, represents the service entry point providing all of the public methods that clients will call. 
+			<itemizedlist id="item-JBoss_Microcontainer_User_Guide-Introduction_to_the_Human_Resources_Example-Methods_Provided_by_the_HRManager_Class">
+				<title>Methods Provided by the <classname>HRManager</classname> Class</title>
+				<listitem>
+					<para>
+						<methodname>addEmployee(Employee employee)</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>removeEmployee(Employee employee)</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>getEmployee(String firstName, String lastName)</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>getEmployees()</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>getSalary(Employee employee)</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>setSalary(Employee employee, Integer newSalary)</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>isHiringFreeze()</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>setHiringFreeze(boolean hiringFreeze)</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>getSalaryStrategy()</methodname>
+					</para>
+				</listitem>
+				<listitem>
+					<para>
+						<methodname>setSalaryStrategy(SalaryStrategy strategy)</methodname>
+					</para>
+				</listitem>
+			</itemizedlist>
+		</para>
+		<para>
+			The Human Resources Service is composed of a handful of classes which maintain a list of employees and their details (addresses and salaries, in this case). Using the <methodname>SalaryStrategy</methodname> interface it is possible to configure the HRManager so that different salary strategy implementations are available to place minimum and maximum limits on the salaries for different employee roles.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Building_Services-Compiling_the_HRManager_Example_Project">
+		<title>Compiling the HRManager Example Project</title>
+		<para>
+			To compile the source code, issue <command>mvn compile</command> from the <filename>humanResourcesService/</filename> directory. This creates a new directory called <filename>target/classes</filename> which contains the compiled classes. To clean up the project and remove the target directory, issue the <command>mvn clean</command> command.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Building_Services-Creating_POJOs">
+		<title>Creating POJOs</title>
+		<para>
+			Before a POJO can be used, you need to create it. You need a naming mechanism that allows you to register a reference to the POJO instance with a name. Clients need this name to use the POJO.
+		</para>
+		<para>
+			The Microcontainer provides such a mechanism: a <emphasis>Controller</emphasis>. A Controller allows you to deploy your POJO-based services into a run-time environment.
+		</para>
+		<section id="sect-JBoss_Microcontainer_User_Guide-Creating_POJOs-XML_Deployment_Descriptors">
+			<title>XML Deployment Descriptors</title>
+			<para>
+				After compiling the classes, use an XML deployment descriptor to create instances of them. The descriptor contains a list of beans representing individual instances. Each bean has a unique name, so that it can be called by clients at run-time. The following descriptor deploys an instance of the HRManager:
+			</para>
+			
+<programlisting language="XML" role="XML"><xi:include href="extras/Creating_Instances_Of_Classes.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				This XML creates an instance of the <classname>HRManager</classname> class and registers it with the name HRService. This file is passed to an XML deployer associated with the Microcontainer at run-time, which performs the actual deployment, and instantiates the beans.
+			</para>
+		</section>
+
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Building_Services-Connecting_POJOs_Together">
+		<title>Connecting POJOs Together</title>
+		<para>
+			Individual POJO instances can only provide relatively simple behavior. The true power of POJOs comes from connecting them together to perform complex tasks. How can you wire POJOs together to choose different salary strategy implementations?
+		</para>
+		<para>
+			The following XML deployment descriptor does just that:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Wiring_POJOs_Together.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This XML creates an instance of the chosen salary strategy implementation by including an additional &lt;bean&gt; element. This time, the AgeBasedSalaryStrategy is chosen. Next the code injects a reference to this bean into the instance of <classname>HRManager</classname> created using the HRService bean. Injection is possible because the <classname>HRManager</classname> class contains a <methodname>setSalaryStrategy(SalaryStrategy strategy)</methodname> method. Behind the scenes, JBoss Microcontainer calls this method on the newly created HRManager instance and passes a reference to the <classname>AgeBasedSalaryStrategy</classname> instance.
+		</para>
+		<para>
+			The XML deployment descriptor causes the same sequence of events to occur as if you had written the following code:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Wiring_POJOs_Together.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</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 'Injection' chapter in Part II 'POJO Development.'<remark>XREF needed</remark>
+		</para>
+		<note>
+			<para>
+				Although creating instances of classes using the &lt;bean&gt; element in the deployment descriptor is possible, it is not always the best way. For example, creating instances of the <classname>Employee</classname> and <classname>Address</classname> classes is unnecessary, because the client creates these in response to input from the user. They remain part of the service but are not referenced in the deployment descriptor.
+			</para>
+			<formalpara id="form-JBoss_Microcontainer_User_Guide-Connecting_POJOs_Together-Comment_Your_Code">
+				<title>Comment Your Code</title>
+				<para>
+					Also, you can define multiple beans within a deployment descriptor as long as each has a unique name, which is used to perform injection as shown above. However all of the beans do not necessarily represent services. While a service can be implemented using a single bean, multiple beans are usually used together. One bean typically represents the service entry point, and contains the public methods called by the clients. In this example the entry point is the HRService bean. The XML deployment descriptor does not indicate whether a bean represents a service or whether a bean is the service entry point. It is a good idea to use comments and an obvious naming scheme to delineate service beans from non-service beans.
+				</para>
+			</formalpara>
+		</note>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Building_Services-Working_with_Services">
+		<title>Working with Services</title>
+		<para>
+			After creating POJOs and connecting them together to form services, you need to configure the services, test them, and package them.
+		</para>
+		<section id="sect-JBoss_Microcontainer_User_Guide-Working_with_Services-Configuring_A_Service">
+			<title>Configuring A Service</title>
+			<para>
+				Services can be configured by at least two ways: 
+				<itemizedlist>
+					<listitem>
+						<para>
+							Injecting references between POJO instances
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							Injecting values into POJO properties
+						</para>
+					</listitem>
+				</itemizedlist>
+				 In this example, the second method is used. The following deployment descriptor configures the HRManager instance in the following ways: 
+				<itemizedlist>
+					<listitem>
+						<para>
+							A hiring freeze is implemented.
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							The <methodname>AgeBasedSalaryStrategy</methodname> implements new minimum and maximum salary values.
+						</para>
+					</listitem>
+				</itemizedlist>
+				 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 language="XML" role="XML"><xi:include href="extras/Injecting_Values_Into_POJO_Properties.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				The classes must have public setter methods for the relevant properties so that values can be injected. For example, the <classname>HRManager</classname> class has a <methodname>setHiringFreeze(boolean hiringFreeze)</methodname> method and the <classname>AgeBasedSalaryStrategy</classname> class has <methodname>setMinSalary(int minSalary)</methodname> and <methodname>setMaxSalary(int maxSalary)</methodname> methods.
+			</para>
+			<para>
+				The values in the deployment descriptor are converted from strings into the relevant types (boolean, int etc...) by JavaBean PropertyEditors. Many PropertyEditors are provided by default for standard types, but you can create your own if necessary. See the Properties chapter in Part II 'POJO Development' for more details.<remark>XREF Needed</remark>
+			</para>
+		</section>
+		
+		<section id="sect-JBoss_Microcontainer_User_Guide-Working_with_Services-Testing_A_Service">
+			<title>Testing A Service</title>
+			<para>
+				After you have created your POJOs and connected them together to form services, you need to test them. JBoss Microcontainer allows unit testing individual POJOs as well as services, through the use of a <classname>MicrocontainerTest</classname> class.
+			</para>
+			<para>
+				The <classname>org.jboss.test.kernel.junit.MicrocontainerTest</classname> class inherits from <classname>junit.framework.TestCase</classname>, setting up each test by bootstrapping JBoss Microcontainer and adding a BasicXMLDeployer. It then searches the classpath for an XML deployment descriptor with the same name as the test class, ending in <filename>.xml</filename> and residing in a directory structure representing the class's package name. Any beans found in this file are deployed and can then be accessed using a convenience method called <methodname>getBean(String name)</methodname>.
+			</para>
+			<para>
+				Examples of these deployment descriptors can be found in the <filename>src/test/resources</filename> directory:
+			</para>
+			<variablelist>
+				<varlistentry>
+					<term><filename>org/jboss/example/service/</filename></term>
+					<listitem>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>HRManagerTestCase.xml</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManagerAgeBasedTestCase.xml</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManagerLocationBasedTestCase.xml</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</varlistentry>
+				<varlistentry>
+					<term>org/jboss/example/service/util/</term>
+					<listitem>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>AgeBasedSalaryTestCase.xml</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>LocationBasedSalaryTestCase.xml</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</varlistentry>
+			</variablelist>
+			<para>
+				The test code is located in the src/test/java directory:
+			</para>
+			<variablelist>
+				<varlistentry>
+					<term><filename>org/jboss/example/service/</filename></term>
+					<listitem>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>HRManagerTestCase.java</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManagerAgeBasedTestCase.xml</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManagerLocationBasedTestCase.xml</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManagerTest.java</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManagerTestSuite.java</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</varlistentry>
+				<varlistentry>
+					<term><filename>org/jboss/example/service/util/</filename></term>
+					<listitem>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>AgeBasedSalaryTestCase.java</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>LocationBasedSalaryTestVase.java</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>SalaryStrategyTestSuite.java</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</varlistentry>
+			</variablelist>
+			<para>
+				The <classname>HRManagerTest</classname> class extends <classname>MicrocontainerTest</classname> in order to set up a number of employees to use as the basis for the tests. Individual test cases then subclass <classname>HRManagerTest</classname> to perform the actual work. Also included are a couple of <classname>TestSuite</classname> classes that are used to group individual test cases together for convenience.
+			</para>
+			<para>
+				To run the tests, enter <command>mvn test</command> from the <filename>humanResourcesService/</filename> directory. You should see some <systemitem>DEBUG</systemitem> log output which shows JBoss Microcontainer starting up and deploying beans from the relevant XML file before running each test. At the end of the test the beans are undeployed and the Microcontainer is shut down.
+			</para>
+			<note>
+				<para>
+					Some of the tests, such as <classname>HRManagerTestCase</classname>, <classname>AgeBasedSalaryTestCase</classname>, and <classname>LocationBasedSalaryTestCase</classname>, unit test individual POJOs. Other tests, such as <classname>HRManagerAgeBasedTestCase</classname> and <classname>HRManagerLocationBasedTestCase</classname> unit test entire services. Either way, the tests are run in the same manner. Using the MicrocontainerTest class makes it easy to set up and conduct comprehensive tests for any part of your code.
+				</para>
+				<para>
+					The <classname>Address</classname> and <classname>Employee</classname> classes are not tested here. They were deliberately left out because they contain trivial logic which is unlikely to break.
+				</para>
+			</note>
+		</section>
+		
+		<section id="sect-JBoss_Microcontainer_User_Guide-Working_with_Services-Packaging_A_Service">
+			<title>Packaging A Service</title>
+			<para>
+				After testing your 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 this is optional.
+			</para>
+			<para>
+				If you do choose to include the deployment descriptor, by convention it should be named <filename>jboss-beans.xml</filename> and should be placed in a <filename>META-INF</filename> directory. This is useful if you later decide to deploy the service in JBoss AS 5, since the JAR deployer recognizes this layout by default and will automatically perform the deployment.
+			</para>
+			<para>
+				In the example it is not included, because we the service needs to be configured by editing the descriptor directly, as a separate file. To generate a JAR in the target directory containing all of the compiled classes, enter <command>mvn package</command> from the <filename>humanResourcesService/</filename> directory.
+			</para>
+			<para>
+				To make the JAR available to other Maven projects, enter <command>mvn install</command> in order to copy it to your local Maven repository. The final layout of the JAR is as follows:
+			</para>
+			<variablelist>
+				<varlistentry>
+					<term><filename>org/jboss/example/service</filename></term>
+					<listitem>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>Address.class</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>Employee.class</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>HRManager.class</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</varlistentry>
+				<varlistentry>
+					<term><filename>org/jboss/example/service/util/</filename></term>
+					<listitem>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>AgeBasedSalaryStrategy.class</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>LocationBasedSalaryStrategy.class</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>SalaryStrategy.class</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</varlistentry>
+				<varlistentry>
+					<term><filename>META-INF/</filename></term>
+					<listitem>
+						<para>
+							<filename>MANIFEST.MF</filename>
+						</para>
+					</listitem>
+				</varlistentry>
+				<varlistentry>
+					<term><filename>META-INF/maven/org.jboss.microcontainer.examples/humanResourcesService/</filename></term>
+					<listitem>
+						<para>
+							<filename>pom.xml</filename>
+						</para>
+					</listitem>
+				</varlistentry>
+				<varlistentry>
+					<term><filename>/</filename></term>
+					<listitem>
+						<para>
+							<filename>pom.properties</filename>
+						</para>
+					</listitem>
+				</varlistentry>
+			</variablelist>
+			<note>
+				<para>
+					The <filename>META-INF/maven</filename> directory is automatically created by Maven, and will not be present if you are using a different build system.
+				</para>
+			</note>
+		</section>
+
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Chapter.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Chapter.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Chapter.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter>
+	<title></title>
+	<para>
+	</para>
+	<section>
+		<title></title>
+		<para>
+		</para>
+	</section>
+	
+	<section>
+		<title></title>
+		<para>
+		</para>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/ClassLoading.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/ClassLoading.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/ClassLoading.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,209 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-The_ClassLoading_Layer">
+	<title>The ClassLoading Layer</title>
+	<para>
+		JBoss has always had a unique way of dealing with classloading, and the new classloading layer that comes with the Microcontainer is no exception ClassLoading is an optional add-on that you can use when you want non-default classloading. With the rising demand for OSGi-style classloading, and a number of new Java classloading specifications on the horizon, the changes to the ClassLoading layer of EAP 5.1 are useful and timely.
+	</para>
+	<para>
+		The Microcontainer ClassLoading layer is an abstraction layer. Most of the details are hidden behind private and package-private methods, without compromising the extensibility and functionality available through public classes and methods that make the API. This means that you code against policy and not against classloader details.
+	</para>
+	<para>
+		The ClassLoader project is split into 3 sub-projects
+	</para>
+	<itemizedlist>
+		<listitem>
+			<para>
+				classloader
+			</para>
+		</listitem>
+		<listitem>
+			<para>
+				classloading
+			</para>
+		</listitem>
+		<listitem>
+			<para>
+				classloading-vfs
+			</para>
+		</listitem>
+	</itemizedlist>
+	<para>
+		<classname>classloader</classname> contains a custom <classname>java.lang.ClassLoader</classname> extension without any specific classloading policy. A classloading policy includes knowledge of where to load from and how to load.
+	</para>
+	<para>
+		classloading is an extension of Microcontainer’s dependency mechanisms, based on classloading configuration, and classloading-vfs is its VFS backed implementation, using VFS is used to load classes.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_ClassLoading_Layer-ClassLoader">
+		<title>ClassLoader</title>
+		<para>
+			The <classname>ClassLoader</classname> implementation supports pluggable policies and is itself a final class, not meant to be altered. To write your own ClassLoader implementations, write a <classname>ClassLoaderPolicy</classname> which provides a simpler API for locating classes and resources, and for specifying other rules associated with the classloader.
+		</para>
+		<para>
+			To customize classloading, instantiate a <classname>ClassLoaderPolicy</classname> and register it with a <classname>ClassLoaderSystem</classname> to create a custom <classname>ClassLoader</classname>. You can also create a <classname>ClassLoaderDomain</classname> to partition the <classname>ClassLoaderSystem</classname>.
+		</para>
+		<para>
+			The <classname>ClassLoader</classname> layer also includes the implementation of things like DelegateLoader model, classloading, resource filters, and parent-child delegation policies.
+		</para>
+		<para>
+			The run-time is JMX enabled to expose the policy used for each classloader. It also provides classloading statistics and debugging methods to help determine where things are loaded from.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-ClassLoader-ClassLoaderPolicy_Example">
+			<title>ClassLoaderPolicy Example</title>
+			<para>
+				The <classname>ClassLoaderPolicy</classname> is the piece that controls the way your classloading works.
+			</para>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/ClassLoaderPolicy.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			Next, let's examine two examples of <classname>ClassLoaderPolicy</classname>. The first one retrieves resources based on regular expressions, while the second one handles encrypted resources.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-ClassLoader-ClassLoaderPolicy_with_Regular_Expression_Support">
+			<title>ClassLoaderPolicy with Regular Expression Support</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/RegexpClassLoaderPolicy.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				<classname>RegexpClassLoaderPolicy</classname> uses a simplistic mechanism to find matching resources. Real-world implementations would be more comprehensive and elegant.
+			</para>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/RegExpService.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				The regexp service uses "config/[^.]+\\.[^.]{1,4}" regular expression to list resources under the <filename>config/</filename>/ directory. The suffix length is limited, such that file names such as excluded.properties will be ignored.
+			</para>
+		</example>
+		<example id="exam-JBoss_Microcontainer_User_Guide-ClassLoader-ClassLoaderPolicy_with_Encryption_Support">
+			<title>ClassLoaderPolicy with Encryption Support</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/ClassLoaderPolicy_with_Encryption_Support.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				This example provides a <classname>Tools</classname> class to encrypt JARs. By specifying a proper filter, you can configure which resources to encrypt. This example encrypts everything except META-INF contents. JDK’s <classname>Cipher</classname> class is used for encryption.
+			</para>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/EncryptedService.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				This service prints out the contents of two configuration files. It shows that decryption of any encrypted resources is hidden behind the classloading layer.
+			</para>
+			<para>
+				To properly test this, either encrypt the policy module yourself or use an existing encrypted one. To put this into action, you need to properly tie EncryptedService to <classname>ClassLoaderSystem</classname> and deployers.
+			</para>
+			<para>
+				Partitioning <classname>ClassLoaderSystem</classname> is discussed later in this chapter.
+			</para>
+		</example>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_ClassLoading_Layer-ClassLoading">
+		<title>ClassLoading</title>
+		<para>
+			Instead of using the <classname>ClassLoader</classname> abstraction directly, you can create <classname>ClassLoading</classname> modules which contain declarations of <classname>ClassLoader</classname> dependencies. Once the dependencies are specified the <classname>ClassLoaderPolicy</classname>s are constructed and wired together accordingly.
+		</para>
+		<para>
+			To facilitate defining the <classname>ClassLoaders</classname> before they actually exist, the abstraction includes a <classname>ClassLoadingMetaData</classname> model.
+		</para>
+		<para>
+			The <classname>ClassLoadingMetaData</classname> can be exposed as a Managed Object within the new JBoss EAP profile service. This helps system administrators to deal with more abstract policy details rather than the implementation details.
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/ClassLoadingMetaData_exposed_as_Managed_Object.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Here is the API definition written in XML:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/ClassLoadingMetaData_exposed_as_Managed_Object.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Here is the API definition written in Java:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/ClassLoading_API.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			You can add ClassLoadingMetaData to your deployment either programmatically, or declaratively, via jboss-classloading.xml.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/jboss-classloading.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This example puts the classloader in the "DefaultDomain" which is shared among all the applications that don't define their own domain:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Classloader_DefaultDomain.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This example shows typical domain-level isolation:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Classloader_domain-level_isolation.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Next we have isolation with a specific parent:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Classloader_isolation_with_specific_parent.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This is an example of non-j2seClassLoadingCompliance, something .war deployments do by default. Instead of doing default parent-first look-up, you first check your own resources.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/non-j2seClassLoadingCompliance.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			An implementation typical of OSGi:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Classloader_OSGi.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			An example of importing and exporting whole modules and libraries, instead of using fine grained packages:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Classloader_import_export_modules.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			You can also mix the requirements and capabilities types, using packages and modules.
+		</para>
+		<para>
+			Another useful feature in the classloading sub-project is its elegantly small resource-visitor-pattern implementation.
+		</para>
+		<para>
+			In the <classname>ClassLoader</classname> project the connection between deployment and classloading is done through the <classname>Module</classname> class. This class holds all of the required information to properly apply restrictions on the visitor pattern, such as filtering:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Classloading_module_class.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			To use the module, instantiate your ResourceVisitor instance and pass it to <methodname>Module::visit</methodname> method. This feature is used in the deployment framework to index annotations usage in deployments.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_ClassLoading_Layer-ClassLoading_VFS">
+		<title>ClassLoading VFS</title>
+		<para>
+			These examples provide an implementation of the <classname>ClassLoaderPolicy</classname> that uses a JBoss Virtual File System project to load classes and resources. You can use this idea directly or in combination with a classloading framework.
+		</para>
+		<para>
+			Optionally, you can set up your modules inside the Microcontainer configuration.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Classloading_module_deployer.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This XML deployer is transformed, via <classname>VFSClassLoaderFactory</classname>, into <classname>VFSClassLoaderPolicyModule</classname>, which then creates the actual <classname>ClassLoader</classname> instance. You can then directly use this new <classname>ClassLoader</classname> instance with your beans.
+		</para>
+		<note>
+			<para>
+				<classname>VFSClassLoaderFactory</classname> extends <classname>ClassLoadingMetaData</classname>, so all examples pertaining to <classname>ClassLoadingMetaData</classname> apply in this case as well.
+			</para>
+		</note>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Intro.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Intro.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Intro.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,115 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-Introduction_to_the_Microcontainer">
+	<title>Introduction to the Microcontainer</title>
+	<para>
+		The JBoss Microcontainer is a refactoring of the JBoss JMX Microkernel to support direct POJO deployment and standalone use outside the JBoss application server.
+	</para>
+	<para>
+		The Microcontainer is designed to meet specific needs of Java developers who want to use object-oriented programming techniques to rapidly deploy software. In addition, it allows software to be deployed on a wide range of devices, from mobile computing platforms, large-scale grid-computing environments, and everything in between.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-Introduction_to_the_Microcontainer-Features">
+		<title>Features</title>
+		<itemizedlist>
+			<listitem>
+				<para>
+					All the features of the JMX Microkernel
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Direct POJO deployment (no need for Standard/XMBean or MBeanProxy)
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Direct IOC style dependency injection
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Improved lifecycle management
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Additional control over dependencies
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Transparent AOP integration
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Virtual File System
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Virtual Deployment Framework
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					OSGi classloading
+				</para>
+			</listitem>
+		</itemizedlist>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Introduction_to_the_Microcontainer-Definitions">
+		<title>Definitions</title>
+		<para>
+			For clarity, let's define some of the terms used often in this guide.
+		</para>
+		<variablelist>
+			<varlistentry>
+				<term>JMX Microkernel</term>
+				<listitem>
+					<para>
+						The JBoss JMX Microkernel is a modular Java environment. It differs from standard environments like J2EE in that the developer is able to choose exactly which components are part of the environment, and leave out the rest. To find out more about the JBoss JMX Microkernel, see the JBoss Enterprise Application Platform Configuration Guide.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>POJO</term>
+				<listitem>
+					<para>
+						POJO is an acronym for Plain Old Java Object. The name is used to emphasize that a given object is an ordinary Java Object, not a special object, and in particular not an Enterprise JavaBean. The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000 in a talk where they were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>Java Bean</term>
+				<listitem>
+					<para>
+						A Java Bean is a reusable software component that can be manipulated visually in a builder tool.
+					</para>
+					<para>
+						A Java Bean is an independent piece of code. It is not required to inherit from any particular base class or interface. Although Java Beans are primarily created in graphical IDEs, they can also be developed in simple text editors.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>AOP</term>
+				<listitem>
+					<para>
+						AOP is an acronym for Aspect-Oriented Programming. This is a programming paradigm in which secondary or supporting functions are isolated from the main program's business logic. It is a subset of object-oriented programming.
+					</para>
+				</listitem>
+			</varlistentry>
+		</variablelist>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Introduction_to_the_Microcontainer-Installation">
+		<title>Installation</title>
+		<para>
+			Installation and basic configuration of the Microcontainer is discussed in detail in the JBoss Microcontainer Admin Guide.
+		</para>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.ent
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.ent	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.ent	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,4 @@
+<!ENTITY PRODUCT "Documentation">
+<!ENTITY BOOKID "Getting_Started_Guide">
+<!ENTITY YEAR "2010">
+<!ENTITY HOLDER "Red Hat, Inc. and others">

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/JBoss_Microcontainer_User_Guide.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<book>
+	<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Preface.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Tutorial.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Advanced_Concepts.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<index />
+</book>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Models.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Models.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Models.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,145 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-Component_Models">
+	<title>Component Models</title>
+	<para>
+		The JBoss Microcontainer works within several popular POJO component models. Components are reusable software programs that you can develop and assemble easily to create sophisticated applications. Effective integration with these component models was an a key goal for the Microcontainer. Some popular component models which can be used with the Microcontainer are JMX, Spring, and Guice.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-Allowable_Interactions_with_Component_Models">
+		<title>Allowable Interactions with Component Models</title>
+		<para>
+			Before discussing interaction with some of the popular component models, it is important to understand which types of interactions are allowable. JMX MBeans are one example of a component model. Their interactions include executing MBean operations, referencing attributes, setting attributes and declaring explicit dependencies between named MBeans.
+		</para>
+		<para>
+			The default behaviors and interactions in the Microcontainer are what you also normally get from any other IoC container and are similar to the functionality that MBeans provided: plain method invocations for operations, setters/getters for attributes and explicit dependencies.
+		</para>
+		<para>
+			However, having only this functionality would only relieve the pain of declaring MBeans. Therefore, the Microcontainer does something more. <remark>Finish Me</remark>
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-A_Bean_With_No_Dependencies">
+		<title>A Bean With No Dependencies</title>
+		<para>
+			The following code is an example of a deployment descriptor for a plain POJO with no dependencies. This is the starting to point, to help you understand the changes needed to integrate with Spring or Guice in the sections ahead.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Plain_POJO_Descriptor.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-Using_the_Microcontainer_with_Spring">
+		<title>Using the Microcontainer with Spring</title>
+		<para>
+			The following descriptor what is needed for Spring support:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/POJO_Spring_Descriptor.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This file's namespace is different from the plain Microcontainer bean’s file. The <systemitem>urn:jboss:spring-beans:2.0</systemitem> namespace points to your version of the Spring schema port. Hence, you can describe your bean's Spring style, but the Microcontainer will deploy them, rather than Spring's bean factory notion.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-Using_the_Microcontainer_with_Spring-Using_Spring_with_the_Microcontainer">
+			<title>Using Spring with the Microcontainer</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/POJO_Spring_Example.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+			<para>
+				Although the SpringPojo bean has a dependency on Spring's library caused by implementing BeanNameAware interface, this dependency is only there to expose and mock some of the Spring's callback behavior.
+			</para>
+		</example>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-Using_Guice_With_the_Microcontainer">
+		<title>Using Guice With the Microcontainer</title>
+		<para>
+			Let's have a look at Guice integration. As Guice users know, Guice is all about type matching. Configuration of Guice beans is done via Modules. In order to generate beans, one must implement a Module.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-Using_Guice_With_the_Microcontainer-Deployment_Descriptor_for_Guice_Integration_In_the_Microcontainer">
+			<title>Deployment Descriptor for Guice Integration In the Microcontainer</title>
+			
+<programlisting language="XML" role="XML"><xi:include href="extras/Guice_Descriptor.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			Two important parts to watch from this file are <classname>PojoModule</classname> and <classname>GuiceKernelRegistryEntryPlugin</classname>. The first one is where we configure our beans:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Guice_Configure_Beans.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			The second class provides integration with the Microcontainer:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Guice_Microcontainer_Integration.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<note>
+			<para>
+				An Injector is created from the Modules and then does a look-up on it for matching beans. The next section shows how to declare our legacy usage of MBeans.
+			</para>
+		</note>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-Legacy_MBeans_and_Mixing_Different_Component_Models">
+		<title>Legacy MBeans, and Mixing Different Component Models</title>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Legacy_Beans.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Of interest is how this code injects a POJO into an MBean. The code above shows your first interactions between different component models.
+		</para>
+		<para>
+			To allow for MBean deployment via the Microcontainer, you must write an entirely new handler for the component model. See <filename>system-jmx-beans.xml</filename> for more details. The code from this file lives in the JBoss Application Server source code: <package>system-jmx</package> sub-project. This capability only exists with the JBoss JMX implementation, since the <package>system-jmx</package> code uses some implementation details.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-Exposing_POJOs_as_MBeans">
+		<title>Exposing POJOs as MBeans</title>
+		<para>
+			The following descriptor exposes an existing POJO as an MBean, registering it into an Mbean server:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Expose_POJO_As_Mbean.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Exposing a POJO as an MBean is done by annotating it with an @JMX annotation. The bean can either be exposed directly, or in its property:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Expose_POJO_As_Mbean_With_Annotation.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			You can use any of the injection look-up types, by either looking up a plain POJO or getting a handle to an MBean from the MBean server. One of the injection options is to use type injection, which is also sometimes called <firstterm>autowiring</firstterm>:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Autowiring.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			The <package>FromGuice</package> bean injects the Guice bean via type matching, where <classname>PlainPojo</classname> is injected with a common name injection. Now, you can test if Guice binding works as expected:
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-Exposing_POJOs_as_MBeans-Testing_Guice_Functionality">
+			<title>Testing Guice Functionality</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Testing_Guice_Functionality.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			This only provides an alias component model. Even though the alias is quite a trivial feature, it has to be introduced as a new component model inside the Microcontainer, in order to implement it as a true dependency. The implementation details for this are included in the AbstractController source code:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/AbstractController.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This descriptor maps the SpringPojo name to the springPojo alias. The benefit of having aliases as true component models is that it is unimportant when the real bean gets deployed. The alias will wait in a non-installed state until the real bean triggers it.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Component_Models-Conclusion">
+		<title>Conclusion</title>
+		<para>
+			This chapter shows how to deploy simple Microcontainer beans, legacy MBeans, Guice POJOs, Spring beans and aliases. And since all of this is controlled by the Microcontainer, mixing and matching the different component models is simple. With the level of abstraction in the Microcontainer component model design, the Microcontainer can handle an almost infinite number of situations.
+		</para>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Preface.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Preface.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Preface.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<preface id="pref-JBoss_Microcontainer_User_Guide-Preface">
+	<title>Preface</title>
+	<xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	</xi:fallback>
+	</xi:include>
+</preface>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Revision_History.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Revision_History.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Revision_History.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE appendix PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<appendix id="appe-JBoss_Microcontainer_User_Guide-Revision_History">
+	<title>Revision History</title>
+	<simpara>
+		<revhistory>
+			<revision>
+				<revnumber>0</revnumber>
+				<date>Wed Mar 31 2010</date>
+				<author>
+					<firstname>Dude</firstname>
+					<surname>McPants</surname>
+					<email>Dude.McPants at example.com</email>
+				</author>
+				<revdescription>
+					<simplelist>
+						<member>Initial creation of book by publican</member>
+					</simplelist>
+				</revdescription>
+			</revision>
+		</revhistory>
+	</simpara>
+</appendix>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Tutorial.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Tutorial.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Tutorial.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<part id="part-JBoss_Microcontainer_User_Guide-Introduction_to_The_Microcontainer_Guided_Tutorial">
+	<title>Introduction to The Microcontainer - Guided Tutorial</title>
+	<xi:include href="Intro.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Building_Services.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Using_Services.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+	<xi:include href="Adding_Behavior_with_AOP.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</part>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Using_Services.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Using_Services.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Using_Services.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,428 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-Using_Services">
+	<title>Using Services</title>
+	<para>
+		The previous chapter guided you through creating, configuring, testing and packaging a service. The next step is to create a client which will perform actual work using the service.
+	</para>
+	<para>
+		In order to keep things simple the client in this example uses a Text User Interface (TUI) to accept input from the user and output results. In practice a Graphical User Interface (GUI) would almost certainly be used is not relevant to learning to use the Microcontainer.
+	</para>
+	<para>
+		All of the necessary files in the <filename>examples/User_Guide/gettingstarted/commandLineClient</filename> directory. As with the previous example this follows the Maven Standard Directory Layout:
+	</para>
+	<variablelist>
+		<varlistentry>
+			<term><filename>commandLineClient/</filename></term>
+			<listitem>
+				<itemizedlist>
+					<listitem>
+						<para>
+							<filename>pom.xml</filename>
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>src/main/</filename>
+						</para>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>assembly/</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>config/</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>java/</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>resources/</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>src/test/</filename>
+						</para>
+						<itemizedlist>
+							<listitem>
+								<para>
+									<filename>java/</filename>
+								</para>
+							</listitem>
+							<listitem>
+								<para>
+									<filename>resources/</filename>
+								</para>
+							</listitem>
+						</itemizedlist>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+		</varlistentry>
+	</variablelist>
+	<para>
+		The client consists of three classes and one interface, located in the <filename>src/main/java</filename> directory:
+	</para>
+	<variablelist>
+		<varlistentry>
+			<term>org/jboss/example/client/</term>
+			<listitem>
+				<itemizedlist>
+					<listitem>
+						<para>
+							<filename>Client.java</filename>
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>ConsoleInput.java</filename>
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>EmbeddedBootstrap.java</filename>
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>UserInterface.java</filename>
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+		</varlistentry>
+	</variablelist>
+	<para>
+		<classname>UserInterface</classname> describes methods that the client calls at run-time to request user input. <classname>ConsoleInput</classname> is an implementation of <classname>UserInterface</classname> that creates a TUI which the user uses to interact with the client. The advantage of this design is that you can easily create a Swing implementation of <classname>UserInterface</classname> at a later date and replace the TUI with a GUI. You can also simulate the data-entry process with a script. Then you can check the behavior of the client automatically using conventional JUnit test cases as demonstrated by the code in the <filename>src/test/java directory</filename>:
+	</para>
+	<variablelist>
+		<varlistentry>
+			<term>org/jboss/example/client/</term>
+			<listitem>
+				<itemizedlist>
+					<listitem>
+						<para>
+							<filename>ClientTestCase.java</filename>
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>ClientTestSuite.java</filename>
+						</para>
+					</listitem>
+					<listitem>
+						<para>
+							<filename>MockUserInterface.java</filename>
+						</para>
+					</listitem>
+				</itemizedlist>
+			</listitem>
+		</varlistentry>
+	</variablelist>
+	<warning>
+		<para>
+			For the build to work you must first build and install <filename>auditAspect.jar</filename> from the <filename>examples/User_Guide/gettingStarted/auditAspect</filename> directory using the <command>mvn install command</command>. A number of different client distributions are created, including one based on AOP which relies on <filename>auditAspect.jar</filename> being available in the local Maven repository.
+		</para>
+		<para>
+			If you previously typed <command>mvn install</command> from the <filename>examples/User_Guide/gettingStarted</filename> directory then <filename>humanResourcesService.jar</filename> and <filename>auditAspect.jar</filename> have already been built and packaged, along with the client, so this step will not be necessary.
+		</para>
+	</warning>
+	<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 <command>mvn package</command> from the <filename>commandLineClient</filename> directory.
+	</para>
+	<para>
+		After compiling and packaging the client, the following sub-directories will exist in the <filename>commandLineClient/target</filename> directory:
+	</para>
+	<variablelist>
+		<varlistentry>
+			<term><filename>client-pojo.dir</filename></term>
+			<listitem>
+				<para>
+					used to call the service without AOP.
+				</para>
+			</listitem>
+		</varlistentry>
+		<varlistentry>
+			<term><filename>client-cl.dir</filename></term>
+			<listitem>
+				<para>
+					used to demonstrate classloading features.
+				</para>
+			</listitem>
+		</varlistentry>
+		<varlistentry>
+			<term>client-aop.dir</term>
+			<listitem>
+				<para>
+					Adding AOP support. See the AOP chapter for more details.
+				</para>
+			</listitem>
+		</varlistentry>
+	</variablelist>
+	<para>
+		Each sub-directory represents a different distribution with all of the shell scripts, JARs, and XML deployment descriptors needed to run the client in different configurations. The rest of this chapter uses the <filename>client-pojo</filename> distribution found in the <filename>client-pojo.dir</filename> sub-directory:
+	</para>
+	
+<screen>
+      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
+</screen>
+	<para>
+		To run the client, change to the <filename>client-pojo.dir</filename> directory and type <command>./run.sh</command>. The following options are presented:
+	</para>
+	
+<screen>
+      Menu:
+
+      d) Deploy Human Resources service
+      u) Undeploy Human Resources service
+
+      a) Add employee
+      l) List employees
+      r) Remove employee
+      g) Get a salary
+      s) Set a salary
+      t) Toggle hiring freeze
+
+      m) Display menu
+      p) Print service status
+      q) Quit
+      &gt;
+</screen>
+	<para>
+		To select an option, enter the letter shown on the left-hand side and press <keycap>RETURN</keycap>. For example to display the menu options enter <keycap>m</keycap> followed by <keycap>RETURN</keycap>. Entering more than one letter or entering an invalid option results in an error message.
+	</para>
+	<important>
+		<para>
+			The <filename>run.sh</filename> script sets up the run-time environment by adding all of the JARs found in the <filename>lib/</filename> directory to the classpath using the <property>java.ext.dirs</property> system property. It also adds the current directory and the <filename>client-1.0.0.jar</filename> using the <property>-cp</property> flag so that the <filename>jboss-beans.xml</filename> deployment descriptor can be found at run-time along with the <classname>org.jboss.example.client.Client</classname> class which is called to start the application.
+		</para>
+	</important>
+	<section id="sect-JBoss_Microcontainer_User_Guide-Using_Services-Bootstrapping_the_Microcontainer">
+		<title>Bootstrapping the Microcontainer</title>
+		<para>
+			Before using the client to deploy and call your service, take a closer look at what happened during its construction:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Bootstrapping_the_Microcontainer.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			First of all a URL representing the <filename>jboss-beans.xml</filename> deployment descriptor is created. This is later required so that the XML deployer can deploy and undeploy beans declared in the file. The <methodname>getResource()</methodname> method of the application classloader is used because the <filename>jboss-beans.xml</filename> file is included on the classpath. This is optional; the name and location of the deployment descriptor are unimportant as long as the URL is valid and reachable.
+		</para>
+		<para>
+			Next an instance of JBoss Microcontainer is created, along with an XML deployer. This process is called <firstterm>bootstrapping</firstterm> and a convenience class called <classname>BasicBootstrap</classname> is provided as part of the Microcontainer to allow for programmatic configuration. To add an XML deployer, extend <classname>BasicBootstrap</classname> to create an <classname>EmbeddedBootstrap</classname> class and override the protected <methodname>bootstrap()</methodname> method as follows:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/EmbeddedBootstrap.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			The <methodname>shutdown</methodname> hook ensures that when the JVM exits, all of the beans are undeployed in the correct order. The public <methodname>deploy</methodname>/<methodname>undeploy</methodname> methods delegate to the <classname>BasicXMLDeployer</classname> so that beans declared in <filename>jboss-beans.xml</filename> can be deployed and undeployed.
+		</para>
+		<para>
+			Finally references to the Microcontainer controller and bus are restored, so you can look up bean references by name and access them directly or indirectly as necessary.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Using_Services-Deploying_the_Service">
+		<title>Deploying the Service</title>
+		<para>
+			After creating the client, you can deploy the Human Resources service. This is done by entering the <keycap>d</keycap> option from the TUI. Output indicates that the <classname>BasicXMLDeployer</classname> has parsed the <filename>jboss-beans.xml</filename> file using the URL, and instantiated the beans found within.
+		</para>
+		<note>
+			<para>
+				The Microcontainer is able to instantiate the beans because their classes are available in the extension classpath inside the <filename>lib/humanResourcesService.jar</filename> file. You can also place these classes in an exploded directory structure and add it to the application classpath, but packaging them in a JAR is typically more convenient.
+			</para>
+		</note>
+		<para>
+			The deployment descriptor is entirely separate from the <filename>humanResourcesService.jar</filename> file. This enables easy editing of it for testing purposes. The <filename>jboss-beans.xml</filename> file in the example contains some commented-out fragments of XML which show some of the possible configurations.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/jboss-beans.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<important>
+			<para>
+				Depending on how you access the service at run-time, you may need to shut down 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 run-time. Alternatively you may be able to simply redeploy the service while the application is running. This increases flexibility but results in slower run-time performance. Keep these trade-offs under consideration when designing your applications.
+			</para>
+		</important>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Using_Services-Direct_Access">
+		<title>Direct Access</title>
+		<para>
+			If no parameters are given to the <filename>run.sh</filename> script when the client is started, a reference to the <classname>HRService</classname> bean is looked up using the Microcontainer controller after the service is deployed:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Looking_Up_Reference_to_HRService.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Rather than immediately looking up a reference to the bean instance, the example first looks up a reference to a <classname>ControllerContext</classname>, then obtains a reference to the bean instance from the context using the <methodname>getTarget()</methodname> method. The bean can exist in many states within the Microcontainer in one of the following states: NOT_INSTALLED, DESCRIBED, INSTANTIATED, CONFIGURED, INSTALLED. To keep track of which state the bean is in, wrap it in another object called a <wordasword>context</wordasword> that describes the current state. The name of the context is the same as the bean name. Once a context reaches the INSTALLED state, the bean it represents is considered to be deployed.
+		</para>
+		<para>
+			After creating a reference to the bean instance representing the service entry point, you can call methods on it to preform work:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Calling_Methods_On_Bean_Instance.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			The client is accessing the service directly since it is using a reference to the actual bean instance. Performance is good, because each method call goes directly to the bean. What happens, however, if you want to reconfigure the service and redeploy it while the application is running?
+		</para>
+		<para>
+			Reconfiguration is achieved by making changes to the XML deployment descriptor and saving the file. In order to redeploy the service, the current instance must be undeployed. During undeployment the Microcontainer controller releases its reference to the bean instance, along with any dependent beans. These beans will subsequently become available for garbage collection because they are no longer required by the application. Redeploying the service creates new bean instances representing the new configuration. Any subsequent look-ups from clients will retrieve references to these new instances and they will be able to access the reconfigured service.
+		</para>
+		<para>
+			The problem is that the reference to the bean instance representing our service entry point is cached when you deploy the service for the first time. Undeploying the service has no affect, since the bean instance can still be accessed using the cached reference and it will not be garbage collected until the client releases it. Along the same line, deploying the service again will not cause another look-up because the client already has a cached reference. It will therefore continue to use the bean instance representing the initial service configuration.
+		</para>
+		<para>
+			You can test this behavior by typing <keycap>u</keycap> followed by <keycap>RETURN</keycap> to undeploy the current service. You should still be able to access the service from the client even though it is 'undeployed'. Next, make some changes to the configuration using the <filename>jboss-beans.xml</filename> file, save the file, and deploy it again using the <keycap>d</keycap> option. Printing out the status of the service using the <keycap>p</keycap> option shows that the client is still accessing the initial instance of the service that was deployed.
+		</para>
+		<warning>
+			<para>
+				Even if you modify the client to look up a new reference each time the service is redeployed, new developers may hand out copies of this reference to other objects, by mistake. If all of these references are not cleaned up during redeployment, the same caching problem can occur.
+			</para>
+		</warning>
+		<para>
+			To reliably redeploy the reconfigured service, shut down the application completely using the 'q' option and restart it again using the <filename>run.sh</filename> script. For enterprise services such as Transactions, Messaging and Persistence this is perfectly acceptable behavior, since they are generally always in use. They cannot be redeployed at run-time and also benefit from the high performance given by using direct access. If your service falls into this category, consider using direct access via the Microcontainer controller.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Using_Services-Indirect_Access">
+		<title>Indirect Access</title>
+		<para>
+			The <filename>run.sh</filename> script can be called with an optional parameter <property>bus</property>, which causes calls to the Human Resources service to use the Microcontainer bus.
+		</para>
+		<para>
+			Instead of using a direct reference to the bean instance obtained from the Microcontainer controller, the new behavior is to call an <methodname>invoke()</methodname> method on the bus, passing in the bean name, method name, method arguments and method types. The bus uses this information to call the bean on the client's behalf.
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Using_the_Invoke_Method.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Behind the scenes, the bus looks up the reference to the named bean instance and calls the chosen method using reflection. Since the client never has a direct reference to the bean instance, it accesses the service 'indirectly'. Since the bus does not cache the reference changes to the service configuration can safely be made and it can be redeployed at run-time. Subsequent calls by the client will use the new reference, as expected. The client and service have been decoupled.
+		</para>
+		<note>
+			<para>
+				This behavior can be tested by deploying the service and using the <keycap>p</keycap> option to print out the status. Undeploy the service using the <keycap>u</keycap> option and notice that it is inaccessible. Next, make some changes to <filename>jboss-beans.xml</filename> file, save the changes, and deploy it again using the <keycap>d</keycap> option. Print out the status again using the <keycap>p</keycap> option. The client is accessing the new service configuration.
+			</para>
+		</note>
+		<para>
+			Because the bus uses reflection to call bean instances, it is a slower than direct access. The benefit of the approach is that only the bus has references to the bean instances. When a service is redeployed, all of the existing references can be cleaned up and replaced with new ones. This way, a service can be reliably redeployed at run-time. Services that are not used very often or that are specific to certain applications are good candidates for indirect access using the Microcontainer bus. Often, the reduction in performance is outweighed by the flexibility that this provides.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-Using_Services-Dynamic_Classloading">
+		<title>Dynamic Classloading</title>
+		<para>
+			So far you have used the extension and application classloaders to load all of the classes in the application. The application classpath is set up by the <filename>run.sh</filename> script using the <property>-cp</property> flag to include the current directory and the <filename>client-1.0.0.jar</filename>, as shown here:
+		</para>
+		
+<screen>java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1
+</screen>
+		<para>
+			For convenience the JARs in the <filename>lib</filename> directory were added to the extension classloader's classpath using the <property>java.ext.dirs</property> system property, rather than listing the full path to each of the JARs after the -cp flag. Because the <classname>classloader</classname> extension is the parent of the <systemitem>classloader</systemitem> application, the client classes is able to find all of the Microcontainer classes and the Human Resources service classes at run-time.
+		</para>
+		<note>
+			<para>
+				With Java 6+ a wild-card can be used to include all JARs in a directory with the <property>-cp</property> flag:
+			</para>
+			
+<screen>
+	  java -cp `pwd`/lib/*:.:client-1.0.0.jar org.jboss.example.client.Client $1
+</screen>
+			<para>
+				Here, all of the classes in the application will be added to the application classloader's classpath, and the extension classloader's classpath will retain its default value.
+			</para>
+		</note>
+		<para>
+			What happens if you need to deploy an additional service at run-time? If the new service is packaged in a JAR file, it must be visible to a classloader before any of its classes can be loaded. Because you have already set up the classpath for the application classloader (and extension classloader) on start-up, it is not easy to 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>
+			You may wish to redeploy an existing service but change some of its classes. Because security constraints forbid an existing classloader from reloading classes, how can this be done?
+		</para>
+		<para>
+			The goal is to create a new classloader that knows the location of the new service's classes, or that can load new versions of an existing service's classes, in order to deploy the service's beans. JBoss Microcontainer uses the &lt;classloader&gt; element in the deployment descriptor to accomplish this.
+		</para>
+		<para>
+			The <filename>client-cl</filename> distribution in the <filename>commandLineClient/target/client-cl.dir</filename> directory contains the following files that demonstrate how this works:
+		</para>
+		
+<screen>
+	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
+</screen>
+		<para>
+			The <filename>humanResourcesService.jar</filename> file has been moved to a new sub-directory called <filename>otherLib</filename>. It is no longer available to either the extension or application classloaders whose classpaths are setup in the run.sh script:
+		</para>
+		
+<screen>java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1
+</screen>
+		<para>
+			To work around this, create a new classloader during the deployment of the service, load it in the service classes, and create instances of the beans. To see how this is done, look at the contents of the <filename>jboss-beans.xml</filename> file:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/new-classloader-via-jboss-beans.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			First, the code creates an instance of <classname>java.net.URL</classname> called <classname>URL</classname> using parameter injection in the constructor to specify the location of the <filename>humanResourcesService.jar</filename> file on the local file-system. The next step is to create an instance of a <classname>URLClassLoader</classname> by injecting the URL bean into the constructor as the only element in an array. Next, include a &lt;classloader&gt; element in our <classname>HRService</classname> bean definition and inject the <classname>customCL</classname> bean. This specifies that the <classname>HRManager</classname> class needs to be loaded by the customCL classloader.
+		</para>
+		<para>
+			But how do you decide which classloader to use for the other beans in the deployment?
+		</para>
+		<para>
+			All beans in the deployment use the current thread's context classloader. In this case the thread that handles deployment is the main thread of the application which has its context classloader set to the application classloader on start-up. If you wish, you can specify a different classloader for the entire deployment using a &lt;classloader&gt; element as follows:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Specifying_a_Different_Classloader.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This would be necessary to allow for reconfiguration of the service by uncommenting the <classname>AgeBasedSalary</classname> or <classname>LocationBasedSalary</classname> beans. Classloaders specified at the bean level override the deployment level classloader. To override the deployment level classloader altogether, and use the default classloader for a bean, use the &lt;null/&gt; value as follows:
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Using_the_Default_Classloader_per_Bean.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<warning>
+			<para>
+				If you create a new classloader for your service using the deployment descriptor, be aware that you may not be able to access classes loaded by it from the application classloader anymore. The result in this example is 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 behavior by starting the client using the <filename>run.sh</filename> command and then trying to deploy the service. You should see that a <systemitem>java.lang.NoClassDefFoundError</systemitem> exception is thrown and the application exits.
+			</para>
+			<para>
+				In this case, you must use the bus to access the service indirectly and provide access to any classes shared by the client in the application classpath. In this example this means the <classname>Address</classname>, <classname>Employee</classname>, and <classname>SalaryStrategy</classname> classes.
+			</para>
+		</warning>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/VFS.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/VFS.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/VFS.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,194 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers">
+	<title>The Virtual File System</title>
+	<para>
+		A common problem for developers is that much code used for resource handling is duplicated in many places. In most cases, the code dealt with determining information about a particular resource. A resource might be a file, a directory, or, in the case of a JAR, a remote URL. Another effort which is duplicated in many places is the processing of nested archives. Here is an example of such duplication:
+	</para>
+	
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Resource_Duplication_Problem.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	<para>
+		There are also many problems with file locking on Windows systems, forcing developers to copy all hot-deployable archives to another location to prevent locking those in deploy folders (which would prevent their deletion and file-system based undeploy). File locking is a major problem whose only solution used to be centralizing all the resource loading code in one place.
+	</para>
+	<para>
+		The <firstterm>VFS</firstterm> project was created solve all of these issues. VFS stands for <firstterm>Virtual File System</firstterm>.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers-VFS_Public_API">
+		<title>VFS Public API</title>
+		<para>
+			Basic usage in VFS can be split in two pieces:
+		</para>
+		<itemizedlist>
+			<listitem>
+				<para>
+					simple resource navigation
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					visitor pattern <firstterm>API</firstterm> (Application Programmer Interface)
+				</para>
+			</listitem>
+		</itemizedlist>
+		<para>
+			As mentioned, in plain JDK, resource handling navigation over resources is far from trivial. You must always check what kind of resource you're currently handling, and this is very cumbersome. VFS limits this to a single resource type: <type>VirtualFile</type>.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-VFS_Public_API-The_VirtualFile_Resource_Type">
+			<title>The VirtualFile Resource Type</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/VirtualFile_Resource.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			All of the usual read-only File System operations are available, plus a few options to cleanup or delete the resource. Cleanup or deletion handling is needed when dealing with some internal temporary files, such as files created for nested jars handling.
+		</para>
+		<para>
+			To switch from the JDK's <type>File</type> or <type>URL</type> resource handling to new <type>VirtualFile</type> you need a root. The <classname>VFS</classname> class knows how to create a <type>VirtualFile</type> with the help of URL or URI parameter.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-VFS_Public_API-Using_the_VFS_Class">
+			<title>Using the <classname>VFS</classname> Class</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/VFS_Class.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			You can see three different methods that look a lot alike:
+		</para>
+		<itemizedlist>
+			<listitem>
+				<para>
+					<methodname>getVFS</methodname>
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					<methodname>createNewRoot</methodname>
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					<methodname>getRoot</methodname>
+				</para>
+			</listitem>
+		</itemizedlist>
+		<para>
+			<methodname>getVFS</methodname> returns a VFS instance but does not yet create a VirtualFile instance. This is important because there are methods which help with configuring a VFS instance (see VFS class API javadocs), before instructing it to create a VirtualFile root.
+		</para>
+		<para>
+			The other two methods, on the other hand, use default settings for root creation. The difference between <methodname>createNewRoot</methodname> and <methodname>getRoot</methodname> is in caching details, which are covered later.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-VFS_Public_API-Using_getVFS">
+			<title>Using <methodname>getVFS</methodname></title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Using_getVFS.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			Another useful thing about VFS API is its implementation of a proper visitor pattern. It is very simple to recursively gather different resources, a task which is quite impossible to do with plain JDK resource loading.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-VFS_Public_API-Recursively_Gathering_Resources">
+			<title>Recursively Gathering Resources</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Recursively_Gathering_Resources.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers-VFS_Architecture">
+		<title>VFS Architecture</title>
+		<para>
+			While the public API is quite intuitive, real implementation details are a bit more complex. Some concepts need to be explained in more detail.
+		</para>
+		<para>
+			Each time you create a VFS instance, its matching <classname>VFSContext</classname> instance is created. This creation is done via <classname>VFSContextFactory</classname>. Different protocols map to different <classname>VFSContextFactory</classname> instances. For example, file/vfsfile map to <classname>FileSystemContextFactory</classname>, zip/vfszip map to <classname>ZipEntryContextFactory</classname>.
+		</para>
+		<para>
+			Also, each time a <classname>VirtualFile</classname> instance is created, its matching <type>VirtualFileHandler</type> is created. This <type>VirtualFileHandler</type> instance knows how to handle different resource types properly; the <classname>VirtualFile</classname> API only delegates invocations to its <type>VirtualFileHandler</type> reference.
+		</para>
+		<para>
+			The <classname>VFSContext</classname> instance knows how to create <type>VirtualFileHandler</type> instances accordingly to a resource type. For example, ZipEntryContextFactory creates <classname>ZipEntryContext</classname>, which then creates <classname>ZipEntryHandler</classname>.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers-Existing_Implementations">
+		<title>Existing Implementations</title>
+		<para>
+			Apart from files, directories (FileHandler) and zip archives (ZipEntryHandler) the Microcontainer also supports other more exotic usages. The first one is <firstterm>Assembled</firstterm>, which is similar to what Eclipse calls <firstterm>Linked Resources</firstterm>. Its purpose is to take existing resources from different trees, and "mock" them into single resource tree.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-Existing_Implementations-Implementation_of_Assembled_VirtualFileHandlers">
+			<title>Implementation of Assembled VirtualFileHandlers</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Implementation_of_Assembled_VirtualFileHandlers.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+		<para>
+			Another implementation is <firstterm>in-memory</firstterm> files. This implantation arose out of a need to easily handle AOP generated bytes. Instead of using temporary files, you can drop bytes into in-memory VirtualFileHandlers.
+		</para>
+		<example id="exam-JBoss_Microcontainer_User_Guide-Existing_Implementations-Implementation_of_In_Memory_VirtualFileHandlers">
+			<title>Implementation of In-Memory VirtualFileHandlers</title>
+			
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Implementation_of_In-Memory_VirtualFileHandlers.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		</example>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers-Extension_Hooks">
+		<title>Extension Hooks</title>
+		<para>
+			It is easy to extend VFS with a new protocol, similar to what we've done with Assembled and Memory. All you need is a combination of <classname>VFSContexFactory</classname>, <classname>VFSContext</classname>, <classname>VirtualFileHandler</classname>, <classname>FileHandlerPlugin</classname>, and <classname>URLStreamHandler</classname> implementations. The first one is trivial, while the others depend on the complexity of your task. You could implement <filename>rar</filename>, <filename>tar</filename>, <filename>gzip</filename>, or even <filename>remote</filename> access.
+		</para>
+		<para>
+			After implementing these, register this new VFSContextFactory with VFSContextFactoryLocator.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers-Features">
+		<title>Features</title>
+		<para>
+			One of the first major problems the Microcontainer developers faced was proper usage of nested resources, more specifically nested jar files: For example, normal ear deployments: <filename>gema.ear/ui.war/WEB-INF/lib/struts.jar</filename>.
+		</para>
+		<para>
+			In order to read contents of <filename>struts.jar</filename> we have two options:
+		</para>
+		<itemizedlist>
+			<listitem>
+				<para>
+					handle resources in memory
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					create top level temporary copies of nested jars, recursively
+				</para>
+			</listitem>
+		</itemizedlist>
+		<para>
+			The first option is easier to implement, but it's very memory-consuming--just imagine huge apps in memory. The other approach leaves a bunch of temporary files, which should be invisible to the end user and therefore should disappear after undeployment.
+		</para>
+		<para>
+			Imagine the following scenario: A user accesses a VFS URL instance, which points to some nested resource.
+		</para>
+		<para>
+			The way plain VFS would handle this is to re-create the entire path from scratch: it would unpack nested resources over and over again. This leads to a great number of temporary files.
+		</para>
+		<para>
+			The Microcontainer avoids this by using <classname>VFSRegistry</classname>, <classname>VFSCache</classname>, and <classname>TempInfo</classname>.
+		</para>
+		<para>
+			When you ask for VirtualFile over VFS (<classname>getRoot</classname>, not <classname>createNewRoot</classname>), VFS asks the <classname>VFSRegistry</classname> implementation to provide the file. The existing <classname>DefaultVFSRegistry</classname> first checks if a matching root <classname>VFSContext</classname> exists for the provided URI. If it does, <classname>DefaultVFSRegistry</classname> first tries to navigate to the existing <classname>TempInfo</classname> (link to a temporary files), falling back to regular navigation if no such temporary file exists. In this way you completely reuse any temporary files which have already been unpacked, saving time and disk space. If no matching <classname>VFSContext</classname> is found in cache, the code will create a new <classname>VFSCache</classname> entry and continue with default navigation.
+		</para>
+		<para>
+			Determining how the <classname>VFSCache</classname> handles cached VFSContext entries depends on the implementation used. <classname>VFSCache</classname> is configurable via <classname>VFSCacheFactory</classname>. By default nothing is cached, but there are a few useful existing <classname>VFSCache</classname> implementations, using algorithms such as least recently used (LRU) to timed cache.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_File_System_Classloading_and_Deployers-API_Use_Case">
+		<title>API Use Case</title>
+		<para>
+		</para>
+	</section>
+
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Virtual_Deployment_Framework.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Virtual_Deployment_Framework.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/Virtual_Deployment_Framework.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,286 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework">
+	<title>The Virtual Deployment Framework</title>
+	<para>
+		The new Virtual Deployment Framework (VDF) is an improved way to manage deployers in the Microcontainer. These features sum up what makes it useful.
+	</para>
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Agnostic_Handling_of_Deployment_Types">
+		<title>Agnostic Handling of Deployment Types</title>
+		<para>
+			If you simply need to create a virtual deployment, based on programmatically described metadata, such as classes which already exist in a shared class-space or domain, you have some choices. The end result will be a new service installed into the server from your admin client.
+		</para>
+		<para>
+			The traditional way to do this is to upload a descriptor file. Using the new VDF, you can pass over the bytes and serialize them into a <classname>Deployment</classname> instance.
+		</para>
+		<para>
+			The other type of deployment, which extends the first one, is plain file-system-based deployment, backed up by Microcontainer VFS. This approach is described in more detail in the VFS chapter.
+		</para>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Separation_of_structure_recognition_from_deployment_lifecycle_logic">
+		<title>Separation of structure recognition from deployment lifecycle logic</title>
+		<para>
+			In order to do any real work on top of a deployment, you must first understand its structure, including its classpaths and metadata locations.
+		</para>
+		<para>
+			Metadata locations are where the configuration files such as <filename>my-jboss-beans.xml</filename>, <filename>web.xml</filename>, <filename>ejb-jar.xml</filename>, and others,are located. Classpaths are classloader roots, such as <filename>WEB-INF/classes</filename> or <filename>myapp.ear/lib</filename>.
+		</para>
+		<para>
+			After you have successfully recognized the structure, you can proceed to actual deployment handling, with the structure info in mind.
+		</para>
+		<para>
+			A typical deployment lifecycle might go something like this:
+		</para>
+		<orderedlist>
+			<listitem>
+				<para>
+					The <classname>MainDeployer</classname> passes the deployment to the set of <classname>StructuralDeployer</classname>s for recognition, and receives back a Deployment context.
+				</para>
+			</listitem>
+			<listitem>
+				<para>
+					Next, the <classname>MainDeployer</classname> passes the resulting Deployment context to the <classname>Deployers</classname> for handling by the appropriate <classname>Deployer</classname>.
+				</para>
+			</listitem>
+		</orderedlist>
+		<para>
+			In this way, the MainDeployer is a broker with the responsibility of deciding which Deployers to use.
+		</para>
+		<para>
+			In the case of virtual or programmatic deployment, an existing predetermined StructureMetaData information is required. This information is used to read the structure information. It is handled in one of two ways:
+		</para>
+		<variablelist>
+			<varlistentry>
+				<term>VFS-based deployments</term>
+				<listitem>
+					<para>
+						the structure recognition is forwarded to a set of StructureDeployers.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>JEE-specification-defined structures</term>
+				<listitem>
+					<para>
+						we have matching StructureDeployer implementations:
+					</para>
+					<itemizedlist>
+						<listitem>
+							<para>
+								EarStructure
+							</para>
+						</listitem>
+						<listitem>
+							<para>
+								WarStructure
+							</para>
+						</listitem>
+						<listitem>
+							<para>
+								JarStructure
+							</para>
+						</listitem>
+					</itemizedlist>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>DeclarativeStructures</term>
+				<listitem>
+					<para>
+						looks for <filename>META-INF/jboss-structure.xml</filename> file inside your deployment, and parses it to construct a proper <classname>StructureMetaData</classname>.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>FileStructures</term>
+				<listitem>
+					<para>
+						simply recognizes known configuration files, such as files like <filename>-jboss-beans.xml</filename> or <filename>-service.xml</filename>.
+					</para>
+					<example id="exam-JBoss_Microcontainer_User_Guide-Separation_of_structure_recognition_from_deployment_lifecycle_logic-An_example_of_jboss_structure.xml">
+						<title>An example of <filename>jboss-structure.xml</filename></title>
+						
+<programlisting language="XML" role="XML"><xi:include href="extras/jboss-structure.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+					</example>
+				</listitem>
+			</varlistentry>
+		</variablelist>
+		<para>
+			In the case of EarStructure, first recognize a top level deployment, then recursively process sub-deployments.
+		</para>
+		<para>
+			It is easy to implement your own <classname>StructureDeployer</classname>, especially with the help of the generic <classname>GroupingStructure</classname>.
+		</para>
+		<para>
+			After you have a recognized deployment structure, you can feed it to real deployers. The Deployers object knows how to deal with the real deployers, using a chain of deployers per <classname>DeploymentStage</classname>.
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Deployment_Stages.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			This is a set of preexisting deployment stages. These states are mapped to the Microcontainer's built-in controller states. They provide a deployment-lifecycle-centric view of generic controller states.
+		</para>
+		<para>
+			Inside Deployers, the deployment is converted into the Microcontainer's component <classname>DeploymentControllerContext</classname>. The Microcontainer's state machine handles dependencies.
+		</para>
+		<para>
+			Deployments are handled sequentially by deployment stage. For each deployer, the entire deployed hierarchy order is handled, using the deployer's <varname>parent-first</varname> property. This property is set to <option>true</option> by default.
+		</para>
+		<para>
+			You can also specify which hierarchy levels your deployer handles. You can choose <option>all</option>, <option>top level</option>, <option>components only</option>, or <option>no components</option>.
+		</para>
+		<para>
+			The way the Microcontainer handles component models and dependency handling applies here as well. If there are unresolved dependencies, the deployment will wait in the current state, potentially reporting an error if the current state is not the required state.
+		</para>
+		<para>
+			Adding a new deployer is accomplished by extending one of the many existing helper deployers.
+		</para>
+		<note>
+			<para>
+				Some deployers actually need VFS backed deployment, while others can use a general deployment. In most cases the parsing deployers are the ones that need VFS backing.
+			</para>
+		</note>
+		<warning>
+			<para>
+				Every deployer is run recursively, against every deployment, sub-deployment, and component. If the deployer is not written correctly, this can result in unnecessary processing. Programmatically determine if the deployer is appropriate before creating the DeploymentContext or filling it up.
+			</para>
+		</warning>
+		<para>
+			This is a simple deployer which outputs information about the deployment it is handling:
+		</para>
+		
+<programlisting language="Java" role="JAVA"><xi:include href="extras/Simple_Deployer.java" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Add this description into one of the <filename>-jboss-beans.xml</filename> files in <filename>deployers/</filename> directory in JBoss Application Server, and <classname>MainDeployerImpl</classname> bean will pick up this deployer via the Microcontainer's IoC callback handling.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/Simple_Deployer_Descriptor.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Natural_flow_control_in_the_form_of_attachments">
+		<title>Natural flow control in the form of attachments</title>
+		<para>
+			VDF includes a mechanism called <firstterm>attachments</firstterm>, which facilitates the passing of information from one deployer to the next. Attachments are implemented as a slightly-enhanced <filename>java.util.Map</filename>, whose entries each represent an attachment.
+		</para>
+		<para>
+			Some deployers are producers, while others are consumers. The same deployer can also perform both functions. Here, some deployers create metadata or util instances, putting them into <firstterm>attachments</firstterm> map, and other deployers only declare their need for these attachments, and get the data out from the attachments map, before doing additional work on that data.
+		</para>
+		<para>
+			<firstterm>Natural order</firstterm> refers to the way that deployers are ordered. A common natural order is to order things in relative terms: before and after. However, with the attachments mechanism already in place, you can order deployers by how they produce and/or consume the attachments.
+		</para>
+		<para>
+			Each attachment has a key, and deployers pass keys to the attachments they produce. If the deployer produces an attachment, then that key is called <firstterm>output</firstterm>. If the deployer consumes an attachment, then that key is called <firstterm>input</firstterm>.
+		</para>
+		<para>
+			Deployers have <firstterm>ordinary</firstterm> inputs and <firstterm>required</firstterm> inputs. Ordinary inputs are only used to help determine the natural order. Required inputs also help determine order, but they have another function too. They help to determine if the deployer is actually relevant for the given deployment, by checking to see if an attachment corresponding to that required input exists in the attachments map.
+		</para>
+		<warning>
+			<para>
+				While relative ordering is still supported, it is considered bad practice, and could go away in the next major release.
+			</para>
+		</warning>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Separate_client_user_and_server_usage_and_implementation_details">
+		<title>Separate client, user, and server usage and implementation details</title>
+		<para>
+			These features hide the implementation details, making the usage less error-prone, while at the same time streamlining the development process.
+		</para>
+		<para>
+			The goal is for clients to only see a Deployment API, while developers see a DeploymentUnit, and server implementation details are contained in a DeploymentContext. Only the necessary information is exposed to a particular level of deployment's lifecycle.
+		</para>
+		<para>
+			Components have already been mentioned as part of deployers' hierarchy handling. While top level deployment and sub-deployments are a natural representation of the deployment's structure hierarchy, components are a new VDF concept. The idea of components is that they have a 1:1 mapping with the <classname>ControllerContexts</classname> inside the Microcontainer. Several facts reinforce this assumption.
+		</para>
+		<variablelist>
+			<varlistentry>
+				<term>Naming</term>
+				<listitem>
+					<para>
+						The component unit's name is the same as the <classname>ControllerContext</classname>'s name.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>get*Scope() and get*MetaData()</term>
+				<listitem>
+					<para>
+						return the same MDR context that will be used by the Microcontainer for that instance.
+					</para>
+				</listitem>
+			</varlistentry>
+			<varlistentry>
+				<term>IncompleteDeploymentException (IDE)</term>
+				<listitem>
+					<para>
+						In order for the IDE to print out what dependencies are missing for a deployment, it needs to know the ControllerContext names. It discovers the name by collecting the Component DeploymentUnit's names in Component Deployers that specify them, such as <classname>BeanMetaDataDeployer</classname> or the <methodname>setUseUnitName()</methodname> method in <classname>AbstractRealDeployer</classname>.
+					</para>
+				</listitem>
+			</varlistentry>
+		</variablelist>
+	</section>
+	
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Single_State_Machine">
+		<title>Single State Machine</title>
+		<para>
+			All Microcontainer components are handled by a single entry point, or single state machine. Deployments are no exception.
+		</para>
+		<para>
+			You can take advantage of this feature by using the <filename>jboss-dependency.xml</filename> configuration file in your deployments.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/jboss-dependency.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Note the artificial call-outs in the XML: (1) and (2).
+		</para>
+		<para>
+			(1) shows how to describe dependency on another service. This example requires <classname>TransactionManager</classname> to be created before the deployment is in the 'Real' stage.
+		</para>
+		<para>
+			(2) is a bit more complex, since you are missing additional information. By default, deployment names inside the Microcontainer are URI names, which makes typing them by hand an error prone proposition. So, in order to be able to easily declare dependence on other deployments, you need an aliasing mechanism to avoid URI names. Making this as simple as possible, drop a plain text file named <filename>aliases.txt</filename> into your deployment. Each line of the file contains an alias, thereby giving a deployment archive one or more simple names used to refer to it.
+		</para>
+	</section>
+	<!-- This is for EAP 6
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Lazy_handling_of_the_Deployment_ClassLoader">
+		<title>Lazy handling of the Deployment ClassLoader</title>
+		<para>
+			Another interesting new feature is lazy handling of the deployment ClassLoader, by using the <filename>jboss-deployment.xml</filename> configuration file.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/jboss-deployment.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+			Declaring the <property>lazy-resolve</property> attribute as <option>true</option> would cause our deployment to wait in the <property>required-stage</property> (whose default value is <option>Describe</option>) until some other deployment needs the current deployment in order to resolve its <classname>ClassLoader</classname>. This functionality is integrated with Microcontainer ClassLoading.
+		</para>
+		<para>
+			If lazy-start-filters exist, or the <property>lazy-start</property> flag is set to <option>true</option>, the deployment will wait in the <classname>ClassLoader</classname> stage until a resource is loaded from the deployment's ClassLoader and reaches the desired filters. Only then will it move our deployment to Installed stage.
+		</para>
+		<para>
+			This behavior means that you can write, and deploy, a service that provides an API, but you don't have to instantiate the necessary run-time objects that provide a service at container start-up time. You can instantiate them on-demand when other running code requests API classes provided by the service.
+		</para>
+	</section>
+	-->
+
+	<section id="sect-JBoss_Microcontainer_User_Guide-The_Virtual_Deployment_Framework-Scanning_Classes_for_Annotations">
+		<title>Scanning Classes for Annotations</title>
+		<para>
+			Current JEE specifications reduce the number of configuration files, but the container is now required to do most of the work using @annotations. In order to get @annotation info, containers must scan classes. This scanning creates a performance penalty.
+		</para>
+		<para>
+			But to reduce the amount of scanning, the Microcontainer provides another descriptor hook, by means of <filename>jboss-scanning.xml</filename>.
+		</para>
+		
+<programlisting language="XML" role="XML"><xi:include href="extras/jboss-scanning.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+		<para>
+		  This example shows a simple description of relative paths to include or exclude when scanning for JEE5 annotated metadata information. <!-- Commented out til EAP 6 This information is used in the VDF's <firstterm>MCAnn</firstterm> Framework. Stay tuned for the new <firstterm>MCScan Scanning Framework</firstterm>, which will provide even more functionality. -->
+		</para>
+	</section>
+</chapter>
+

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AOP_via_Descriptor.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AOP_via_Descriptor.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AOP_via_Descriptor.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<interceptor xmlns="urn:jboss:aop-beans:1.0" name="StopWatchInterceptor" class="org.jboss.demos.ioc.annotations.StopWatchInterceptor"/>
+
+<bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* @org.jboss.demos.ioc.annotations.StopWatchLog->*(..)) OR execution(* *->@org.jboss.demos.ioc.annotations.StopWatchLog(..))">
+  <interceptor-ref name="StopWatchInterceptor"/>
+</bind>
+</interceptor>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AbstractController.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AbstractController.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/AbstractController.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+  <alias name="SpringPojo">springPojo</alias>
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,9 @@
+public class AnnotatedExecutor implements Executor
+{
+    ...
+	@StopWatchLog // <-- Pointcut match!
+	    public void execute() throws Exception
+    {
+	delegate.execute();
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Annotated_Executor.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1 @@
+<bean name="AnnotatedExecutor" class="org.jboss.demos.ioc.annotations.AnnotatedExecutor">
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Applying_An_Aspect.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Applying_An_Aspect.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Applying_An_Aspect.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,19 @@
+<?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>
+
+  ...
+
+</deployment>

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Autowiring.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Autowiring.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Autowiring.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,14 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="FromGuice" class="org.jboss.demos.models.plain.FromGuice">
+    <constructor><parameter><inject bean="PlainPojo"/></parameter></constructor>
+    <property name="guicePojo"><inject/></property>
+  </bean>
+
+  <bean name="AllPojos" class="org.jboss.demos.models.plain.AllPojos">
+    <property name="directMBean"><inject bean="jboss.demos:service=pojo"/></property>
+    <property name="exposedMBean"><inject bean="jboss.demos:service=ExposedPojo"/></property>
+    <property name="exposedMBean"><inject bean="jboss.demos:service=ExposedPojo"/></property>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanAccessMode.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanAccessMode.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanAccessMode.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+public enum BeanAccessMode
+{
+    STANDARD(BeanInfoCreator.STANDARD), // Getters and Setters
+	FIELDS(BeanInfoCreator.FIELDS), // Getters/Setters and fields without getters and setters
+	ALL(BeanInfoCreator.ALL); // As above but with non public fields included
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanMetaDataBuilder.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanMetaDataBuilder.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BeanMetaDataBuilder.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<bean name="BuilderUtil" class="org.jboss.demos.ioc.builder.BuilderUtil"/>
+<bean name="BuilderExampleHolder" class="org.jboss.demos.ioc.builder.BuilderExampleHolder">
+  <constructor>
+    <parameter><inject bean="BUExample"/></parameter>
+  </constructor>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Aliases.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Aliases.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Aliases.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<bean name="SimpleName" class="java.lang.Object">
+  <alias>SimpleAlias</alias>
+  <alias replace="true">${some.system.property}</alias>
+  <alias class="java.lang.Integer">12345</alias>
+  <alias><javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.demos.bootstrap.Main"/></alias>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Controller_Mode.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Controller_Mode.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Controller_Mode.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+<bean name="OptionalService" class="org.jboss.demos.ioc.mode.OptionalService" mode="On Demand"/>
+<bean name="OptionalServiceUser" class="org.jboss.demos.ioc.mode.OptionalServiceUser"/>
+<bean name="ManualService" class="org.jboss.demos.ioc.mode.ManualService" mode="Manual"/>
+<bean name="ManualServiceUser" class="org.jboss.demos.ioc.mode.ManualServiceUser">
+  <start>
+    <parameter><inject bean="ManualService" fromContext="context" state="Not Installed"/></parameter>
+  </start>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycle_Separation.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycle_Separation.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycle_Separation.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,12 @@
+<bean name="cycleA" class="org.jboss.demos.ioc.cycle.CyclePojo">
+  <property name="dependency"><inject bean="cycleB"/></property>
+</bean>
+<bean name="cycleB" class="org.jboss.demos.ioc.cycle.CyclePojo">
+  <constructor><parameter><inject bean="cycleA" state="Instantiated"/></parameter></constructor>
+</bean>
+<bean name="cycleC" class="org.jboss.demos.ioc.cycle.CyclePojo">
+  <property name="dependency"><inject bean="cycleD"/></property>
+</bean>
+<bean name="cycleD" class="org.jboss.demos.ioc.cycle.CyclePojo">
+  <property name="dependency"><inject bean="cycleC" state="Instantiated"/></property>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycles.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycles.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bean_Lifecycles.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,7 @@
+<bean name="FullLifecycleBean-3" class="org.jboss.demos.ioc.lifecycle.FullLifecycleBean"/>
+<bean name="FullLifecycleBean-2" class="org.jboss.demos.ioc.lifecycle.FullLifecycleBean">
+  <create ignored="true"/>
+</bean>
+<bean name="FullLifecycleBean-1" class="org.jboss.demos.ioc.lifecycle.FullLifecycleBean">
+  <start ignored="true"/>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bootstrapping_the_Microcontainer.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bootstrapping_the_Microcontainer.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Bootstrapping_the_Microcontainer.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,14 @@
+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();
+
+    kernel = bootstrap.getKernel();
+    controller = kernel.getController();
+    bus = kernel.getBus();
+}

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BuilderUtil.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BuilderUtil.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/BuilderUtil.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,19 @@
+public class BuilderUtil
+{
+    private KernelController controller;
+    @Constructor
+	public BuilderUtil(@Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) KernelController controller)
+    {
+	this.controller = controller;
+    }
+    public void create() throws Throwable
+    {
+	BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("BUExample", BuilderExample.class.getName());
+	builder.addStartParameter(Kernel.class.getName(), builder.createInject(KernelConstants.KERNEL_NAME));
+	controller.install(builder.getBeanMetaData());
+    }
+    public void destroy()
+    {
+	controller.uninstall("BUExample");
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callback_Classes.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callback_Classes.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callback_Classes.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,2 @@
+<incallback method="addEditor" cardinality="4..n"/>
+<uncallback method="removeEditor"/>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callbacks.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callbacks.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Callbacks.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,24 @@
+<bean name="checker" class="org.jboss.demos.ioc.callback.Checker">
+  <constructor>
+    <parameter>
+      <value-factory bean="parser" method="parse">
+	<parameter>
+	  <array elementClass="java.lang.Object">
+	    <value>http://www.jboss.org</value>
+	    <value>SI</value>
+	    <value>3.14</value>
+	    <value>42</value>
+	  </array>
+	</parameter>
+      </value-factory>
+    </parameter>
+  </constructor>
+</bean>
+<bean name="editorA" class="org.jboss.demos.ioc.callback.DoubleEditor"/>
+<bean name="editorB" class="org.jboss.demos.ioc.callback.LocaleEditor"/>
+<bean name="parser" class="org.jboss.demos.ioc.callback.Parser">
+  <incallback method="addEditor" cardinality="4..n"/>
+  <uncallback method="removeEditor"/>
+</bean>
+<bean name="editorC" class="org.jboss.demos.ioc.callback.LongEditor"/>
+<bean name="editorD" class="org.jboss.demos.ioc.callback.URLEditor"/>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Calling_Methods_On_Bean_Instance.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Calling_Methods_On_Bean_Instance.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Calling_Methods_On_Bean_Instance.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+ at SuppressWarnings("unchecked")
+    
+    Set<Employee> listEmployees() {
+    if (useBus)
+	...
+    else
+	return manager.getEmployees();
+}

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,25 @@
+public abstract class ClassLoaderPolicy extends BaseClassLoaderPolicy
+{
+    public DelegateLoader getExported()
+
+	public String[] getPackageNames()
+
+	protected List<? extends DelegateLoader> getDelegates()
+
+	protected boolean isImportAll()
+	protected boolean isCacheable()
+	protected boolean isBlackListable()
+
+	public abstract URL getResource(String path);
+
+    public InputStream getResourceAsStream(String path)
+
+	public abstract void getResources(String name, Set<URL> urls) throws IOException;
+
+    protected ProtectionDomain getProtectionDomain(String className, String path)
+	public PackageInformation getPackageInformation(String packageName)
+	public PackageInformation getClassPackageInformation(String className, String packageName)
+
+	protected ClassLoader isJDKRequest(String name)
+	}
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy_with_Encryption_Support.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy_with_Encryption_Support.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoaderPolicy_with_Encryption_Support.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,49 @@
+public class CrypterClassLoaderPolicy extends VFSClassLoaderPolicy
+{
+    private Crypter crypter;
+
+    public CrypterClassLoaderPolicy(String name, VirtualFile[] roots, VirtualFile[] excludedRoots, Crypter crypter)
+    {
+	super(name, roots, excludedRoots);
+	this.crypter = crypter;
+    }
+
+    @Override
+	public URL getResource(String path)
+    {
+	try
+	    {
+		URL resource = super.getResource(path);
+		return wrap(resource);
+	    }
+	catch (IOException e)
+	    {
+		throw new RuntimeException(e);
+	    }
+    }
+
+    @Override
+	public InputStream getResourceAsStream(String path)
+    {
+	InputStream stream = super.getResourceAsStream(path);
+	return crypter.crypt(stream);
+    }
+
+    @Override
+	public void getResources(String name, Set<URL> urls) throws IOException
+    {
+	super.getResources(name, urls);
+	Set<URL> temp = new HashSet<URL>(urls.size());
+	for (URL url : urls)
+	    {
+		temp.add(wrap(url));
+	    }
+	urls.clear();
+	urls.addAll(temp);
+    }
+
+    protected URL wrap(URL url) throws IOException
+    {
+	return new URL(url.getProtocol(), url.getHost(), url.getPort(), url.getFile(), new CrypterURLStreamHandler(crypter));
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_CB2_Bean_Test.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_CB2_Bean_Test.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_CB2_Bean_Test.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,19 @@
+public class CustomClassLoader extends ClassLoader
+{
+    private Pattern pattern;
+    public CustomClassLoader(ClassLoader parent)
+    {
+	super(parent);
+    }
+    public Class<?> loadClass(String name) throws ClassNotFoundException
+    {
+	if (pattern == null || pattern.matcher(name).matches())
+	    return super.loadClass(name);
+	else
+	    throw new ClassNotFoundException("Name '" + name + "' doesn't match pattern: " + pattern);
+    }
+    public void setPattern(String regexp)
+    {
+	pattern = Pattern.compile(regexp);
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_Per_Bean.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_Per_Bean.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoader_Per_Bean.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,13 @@
+<classloader><inject bean="custom-classloader:0.0.0"/></classloader>
+<!-- this will be explained in future article -->
+<classloader name="custom-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true"/>
+<bean name="CustomCL" class="org.jboss.demos.ioc.classloader.CustomClassLoader">
+  <constructor>
+    <parameter><inject bean="custom-classloader:0.0.0"/></parameter>
+  </constructor>
+  <property name="pattern">org\.jboss\.demos\.ioc\..+</property>
+</bean>
+<bean name="CB1" class="org.jboss.demos.ioc.classloader.CustomBean"/>
+<bean name="CB2" class="org.jboss.demos.ioc.classloader.CustomBean">
+  <classloader><inject bean="CustomCL"/></classloader>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,54 @@
+public class ClassLoadingMetaData extends NameAndVersionSupport
+{
+    /** The serialVersionUID */
+    private static final long serialVersionUID = -2782951093046585620L;
+
+    /** The classloading domain */
+    private String domain;
+
+    /** The parent domain */
+    private String parentDomain;
+
+    /** Whether to make a subdeployment classloader a top-level classloader */
+    private boolean topLevelClassLoader = false;
+
+    /** Whether to enforce j2se classloading compliance */
+    private boolean j2seClassLoadingCompliance = true;
+
+    /** Whether we are cacheable */
+    private boolean cacheable = true;
+
+    /** Whether we are blacklistable */
+    private boolean blackListable = true;
+
+    /** Whether to export all */
+    private ExportAll exportAll;
+
+    /** Whether to import all */
+    private boolean importAll;
+
+    /** The included packages */
+    private String includedPackages;
+
+    /** The excluded packages */
+    private String excludedPackages;
+
+    /** The excluded for export */
+    private String excludedExportPackages;
+
+    /** The included packages */
+    private ClassFilter included;
+
+    /** The excluded packages */
+    private ClassFilter excluded;
+
+    /** The excluded for export */
+    private ClassFilter excludedExport;
+
+    /** The requirements */
+    private RequirementsMetaData requirements = new RequirementsMetaData();
+
+    /** The capabilities */
+    private CapabilitiesMetaData capabilities = new CapabilitiesMetaData();
+
+    ... setters & getters
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoadingMetaData_exposed_as_Managed_Object.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,7 @@
+<classloading xmlns="urn:jboss:classloading:1.0"
+	      name="ptd-jsf-1.0.war"
+	      domain="ptd-jsf-1.0.war"
+	      parent-domain="ptd-ear-1.0.ear"
+	      export-all="NON_EMPTY"
+	      import-all="true"
+	      parent-first="true"/>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoading_API.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoading_API.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/ClassLoading_API.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,7 @@
+ClassLoadingMetaData clmd = new ClassLoadingMetaData();
+if (name != null)
+    clmd.setDomain(name + "_Domain");
+clmd.setParentDomain(parentDomain);
+clmd.setImportAll(true);
+clmd.setExportAll(ExportAll.NON_EMPTY);
+clmd.setVersion(Version.DEFAULT_VERSION);
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_DefaultDomain.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_DefaultDomain.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_DefaultDomain.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,5 @@
+<classloading xmlns="urn:jboss:classloading:1.0"
+	      domain="IsolatedDomain"
+	      export-all="NON_EMPTY"
+	      import-all="true">
+</classloading>

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_OSGi.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_OSGi.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_OSGi.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+<classloading xmlns="urn:jboss:classloading:1.0">
+  <requirements>
+    <module name="jboss-reflect.jar"/>
+  </requirements>
+  <capabilities>
+    <module name="jboss-cache.jar"/>
+  </capabilities>
+</classloading>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_domain-level_isolation.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_domain-level_isolation.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_domain-level_isolation.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<classloading xmlns="urn:jboss:classloading:1.0"
+	      domain="IsolatedWithParentDomain"
+	      parent-domain="DefaultDomain"
+	      export-all="NON_EMPTY"
+	      import-all="true">
+</classloading>

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_import_export_modules.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_import_export_modules.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_import_export_modules.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,10 @@
+<classloading xmlns="urn:jboss:classloading:1.0">
+  <requirements>
+    <package name="si.acme.foobar"/>
+    <module name="jboss-reflect.jar"/>
+  </requirements>
+  <capabilities>
+    <package name="org.alesj.cl"/>
+    <module name="jboss-cache.jar"/>
+  </capabilities>
+</classloading>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_isolation_with_specific_parent.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_isolation_with_specific_parent.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloader_isolation_with_specific_parent.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,3 @@
+<classloading xmlns="urn:jboss:classloading:1.0"
+	      parent-first="false">
+</classloading>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_class.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_class.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_class.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,25 @@
+public interface ResourceVisitor
+{
+    ResourceFilter getFilter();
+
+    void visit(ResourceContext resource);
+}
+
+public interface ResourceContext
+{
+    URL getUrl();
+
+    ClassLoader getClassLoader();
+
+    String getResourceName();
+
+    String getClassName();
+
+    boolean isClass();
+
+    Class<?> loadClass();
+
+    InputStream getInputStream() throws IOException;
+
+    byte[] getBytes() throws IOException;
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_deployer.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_deployer.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Classloading_module_deployer.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,14 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <classloader name="anys-classloader" xmlns="urn:jboss:classloader:1.0" import-all="true" domain="Anys" parent-domain="DefaultDomain">
+    <capabilities>
+      <package name="org.jboss.test.deployers.vfs.reflect.support.web"/>
+    </capabilities>
+    <root>${jboss.tests.url}</root>
+  </classloader>
+
+  <bean name="AnyServlet" class="org.jboss.test.deployers.vfs.reflect.support.web.AnyServlet">
+    <classloader><inject bean="anys-classloader:0.0.0"/></classloader>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Create_Pojo.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Create_Pojo.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Create_Pojo.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,52 @@
+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;
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Creating_Instances_Of_Classes.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Creating_Instances_Of_Classes.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Creating_Instances_Of_Classes.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,5 @@
+<?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>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Deployment_Stages.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Deployment_Stages.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Deployment_Stages.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,35 @@
+public interface DeploymentStages
+{
+   /** The not installed stage - nothing is done here */
+   DeploymentStage NOT_INSTALLED = new DeploymentStage("Not Installed");
+
+   /** The pre parse stage - where pre parsing stuff can be prepared; altDD, ignore, ... */
+   DeploymentStage PRE_PARSE = new DeploymentStage("PreParse", NOT_INSTALLED);
+
+   /** The parse stage - where metadata is read */
+   DeploymentStage PARSE = new DeploymentStage("Parse", PRE_PARSE);
+
+   /** The post parse stage - where metadata can be fixed up */
+   DeploymentStage POST_PARSE = new DeploymentStage("PostParse", PARSE);
+
+   /** The pre describe stage - where default dependencies metadata can be created */
+   DeploymentStage PRE_DESCRIBE = new DeploymentStage("PreDescribe", POST_PARSE);
+
+   /** The describe stage - where dependencies are established */
+   DeploymentStage DESCRIBE = new DeploymentStage("Describe", PRE_DESCRIBE);
+
+   /** The classloader stage - where classloaders are created */
+   DeploymentStage CLASSLOADER = new DeploymentStage("ClassLoader", DESCRIBE);
+
+   /** The post classloader stage - e.g. aop */
+   DeploymentStage POST_CLASSLOADER = new DeploymentStage("PostClassLoader", CLASSLOADER);
+
+   /** The pre real stage - where before real deployments are done */
+   DeploymentStage PRE_REAL = new DeploymentStage("PreReal", POST_CLASSLOADER);
+
+   /** The real stage - where real deployment processing is done */
+   DeploymentStage REAL = new DeploymentStage("Real", PRE_REAL);
+
+   /** The installed stage - could be used to provide valve in future? */
+   DeploymentStage INSTALLED = new DeploymentStage("Installed", REAL);
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Editor_Parser.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Editor_Parser.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Editor_Parser.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,13 @@
+public class Parser
+{
+    private Set<Editor> editors = new HashSet<Editor>();
+    ...
+	public void addEditor(Editor editor)
+    {
+	editors.add(editor);
+    }
+    public void removeEditor(Editor editor)
+    {
+	editors.remove(editor);
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EmbeddedBootstrap.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EmbeddedBootstrap.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EmbeddedBootstrap.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,31 @@
+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("Shutting down");
+	    deployer.shutdown();
+	}
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EncryptedService.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EncryptedService.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/EncryptedService.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,20 @@
+public class EncryptedService extends PrintService
+{
+    public void start() throws Exception
+    {
+	ClassLoader cl = getClass().getClassLoader();
+
+	URL url = cl.getResource("config/settings.txt");
+	if (url == null)
+	    throw new IllegalArgumentException("No such settings.txt.");
+
+	InputStream is = url.openStream();
+	print(is, "Printing settings:\n");
+
+	is = cl.getResourceAsStream("config/properties.xml");
+	if (is == null)
+	    throw new IllegalArgumentException("No such properties.xml.");
+
+	print(is, "\nPrinting properties:\n");
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,17 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="AnnotatedJMXPojo" class="org.jboss.demos.models.jmx.AtJmxPojo"/>
+
+  <bean name="XmlJMXPojo" class="org.jboss.demos.models.mbeans.Pojo">
+    <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(exposedInterface=org.jboss.demos.models.mbeans.PojoMBean.class, registerDirectly=true)</annotation>
+  </bean>
+
+  <bean name="ExposedPojo" class="org.jboss.demos.models.jmx.Pojo"/>
+
+  <bean name="AnnotatedExposePojo" class="org.jboss.demos.models.jmx.ExposePojo">
+    <constructor>
+      <parameter><inject bean="ExposedPojo"/></parameter>
+    </constructor>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean_With_Annotation.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean_With_Annotation.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Expose_POJO_As_Mbean_With_Annotation.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,14 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="XMLLoginConfig" class="org.jboss.demos.models.old.XMLLoginConfig"/>
+
+  <bean name="SecurityConfig" class="org.jboss.demos.models.old.SecurityConfig">
+    <property name="defaultLoginConfig"><inject bean="XMLLoginConfig"/></property>
+  </bean>
+
+  <bean name="SecurityChecker" class="org.jboss.demos.models.old.Checker">
+    <property name="loginConfig"><inject bean="jboss.security:service=XMLLoginConfig"/></property>
+    <property name="securityConfig"><inject bean="jboss.security:service=SecurityConfig"/></property>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Extended_BeanFactory_Usage.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Extended_BeanFactory_Usage.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Extended_BeanFactory_Usage.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,48 @@
+public class EnhancedBeanFactory extends GenericBeanFactory
+{
+    public EnhancedBeanFactory(KernelConfigurator configurator)
+    {
+	super(configurator);
+    }
+    public Object createBean() throws Throwable
+    {
+	Object bean = super.createBean();
+	Class<?> clazz = bean.getClass();
+	if (clazz.isAnnotationPresent(SetterProxy.class))
+	    {
+		Set<Class> interfaces = new HashSet<Class>();
+		addInterfaces(clazz, interfaces);
+		return Proxy.newProxyInstance(
+					      clazz.getClassLoader(),
+					      interfaces.toArray(new Class<?>[interfaces.size()]),
+					      new SetterInterceptor(bean)
+					      );
+	    }
+	else
+	    {
+		return bean;
+	    }
+    }
+    protected static void addInterfaces(Class<?> clazz, Set<Class> interfaces)
+    {
+	if (clazz == null)
+	    return;
+	interfaces.addAll(Arrays.asList(clazz.getInterfaces()));
+	addInterfaces(clazz.getSuperclass(), interfaces);
+    }
+    private class SetterInterceptor implements InvocationHandler
+    {
+	private Object target;
+	private SetterInterceptor(Object target)
+	{
+	    this.target = target;
+	}
+	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+	{
+	    String methodName = method.getName();
+	    if (methodName.startsWith("set"))
+		throw new IllegalArgumentException("Cannot invoke setters.");
+	    return method.invoke(target, args);
+	}
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Field_Bean_Class.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Field_Bean_Class.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Field_Bean_Class.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,9 @@
+public class FieldsBean
+{
+    private String string;
+    public void start()
+    {
+	if (string == null)
+	    throw new IllegalArgumentException("Strings should be set!");
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/GenericBeanFactory.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/GenericBeanFactory.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/GenericBeanFactory.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,15 @@
+<bean name="Object" class="java.lang.Object"/>
+<beanfactory name="DefaultPrototype" class="org.jboss.demos.ioc.factory.Prototype">
+  <property name="value"><inject bean="Object"/></property>
+</beanfactory>
+<beanfactory name="EnhancedPrototype" class="org.jboss.demos.ioc.factory.Prototype" factoryClass="org.jboss.demos.ioc.factory.EnhancedBeanFactory">
+  <property name="value"><inject bean="Object"/></property>
+</beanfactory>
+<beanfactory name="ProxiedPrototype" class="org.jboss.demos.ioc.factory.UnmodifiablePrototype" factoryClass="org.jboss.demos.ioc.factory.EnhancedBeanFactory">
+  <property name="value"><inject bean="Object"/></property>
+</beanfactory>
+<bean name="PrototypeCreator" class="org.jboss.demos.ioc.factory.PrototypeCreator">
+  <property name="default"><inject bean="DefaultPrototype"/></property>
+  <property name="enhanced"><inject bean="EnhancedPrototype"/></property>
+  <property name="proxied"><inject bean="ProxiedPrototype"/></property>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Configure_Beans.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Configure_Beans.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Configure_Beans.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,17 @@
+public class PojoModule extends AbstractModule
+{
+    private Controller controller;
+
+    @Constructor
+	public PojoModule(@Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) Controller controller)
+    {
+	this.controller = controller;
+    }
+
+    protected void configure()
+    {
+	bind(Controller.class).toInstance(controller);
+	bind(IPojo.class).to(Pojo.class).in(Scopes.SINGLETON);
+	bind(IPojo.class).annotatedWith(FromMC.class).toProvider(GuiceIntegration.fromMicrocontainer(IPojo.class, "PlainPojo"));
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Descriptor.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Descriptor.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Descriptor.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,13 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="GuicePlugin" class="org.jboss.guice.spi.GuiceKernelRegistryEntryPlugin">
+    <constructor>
+      <parameter>
+	<array elementClass="com.google.inject.Module">
+	  <bean class="org.jboss.demos.models.guice.PojoModule"/>
+	</array>
+      </parameter>
+    </constructor>
+  </bean>
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Microcontainer_Integration.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Microcontainer_Integration.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Guice_Microcontainer_Integration.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,36 @@
+public class GuiceKernelRegistryEntryPlugin implements KernelRegistryPlugin
+{
+    private Injector injector;
+
+    public GuiceKernelRegistryEntryPlugin(Module... modules)
+    {
+	injector = Guice.createInjector(modules);
+    }
+
+    public void destroy()
+    {
+	injector = null;
+    }
+
+    public KernelRegistryEntry getEntry(Object name)
+    {
+	KernelRegistryEntry entry = null;
+	try
+	    {
+		if (name instanceof Class<?>)
+		    {
+			Class<?> clazz = (Class<?>)name;
+			entry = new AbstractKernelRegistryEntry(name, injector.getInstance(clazz));
+		    }
+		else if (name instanceof Key)
+		    {
+			Key<?> key = (Key<?>)name;
+			entry = new AbstractKernelRegistryEntry(name, injector.getInstance(key));
+		    }
+	    }
+	catch (Exception ignored)
+	    {
+	    }
+	return entry;
+    }	
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_Assembled_VirtualFileHandlers.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_Assembled_VirtualFileHandlers.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_Assembled_VirtualFileHandlers.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,20 @@
+AssembledDirectory sar = AssembledContextFactory.getInstance().create("assembled.sar");
+
+URL url = getResource("/vfs/test/jar1.jar");
+VirtualFile jar1 = VFS.getRoot(url);
+sar.addChild(jar1);
+
+url = getResource("/tmp/app/ext.jar");
+VirtualFile ext1 = VFS.getRoot(url);
+sar.addChild(ext);
+
+AssembledDirectory metainf = sar.mkdir("META-INF");
+
+url = getResource("/config/jboss-service.xml");
+VirtualFile serviceVF = VFS.getRoot(url);
+metainf.addChild(serviceVF);
+
+AssembledDirectory app = sar.mkdir("app.jar");
+url = getResource("/app/someapp/classes");
+VirtualFile appVF = VFS.getRoot(url);
+app.addPath(appVF, new SuffixFilter(".class"));
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_In-Memory_VirtualFileHandlers.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_In-Memory_VirtualFileHandlers.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Implementation_of_In-Memory_VirtualFileHandlers.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+URL url = new URL("vfsmemory://aopdomain/org/acme/test/Test.class");
+byte[] bytes = ...; // some AOP generated class bytes
+MemoryFileFactory.putFile(url,  bytes);
+
+VirtualFile classFile = VFS.getVirtualFile(new URL("vfsmemory://aopdomain"), "org/acme/test/Test.class");
+InputStream bis = classFile.openStream(); // e.g. load class from input stream
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Include_and_Exclude_with_Autowiring.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Include_and_Exclude_with_Autowiring.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Include_and_Exclude_with_Autowiring.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,12 @@
+<bean name="Square" class="org.jboss.demos.ioc.autowire.Square" autowire-candidate="false"/>
+<bean name="Circle" class="org.jboss.demos.ioc.autowire.Circle"/>
+<bean name="ShapeUser" class="org.jboss.demos.ioc.autowire.ShapeUser">
+  <constructor>
+    <parameter><inject/></parameter>
+  </constructor>
+</bean>
+<bean name="ShapeHolder" class="org.jboss.demos.ioc.autowire.ShapeHolder">
+  <incallback method="addShape"/>
+  <uncallback method="removeShape"/>
+</bean>
+<bean name="ShapeChecker" class="org.jboss.demos.ioc.autowire.ShapesChecker"/>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Injecting_Values_Into_POJO_Properties.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Injecting_Values_Into_POJO_Properties.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Injecting_Values_Into_POJO_Properties.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -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="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>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Invoking_Methods_In_Different_States.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Invoking_Methods_In_Different_States.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Invoking_Methods_In_Different_States.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,18 @@
+<bean name="RepositoryManager" class="org.jboss.demos.ioc.install.RepositoryManager">
+  <install method="addEntry">
+    <parameter><inject fromContext="name"/></parameter>
+    <parameter><this/></parameter>
+  </install>
+  <uninstall method="removeEntry">
+    <parameter><inject fromContext="name"/></parameter>
+  </uninstall>
+</bean>
+<bean name="Entry" class="org.jboss.demos.ioc.install.SimpleEntry">
+  <install bean="RepositoryManager" method="addEntry" state="Instantiated">
+    <parameter><inject fromContext="name"/></parameter>
+    <parameter><this/></parameter>
+  </install>
+  <uninstall bean="RepositoryManager" method="removeEntry" state="Configured">
+    <parameter><inject fromContext="name"/></parameter>
+  </uninstall>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Lazy_Mock.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Lazy_Mock.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Lazy_Mock.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,20 @@
+<bean name="lazyA" class="org.jboss.demos.ioc.lazy.LazyImpl">
+  <constructor>
+    <parameter>
+      <lazy bean="lazyB">
+	<interface>org.jboss.demos.ioc.lazy.ILazyPojo</interface>
+      </lazy>
+    </parameter>
+  </constructor>
+</bean>
+<bean name="lazyB" class="org.jboss.demos.ioc.lazy.LazyImpl">
+  <constructor>
+    <parameter>
+      <lazy bean="lazyA">
+	<interface>org.jboss.demos.ioc.lazy.ILazyPojo</interface>
+      </lazy>
+    </parameter>
+  </constructor>
+</bean>
+<lazy name="anotherLazy" bean="Pojo" exposeClass="true"/>
+<bean name="Pojo" class="org.jboss.demos.ioc.lazy.Pojo"/>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Legacy_Beans.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Legacy_Beans.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Legacy_Beans.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,7 @@
+<server>
+
+  <mbean code="org.jboss.demos.models.mbeans.Pojo" name="jboss.demos:service=pojo">
+    <attribute name="OtherPojo"><inject bean="PlainPojo"/></attribute>
+  </mbean>
+
+</server>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_Reference_to_HRService.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_Reference_to_HRService.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_Reference_to_HRService.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,12 @@
+private HRManager manager;
+...
+private final static String HRSERVICE = "HRService";
+
+...
+void deploy() {
+    bootstrap.deploy(url);
+    if (!useBus && manager == null) {
+	ControllerContext context = controller.getInstalledContext(HRSERVICE);
+	if (context != null) { manager = (HRManager) context.getTarget(); }
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_References_To_Beans.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_References_To_Beans.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Looking_Up_References_To_Beans.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,19 @@
+private HRManager manager;
+private EmbeddedBootstrap bootstrap;
+private Kernel kernel;
+private KernelController controller;
+private final static String HRSERVICE = "HRService";
+
+...
+
+// 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(); }
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Descriptor.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Descriptor.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Descriptor.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+<beans xmlns="urn:jboss:spring-beans:2.0">
+
+  <!-- Adding @Spring annotation handler -->
+  <bean id="SpringAnnotationPlugin" class="org.jboss.spring.annotations.SpringBeanAnnotationPlugin" />
+
+  <bean id="SpringPojo" class="org.jboss.demos.models.spring.Pojo"/>
+
+</beans>

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Example.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Example.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/POJO_Spring_Example.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,20 @@
+public class Pojo extends AbstractPojo implements BeanNameAware
+{
+    private String beanName;
+
+    public void setBeanName(String name)
+    {
+	beanName = name;
+    }
+
+    public String getBeanName()
+    {
+	return beanName;
+    }
+
+    public void start()
+    {
+	if ("SpringPojo".equals(getBeanName()) == false)
+	    throw new IllegalArgumentException("Name doesn't match: " + getBeanName());
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Parser_Checker.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Parser_Checker.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Parser_Checker.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+public void create() throws Throwable
+{
+    Set<String> strings = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
+    for (Object element : elements)
+	strings.add(element.toString());
+    if (expected.equals(strings) == false)
+	throw new IllegalArgumentException("Illegal expected set: " + expected + "!=" + strings);
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Plain_POJO_Descriptor.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Plain_POJO_Descriptor.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Plain_POJO_Descriptor.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,9 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="PlainPojo" class="org.jboss.demos.models.plain.Pojo"/>
+
+  <beanfactory name="PojoFactory" class="org.jboss.demos.models.plain.Pojo">
+    <property name="factoryClass">org.jboss.demos.models.plain.PojoFactory</property>
+  </beanfactory>
+
+</deployment>

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/PortsConfig_Bean.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/PortsConfig_Bean.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/PortsConfig_Bean.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,23 @@
+public class PortBindingManager
+{
+    private Map<String, Integer> bindings;
+    public PortBindingManager(Map<String, Integer> bindings)
+    {
+	this.bindings = bindings;
+    }
+    public Integer getPort(String key)
+    {
+	return getPort(key, null);
+    }
+    public Integer getPort(String key, Integer defaultValue)
+    {
+	if (bindings == null)
+	    return defaultValue;
+	Integer value = bindings.get(key);
+	if (value != null)
+	    return value;
+	if (defaultValue != null)
+	    bindings.put(key, defaultValue);
+	return defaultValue;
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Prototype_Creator.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Prototype_Creator.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Prototype_Creator.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,19 @@
+public class PrototypeCreator
+{
+    ...
+	public void create() throws Throwable
+    {
+	ValueInvoker vi1 = (ValueInvoker)bfDefault.createBean();
+	vi1.setValue("default");
+	ValueInvoker vi2 = (ValueInvoker)enhanced.createBean();
+	vi2.setValue("enhanced");
+	ValueInvoker vi3 = (ValueInvoker)proxied.createBean();
+	try
+	    {
+		vi3.setValue("default");
+		throw new Error("Should not be here.");
+	    }
+	catch (Exception ignored)
+	    {
+	    }
+    }
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Recursively_Gathering_Resources.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Recursively_Gathering_Resources.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Recursively_Gathering_Resources.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,20 @@
+public interface VirtualFileVisitor
+{
+    /**
+     * Get the search attribues for this visitor
+     *
+     * @return the attributes
+     */
+    VisitorAttributes getAttributes();
+
+    /**
+     * Visit a virtual file
+     *
+     * @param virtualFile the virtual file being visited
+     */
+    void visit(VirtualFile virtualFile);
+}
+
+VirtualFile root = ...; // get root
+VirtualFileVisitor visitor = new SuffixVisitor(".class"); // get all classes
+root.visit(visitor);
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegExpService.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegExpService.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegExpService.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,15 @@
+public class RegexpService extends PrintService
+{
+    public void start() throws Exception
+    {
+	System.out.println();
+
+	ClassLoader cl = getClass().getClassLoader();
+	Enumeration<URL> urls = cl.getResources("config/[^.]+\\.[^.]{1,4}");
+	while (urls.hasMoreElements())
+	    {
+		URL url = urls.nextElement();
+		print(url.openStream(), url.toExternalForm());
+	    }
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegexpClassLoaderPolicy.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegexpClassLoaderPolicy.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/RegexpClassLoaderPolicy.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,134 @@
+public class RegexpClassLoaderPolicy extends ClassLoaderPolicy
+{
+    private VirtualFile[] roots;
+    private String[] packageNames;
+
+    public RegexpClassLoaderPolicy(VirtualFile[] roots)
+    {
+	this.roots = roots;
+    }
+
+    @Override
+	public String[] getPackageNames()
+    {
+	if (packageNames == null)
+	    {
+		Set<String> exportedPackages = PackageVisitor.determineAllPackages(roots, null, ExportAll.NON_EMPTY, null, null, null);
+		packageNames = exportedPackages.toArray(new String[exportedPackages.size()]);
+	    }
+	return packageNames;
+    }
+
+    protected Pattern createPattern(String regexp)
+    {
+	boolean outside = true;
+	StringBuilder builder = new StringBuilder();
+	for (int i = 0; i < regexp.length(); i++)
+	    {
+		char ch = regexp.charAt(i);
+		if ((ch == '[' || ch == ']' || ch == '.') && escaped(regexp, i) == false)
+		    {
+			switch (ch)
+			    {
+			    case '[' : outside = false; break;
+			    case ']' : outside = true; break;
+			    case '.' : if (outside) builder.append("\\"); break;
+			    }
+		    }
+
+		builder.append(ch);
+	    }
+	return Pattern.compile(builder.toString());
+    }
+
+    protected boolean escaped(String regexp, int i)
+    {
+	return i > 0 && regexp.charAt(i - 1) == '\\';
+    }
+
+    public URL getResource(String path)
+    {
+	Pattern pattern = createPattern(path);
+	for (VirtualFile root : roots)
+	    {
+		URL url = findURL(root, root, pattern);
+		if (url != null)
+		    return url;
+	    }
+	return null;
+    }
+
+    private URL findURL(VirtualFile root, VirtualFile file, Pattern pattern)
+    {
+	try
+	    {
+		String path = AbstractStructureDeployer.getRelativePath(root, file);
+		Matcher matcher = pattern.matcher(path);
+		if (matcher.matches())
+		    return file.toURL();
+
+		List<VirtualFile> children = file.getChildren();
+		for (VirtualFile child : children)
+		    {
+			URL url = findURL(root, child, pattern);
+			if (url != null)
+			    return url;
+		    }
+
+		return null;
+	    }
+	catch (Exception e)
+	    {
+		throw new RuntimeException(e);
+	    }
+    }
+
+    public void getResources(String name, Set<URL> urls) throws IOException
+    {
+	Pattern pattern = createPattern(name);
+	for (VirtualFile root : roots)
+	    {
+		RegexpVisitor visitor = new RegexpVisitor(root, pattern);
+		root.visit(visitor);
+		urls.addAll(visitor.getUrls());
+	    }
+    }
+
+    private static class RegexpVisitor implements VirtualFileVisitor
+    {
+	private VirtualFile root;
+	private Pattern pattern;
+	private Set<URL> urls = new HashSet<URL>();
+
+	private RegexpVisitor(VirtualFile root, Pattern pattern)
+	{
+	    this.root = root;
+	    this.pattern = pattern;
+	}
+
+	public VisitorAttributes getAttributes()
+	{
+	    return VisitorAttributes.RECURSE_LEAVES_ONLY;
+	}
+
+	public void visit(VirtualFile file)
+	{
+	    try
+		{
+		    String path = AbstractStructureDeployer.getRelativePath(root, file);
+		    Matcher matcher = pattern.matcher(path);
+		    if (matcher.matches())
+			urls.add(file.toURL());
+		}
+	    catch (Exception e)
+		{
+		    throw new RuntimeException(e);
+		}
+	}
+
+	public Set<URL> getUrls()
+	{
+	    return urls;
+	}
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Resource_Duplication_Problem.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Resource_Duplication_Problem.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Resource_Duplication_Problem.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,65 @@
+public static URL[] search(ClassLoader cl, String prefix, String suffix) throws IOException
+{
+    Enumeration[] e = new Enumeration[]{
+	cl.getResources(prefix),
+	cl.getResources(prefix + "MANIFEST.MF")
+    };
+    Set all = new LinkedHashSet();
+    URL url;
+    URLConnection conn;
+    JarFile jarFile;
+    for (int i = 0, s = e.length; i < s; ++i)
+	{
+	    while (e[i].hasMoreElements())
+		{
+		    url = (URL)e[i].nextElement();
+		    conn = url.openConnection();
+		    conn.setUseCaches(false);
+		    conn.setDefaultUseCaches(false);
+		    if (conn instanceof JarURLConnection)
+			{
+			    jarFile = ((JarURLConnection)conn).getJarFile();
+			}
+		    else
+			{
+			    jarFile = getAlternativeJarFile(url);
+			}
+		    if (jarFile != null)
+			{
+			    searchJar(cl, all, jarFile, prefix, suffix);
+			}
+		    else
+			{
+			    boolean searchDone = searchDir(all, new File(URLDecoder.decode(url.getFile(), "UTF-8")), suffix);
+			    if (searchDone == false)
+				{
+				    searchFromURL(all, prefix, suffix, url);
+				}
+			}
+		}
+	}
+    return (URL[])all.toArray(new URL[all.size()]);
+}
+
+private static boolean searchDir(Set result, File file, String suffix) throws IOException
+{
+    if (file.exists() && file.isDirectory())
+	{
+	    File[] fc = file.listFiles();
+	    String path;
+	    for (int i = 0; i < fc.length; i++)
+		{
+		    path = fc[i].getAbsolutePath();
+		    if (fc[i].isDirectory())
+			{
+			    searchDir(result, fc[i], suffix);
+			}
+		    else if (path.endsWith(suffix))
+			{
+			    result.add(fc[i].toURL());
+			}
+		}
+	    return true;
+	}
+    return false;
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,13 @@
+public class StdioDeployer extends AbstractDeployer
+{
+   public void deploy(DeploymentUnit unit) throws DeploymentException
+   {
+      System.out.println("Deploying unit: " + unit);
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit unit)
+   {
+      System.out.println("Undeploying unit: " + unit);
+   }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer_Descriptor.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer_Descriptor.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Deployer_Descriptor.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1 @@
+<bean name="StdioDeployer" class="org.jboss.acme.StdioDeployer"/>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+public class SimpleExecutor implements Executor
+{
+    private static Random random = new Random();
+    public void execute() throws Exception
+    {
+	Thread.sleep(Math.abs(random.nextLong() % 101));
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Simple_Executor_with_XML_Annotations.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,3 @@
+<bean name="SimpleExecutor" class="org.jboss.demos.ioc.annotations.SimpleExecutor">
+  <annotation>@org.jboss.demos.ioc.annotations.StopWatchLog</annotation> // <-- Pointcut match!
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Specifying_a_Different_Classloader.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Specifying_a_Different_Classloader.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Specifying_a_Different_Classloader.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,27 @@
+<?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">
+
+  <classloader><inject bean="customCL"/></classloader>
+
+  <bean name="URL" class="java.net.URL">
+    <constructor>
+      <parameter>file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/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>
+
+  ...
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Static_Code_Usage.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Static_Code_Usage.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Static_Code_Usage.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<bean name="TMDemand" class="org.jboss.demos.ioc.demandsupply.TMDemander">
+  <demand>TM</demand>
+</bean>
+<bean name="SimpleTMSupply" class="org.jboss.demos.ioc.demandsupply.SimpleTMSupplyer">
+  <supply>TM</supply>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/StopWatchInterceptor.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/StopWatchInterceptor.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/StopWatchInterceptor.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,18 @@
+public class StopWatchInterceptor implements Interceptor
+{
+    ...
+	public Object invoke(Invocation invocation) throws Throwable
+    {
+	Object target = invocation.getTargetObject();
+	long time = System.currentTimeMillis();
+	log.info("Invocation [" + target + "] start: " + time);
+	try
+	    {
+		return invocation.invokeNext();
+	    }
+	finally
+	    {
+		log.info("Invocation [" + target + "] time: " + (System.currentTimeMillis() - time));
+	    }
+    }
+}    
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/String_Set_To_Private.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/String_Set_To_Private.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/String_Set_To_Private.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,3 @@
+<bean name="FieldsBean" class="org.jboss.demos.ioc.access.FieldsBean" access-mode="ALL">
+  <property name="string">InternalString</property>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Testing_Guice_Functionality.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Testing_Guice_Functionality.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Testing_Guice_Functionality.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,21 @@
+public class FromGuice
+{
+    private IPojo plainPojo;
+    private org.jboss.demos.models.guice.Pojo guicePojo;
+
+    public FromGuice(IPojo plainPojo)
+    {
+	this.plainPojo = plainPojo;
+    }
+
+    public void setGuicePojo(org.jboss.demos.models.guice.Pojo guicePojo)
+    {
+	this.guicePojo = guicePojo;
+    }
+
+    public void start()
+    {
+	f (plainPojo != guicePojo.getMcPojo())
+	    throw new IllegalArgumentException("Pojos are not the same: " + plainPojo + "!=" + guicePojo.getMcPojo());
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Callback_Class.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Callback_Class.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Callback_Class.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,11 @@
+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 uninstall(ControllerContext ctx) {
+	    System.out.println("Bean " + ctx.getName() + " is being uninstalled";
+    }
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Classes_Attribute.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Classes_Attribute.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_The_Classes_Attribute.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,9 @@
+<aop:lifecycle-install xmlns:aop="urn:jboss:aop-beans:1.0"
+
+name="InstallAdvice"
+
+class="org.jboss.test.microcontainer.support.LifecycleCallback"
+
+classes="@org.jboss.test.microcontainer.support.Install">
+
+</aop:lifecycle-install>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_getVFS.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_getVFS.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_getVFS.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,7 @@
+URL rootURL = ...; // get root url
+VFS vfs = VFS.getVFS(rootURL);
+// configure vfs instance
+VirtualFile root1 = vfs.getRoot();
+// or you can get root directly
+VirtualFile root2 = VFS.crateNewRoot(rootURL);
+VirtualFile root3 = VFS.getRoot(rootURL);
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Default_Classloader_per_Bean.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Default_Classloader_per_Bean.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Default_Classloader_per_Bean.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,3 @@
+<bean name="HRService" class="org.jboss.example.service.HRManager">
+  <classloader><null/></classloader>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Invoke_Method.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Invoke_Method.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Using_the_Invoke_Method.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,21 @@
+private final static String HRSERVICE = "HRService";
+
+...
+
+    @SuppressWarnings("unchecked")
+	Set<Employee> listEmployees() {
+	if (useBus)
+	    return (Set<Employee>) invoke(HRSERVICE, "getEmployees", 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;
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VFS_Class.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VFS_Class.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VFS_Class.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,70 @@
+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
+     */
+    static VFS getVFS(URI rootURI) throws IOException
+
+    /**
+     * Create new root
+     *
+     * @param rootURI the root url
+     * @return the virtual file
+     * @throws IOException if there is a problem accessing the VFS
+     * @throws IllegalArgumentException if the rootURL
+     */
+    static VirtualFile createNewRoot(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 is null
+     */
+    static VirtualFile getRoot(URI rootURI) 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
+     */
+    static VFS getVFS(URL rootURL) throws IOException
+
+    /**
+     * Create new root
+     *
+     * @param rootURL the root url
+     * @return the virtual file
+     * @throws IOException if there is a problem accessing the VFS
+     * @throws IllegalArgumentException if the rootURL
+     */
+    static VirtualFile createNewRoot(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
+     */
+    static VirtualFile getRoot(URL rootURL) throws IOException
+
+    /**
+     * Get the root file of this VFS
+     *
+     * @return the root
+     * @throws IOException for any problem accessing the VFS
+     */
+    VirtualFile getRoot() throws IOException
+}
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Value_Factory.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Value_Factory.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Value_Factory.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,32 @@
+<bean name="Binding" class="org.jboss.demos.ioc.vf.PortBindingManager">
+  <constructor>
+    <parameter>
+      <map keyClass="java.lang.String" valueClass="java.lang.Integer">
+	<entry>
+	  <key>http</key>
+	  <value>80</value>
+	</entry>
+	<entry>
+	  <key>ssh</key>
+	  <value>22</value>
+	</entry>
+      </map>
+    </parameter>
+  </constructor>
+</bean>
+<bean name="PortsConfig" class="org.jboss.demos.ioc.vf.PortsConfig">
+  <property name="http"><value-factory bean="Binding" method="getPort" parameter="http"/></property>
+  <property name="ssh"><value-factory bean="Binding" method="getPort" parameter="ssh"/></property>
+  <property name="ftp">
+    <value-factory bean="Binding" method="getPort">
+      <parameter>ftp</parameter>
+      <parameter>21</parameter>
+    </value-factory>
+  </property>
+  <property name="mail">
+    <value-factory bean="Binding" method="getPort">
+      <parameter>mail</parameter>
+      <parameter>25</parameter>
+    </value-factory>
+  </property>
+</bean>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VirtualFile_Resource.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VirtualFile_Resource.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/VirtualFile_Resource.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,224 @@
+public class VirtualFile implements Serializable
+{
+    /**
+     * Get certificates.
+     *
+     * @return the certificates associated with this virtual file
+     */
+    Certificate[] getCertificates()
+
+    /**
+     * Get the simple VF name (X.java)
+     *
+     * @return the simple file name
+     * @throws IllegalStateException if the file is closed
+     */
+	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
+     */
+	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
+     */
+	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
+     */
+			   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
+     */
+			   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 true if modifed, false otherwise
+     * @throws IOException for any error
+     */
+			   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
+     */
+			   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.
+     */
+			   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
+     */
+			   boolean isLeaf() throws IOException
+
+    /**
+     * Is the file archive.
+     *
+     * @return true if archive, false otherwise
+     * @throws IOException for any error
+     */
+			   boolean isArchive() 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
+     */
+			   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
+     */
+			   InputStream openStream() throws IOException
+
+    /**
+     * Do file cleanup.
+     *
+     * e.g. delete temp files
+     */
+			   void cleanup()
+
+    /**
+     * Close the file resources (stream, etc.)
+     */
+			   void close()
+
+    /**
+     * Delete this virtual file
+     *
+     * @return true if file was deleted
+     * @throws IOException if an error occurs
+     */
+			   boolean delete() throws IOException
+
+    /**
+     * Delete this virtual file
+     *
+     * @param gracePeriod max time to wait for any locks (in milliseconds)
+     * @return true if file was deleted
+     * @throws IOException if an error occurs
+     */
+			   boolean delete(int gracePeriod) throws IOException
+
+    /**
+     * Get the VFS instance for this virtual file
+     *
+     * @return the VFS
+     * @throws IllegalStateException if the file is closed
+     */
+			   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
+     */
+			   VirtualFile getParent() throws IOException
+
+    /**
+     * Get a child
+     *
+     * @param path the path
+     * @return the child or <code>null</code> if not found
+     * @throws IOException for any problem accessing the VFS
+     * @throws IllegalArgumentException if the path is null
+     * @throws IllegalStateException if the file is closed or it is a leaf node
+     */
+			   VirtualFile getChild(String path) 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
+     */
+			   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 file is closed or it is a leaf node
+     */
+			   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
+     */
+			   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 file is closed or it is a leaf node
+     */
+			   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
+     */
+			   void visit(VirtualFileVisitor visitor) throws IOException
+			   }

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.java
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.java	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.java	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,3 @@
+HRManager hrService = new HRManager();
+AgeBasedSalaryStrategy ageBasedSalary = new AgeBasedSalaryStrategy();
+hrService.setSalaryStrategy(ageBasedSalary);
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/Wiring_POJOs_Together.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,8 @@
+<?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="salaryStrategy"><inject bean="AgeBasedSalary"/></property>
+  </bean>
+  <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy"/>
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-beans.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-beans.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-beans.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -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>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-classloading.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-classloading.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-classloading.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<classloading xmlns="urn:jboss:classloading:1.0"
+	      domain="DefaultDomain"
+	      top-level-classloader="true"
+	      export-all="NON_EMPTY"
+	      import-all="true">
+</classloading>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-dependency.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-dependency.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-dependency.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,4 @@
+<dependency xmlns="urn:jboss:dependency:1.0">
+  <item whenRequired="Real" dependentState="Create">TransactionManager</item> (1)
+  <item>my-human-readable-deployment-alias</item> (2)
+</dependency>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-deployment.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-deployment.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-deployment.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,6 @@
+<deployment xmlns="urn:jboss:deployment:1.0" required-stage="PreDescribe" lazy-resolve="true">
+
+  <lazy-start-filter recurse="false">org.foo.bar</lazy-start-filter>
+  <lazy-start-filter recurse="true">com.acme.somepackage</lazy-start-filter>
+
+</deployment>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-scanning.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-scanning.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-scanning.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,9 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+  <path name="myejbs.jar">
+    <include name="com.acme.foo"/>
+    <exclude name="com.acme.foo.bar"/>
+  </path>
+  <path name="my.war/WEB-INF/classes">
+    <include name="com.acme.foo"/>
+  </path>
+</scanning>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-structure.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-structure.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/jboss-structure.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,11 @@
+<structure>
+  <context comparator="org.jboss.test.deployment.test.SomeDeploymentComparatorTop">
+    <path name=""/>
+    <metaDataPath>
+      <path name="META-INF"/>
+    </metaDataPath>
+    <classpath>
+      <path name="lib" suffixes=".jar"/>
+    </classpath>
+  </context>
+</structure>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/new-classloader-via-jboss-beans.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/new-classloader-via-jboss-beans.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/new-classloader-via-jboss-beans.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -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:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/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>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/non-j2seClassLoadingCompliance.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/non-j2seClassLoadingCompliance.xml	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/en-US/extras/non-j2seClassLoadingCompliance.xml	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,9 @@
+<classloading xmlns="urn:jboss:classloading:1.0">
+  <requirements>
+    <package name="org.jboss.dependency.spi"/>
+  </requirements>
+  <capabilities>
+    <package name="org.jboss.cache.api"/>
+    <package name="org.jboss.kernel.spi"/>
+  </capabilities>
+</classloading>
\ No newline at end of file

Added: projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/publican.cfg
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/publican.cfg	                        (rev 0)
+++ projects/docs/enterprise/EAP/trunk/5.x/JBoss_Microcontainer_User_Guide/publican.cfg	2010-05-31 06:20:47 UTC (rev 105405)
@@ -0,0 +1,7 @@
+# Config::Simple 4.59
+# Wed Mar 31 12:47:10 2010
+
+xml_lang: en-US
+type: Book
+brand: JBoss
+




More information about the jboss-cvs-commits mailing list