[jboss-cvs] JBossAS SVN: r85219 - in projects/jboss-osgi/trunk: testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 4 08:09:08 EST 2009


Author: thomas.diesler at jboss.com
Date: 2009-03-04 08:09:08 -0500 (Wed, 04 Mar 2009)
New Revision: 85219

Modified:
   projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/OSGI36TestCase.java
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java
   projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
Log:
Add simpleStartStop configuration

Modified: projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java	2009-03-04 13:02:41 UTC (rev 85218)
+++ projects/jboss-osgi/trunk/runtime/deployer/src/main/java/org/jboss/osgi/deployer/BundleStartStopDeployer.java	2009-03-04 13:09:08 UTC (rev 85219)
@@ -51,6 +51,7 @@
 
    // The list of unresolved bundles
    private List<Bundle> unresolvedBundles = new ArrayList<Bundle>();
+   private boolean simpleStartStop;
 
    public BundleStartStopDeployer()
    {
@@ -62,8 +63,55 @@
       this.systemContext = systemContext;
    }
 
+   public void setSimpleStartStop(boolean simpleStartStop)
+   {
+      this.simpleStartStop = simpleStartStop;
+   }
+
    public void deploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
    {
+      if (simpleStartStop)
+      {
+         simpleStartDeploy(unit, bundle);
+      }
+      else
+      {
+         deferredStartDeploy(unit, bundle);
+      }
+   }
+
+   @Override
+   public void undeploy(DeploymentUnit unit, Bundle bundle)
+   {
+      try
+      {
+         bundle.stop();
+
+         String state = StateFormat.formatBundleState(bundle.getState());
+         log.info(bundle.getSymbolicName() + ",state=" + state);
+      }
+      catch (BundleException e)
+      {
+         log.warn("Cannot stop bundle: " + e);
+      }
+   }
+
+   private void simpleStartDeploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
+   {
+      try
+      {
+         bundle.start();
+         String state = StateFormat.formatBundleState(bundle.getState());
+         log.info(bundle.getSymbolicName() + ",state=" + state);
+      }
+      catch (BundleException e)
+      {
+         log.warn("Cannot start bundle", e);
+      }
+   }
+
+   private void deferredStartDeploy(DeploymentUnit unit, Bundle bundle) throws DeploymentException
+   {
       // Get the required dependency on the PackageAdmin service
       if (packageAdmin == null)
       {
@@ -107,20 +155,4 @@
       if (unresolvedBundles.size() > 0)
          log.info("Unresolved: " + unresolvedBundles);
    }
-
-   @Override
-   public void undeploy(DeploymentUnit unit, Bundle bundle)
-   {
-      try
-      {
-         bundle.stop();
-         
-         String state = StateFormat.formatBundleState(bundle.getState());
-         log.info(bundle.getSymbolicName() + ",state=" + state);
-      }
-      catch (BundleException e)
-      {
-         log.warn("Cannot stop bundle: " + e);
-      }
-   }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/OSGI36TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/OSGI36TestCase.java	2009-03-04 13:02:41 UTC (rev 85218)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi36/junit/OSGI36TestCase.java	2009-03-04 13:09:08 UTC (rev 85219)
@@ -37,7 +37,7 @@
 /**
  * [JBOSGI-36] Bundle classes leak into system classloader
  * 
- * https://jira.jboss.org/jira/browse/OSGI-36
+ * https://jira.jboss.org/jira/browse/JBOSGI-36
  * 
  * @author thomas.diesler at jboss.com
  * @since 25-Feb-2009

Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java	2009-03-04 13:02:41 UTC (rev 85218)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38DeployerTestCase.java	2009-03-04 13:09:08 UTC (rev 85219)
@@ -29,7 +29,7 @@
 /**
  * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
  * 
- * https://jira.jboss.org/jira/browse/OSGI-38
+ * https://jira.jboss.org/jira/browse/JBOSGI-38
  * 
  * Bundle A depends on bundle B, both share bundle X.
  * 

Modified: projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java
===================================================================
--- projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-03-04 13:02:41 UTC (rev 85218)
+++ projects/jboss-osgi/trunk/testsuite/src/test/java/org/jboss/test/osgi/jbosgi38/OSGI38TestCase.java	2009-03-04 13:09:08 UTC (rev 85219)
@@ -33,7 +33,7 @@
 /**
  * [JBOSGI-38] Investigate bundle install/start behaviour with random deployment order
  * 
- * https://jira.jboss.org/jira/browse/OSGI-38
+ * https://jira.jboss.org/jira/browse/JBOSGI-38
  * 
  * Bundle A depends on bundle B, both share bundle X.
  * 




More information about the jboss-cvs-commits mailing list