[jboss-cvs] JBossAS SVN: r62485 - in projects/microcontainer/trunk: kernel/src/main/org/jboss/beans/metadata/plugins and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Apr 23 11:13:31 EDT 2007


Author: alesj
Date: 2007-04-23 11:13:31 -0400 (Mon, 23 Apr 2007)
New Revision: 62485

Added:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Callback.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackFactory.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackType.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectFactory.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectOption.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectType.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Install.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallFactory.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Uninstall.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallFactory.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactory.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactoryLookup.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
Removed:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/Inject.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectOption.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectType.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
Modified:
   projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/LifecycleMetaDataBuilder.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/ParameterMetaDataBuilder.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/StateMetaDataBuilder.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/BundleActivatorDeployer.java
   projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java
Log:
BeanMetaDataBuilderImpl - removing it from spi (mixing plugins with spi).
Callback annotation introduction.

Modified: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -37,10 +37,10 @@
   
    public static final int INFINITY = -1;
 
-   public static Cardinality ZERO_TO_ONE = new Cardinality("0..1", 0, 1);
-   public static Cardinality ZERO_TO_MANY = new Cardinality("0..n", 0, INFINITY);
-   public static Cardinality ONE_TO_ONE = new Cardinality("1..1", 1, 1);
-   public static Cardinality ONE_TO_MANY = new Cardinality("1..n", 1, INFINITY);
+   public static final Cardinality ZERO_TO_ONE = new Cardinality("0..1", 0, 1);
+   public static final Cardinality ZERO_TO_MANY = new Cardinality("0..n", 0, INFINITY);
+   public static final Cardinality ONE_TO_ONE = new Cardinality("1..1", 1, 1);
+   public static final Cardinality ONE_TO_MANY = new Cardinality("1..n", 1, INFINITY);
 
    private static Cardinality[] values = new Cardinality[]
          {

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Callback.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Callback.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Callback.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,69 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactoryLookup;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD})
+ at DependencyFactoryLookup(CallbackFactory.class)
+public @interface Callback
+{
+   /**
+    * Define callback type - install or uninstall.
+    *
+    * @return type
+    */
+   CallbackType type();
+
+   /**
+    * Get the cardinality.
+    * Default is no cardinality.
+    *
+    * @return cardinality
+    */
+   String cardinality() default "";
+
+   /**
+    * Get when required.
+    * Default is Configured.
+    *
+    * @return when required.
+    */
+   String whenRequired() default "Configured";
+
+   /**
+    * Get dependent state.
+    * Default is Installed.
+    *
+    * @return dependent state.
+    */
+   String dependentState() default "Installed";
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackFactory.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,39 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactory;
+import org.jboss.classadapter.spi.DependencyBuilderListItem;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * Create dependency list item from Callback info.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class CallbackFactory implements DependencyFactory<Callback>
+{
+   public DependencyBuilderListItem<KernelControllerContext> createDependency(Callback annotation)
+   {
+      return null; // todo
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackType.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackType.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CallbackType.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,50 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+/**
+ * Callback type - Install or Uninstall.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public enum CallbackType
+{
+   INSTALL(true),
+   UNINSTALL(false);
+
+   private boolean type;
+
+   CallbackType(boolean type)
+   {
+      this.type = type;
+   }
+
+   /**
+    * Is install or uninstall.
+    *
+    * @return true for install, false for uninstall
+    */
+   public boolean isInstallPhase()
+   {
+      return type;
+   }
+}

Copied: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java (from rev 62482, projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/Inject.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,91 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactoryLookup;
+
+/**
+ * Beans when injected by class type are by default changed to configured
+ * state - if not yet configured.
+ * You can change this behavior by setting state.
+ *
+ * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.TYPE})
+ at DependencyFactoryLookup(InjectFactory.class)
+public @interface Inject
+{
+   /**
+    * Get bean.
+    * Default is no bean.
+    *
+    * @return bean name
+    */
+   String bean() default "";
+
+   /**
+    * Get property.
+    * Default is no property.
+    *
+    * @return property name
+    */
+   String property() default "";
+
+   /**
+    * Get when required.
+    * Default is Describe.
+    *
+    * @return when required.
+    */
+   String whenRequired() default "Describe";
+
+   /**
+    * Get dependent state.
+    * Default is Installed.
+    *
+    * @return dependent state.
+    */
+   String dependentState() default "Installed";
+
+   /**
+    * Get injection type.
+    * Default is by class.
+    *
+    * @return injection type
+    */
+   InjectType type() default InjectType.BY_CLASS;
+
+   /**
+    * Get injection option.
+    * Default is Strict.
+    *
+    * @return injection option
+    */
+   InjectOption option() default InjectOption.STRICT;
+
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectFactory.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,39 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactory;
+import org.jboss.classadapter.spi.DependencyBuilderListItem;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * Create injection dependency.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InjectFactory implements DependencyFactory<Inject>
+{
+   public DependencyBuilderListItem<KernelControllerContext> createDependency(Inject annotation)
+   {
+      return null; // todo
+   }
+}

Copied: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectOption.java (from rev 62482, projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectOption.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectOption.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectOption.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,46 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+/**
+ * Injection option - strict or optional / callback.
+ *
+ * @author <a href="mailto:ales.justin at gmail.com">Ales Justin</a>
+ */
+public enum InjectOption
+{
+   STRICT("Strict"),
+   CALLBACK("Callback");
+
+   private String optionString;
+
+   InjectOption(String optionString)
+   {
+      this.optionString = optionString;
+   }
+
+   public String toString()
+   {
+      return optionString;
+   }
+
+}

Copied: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectType.java (from rev 62482, projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectType.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectType.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InjectType.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+/**
+ * Injection type - by class or by property name.
+ *
+ * @author <a href="mailto:ales.justin at gmail.com">Ales Justin</a>
+ */
+public enum InjectType
+{
+   BY_CLASS("ByClass"),
+   BY_NAME("ByName");
+
+   private String typeString;
+
+   InjectType(String modeString)
+   {
+      this.typeString = modeString;
+   }
+
+   public String toString()
+   {
+      return typeString;
+   }
+
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Install.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Install.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Install.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,65 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactoryLookup;
+
+/**
+ * Inistall callback.
+ * @see @org.jboss.beans.metadata.plugins.annotations.Callback
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD})
+ at DependencyFactoryLookup(InstallFactory.class)
+public @interface Install
+{
+   /**
+    * Get the cardinality.
+    * Default is no cardinality.
+    *
+    * @return cardinality
+    */
+   String cardinality() default "";
+
+   /**
+    * Get when required.
+    * Default is Configured.
+    *
+    * @return when required.
+    */
+   String whenRequired() default "Configured";
+
+   /**
+    * Get dependent state.
+    * Default is Installed.
+    *
+    * @return dependent state.
+    */
+   String dependentState() default "Installed";
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallFactory.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,39 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactory;
+import org.jboss.classadapter.spi.DependencyBuilderListItem;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * Create dependency list item from Install info.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InstallFactory implements DependencyFactory<Install>
+{
+   public DependencyBuilderListItem<KernelControllerContext> createDependency(Install annotation)
+   {
+      return null; // todo
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Uninstall.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Uninstall.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Uninstall.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,65 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactoryLookup;
+
+/**
+ * Uninistall callback.
+ * @see @org.jboss.beans.metadata.plugins.annotations.Callback
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD})
+ at DependencyFactoryLookup(UninstallFactory.class)
+public @interface Uninstall
+{
+   /**
+    * Get the cardinality.
+    * Default is no cardinality.
+    *
+    * @return cardinality
+    */
+   String cardinality() default "";
+
+   /**
+    * Get when required.
+    * Default is Configured.
+    *
+    * @return when required.
+    */
+   String whenRequired() default "Configured";
+
+   /**
+    * Get dependent state.
+    * Default is Installed.
+    *
+    * @return dependent state.
+    */
+   String dependentState() default "Installed";
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallFactory.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,39 @@
+/*
+* 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.beans.metadata.plugins.annotations;
+
+import org.jboss.beans.metadata.spi.annotations.DependencyFactory;
+import org.jboss.classadapter.spi.DependencyBuilderListItem;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * Create dependency list item from Uninstall info.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class UninstallFactory implements DependencyFactory<Uninstall>
+{
+   public DependencyBuilderListItem<KernelControllerContext> createDependency(Uninstall annotation)
+   {
+      return null; // todo
+   }
+}

Copied: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java (from rev 62482, projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,312 @@
+/*
+* 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.beans.metadata.plugins.builder;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDemandMetaData;
+import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
+import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.DemandMetaData;
+import org.jboss.beans.metadata.spi.DependencyMetaData;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.beans.metadata.spi.SupplyMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerMode;
+
+/**
+ * Helper class.
+ * Similar to StringBuffer, methods return current instance of BeanMetaDataBuilder.
+ *
+ * TODO - add on demand, when building OSGi, Spring, ...
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class BeanMetaDataBuilderImpl implements BeanMetaDataBuilder
+{
+   private AbstractBeanMetaData beanMetaData;
+   // parameter builders
+   private ParameterMetaDataBuilder<AbstractConstructorMetaData> constructorBuilder;
+   private LifecycleMetaDataBuilder createBuilder;
+   private LifecycleMetaDataBuilder startBuilder;
+   private LifecycleMetaDataBuilder stopBuilder;
+   private LifecycleMetaDataBuilder destroyBuilder;
+   // install
+   private AbstractInstallMetaDataBuilder installBuilder;
+   private AbstractInstallMetaDataBuilder uninstallBuilder;
+
+   public BeanMetaDataBuilderImpl(String bean)
+   {
+      this(new AbstractBeanMetaData(bean));
+   }
+
+   public BeanMetaDataBuilderImpl(String name, String bean)
+   {
+      this(new AbstractBeanMetaData(name, bean));
+   }
+
+   public BeanMetaDataBuilderImpl(AbstractBeanMetaData beanMetaData)
+   {
+      this.beanMetaData = beanMetaData;
+      // lifecycle builders
+      createBuilder = new CreateLifecycleMetaDataBuilder(beanMetaData);
+      startBuilder = new StartLifecycleMetaDataBuilder(beanMetaData);
+      stopBuilder = new StopLifecycleMetaDataBuilder(beanMetaData);
+      destroyBuilder = new DestroyLifecycleMetaDataBuilder(beanMetaData);
+      // install
+      installBuilder = new InstallMetaDataBuilder(beanMetaData);
+      uninstallBuilder = new UninstallMetaDataBuilder(beanMetaData);
+   }
+
+   public BeanMetaData getBeanMetaData()
+   {
+      return beanMetaData;
+   }
+
+   public BeanMetaDataBuilder setMode(String modeString)
+   {
+      return setMode(new ControllerMode(modeString));
+   }
+
+   public BeanMetaDataBuilder setMode(ControllerMode mode)
+   {
+      beanMetaData.setMode(mode);
+      return this;
+   }
+
+   public BeanMetaDataBuilder setClassLoader(Object classLoader)
+   {
+      beanMetaData.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData(classLoader)));
+      return this;
+   }
+
+   public BeanMetaDataBuilder addConstructorParameter(String type, Object value)
+   {
+      AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
+      if (constructor == null)
+      {
+         constructor = new AbstractConstructorMetaData();
+         beanMetaData.setConstructor(constructor);
+         constructorBuilder = new ParameterMetaDataBuilder<AbstractConstructorMetaData>(constructor);
+      }
+      constructorBuilder.addParameterMetaData(type, value);
+      return this;
+   }
+
+   public BeanMetaDataBuilder addPropertyMetaData(String name, Object value)
+   {
+      Set<PropertyMetaData> properties = getProperties();
+      properties.add(new AbstractPropertyMetaData(name, value));
+      return this;
+   }
+
+   public BeanMetaDataBuilder addPropertyMetaData(String name, String value)
+   {
+      Set<PropertyMetaData> properties = getProperties();
+      properties.add(new AbstractPropertyMetaData(name, value));
+      return this;
+   }
+
+   public BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value)
+   {
+      Set<PropertyMetaData> properties = getProperties();
+      properties.add(new AbstractPropertyMetaData(name, value));
+      return this;
+   }
+
+   private Set<PropertyMetaData> getProperties()
+   {
+      Set<PropertyMetaData> properties = beanMetaData.getProperties();
+      if (properties == null)
+      {
+         properties = new HashSet<PropertyMetaData>();
+         beanMetaData.setProperties(properties);
+      }
+      return properties;
+   }
+
+   public BeanMetaDataBuilder setCreate(String methodName)
+   {
+      createBuilder.createLifecycleMetaData(methodName);
+      return this;
+   }
+
+   public BeanMetaDataBuilder addCreateParameter(String type, Object value)
+   {
+      createBuilder.addParameterMetaData(type, value);
+      return this;
+   }
+
+   public BeanMetaDataBuilder setStart(String methodName)
+   {
+      startBuilder.createLifecycleMetaData(methodName);
+      return this;
+   }
+
+   public BeanMetaDataBuilder addStartParameter(String type, Object value)
+   {
+      startBuilder.addParameterMetaData(type, value);
+      return this;
+   }
+
+   public BeanMetaDataBuilder setStop(String methodName)
+   {
+      stopBuilder.createLifecycleMetaData(methodName);
+      return this;
+   }
+
+   public BeanMetaDataBuilder addStopParameter(String type, Object value)
+   {
+      stopBuilder.addParameterMetaData(type, value);
+      return this;
+   }
+
+   public BeanMetaDataBuilder setDestroy(String methodName)
+   {
+      destroyBuilder.createLifecycleMetaData(methodName);
+      return this;
+   }
+
+   public BeanMetaDataBuilder addDestroyParameter(String type, Object value)
+   {
+      destroyBuilder.addParameterMetaData(type, value);
+      return this;
+   }
+
+   public BeanMetaDataBuilder addSupply(Object supply)
+   {
+      Set<SupplyMetaData> supplies = beanMetaData.getSupplies();
+      if (supplies == null)
+      {
+         supplies = new HashSet<SupplyMetaData>();
+         beanMetaData.setSupplies(supplies);
+      }
+      supplies.add(new AbstractSupplyMetaData(supply));
+      return this;
+   }
+
+   public BeanMetaDataBuilder addDemand(Object demand)
+   {
+      Set<DemandMetaData> demands = beanMetaData.getDemands();
+      if (demands == null)
+      {
+         demands = new HashSet<DemandMetaData>();
+         beanMetaData.setDemands(demands);
+      }
+      demands.add(new AbstractDemandMetaData(demand));
+      return this;
+   }
+
+   public BeanMetaDataBuilder addDependency(Object dependency)
+   {
+      Set<DependencyMetaData> dependencies = beanMetaData.getDepends();
+      if (dependencies == null)
+      {
+         dependencies = new HashSet<DependencyMetaData>();
+         beanMetaData.setDepends(dependencies);
+      }
+      dependencies.add(new AbstractDependencyMetaData(dependency));
+      return this;
+   }
+
+   public BeanMetaDataBuilder addInstall(String methodName)
+   {
+      return addInstall(methodName, null);
+   }
+
+   public BeanMetaDataBuilder addInstall(String methodName, String bean)
+   {
+      return addInstall(methodName, bean, new String[]{}, new Object[]{});
+   }
+
+   public BeanMetaDataBuilder addInstall(String methodName, String type, Object value)
+   {
+      return addInstall(methodName, null, type, value);
+   }
+
+   public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, Object value)
+   {
+      return addInstall(methodName, bean, new String[]{type}, new Object[]{value});
+   }
+
+   public BeanMetaDataBuilder addInstall(String methodName, String[] types, Object[] values)
+   {
+      return addInstall(methodName, null, types, values);
+   }
+
+   public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, Object[] values)
+   {
+      AbstractInstallMetaData install = (AbstractInstallMetaData)installBuilder.createLifecycleMetaData(methodName);
+      install.setBean(bean);
+      for(int i = 0; i < types.length; i++)
+      {
+         installBuilder.addParameter(install, types[i], values[i]);
+      }
+      return this;
+   }
+
+   public BeanMetaDataBuilder addUninstall(String methodName)
+   {
+      return addUninstall(methodName, null);
+   }
+
+   public BeanMetaDataBuilder addUninstall(String methodName, String type, Object value)
+   {
+      return addUninstall(methodName, new String[]{type}, new Object[]{value});
+   }
+
+   public BeanMetaDataBuilder addUninstall(String methodName, String[] types, Object[] values)
+   {
+      return addUninstall(methodName, null, types, values);
+   }
+
+   public BeanMetaDataBuilder addUninstall(String methodName, String bean)
+   {
+      return addUninstall(methodName, bean, new String[]{}, new Object[]{});
+   }
+
+   public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, Object value)
+   {
+      return addUninstall(methodName, bean, new String[]{type}, new Object[]{value});
+   }
+
+   public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, Object[] values)
+   {
+      AbstractInstallMetaData uninstall = (AbstractInstallMetaData)uninstallBuilder.createLifecycleMetaData(methodName);
+      uninstall.setBean(bean);
+      for(int i = 0; i < types.length; i++)
+      {
+         uninstallBuilder.addParameter(uninstall, types[i], values[i]);
+      }
+      return this;
+   }
+
+}

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/LifecycleMetaDataBuilder.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/LifecycleMetaDataBuilder.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/LifecycleMetaDataBuilder.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -24,11 +24,10 @@
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData;
 import org.jboss.beans.metadata.spi.LifecycleMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
 
 /**
  * Helper class.
- * @see BeanMetaDataBuilder
+ * @see BeanMetaDataBuilderImpl
  * @see ParameterMetaDataBuilder
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/ParameterMetaDataBuilder.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/ParameterMetaDataBuilder.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/ParameterMetaDataBuilder.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -26,13 +26,12 @@
 
 import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
 import org.jboss.beans.metadata.spi.ParameterMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
 
 /**
  * Helper class.
  *
  * @param <T> the parameter holder type
- * @see BeanMetaDataBuilder
+ * @see BeanMetaDataBuilderImpl
  * @see LifecycleMetaDataBuilder
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/StateMetaDataBuilder.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/StateMetaDataBuilder.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/StateMetaDataBuilder.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -27,7 +27,7 @@
 
 /**
  * Helper class.
- * @see org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder
+ * @see BeanMetaDataBuilderImpl
  * @see org.jboss.beans.metadata.plugins.builder.ParameterMetaDataBuilder
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactory.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,43 @@
+/*
+* 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.beans.metadata.spi.annotations;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.classadapter.spi.DependencyBuilderListItem;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+
+/**
+ * Dependecy factory contract.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface DependencyFactory<T extends Annotation>
+{
+   /**
+    * Create dependency builder item.
+    *
+    * @param annotation current annotation
+    * @return dependency builder item
+    */
+   DependencyBuilderListItem<KernelControllerContext> createDependency(T annotation);
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactoryLookup.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactoryLookup.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/DependencyFactoryLookup.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -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.beans.metadata.spi.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.ANNOTATION_TYPE})
+public @interface DependencyFactoryLookup
+{
+   Class<? extends DependencyFactory> value();
+}

Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/Inject.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/Inject.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/Inject.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -1,50 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.beans.metadata.spi.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Beans when injected by class type are by default changed to configured
- * state - if not yet configured.
- * You can change this behavior by setting state.
- *
- * @author <a href="mailto:ales.justin at genera-lynx.com">Ales Justin</a>
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.METHOD, ElementType.TYPE})
-public @interface Inject
-{
-   String bean() default "";
-
-   String property() default "";
-
-   String state() default "Installed";
-
-   InjectType type() default InjectType.BY_CLASS;
-
-   InjectOption option() default InjectOption.STRICT;
-
-}

Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectOption.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectOption.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectOption.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -1,46 +0,0 @@
-/*
-* 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.beans.metadata.spi.annotations;
-
-/**
- * Injection option - strict or optional / callback.
- *
- * @author <a href="mailto:ales.justin at gmail.com">Ales Justin</a>
- */
-public enum InjectOption
-{
-   STRICT("Strict"),
-   CALLBACK("Callback");
-
-   private String optionString;
-
-   InjectOption(String optionString)
-   {
-      this.optionString = optionString;
-   }
-
-   public String toString()
-   {
-      return optionString;
-   }
-
-}

Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectType.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectType.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/annotations/InjectType.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -1,46 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.beans.metadata.spi.annotations;
-
-/**
- * Injection type - by class or by property name.
- *
- * @author <a href="mailto:ales.justin at gmail.com">Ales Justin</a>
- */
-public enum InjectType
-{
-   BY_CLASS("ByClass"),
-   BY_NAME("ByName");
-
-   private String typeString;
-
-   InjectType(String modeString)
-   {
-      this.typeString = modeString;
-   }
-
-   public String toString()
-   {
-      return typeString;
-   }
-
-}

Deleted: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -1,320 +0,0 @@
-/*
-* 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.beans.metadata.spi.builder;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
-import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData;
-import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDemandMetaData;
-import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
-import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData;
-import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
-import org.jboss.beans.metadata.plugins.builder.AbstractInstallMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.CreateLifecycleMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.DestroyLifecycleMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.InstallMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.LifecycleMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.ParameterMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.StartLifecycleMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.StopLifecycleMetaDataBuilder;
-import org.jboss.beans.metadata.plugins.builder.UninstallMetaDataBuilder;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.DemandMetaData;
-import org.jboss.beans.metadata.spi.DependencyMetaData;
-import org.jboss.beans.metadata.spi.PropertyMetaData;
-import org.jboss.beans.metadata.spi.SupplyMetaData;
-import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.dependency.spi.ControllerMode;
-
-/**
- * Helper class.
- * Similar to StringBuffer, methods return current instance of BeanMetaDataBuilder.
- *
- * TODO - add on demand, when building OSGi, Spring, ...
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class BeanMetaDataBuilder
-{
-   private AbstractBeanMetaData beanMetaData;
-   // parameter builders
-   private ParameterMetaDataBuilder<AbstractConstructorMetaData> constructorBuilder;
-   private LifecycleMetaDataBuilder createBuilder;
-   private LifecycleMetaDataBuilder startBuilder;
-   private LifecycleMetaDataBuilder stopBuilder;
-   private LifecycleMetaDataBuilder destroyBuilder;
-   // install
-   private AbstractInstallMetaDataBuilder installBuilder;
-   private AbstractInstallMetaDataBuilder uninstallBuilder;
-
-   public BeanMetaDataBuilder(String bean)
-   {
-      this(new AbstractBeanMetaData(bean));
-   }
-
-   public BeanMetaDataBuilder(String name, String bean)
-   {
-      this(new AbstractBeanMetaData(name, bean));
-   }
-
-   public BeanMetaDataBuilder(AbstractBeanMetaData beanMetaData)
-   {
-      this.beanMetaData = beanMetaData;
-      // lifecycle builders
-      createBuilder = new CreateLifecycleMetaDataBuilder(beanMetaData);
-      startBuilder = new StartLifecycleMetaDataBuilder(beanMetaData);
-      stopBuilder = new StopLifecycleMetaDataBuilder(beanMetaData);
-      destroyBuilder = new DestroyLifecycleMetaDataBuilder(beanMetaData);
-      // install
-      installBuilder = new InstallMetaDataBuilder(beanMetaData);
-      uninstallBuilder = new UninstallMetaDataBuilder(beanMetaData);
-   }
-
-   public BeanMetaData getBeanMetaData()
-   {
-      return beanMetaData;
-   }
-
-   public BeanMetaDataBuilder setMode(String modeString)
-   {
-      return setMode(new ControllerMode(modeString));
-   }
-
-   public BeanMetaDataBuilder setMode(ControllerMode mode)
-   {
-      beanMetaData.setMode(mode);
-      return this;
-   }
-
-   public BeanMetaDataBuilder setClassLoader(Object classLoader)
-   {
-      beanMetaData.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData(classLoader)));
-      return this;
-   }
-
-   public BeanMetaDataBuilder addConstructorParameter(String type, Object value)
-   {
-      AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor();
-      if (constructor == null)
-      {
-         constructor = new AbstractConstructorMetaData();
-         beanMetaData.setConstructor(constructor);
-         constructorBuilder = new ParameterMetaDataBuilder<AbstractConstructorMetaData>(constructor);
-      }
-      constructorBuilder.addParameterMetaData(type, value);
-      return this;
-   }
-
-   public BeanMetaDataBuilder addPropertyMetaData(String name, Object value)
-   {
-      Set<PropertyMetaData> properties = getProperties();
-      properties.add(new AbstractPropertyMetaData(name, value));
-      return this;
-   }
-
-   public BeanMetaDataBuilder addPropertyMetaData(String name, String value)
-   {
-      Set<PropertyMetaData> properties = getProperties();
-      properties.add(new AbstractPropertyMetaData(name, value));
-      return this;
-   }
-
-   public BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value)
-   {
-      Set<PropertyMetaData> properties = getProperties();
-      properties.add(new AbstractPropertyMetaData(name, value));
-      return this;
-   }
-
-   private Set<PropertyMetaData> getProperties()
-   {
-      Set<PropertyMetaData> properties = beanMetaData.getProperties();
-      if (properties == null)
-      {
-         properties = new HashSet<PropertyMetaData>();
-         beanMetaData.setProperties(properties);
-      }
-      return properties;
-   }
-
-   public BeanMetaDataBuilder setCreate(String methodName)
-   {
-      createBuilder.createLifecycleMetaData(methodName);
-      return this;
-   }
-
-   public BeanMetaDataBuilder addCreateParameter(String type, Object value)
-   {
-      createBuilder.addParameterMetaData(type, value);
-      return this;
-   }
-
-   public BeanMetaDataBuilder setStart(String methodName)
-   {
-      startBuilder.createLifecycleMetaData(methodName);
-      return this;
-   }
-
-   public BeanMetaDataBuilder addStartParameter(String type, Object value)
-   {
-      startBuilder.addParameterMetaData(type, value);
-      return this;
-   }
-
-   public BeanMetaDataBuilder setStop(String methodName)
-   {
-      stopBuilder.createLifecycleMetaData(methodName);
-      return this;
-   }
-
-   public BeanMetaDataBuilder addStopParameter(String type, Object value)
-   {
-      stopBuilder.addParameterMetaData(type, value);
-      return this;
-   }
-
-   public BeanMetaDataBuilder setDestroy(String methodName)
-   {
-      destroyBuilder.createLifecycleMetaData(methodName);
-      return this;
-   }
-
-   public BeanMetaDataBuilder addDestroyParameter(String type, Object value)
-   {
-      destroyBuilder.addParameterMetaData(type, value);
-      return this;
-   }
-
-   public BeanMetaDataBuilder addSupply(Object supply)
-   {
-      Set<SupplyMetaData> supplies = beanMetaData.getSupplies();
-      if (supplies == null)
-      {
-         supplies = new HashSet<SupplyMetaData>();
-         beanMetaData.setSupplies(supplies);
-      }
-      supplies.add(new AbstractSupplyMetaData(supply));
-      return this;
-   }
-
-   public BeanMetaDataBuilder addDemand(Object demand)
-   {
-      Set<DemandMetaData> demands = beanMetaData.getDemands();
-      if (demands == null)
-      {
-         demands = new HashSet<DemandMetaData>();
-         beanMetaData.setDemands(demands);
-      }
-      demands.add(new AbstractDemandMetaData(demand));
-      return this;
-   }
-
-   public BeanMetaDataBuilder addDependency(Object dependency)
-   {
-      Set<DependencyMetaData> dependencies = beanMetaData.getDepends();
-      if (dependencies == null)
-      {
-         dependencies = new HashSet<DependencyMetaData>();
-         beanMetaData.setDepends(dependencies);
-      }
-      dependencies.add(new AbstractDependencyMetaData(dependency));
-      return this;
-   }
-
-   public BeanMetaDataBuilder addInstall(String methodName)
-   {
-      return addInstall(methodName, null);
-   }
-
-   public BeanMetaDataBuilder addInstall(String methodName, String bean)
-   {
-      return addInstall(methodName, bean, new String[]{}, new Object[]{});
-   }
-
-   public BeanMetaDataBuilder addInstall(String methodName, String type, Object value)
-   {
-      return addInstall(methodName, null, type, value);
-   }
-
-   public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, Object value)
-   {
-      return addInstall(methodName, bean, new String[]{type}, new Object[]{value});
-   }
-
-   public BeanMetaDataBuilder addInstall(String methodName, String[] types, Object[] values)
-   {
-      return addInstall(methodName, null, types, values);
-   }
-
-   public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, Object[] values)
-   {
-      AbstractInstallMetaData install = (AbstractInstallMetaData)installBuilder.createLifecycleMetaData(methodName);
-      install.setBean(bean);
-      for(int i = 0; i < types.length; i++)
-      {
-         installBuilder.addParameter(install, types[i], values[i]);
-      }
-      return this;
-   }
-
-   public BeanMetaDataBuilder addUninstall(String methodName)
-   {
-      return addUninstall(methodName, null);
-   }
-
-   public BeanMetaDataBuilder addUninstall(String methodName, String type, Object value)
-   {
-      return addUninstall(methodName, new String[]{type}, new Object[]{value});
-   }
-
-   public BeanMetaDataBuilder addUninstall(String methodName, String[] types, Object[] values)
-   {
-      return addUninstall(methodName, null, types, values);
-   }
-
-   public BeanMetaDataBuilder addUninstall(String methodName, String bean)
-   {
-      return addUninstall(methodName, bean, new String[]{}, new Object[]{});
-   }
-
-   public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, Object value)
-   {
-      return addUninstall(methodName, bean, new String[]{type}, new Object[]{value});
-   }
-
-   public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, Object[] values)
-   {
-      AbstractInstallMetaData uninstall = (AbstractInstallMetaData)uninstallBuilder.createLifecycleMetaData(methodName);
-      uninstall.setBean(bean);
-      for(int i = 0; i < types.length; i++)
-      {
-         uninstallBuilder.addParameter(uninstall, types[i], values[i]);
-      }
-      return this;
-   }
-
-}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -0,0 +1,97 @@
+/*
+* 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.beans.metadata.spi.builder;
+
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.dependency.spi.ControllerMode;
+
+/**
+ * BeanMetaDataBuilder contract.
+ * TODO - javadocs
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface BeanMetaDataBuilder
+{
+   BeanMetaData getBeanMetaData();
+
+   BeanMetaDataBuilder setMode(String modeString);
+
+   BeanMetaDataBuilder setMode(ControllerMode mode);
+
+   BeanMetaDataBuilder setClassLoader(Object classLoader);
+
+   BeanMetaDataBuilder addConstructorParameter(String type, Object value);
+
+   BeanMetaDataBuilder addPropertyMetaData(String name, Object value);
+
+   BeanMetaDataBuilder addPropertyMetaData(String name, String value);
+
+   BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value);
+
+   BeanMetaDataBuilder setCreate(String methodName);
+
+   BeanMetaDataBuilder addCreateParameter(String type, Object value);
+
+   BeanMetaDataBuilder setStart(String methodName);
+
+   BeanMetaDataBuilder addStartParameter(String type, Object value);
+
+   BeanMetaDataBuilder setStop(String methodName);
+
+   BeanMetaDataBuilder addStopParameter(String type, Object value);
+
+   BeanMetaDataBuilder setDestroy(String methodName);
+
+   BeanMetaDataBuilder addDestroyParameter(String type, Object value);
+
+   BeanMetaDataBuilder addSupply(Object supply);
+
+   BeanMetaDataBuilder addDemand(Object demand);
+
+   BeanMetaDataBuilder addDependency(Object dependency);
+
+   BeanMetaDataBuilder addInstall(String methodName);
+
+   BeanMetaDataBuilder addInstall(String methodName, String bean);
+
+   BeanMetaDataBuilder addInstall(String methodName, String type, Object value);
+
+   BeanMetaDataBuilder addInstall(String methodName, String bean, String type, Object value);
+
+   BeanMetaDataBuilder addInstall(String methodName, String[] types, Object[] values);
+
+   BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, Object[] values);
+
+   BeanMetaDataBuilder addUninstall(String methodName);
+
+   BeanMetaDataBuilder addUninstall(String methodName, String type, Object value);
+
+   BeanMetaDataBuilder addUninstall(String methodName, String[] types, Object[] values);
+
+   BeanMetaDataBuilder addUninstall(String methodName, String bean);
+
+   BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, Object value);
+
+   BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, Object[] values);
+}

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -25,6 +25,7 @@
 import java.util.Arrays;
 
 import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderImpl;
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
 import org.jboss.kernel.Kernel;
@@ -54,7 +55,7 @@
 
    public void testConstructor() throws Throwable
    {
-      BeanMetaDataBuilder builder = new BeanMetaDataBuilder("FromBMD", SimpleBean.class.getName());
+      BeanMetaDataBuilder builder = new BeanMetaDataBuilderImpl("FromBMD", SimpleBean.class.getName());
       builder.addConstructorParameter(String.class.getName(), "TestConstructor");
       BeanMetaData beanMetaData = builder.getBeanMetaData();
       SimpleBean fbmd = (SimpleBean)instantiateAndConfigure(beanMetaData);
@@ -66,7 +67,7 @@
 
    public void testProperty() throws Throwable
    {
-      BeanMetaDataBuilder builder = new BeanMetaDataBuilder("PropBMD", SimpleBean.class.getName())
+      BeanMetaDataBuilder builder = new BeanMetaDataBuilderImpl("PropBMD", SimpleBean.class.getName())
             .addPropertyMetaData("adouble", 3.1459)
             .addPropertyMetaData("anint", "123")
             .addPropertyMetaData("collection", new ArrayList());
@@ -84,7 +85,7 @@
    {
       Kernel kernel = bootstrap();
 
-      BeanMetaDataBuilder builder = new BeanMetaDataBuilder("SLB", SimpleLifecycleBean.class.getName())
+      BeanMetaDataBuilder builder = new BeanMetaDataBuilderImpl("SLB", SimpleLifecycleBean.class.getName())
          .addCreateParameter(String.class.getName(), "ParamCreate")
          .setStart("doStart")
          .addStartParameter(String.class.getName(), "ParamStart")
@@ -112,7 +113,7 @@
    {
       Kernel kernel = bootstrap();
 
-      BeanMetaDataBuilder builder = new BeanMetaDataBuilder("SLB", SimpleLifecycleBean.class.getName())
+      BeanMetaDataBuilder builder = new BeanMetaDataBuilderImpl("SLB", SimpleLifecycleBean.class.getName())
          .addInstall("installParam", String.class.getName(), "Install")
          .addUninstall("uninstallParam", String.class.getName(), "Uninstall");
       BeanMetaData beanMetaData = builder.getBeanMetaData();
@@ -132,11 +133,11 @@
 
    public void testDemandSupply() throws Throwable
    {
-      BeanMetaDataBuilder demand = new BeanMetaDataBuilder("DemandBean", SimpleBean.class.getName());
+      BeanMetaDataBuilder demand = new BeanMetaDataBuilderImpl("DemandBean", SimpleBean.class.getName());
       demand.addDemand("Barrier");
       BeanMetaData demandBean = demand.getBeanMetaData();
 
-      BeanMetaDataBuilder supply = new BeanMetaDataBuilder("SupplyBean", SimpleLifecycleBean.class.getName());
+      BeanMetaDataBuilder supply = new BeanMetaDataBuilderImpl("SupplyBean", SimpleLifecycleBean.class.getName());
       supply.addSupply("Barrier");
       BeanMetaData supplyBean = supply.getBeanMetaData();
 
@@ -159,11 +160,11 @@
 
    public void testDependency() throws Throwable
    {
-      BeanMetaDataBuilder dependOn = new BeanMetaDataBuilder("DependOnBean", SimpleBean.class.getName());
+      BeanMetaDataBuilder dependOn = new BeanMetaDataBuilderImpl("DependOnBean", SimpleBean.class.getName());
       dependOn.addDependency("DependencyResolver");
       BeanMetaData dependOnBean = dependOn.getBeanMetaData();
 
-      BeanMetaDataBuilder resolver = new BeanMetaDataBuilder("DependencyResolver", SimpleLifecycleBean.class.getName());
+      BeanMetaDataBuilder resolver = new BeanMetaDataBuilderImpl("DependencyResolver", SimpleLifecycleBean.class.getName());
       BeanMetaData resolverBean = resolver.getBeanMetaData();
 
       AbstractKernelDeployment deployment = new AbstractKernelDeployment();

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/BundleActivatorDeployer.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/BundleActivatorDeployer.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/deployers/BundleActivatorDeployer.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -21,6 +21,7 @@
 */
 package org.jboss.osgi.plugins.deployers;
 
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderImpl;
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
 import org.jboss.deployers.plugins.deployers.helpers.AbstractRealDeployer;
@@ -64,7 +65,7 @@
             String name = createBundleActivatorBeanName(deployment);
             // todo - get deployment context in non-depricated way
             BundleContext bundleContext = new BundleContextImpl(unit.getDeploymentContext());
-            BeanMetaDataBuilder builder = new BeanMetaDataBuilder(name, bundleActivator)
+            BeanMetaDataBuilder builder = new BeanMetaDataBuilderImpl(name, bundleActivator)
                   .addStartParameter(BundleContext.class.getName(), bundleContext)
                   .addStopParameter(BundleContext.class.getName(), bundleContext);
             BeanMetaData beanMetaData = builder.getBeanMetaData();

Modified: projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java
===================================================================
--- projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java	2007-04-23 14:06:24 UTC (rev 62484)
+++ projects/microcontainer/trunk/osgi-int/src/main/org/jboss/osgi/plugins/facade/BundleContextImpl.java	2007-04-23 15:13:31 UTC (rev 62485)
@@ -32,6 +32,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderImpl;
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
 import org.jboss.deployers.spi.structure.DeploymentContext;
@@ -347,7 +348,7 @@
       {
          service = ServiceFactoryProxy.createProxy(service, interfaces);
       }
-      BeanMetaDataBuilder builder = new BeanMetaDataBuilder(GUID.asString(), serviceInfo.getName());
+      BeanMetaDataBuilder builder = new BeanMetaDataBuilderImpl(GUID.asString(), serviceInfo.getName());
       BeanMetaData metaData = builder.getBeanMetaData();
       KernelControllerContext context;
       try




More information about the jboss-cvs-commits mailing list