[jboss-cvs] JBossAS SVN: r63582 - in projects/microcontainer/trunk/docs/examples: alias and 113 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 20 09:49:25 EDT 2007


Author: alesj
Date: 2007-06-20 09:49:25 -0400 (Wed, 20 Jun 2007)
New Revision: 63582

Added:
   projects/microcontainer/trunk/docs/examples/alias/
   projects/microcontainer/trunk/docs/examples/alias/build.xml
   projects/microcontainer/trunk/docs/examples/alias/src/
   projects/microcontainer/trunk/docs/examples/alias/src/main/
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/jboss/example/microcontainer/alias/
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/jboss/example/microcontainer/alias/Nameable.java
   projects/microcontainer/trunk/docs/examples/alias/src/main/org/jboss/example/microcontainer/alias/ObjectHolder.java
   projects/microcontainer/trunk/docs/examples/alias/src/resources/
   projects/microcontainer/trunk/docs/examples/alias/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/alias/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/annotations/
   projects/microcontainer/trunk/docs/examples/annotations/build.xml
   projects/microcontainer/trunk/docs/examples/annotations/src/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/example/microcontainer/annotations/
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/example/microcontainer/annotations/AnnotationChecker.java
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/example/microcontainer/annotations/Name.java
   projects/microcontainer/trunk/docs/examples/annotations/src/main/org/jboss/example/microcontainer/annotations/POJO.java
   projects/microcontainer/trunk/docs/examples/annotations/src/resources/
   projects/microcontainer/trunk/docs/examples/annotations/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/annotations/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/aspects/
   projects/microcontainer/trunk/docs/examples/aspects/build.xml
   projects/microcontainer/trunk/docs/examples/aspects/src/
   projects/microcontainer/trunk/docs/examples/aspects/src/main/
   projects/microcontainer/trunk/docs/examples/aspects/src/main/org/
   projects/microcontainer/trunk/docs/examples/aspects/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/aspects/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/aspects/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/aspects/src/main/org/jboss/example/microcontainer/aspects/
   projects/microcontainer/trunk/docs/examples/aspects/src/resources/
   projects/microcontainer/trunk/docs/examples/aspects/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/aspects/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/autowiring/
   projects/microcontainer/trunk/docs/examples/autowiring/build.xml
   projects/microcontainer/trunk/docs/examples/autowiring/src/
   projects/microcontainer/trunk/docs/examples/autowiring/src/main/
   projects/microcontainer/trunk/docs/examples/autowiring/src/main/org/
   projects/microcontainer/trunk/docs/examples/autowiring/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/autowiring/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/autowiring/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/autowiring/src/main/org/jboss/example/microcontainer/autowiring/
   projects/microcontainer/trunk/docs/examples/autowiring/src/resources/
   projects/microcontainer/trunk/docs/examples/autowiring/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/autowiring/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/classloader/
   projects/microcontainer/trunk/docs/examples/classloader/build.xml
   projects/microcontainer/trunk/docs/examples/classloader/src/
   projects/microcontainer/trunk/docs/examples/classloader/src/main/
   projects/microcontainer/trunk/docs/examples/classloader/src/main/org/
   projects/microcontainer/trunk/docs/examples/classloader/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/classloader/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/classloader/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/classloader/src/main/org/jboss/example/microcontainer/classloader/
   projects/microcontainer/trunk/docs/examples/classloader/src/resources/
   projects/microcontainer/trunk/docs/examples/classloader/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/classloader/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/demand/
   projects/microcontainer/trunk/docs/examples/demand/build.xml
   projects/microcontainer/trunk/docs/examples/demand/src/
   projects/microcontainer/trunk/docs/examples/demand/src/main/
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/jboss/example/microcontainer/demand/
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/jboss/example/microcontainer/demand/Demander.java
   projects/microcontainer/trunk/docs/examples/demand/src/main/org/jboss/example/microcontainer/demand/Starters.java
   projects/microcontainer/trunk/docs/examples/demand/src/resources/
   projects/microcontainer/trunk/docs/examples/demand/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/demand/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/installation/
   projects/microcontainer/trunk/docs/examples/installation/build.xml
   projects/microcontainer/trunk/docs/examples/installation/src/
   projects/microcontainer/trunk/docs/examples/installation/src/main/
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/jboss/example/microcontainer/installation/
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/jboss/example/microcontainer/installation/DeamonTimer.java
   projects/microcontainer/trunk/docs/examples/installation/src/main/org/jboss/example/microcontainer/installation/MyTimerTask.java
   projects/microcontainer/trunk/docs/examples/installation/src/resources/
   projects/microcontainer/trunk/docs/examples/installation/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/installation/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/javabeans/
   projects/microcontainer/trunk/docs/examples/javabeans/build.xml
   projects/microcontainer/trunk/docs/examples/javabeans/src/
   projects/microcontainer/trunk/docs/examples/javabeans/src/main/
   projects/microcontainer/trunk/docs/examples/javabeans/src/main/org/
   projects/microcontainer/trunk/docs/examples/javabeans/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/javabeans/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/javabeans/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/javabeans/src/main/org/jboss/example/microcontainer/javabeans/
   projects/microcontainer/trunk/docs/examples/javabeans/src/resources/
   projects/microcontainer/trunk/docs/examples/javabeans/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/javabeans/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/mbeans/
   projects/microcontainer/trunk/docs/examples/mbeans/build.xml
   projects/microcontainer/trunk/docs/examples/mbeans/src/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/mbeans/
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/mbeans/MBeanServerChecker.java
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/mbeans/PojoInjectee.java
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/mbeans/PojoName.java
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/mbeans/TestService.java
   projects/microcontainer/trunk/docs/examples/mbeans/src/main/org/jboss/example/microcontainer/mbeans/TestServiceMBean.java
   projects/microcontainer/trunk/docs/examples/mbeans/src/resources/
   projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-services.xml
   projects/microcontainer/trunk/docs/examples/osgi/
   projects/microcontainer/trunk/docs/examples/osgi/build.xml
   projects/microcontainer/trunk/docs/examples/osgi/src/
   projects/microcontainer/trunk/docs/examples/osgi/src/main/
   projects/microcontainer/trunk/docs/examples/osgi/src/main/org/
   projects/microcontainer/trunk/docs/examples/osgi/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/osgi/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/osgi/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/osgi/src/main/org/jboss/example/microcontainer/osgi/
   projects/microcontainer/trunk/docs/examples/osgi/src/resources/
   projects/microcontainer/trunk/docs/examples/osgi/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/osgi/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/spring/
   projects/microcontainer/trunk/docs/examples/spring/build.xml
   projects/microcontainer/trunk/docs/examples/spring/src/
   projects/microcontainer/trunk/docs/examples/spring/src/main/
   projects/microcontainer/trunk/docs/examples/spring/src/main/org/
   projects/microcontainer/trunk/docs/examples/spring/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/spring/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/spring/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/spring/src/main/org/jboss/example/microcontainer/spring/
   projects/microcontainer/trunk/docs/examples/spring/src/resources/
   projects/microcontainer/trunk/docs/examples/spring/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/spring/src/resources/META-INF/jboss-beans.xml
   projects/microcontainer/trunk/docs/examples/supply/
   projects/microcontainer/trunk/docs/examples/supply/build.xml
   projects/microcontainer/trunk/docs/examples/supply/src/
   projects/microcontainer/trunk/docs/examples/supply/src/main/
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/example/
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/example/microcontainer/
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/example/microcontainer/supply/
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/example/microcontainer/supply/Binder.java
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/example/microcontainer/supply/PojoLookup.java
   projects/microcontainer/trunk/docs/examples/supply/src/main/org/jboss/example/microcontainer/supply/StaticBinder.java
   projects/microcontainer/trunk/docs/examples/supply/src/resources/
   projects/microcontainer/trunk/docs/examples/supply/src/resources/META-INF/
   projects/microcontainer/trunk/docs/examples/supply/src/resources/META-INF/jboss-beans.xml
Log:
New examples.

Added: projects/microcontainer/trunk/docs/examples/alias/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/alias/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/alias/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-alias" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

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

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

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

Added: projects/microcontainer/trunk/docs/examples/annotations/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/annotations/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/annotations/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-annotations" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

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

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

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

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

Added: projects/microcontainer/trunk/docs/examples/aspects/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/aspects/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/aspects/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-aspects" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

Added: projects/microcontainer/trunk/docs/examples/aspects/src/resources/META-INF/jboss-beans.xml
===================================================================

Added: projects/microcontainer/trunk/docs/examples/autowiring/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/autowiring/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/autowiring/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-autowiring" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

Added: projects/microcontainer/trunk/docs/examples/autowiring/src/resources/META-INF/jboss-beans.xml
===================================================================

Added: projects/microcontainer/trunk/docs/examples/classloader/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/classloader/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/classloader/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-classloader" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

Added: projects/microcontainer/trunk/docs/examples/classloader/src/resources/META-INF/jboss-beans.xml
===================================================================

Added: projects/microcontainer/trunk/docs/examples/demand/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/demand/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/demand/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-demand" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

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

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

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

Added: projects/microcontainer/trunk/docs/examples/installation/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/installation/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/installation/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-installation" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

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

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

Added: projects/microcontainer/trunk/docs/examples/installation/src/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/installation/src/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/installation/src/resources/META-INF/jboss-beans.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="Task" class="org.jboss.example.microcontainer.installation.MyTimerTask">
+      <install bean="Timer" method="schedule">
+         <parameter><this/></parameter>
+         <parameter>100</parameter>
+         <parameter>10000</parameter>
+      </install>
+      <uninstall method="cancel"/>
+   </bean>
+
+   <bean name="Timer" class="org.jboss.example.microcontainer.installation.DeamonTimer">
+      <uninstall method="cancel"/>
+   </bean>
+
+</deployment>

Added: projects/microcontainer/trunk/docs/examples/javabeans/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/javabeans/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/javabeans/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-javabeans" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

Added: projects/microcontainer/trunk/docs/examples/javabeans/src/resources/META-INF/jboss-beans.xml
===================================================================

Added: projects/microcontainer/trunk/docs/examples/mbeans/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/mbeans/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/mbeans/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-mbeans" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

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

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

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

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

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

Added: projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-beans.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="PojoInjectee" class="org.jboss.example.microcontainer.mbeans.PojoInjectee">
+      <depends>MBeanServerChecker</depends>
+   </bean>
+
+   <bean name="MBeanServerChecker" class="org.jboss.example.microcontainer.mbeans.MBeanServerChecker" />
+
+</deployment>

Added: projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-services.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-services.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/mbeans/src/resources/META-INF/jboss-services.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <mbean code="org.jboss.example.microcontainer.mbeans.TestService"
+      name="jboss.j2ee:service=MCExampleTestService"
+      xmbean-dd="">
+      <attribute name="InjecteeName"><inject bean="PojoInjectee" property="name"/></attribute>
+   </mbean>
+
+</server>
+

Added: projects/microcontainer/trunk/docs/examples/osgi/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/osgi/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/osgi/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-osgi" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

Added: projects/microcontainer/trunk/docs/examples/osgi/src/resources/META-INF/jboss-beans.xml
===================================================================

Added: projects/microcontainer/trunk/docs/examples/spring/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/spring/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/spring/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-spring" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

Added: projects/microcontainer/trunk/docs/examples/spring/src/resources/META-INF/jboss-beans.xml
===================================================================

Added: projects/microcontainer/trunk/docs/examples/supply/build.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/supply/build.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/supply/build.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<!-- ==========================================================================
+A template build file for building jboss5 applications
+Requires ant1.6+
+
+Distributable under the LGL
+See the terms of license at gnu.org
+=========================================================================== -->
+<project name="example-supply" default="run" basedir=".">
+
+   <!-- common build file -->
+   <import file="../build-common.xml"/>
+</project>

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

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

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

Added: projects/microcontainer/trunk/docs/examples/supply/src/resources/META-INF/jboss-beans.xml
===================================================================
--- projects/microcontainer/trunk/docs/examples/supply/src/resources/META-INF/jboss-beans.xml	                        (rev 0)
+++ projects/microcontainer/trunk/docs/examples/supply/src/resources/META-INF/jboss-beans.xml	2007-06-20 13:49:25 UTC (rev 63582)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+            xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+            xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="lookup" class="org.jboss.example.microcontainer.supply.PojoLookup">
+      <demand>pojo</demand>
+   </bean>
+
+   <bean name="binder">
+      <constructor factoryMethod="getInstance" factoryClass="org.jboss.example.microcontainer.supply.StaticBinder"/>
+      <supply>pojo</supply>
+   </bean>
+
+</deployment>




More information about the jboss-cvs-commits mailing list