tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r830738 [2/2] - in /tuscany/java/sca/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/ assembly-xml/src/test/java/org/apache/tuscany/sca/assembly/xml/ assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/...
Date Wed, 28 Oct 2009 19:29:53 GMT
Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java?rev=830738&r1=830737&r2=830738&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
(original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/java/org/apache/tuscany/sca/osgi/remoteserviceadmin/impl/RemoteServiceAdminImpl.java
Wed Oct 28 19:29:50 2009
@@ -21,7 +21,9 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Dictionary;
 import java.util.HashMap;
+import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 
@@ -36,6 +38,8 @@
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;
 import org.osgi.util.tracker.ServiceTracker;
@@ -43,9 +47,10 @@
 /**
  * SCA Implementation of {@link RemoteServiceAdmin}
  */
-public class RemoteServiceAdminImpl implements RemoteServiceAdmin {
+public class RemoteServiceAdminImpl implements RemoteServiceAdmin, ManagedService {
     private BundleContext context;
     private ServiceRegistration registration;
+    private ServiceRegistration managedService;
     private ServiceTracker listeners;
 
     private OSGiServiceExporter exporter;
@@ -64,6 +69,9 @@
         exporter.start();
         importer.start();
         registration = context.registerService(RemoteServiceAdmin.class.getName(), this,
null);
+        Hashtable<String, Object> props = new Hashtable<String, Object>();
+        props.put(Constants.SERVICE_PID, RemoteServiceAdminImpl.class.getName());
+        managedService = context.registerService(ManagedService.class.getName(), this, props);
         listeners = new ServiceTracker(this.context, RemoteServiceAdminListener.class.getName(),
null);
         listeners.open();
     }
@@ -73,6 +81,10 @@
             registration.unregister();
             registration = null;
         }
+        if (managedService != null) {
+            managedService.unregister();
+            managedService = null;
+        }
         if (listeners != null) {
             listeners.close();
             listeners = null;
@@ -249,4 +261,12 @@
         }
         return importReg;
     }
+
+    public synchronized void updated(Dictionary props) throws ConfigurationException {
+        String domainRegistry = (String)props.get("org.osgi.sca.domain.registry");
+        if (domainRegistry != null) {
+            exporter.setDomainRegistry(domainRegistry);
+            importer.setDomainRegistry(domainRegistry);
+        }
+    }
 }

Modified: tuscany/java/sca/modules/node-impl-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory?rev=830738&r1=830737&r2=830738&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory
(original)
+++ tuscany/java/sca/modules/node-impl-osgi/src/main/resources/META-INF/services/org.apache.tuscany.sca.node.NodeFactory
Wed Oct 28 19:29:50 2009
@@ -14,4 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-# org.apache.tuscany.sca.node.osgi.impl.OSGiNodeFactoryImpl
\ No newline at end of file
+# org.apache.tuscany.sca.node.osgi.impl.OSGiNodeFactoryImpl;ranking=100
\ No newline at end of file

Modified: tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java?rev=830738&r1=830737&r2=830738&view=diff
==============================================================================
--- tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
(original)
+++ tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeFactoryImpl.java
Wed Oct 28 19:29:50 2009
@@ -154,6 +154,7 @@
             nodes.clear();
             deployer.stop();
             registry.stop();
+            super.destroy();
             inited = false;
         }
     }



Mime
View raw message