[jboss-cvs] JBossAS SVN: r87484 - projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 17 06:18:49 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-04-17 06:18:49 -0400 (Fri, 17 Apr 2009)
New Revision: 87484

Modified:
   projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
Log:
[FELIX-1040] Call Felix.waitForStop()

Modified: projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java
===================================================================
--- projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java	2009-04-17 10:09:46 UTC (rev 87483)
+++ projects/jboss-osgi/trunk/runtime/felix/src/main/java/org/jboss/osgi/felix/framework/FelixIntegration.java	2009-04-17 10:18:49 UTC (rev 87484)
@@ -35,10 +35,7 @@
 import org.jboss.osgi.spi.framework.OSGiFramework;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleEvent;
 import org.osgi.framework.BundleException;
-import org.osgi.framework.BundleListener;
-import org.osgi.framework.SynchronousBundleListener;
 
 /**
  * An abstraction of an OSGi Framework
@@ -175,28 +172,18 @@
       {
          try
          {
-            BundleListener listener = new SynchronousBundleListener()
-            {
-               long sysBundleId = getSystemBundle().getBundleId();
-               public void bundleChanged(BundleEvent event)
-               {
-                  Bundle bundle = event.getBundle();
-                  long bundleId = bundle.getBundleId();
-                  int type = event.getType();
-                  if (bundleId == sysBundleId && type == BundleEvent.STOPPED)
-                  {
-                     log.debug("SystemBundle STOPPED");
-                  }
-               }
-            };
-            getSystemBundleContext().addBundleListener(listener);
-            
             framework.stop();
+            framework.waitForStop(500);
+            log.debug("SystemBundle STOPPED");
          }
          catch (BundleException ex)
          {
             log.error("Cannot stop Felix", ex);
          }
+         catch (InterruptedException ex)
+         {
+            log.error("Cannot stop Felix", ex);
+         }
       }
    }
 }
\ No newline at end of file




More information about the jboss-cvs-commits mailing list