[jboss-cvs] JBossAS SVN: r106211 - in projects/demos/microcontainer/trunk: bundle/src/main/java/org/jboss/demos/bundle and 9 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 21 10:09:27 EDT 2010


Author: alesj
Date: 2010-06-21 10:09:26 -0400 (Mon, 21 Jun 2010)
New Revision: 106211

Added:
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/RandomizerActivator.java
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/Randomizer.java
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/RandomizerDelegate.java
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/CheatRandomizer.java
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/DefaultRandomizer.java
   projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/jboss-deployment.xml
   projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/hack/
   projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/hack/Hack.java
Removed:
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/DemosActivator.java
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/DefaultEventService.java
   projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/EventService.java
Modified:
   projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/MANIFEST.MF
   projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml
   projects/demos/microcontainer/trunk/pom.xml
   projects/demos/microcontainer/trunk/weld/src/main/java/org/jboss/demos/weld/mock/MockEjbServices.java
   projects/demos/microcontainer/trunk/wpojo/pom.xml
   projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java
   projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml
Log:
MC -> Weld.

Deleted: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/DemosActivator.java
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/DemosActivator.java	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/DemosActivator.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle;
-
-import java.util.logging.Logger;
-
-import org.jboss.demos.bundle.services.DefaultEventService;
-import org.jboss.demos.bundle.services.EventService;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class DemosActivator implements BundleActivator
-{
-   private Logger log = Logger.getLogger(DemosActivator.class.getName());
-
-   private ServiceRegistration ref;
-
-   public void start(BundleContext bundleContext) throws Exception
-   {
-      log.info("Starting Demos activator ...");
-      ref = bundleContext.registerService(EventService.class.getName(), new DefaultEventService("JBossWorld 2009"), null);
-   }
-
-   public void stop(BundleContext bundleContext) throws Exception
-   {
-      log.info("Stopping Demos activator ...");
-      if (ref != null)
-         ref.unregister();
-   }
-}

Copied: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/RandomizerActivator.java (from rev 104079, projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/DemosActivator.java)
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/RandomizerActivator.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/RandomizerActivator.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle;
+
+import java.util.logging.Logger;
+
+import org.jboss.demos.bundle.services.impl.DefaultRandomizer;
+import org.jboss.demos.bundle.services.Randomizer;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class RandomizerActivator implements BundleActivator
+{
+   private Logger log = Logger.getLogger(RandomizerActivator.class.getName());
+
+   private ServiceRegistration ref;
+
+   public void start(BundleContext bundleContext) throws Exception
+   {
+      log.info("Starting Randomizer activator ...");
+      ref = bundleContext.registerService(Randomizer.class.getName(), new DefaultRandomizer(), null);
+   }
+
+   public void stop(BundleContext bundleContext) throws Exception
+   {
+      log.info("Stopping Randomizer activator ...");
+      if (ref != null)
+         ref.unregister();
+   }
+}

Deleted: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/DefaultEventService.java
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/DefaultEventService.java	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/DefaultEventService.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle.services;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class DefaultEventService implements EventService
-{
-   private String name;
-
-   public DefaultEventService(String name)
-   {
-      this.name = name;
-   }
-
-   public String getEventName()
-   {
-      return name;
-   }
-}

Deleted: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/EventService.java
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/EventService.java	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/EventService.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -1,30 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle.services;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public interface EventService
-{
-   String getEventName(); 
-}

Copied: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/Randomizer.java (from rev 104079, projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/EventService.java)
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/Randomizer.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/Randomizer.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle.services;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface Randomizer
+{
+   /**
+    * Return a random element.
+    *
+    * @param elements the elements
+    * @return random element
+    */
+   Object execute(List elements);
+}

Added: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/RandomizerDelegate.java
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/RandomizerDelegate.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/RandomizerDelegate.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle.services;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class RandomizerDelegate
+{
+   private Randomizer randomizer;
+
+   public RandomizerDelegate(Randomizer randomizer)
+   {
+      if (randomizer == null)
+         throw new IllegalArgumentException("Null randomizer");
+      this.randomizer = randomizer;
+   }
+
+   public Object execute(List elements)
+   {
+      return randomizer.execute(elements);
+   }
+}
\ No newline at end of file

Added: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/CheatRandomizer.java
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/CheatRandomizer.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/CheatRandomizer.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle.services.impl;
+
+import java.util.List;
+import java.util.Random;
+
+import org.jboss.demos.bundle.services.Randomizer;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class CheatRandomizer implements Randomizer
+{
+   private String cheat;
+
+   public CheatRandomizer()
+   {
+      this("Slovenia");
+   }
+
+   public CheatRandomizer(String cheat)
+   {
+      this.cheat = cheat;
+   }
+
+   public Object execute(List elements)
+   {
+      for (Object e : elements)
+      {
+         if (e.toString().contains(cheat))
+            return e;
+      }
+      return null;
+   }
+}
\ No newline at end of file

Copied: projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/DefaultRandomizer.java (from rev 104079, projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/DefaultEventService.java)
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/DefaultRandomizer.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/bundle/src/main/java/org/jboss/demos/bundle/services/impl/DefaultRandomizer.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.demos.bundle.services.impl;
+
+import java.util.List;
+import java.util.Random;
+
+import org.jboss.demos.bundle.services.Randomizer;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DefaultRandomizer implements Randomizer
+{
+   public Object execute(List elements)
+   {
+      Random r = new Random();
+      int index = r.nextInt(elements.size());
+      return elements.get(index);
+   }
+}

Modified: projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/MANIFEST.MF
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/MANIFEST.MF	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/MANIFEST.MF	2010-06-21 14:09:26 UTC (rev 106211)
@@ -7,4 +7,4 @@
 Bundle-SymbolicName: org.jboss.demos.bundle
 Export-Package: org.jboss.demos.bundle.services;version=1.3
 Import-Package: org.osgi.framework;version="[0,1000]"
-Bundle-Activator: org.jboss.demos.bundle.DemosActivator
+Bundle-Activator: org.jboss.demos.bundle.RandomizerActivator

Copied: projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/jboss-deployment.xml (from rev 106095, projects/demos/microcontainer/trunk/bundle_user/src/main/resources/META-INF/jboss-deployment.xml)
===================================================================
--- projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/jboss-deployment.xml	                        (rev 0)
+++ projects/demos/microcontainer/trunk/bundle/src/main/resources/META-INF/jboss-deployment.xml	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1 @@
+<deployment xmlns="urn:jboss:deployment:1.0" required-stage="Installed"/>

Modified: projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/opojo/src/main/resources/META-INF/service-mix-beans.xml	2010-06-21 14:09:26 UTC (rev 106211)
@@ -1,16 +1,16 @@
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
 
-    <!-- osgi xmlns="urn:jboss:pojo2osgi:1.0" name="WorldCup" class="org.jboss.demos.opojo.impl.WorldCupImpl">
+    <osgi xmlns="urn:jboss:pojo2osgi:1.0" name="WorldCup" class="org.jboss.demos.opojo.impl.WorldCupImpl">
         <constructor>
-            <parameter><null/></parameter>
+            <parameter><inject bean="OfficeBox" property="winner"/></parameter>
         </constructor>
         <exposed-type>org.jboss.demos.opojo.api.WorldCup</exposed-type>
-    </osgi -->
+    </osgi>
 
-    <bean name="WorldCup" class="org.jboss.demos.opojo.impl.WorldCupImpl">
+    <!-- bean name="WorldCup" class="org.jboss.demos.opojo.impl.WorldCupImpl">
         <constructor>
             <parameter><inject bean="OfficeBox" property="winner"/></parameter>
         </constructor>
-    </bean>
+    </bean -->
 
 </deployment>

Modified: projects/demos/microcontainer/trunk/pom.xml
===================================================================
--- projects/demos/microcontainer/trunk/pom.xml	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/pom.xml	2010-06-21 14:09:26 UTC (rev 106211)
@@ -29,7 +29,7 @@
     <module>classloading</module>
     <module>classpath</module>
     <module>igloo</module>
-    <!-- module>bundle</module -->
+    <module>bundle</module>
     <module>bundle_user</module>
     <module>vfs</module>
     <module>policy</module>
@@ -39,6 +39,7 @@
     <module>opojo</module>
     <module>weld</module>
     <module>wpojo</module>
+    <module>judcon</module>
     <!-- <module>osgi</module> -->
     <module>build</module>
   </modules>
@@ -208,6 +209,16 @@
         <artifactId>jboss-demos-opojo</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.jboss.demos</groupId>
+        <artifactId>jboss-demos-igloo</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.demos</groupId>
+        <artifactId>jboss-demos-weld</artifactId>
+        <version>${project.version}</version>
+      </dependency>
 
       <dependency>
         <groupId>org.jboss.kernel</groupId>

Modified: projects/demos/microcontainer/trunk/weld/src/main/java/org/jboss/demos/weld/mock/MockEjbServices.java
===================================================================
--- projects/demos/microcontainer/trunk/weld/src/main/java/org/jboss/demos/weld/mock/MockEjbServices.java	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/weld/src/main/java/org/jboss/demos/weld/mock/MockEjbServices.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -64,6 +64,6 @@
 
    public Iterable<String> getEjbContainerNames()
    {
-	   return Collections.emptySet();
+	   return Collections.singleton("Randomizer"); // HACK -- TODO; fix it
    }
 }

Modified: projects/demos/microcontainer/trunk/wpojo/pom.xml
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/pom.xml	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/wpojo/pom.xml	2010-06-21 14:09:26 UTC (rev 106211)
@@ -17,12 +17,20 @@
        <groupId>org.jboss.demos</groupId>
        <artifactId>jboss-demos-opojo</artifactId>
       </dependency>
+      <dependency>
+       <groupId>org.jboss.demos</groupId>
+       <artifactId>jboss-demos-bundle</artifactId>
+      </dependency>
       <!-- Compile (global dependencies) -->
       <dependency>
         <groupId>javax.enterprise</groupId>
         <artifactId>cdi-api</artifactId>
       </dependency>
       <dependency>
+        <groupId>org.jboss</groupId>
+        <artifactId>jboss-common-core</artifactId>
+      </dependency>
+      <dependency>
         <groupId>org.jboss.kernel</groupId>
         <artifactId>jboss-weld-int</artifactId>
       </dependency>

Modified: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/Lottery.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -32,6 +32,7 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.jboss.demos.bundle.services.RandomizerDelegate;
 import org.jboss.demos.opojo.api.Team;
 
 /**
@@ -41,6 +42,7 @@
 {
    private Logger log = Logger.getLogger(Lottery.class.getName());
    private Instance<Team> teams;
+   private RandomizerDelegate randomizer;
 
    @Produces @Winner
    public Team winner()
@@ -55,6 +57,9 @@
       Random r = new Random();
       int x = r.nextInt(list.size());
       return list.get(x);
+
+      // Object result = randomizer.execute(list);
+      // return Team.class.cast(result);
    }
 
    @Inject
@@ -62,4 +67,10 @@
    {
       this.teams = teams;
    }
+
+   // @Inject
+   public void setRandomizer(RandomizerDelegate randomizer)
+   {
+      this.randomizer = randomizer;
+   }
 }

Added: projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/hack/Hack.java
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/hack/Hack.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/java/org/jboss/demos/wpojo/hack/Hack.java	2010-06-21 14:09:26 UTC (rev 106211)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.demos.wpojo.hack;
+
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class Hack
+{
+   private KernelController controller;
+
+   public Hack(KernelController controller)
+   {
+      this.controller = controller;
+   }
+
+   public void create() throws Throwable
+   {
+      BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("EjbContainer#1", Object.class.getName());
+      controller.install(builder.getBeanMetaData());
+   }
+
+   public void destroy()
+   {
+      controller.uninstall("EjbContainer#1");
+   }
+}

Modified: projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml	2010-06-21 13:58:04 UTC (rev 106210)
+++ projects/demos/microcontainer/trunk/wpojo/src/main/resources/META-INF/teams-beans.xml	2010-06-21 14:09:26 UTC (rev 106211)
@@ -4,4 +4,10 @@
 
   <bean name="OfficeBox" class="org.jboss.demos.wpojo.OfficeBox"/>
 
+   <bean name="Randomizer" class="org.jboss.demos.bundle.services.RandomizerDelegate">
+      <constructor>
+         <parameter><inject/></parameter>
+      </constructor>
+   </bean>
+
 </deployment>



More information about the jboss-cvs-commits mailing list