[jboss-cvs] JBossAS SVN: r93006 - in projects/demos/microcontainer/trunk/igloo/src/main: resources/META-INF and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Aug 30 09:57:37 EDT 2009


Author: alesj
Date: 2009-08-30 09:57:36 -0400 (Sun, 30 Aug 2009)
New Revision: 93006

Added:
   projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleRequiredStageDeployer.java
Modified:
   projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResetDeployer.java
   projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResolver.java
   projects/demos/microcontainer/trunk/igloo/src/main/resources/META-INF/igloo-beans.xml
Log:
Fix Reset usage.

Copied: projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleRequiredStageDeployer.java (from rev 92953, projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleStartStopDeployer.java)
===================================================================
--- projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleRequiredStageDeployer.java	                        (rev 0)
+++ projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleRequiredStageDeployer.java	2009-08-30 13:57:36 UTC (rev 93006)
@@ -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.bootstrap.igloo.deployers;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.osgi.spi.metadata.OSGiMetaData;
+
+/**
+ * Change required stage to reset.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BundleRequiredStageDeployer extends AbstractSimpleRealDeployer<OSGiMetaData>
+{
+   public BundleRequiredStageDeployer()
+   {
+      super(OSGiMetaData.class);
+      setStage(DeploymentStages.POST_CLASSLOADER);
+      setTopLevelOnly(true);
+   }
+
+   public void deploy(DeploymentUnit unit, OSGiMetaData deployment) throws DeploymentException
+   {
+      unit.setRequiredStage(BundleResolver.RESET_STAGE);
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit unit, OSGiMetaData deployment)
+   {
+      unit.setRequiredStage(DeploymentStages.INSTALLED);   
+   }
+}
\ No newline at end of file

Modified: projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResetDeployer.java
===================================================================
--- projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResetDeployer.java	2009-08-30 13:38:54 UTC (rev 93005)
+++ projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResetDeployer.java	2009-08-30 13:57:36 UTC (rev 93006)
@@ -22,7 +22,6 @@
 package org.jboss.demos.bootstrap.igloo.deployers;
 
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentStage;
 import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.osgi.spi.metadata.OSGiMetaData;
@@ -45,7 +44,7 @@
 
       this.resolver = resolver;
 
-      setStage(new DeploymentStage("Reset"));
+      setStage(BundleResolver.RESET_STAGE);
       setTopLevelOnly(true);
    }
 

Modified: projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResolver.java
===================================================================
--- projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResolver.java	2009-08-30 13:38:54 UTC (rev 93005)
+++ projects/demos/microcontainer/trunk/igloo/src/main/java/org/jboss/demos/bootstrap/igloo/deployers/BundleResolver.java	2009-08-30 13:57:36 UTC (rev 93006)
@@ -30,6 +30,7 @@
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.dependency.spi.DependencyInfo;
 import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.deployers.spi.deployer.DeploymentStage;
 import org.jboss.deployers.spi.deployer.DeploymentStages;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 
@@ -43,11 +44,14 @@
    static final ControllerState DESCRIBED_STATE = new ControllerState(DeploymentStages.DESCRIBE.getName());
    static final ControllerState CLASSLOADER_STATE = new ControllerState(DeploymentStages.CLASSLOADER.getName());
 
+   static final ControllerState RESET_STATE = new ControllerState("Reset");
+   static final DeploymentStage RESET_STAGE = new DeploymentStage("Reset", "Installed");
+
    private Set<DeploymentUnit> units = new CopyOnWriteArraySet<DeploymentUnit>();
 
    public BundleResolver(Controller controller)
    {
-      controller.addState(new ControllerState("Reset"), null);
+      controller.addState(RESET_STATE, null);
    }
 
    void resolve(DeploymentUnit unit)

Modified: projects/demos/microcontainer/trunk/igloo/src/main/resources/META-INF/igloo-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/igloo/src/main/resources/META-INF/igloo-beans.xml	2009-08-30 13:38:54 UTC (rev 93005)
+++ projects/demos/microcontainer/trunk/igloo/src/main/resources/META-INF/igloo-beans.xml	2009-08-30 13:57:36 UTC (rev 93006)
@@ -64,9 +64,10 @@
   <bean name="OSGiBundleResolveDeployer" class="org.jboss.demos.bootstrap.igloo.deployers.BundleResolveDeployer">
     <constructor><parameter><inject bean="BundleResolver" /></parameter></constructor>
   </bean>
+  <bean name="OSGiBundleStartStopDeployer" class="org.jboss.demos.bootstrap.igloo.deployers.BundleStartStopDeployer" />
+  <bean name="OSGiBundleRequiredStageDeployer" class="org.jboss.demos.bootstrap.igloo.deployers.BundleRequiredStageDeployer" />
   <bean name="OSGiBundleResetDeployer" class="org.jboss.demos.bootstrap.igloo.deployers.BundleResetDeployer">
     <constructor><parameter><inject bean="BundleResolver" /></parameter></constructor>
   </bean>
-  <bean name="OSGiBundleStartStopDeployer" class="org.jboss.demos.bootstrap.igloo.deployers.BundleStartStopDeployer" />
 
 </deployment>




More information about the jboss-cvs-commits mailing list