You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ff...@apache.org on 2010/04/06 08:11:34 UTC

svn commit: r931030 - /servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java

Author: ffang
Date: Tue Apr  6 06:11:34 2010
New Revision: 931030

URL: http://svn.apache.org/viewvc?rev=931030&view=rev
Log:
[SMX4NMR-187]restart SA bundle should check if this SA object is already managed from JMX server

Modified:
    servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java

Modified: servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java?rev=931030&r1=931029&r2=931030&view=diff
==============================================================================
--- servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java (original)
+++ servicemix/smx4/nmr/trunk/jbi/deployer/src/main/java/org/apache/servicemix/jbi/deployer/impl/Deployer.java Tue Apr  6 06:11:34 2010
@@ -411,7 +411,9 @@ public class Deployer implements Synchro
         props.put(NAME, sharedLibraryDesc.getIdentification().getName());
         LOGGER.debug("Registering JBI Shared Library");
         registerService(bundle, SharedLibrary.class.getName(), sl, props);
-        getManagementStrategy().manageObject(sl);
+        if (!getManagementStrategy().isManaged(sl, null)) {
+        	getManagementStrategy().manageObject(sl);
+        }
         // Check pending bundles
         checkPendingInstallers();
         return sl;
@@ -438,7 +440,9 @@ public class Deployer implements Synchro
         if (!wrappedComponents.containsKey(name)) {
             registerService(bundle, javax.jbi.component.Component.class.getName(), innerComponent, props);
         }
-        getManagementStrategy().manageObject(component);
+        if (!getManagementStrategy().isManaged(component, null)) {
+        	getManagementStrategy().manageObject(component);
+        }
         return component;
     }
 
@@ -456,7 +460,10 @@ public class Deployer implements Synchro
         // register the service assembly in the OSGi registry
         LOGGER.debug("Registering JBI service assembly");
         registerService(bundle, ServiceAssembly.class.getName(), sa, props);
-        getManagementStrategy().manageObject(sa);
+        if (!getManagementStrategy().isManaged(sa, null)) {
+        	//check if this SA is managed, this is the case that restart SA bundle
+        	getManagementStrategy().manageObject(sa);
+        }
         return sa;
     }