[jboss-cvs] JBossAS SVN: r101068 - in projects/jboss-osgi/projects/runtime/framework/trunk: .settings and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 17 07:05:54 EST 2010


Author: thomas.diesler at jboss.com
Date: 2010-02-17 07:05:52 -0500 (Wed, 17 Feb 2010)
New Revision: 101068

Modified:
   projects/jboss-osgi/projects/runtime/framework/trunk/.classpath
   projects/jboss-osgi/projects/runtime/framework/trunk/.settings/org.eclipse.jdt.core.prefs
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/ServiceManagerPluginImpl.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/AbstractExportedPackage.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServicesTest.java
   projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/MockInvokerMBean.java
Log:
Service events must be delivered synchronously

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/.classpath
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/.classpath	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/.classpath	2010-02-17 12:05:52 UTC (rev 101068)
@@ -4,7 +4,7 @@
 	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
 	<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
 	<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
 	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="output" path="target/classes"/>
 </classpath>

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/.settings/org.eclipse.jdt.core.prefs	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/.settings/org.eclipse.jdt.core.prefs	2010-02-17 12:05:52 UTC (rev 101068)
@@ -1,6 +1,13 @@
-#Fri Dec 18 11:03:28 CET 2009
+#Wed Feb 17 12:15:31 CET 2010
 eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/OSGiServiceState.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -528,6 +528,7 @@
       else
          this.properties = new CaseInsensitiveDictionary(properties);
 
+      // This event is synchronously delivered after the service properties have been modified. 
       FrameworkEventsPlugin plugin = bundleState.getBundleManager().getPlugin(FrameworkEventsPlugin.class);
       plugin.fireServiceEvent(bundleState, ServiceEvent.MODIFIED, this);
    }

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/ServiceManagerPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/ServiceManagerPluginImpl.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/bundle/ServiceManagerPluginImpl.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -233,6 +233,7 @@
          putContext(result, ((OSGiBundleState)bundleState).getDeploymentUnit());
       }
 
+      // This event is synchronously delivered after the service has been registered with the Framework. 
       FrameworkEventsPlugin eventsPlugin = getPlugin(FrameworkEventsPlugin.class);
       eventsPlugin.fireServiceEvent(bundleState, ServiceEvent.REGISTERED, result);
       
@@ -242,6 +243,11 @@
    public void unregisterService(OSGiServiceState serviceState)
    {
       AbstractBundleState bundleState = serviceState.getBundleState();
+      
+      // This event is synchronously delivered before the service has completed unregistering. 
+      FrameworkEventsPlugin plugin = getPlugin(FrameworkEventsPlugin.class);
+      plugin.fireServiceEvent(bundleState, ServiceEvent.UNREGISTERING, serviceState);
+      
       if (bundleState instanceof OSGiBundleState)
       {
          removeContext(serviceState, ((OSGiBundleState)bundleState).getDeploymentUnit());
@@ -250,9 +256,6 @@
       Controller controller = kernel.getController();
       controller.uninstall(serviceState.getName());
       serviceState.internalUnregister();
-
-      FrameworkEventsPlugin plugin = getPlugin(FrameworkEventsPlugin.class);
-      plugin.fireServiceEvent(bundleState, ServiceEvent.UNREGISTERING, serviceState);
    }
 
    public boolean ungetService(AbstractBundleState bundleState, ServiceReference reference)

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/AbstractExportedPackage.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/AbstractExportedPackage.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/AbstractExportedPackage.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -23,7 +23,6 @@
 
 //$Id: StartLevelImpl.java 93118 2009-09-02 08:24:44Z thomas.diesler at jboss.com $
 
-import org.jboss.logging.Logger;
 import org.jboss.osgi.framework.bundle.AbstractBundleState;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.Version;
@@ -37,9 +36,6 @@
  */
 abstract class AbstractExportedPackage implements ExportedPackage
 {
-   /** The log */
-   private static final Logger log = Logger.getLogger(AbstractExportedPackage.class);
-   
    private AbstractBundleState bundle;
    private String packageName;
    private Version version;
@@ -64,7 +60,6 @@
    public Bundle[] getImportingBundles()
    {
       // [TODO] Not implemented getImportingBundles
-      log.info("Not implemented getImportingBundles");
       return null;
    }
 
@@ -76,7 +71,6 @@
    public String getSpecificationVersion()
    {
       // [TODO] Not implemented getSpecificationVersion
-      log.info("Not implemented getSpecificationVersion");
       return null;
    }
 
@@ -88,7 +82,6 @@
    public boolean isRemovalPending()
    {
       // [TODO] Not implemented isRemovalPending
-      log.info("Not implemented isRemovalPending");
       return false;
    }
 }
\ No newline at end of file

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/packageadmin/PackageAdminImpl.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -233,14 +233,12 @@
    public RequiredBundle[] getRequiredBundles(String symbolicName)
    {
       // [TODO] getRequiredBundles(String symbolicName)
-      log.info("Not implemented getRequiredBundles");
       return null;
    }
 
    public void refreshPackages(Bundle[] bundles)
    {
       // [TODO] refreshPackages(Bundle[] bundles)
-      log.debug("Ignore refreshPackages");
    }
 
    public boolean resolveBundles(Bundle[] bundleArr)

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -429,32 +429,29 @@
       if (getBundleManager().isFrameworkActive() == false)
          return;
 
-      Runnable runnable = new Runnable()
+      // Call the listeners. All service events are synchronously delivered
+      for (ServiceListenerRegistration registration : listeners)
       {
-         public void run()
+         try
          {
-            // Call the listeners
-            for (ServiceListenerRegistration registration : listeners)
+            // [TODO] MODIFIED_ENDMATCH
+            // This event is synchronously delivered after the service properties have been modified. 
+            // This event is only delivered to listeners which were added with a non-null filter where 
+            // the filter matched the service properties prior to the modification but the filter does 
+            // not match the modified service properties. 
+            
+            if (registration.filter.match(service))
             {
-               try
-               {
-                  if (registration.filter.match(service))
-                  {
-                     AccessControlContext accessControlContext = registration.accessControlContext;
-                     if (accessControlContext == null || service.hasPermission(accessControlContext))
-                        registration.listener.serviceChanged(event);
-                  }
-               }
-               catch (Throwable t)
-               {
-                  log.warn("Error while firing " + typeName + " for service " + service, t);
-               }
+               AccessControlContext accessControlContext = registration.accessControlContext;
+               if (accessControlContext == null || service.hasPermission(accessControlContext))
+                  registration.listener.serviceChanged(event);
             }
          }
-      };
-
-      // Fire the event in a runnable
-      fireEvent(runnable, synchronous);
+         catch (Throwable t)
+         {
+            log.warn("Error while firing " + typeName + " for service " + service, t);
+         }
+      }
    }
 
    private Bundle assertBundle(Bundle bundle)

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/main/java/org/jboss/osgi/framework/service/internal/MicrocontainerServiceImpl.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -116,7 +116,7 @@
       return (T)target;
    }
 
-   public List<String> getRegisteredBeans()
+   public List<String> listRegisteredBeans()
    {
       List<String> names = new ArrayList<String>();
 

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/FrameworkTestDelegate.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -106,6 +106,7 @@
       super.undeploy();
    }
 
+   @SuppressWarnings("unchecked")
    protected void deployBundles() throws Exception
    {
       try

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServiceMixUnitTestCase.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -21,7 +21,6 @@
  */
 package org.jboss.test.osgi.service;
 
-import java.lang.reflect.Method;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.List;
@@ -33,7 +32,6 @@
 import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployers.client.spi.Deployment;
 import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.test.osgi.DeployersTest;
 import org.jboss.test.osgi.service.support.LazyBundle;
 import org.jboss.test.osgi.service.support.a.A;
 import org.jboss.test.osgi.service.support.c.C;

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServicesTest.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServicesTest.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/ServicesTest.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -21,28 +21,10 @@
  */
 package org.jboss.test.osgi.service;
 
-import junit.framework.Test;
-import org.jboss.beans.metadata.spi.BeanMetaData;
-import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
-import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.client.spi.Deployment;
-import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.test.osgi.DeployersTest;
-import org.jboss.test.osgi.service.support.LazyBundle;
-import org.jboss.test.osgi.service.support.a.A;
-import org.jboss.test.osgi.service.support.c.C;
-import org.jboss.test.osgi.service.support.d.D;
-import org.jboss.virtual.AssembledDirectory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
 import java.lang.reflect.Method;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.List;
 
+import org.jboss.test.osgi.DeployersTest;
+
 /**
  * Test MC's services.
  *

Modified: projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/MockInvokerMBean.java
===================================================================
--- projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/MockInvokerMBean.java	2010-02-17 12:02:30 UTC (rev 101067)
+++ projects/jboss-osgi/projects/runtime/framework/trunk/src/test/java/org/jboss/test/osgi/service/support/MockInvokerMBean.java	2010-02-17 12:05:52 UTC (rev 101068)
@@ -21,7 +21,6 @@
  */
 package org.jboss.test.osgi.service.support;
 
-import javax.management.MBeanRegistration;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 




More information about the jboss-cvs-commits mailing list