You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by da...@apache.org on 2009/03/08 23:07:36 UTC
svn commit: r751541 - in
/cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local:
Activator.java LocalDiscoveryService.java
Author: davidb
Date: Sun Mar 8 22:07:35 2009
New Revision: 751541
URL: http://svn.apache.org/viewvc?rev=751541&view=rev
Log:
Removed the fact that the local discovery service was registered with the Configuration Admin Service as a Managed Service.
There is currently no configuration for the local discovery service, so being a Managed Service was not needed.
Modified:
cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/Activator.java
cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java
Modified: cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/Activator.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/Activator.java?rev=751541&r1=751540&r2=751541&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/Activator.java (original)
+++ cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/Activator.java Sun Mar 8 22:07:35 2009
@@ -19,56 +19,33 @@
package org.apache.cxf.dosgi.discovery.local;
-import java.util.Dictionary;
import java.util.Hashtable;
import java.util.logging.Logger;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedService;
+import org.osgi.framework.ServiceRegistration;
import org.osgi.service.discovery.Discovery;
-
-public class Activator implements BundleActivator, ManagedService {
-
+public class Activator implements BundleActivator {
private static final Logger LOG = Logger.getLogger(Activator.class.getName());
-
- private static final String CONFIG_SERVICE_PID = "discovery";
+
private LocalDiscoveryService discoveryService;
+ private ServiceRegistration discoveryServiceReg;
- public void start(BundleContext context) {
-
- LOG.info("Registering ManagedService for LocalDiscoveryService bundle with service PID "
- + CONFIG_SERVICE_PID);
- context.registerService(ManagedService.class.getName(),
- this, getDefaults());
-
+ public void start(BundleContext context) {
LOG.info("Registering LocalDiscoveryService service object");
discoveryService = new LocalDiscoveryService(context);
- context.registerService(
+ discoveryServiceReg = context.registerService(
Discovery.class.getName(),
discoveryService,
- new Hashtable());
+ new Hashtable<String, Object>());
}
public void stop(BundleContext context) {
+ discoveryServiceReg.unregister();
discoveryService.shutdown();
}
-
- private Dictionary<String, String> getDefaults() {
- Dictionary<String, String> defaults = new Hashtable<String, String>();
- defaults.put(Constants.SERVICE_PID, CONFIG_SERVICE_PID);
- return defaults;
- }
-
- public void updated(Dictionary props) throws ConfigurationException {
- if (props != null
- && CONFIG_SERVICE_PID.equals(props.get(Constants.SERVICE_PID))) {
- discoveryService.updateProperties(props);
- }
- }
}
Modified: cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java?rev=751541&r1=751540&r2=751541&view=diff
==============================================================================
--- cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java (original)
+++ cxf/dosgi/trunk/discovery/local/src/main/java/org/apache/cxf/dosgi/discovery/local/LocalDiscoveryService.java Sun Mar 8 22:07:35 2009
@@ -412,12 +412,5 @@
}
return null;
}
-
- @SuppressWarnings("unchecked")
- public void updateProperties(Dictionary props) {
- // TODO can we get rid of the Config Admin stuff in here?
- // It doesn't seem to do anything with it...
- // TODO Auto-generated method stub
- }
}