diff options
author | slewis | 2011-01-04 19:30:55 -0500 |
---|---|---|
committer | slewis | 2011-01-04 19:30:55 -0500 |
commit | 8c905e23c320822278cc0649539de16957b236a8 (patch) | |
tree | 54dc44b71f0dc97e33588712e410797f3939180d /incubation | |
parent | 38ca20ed022460e01053e174f1461e49aacf4c5c (diff) | |
download | org.eclipse.ecf-8c905e23c320822278cc0649539de16957b236a8.tar.gz org.eclipse.ecf-8c905e23c320822278cc0649539de16957b236a8.tar.xz org.eclipse.ecf-8c905e23c320822278cc0649539de16957b236a8.zip |
rsa simplifications
Diffstat (limited to 'incubation')
-rw-r--r-- | incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java | 14 | ||||
-rw-r--r-- | incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java | 44 | ||||
-rw-r--r-- | incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/BasicTopologyManager.java (renamed from incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManager.java) | 57 |
3 files changed, 65 insertions, 50 deletions
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java index e063a9081..fda7992aa 100644 --- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java +++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/internal/osgi/services/remoteserviceadmin/Activator.java @@ -23,7 +23,7 @@ import org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionAdver import org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescriptionLocator; import org.eclipse.ecf.osgi.services.remoteserviceadmin.IEndpointDescriptionAdvertiser; import org.eclipse.ecf.osgi.services.remoteserviceadmin.RemoteServiceAdmin; -import org.eclipse.ecf.osgi.services.remoteserviceadmin.TopologyManager; +import org.eclipse.ecf.osgi.services.remoteserviceadmin.BasicTopologyManager; import org.osgi.framework.Bundle; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; @@ -55,7 +55,7 @@ public class Activator implements BundleActivator { private EndpointDescriptionAdvertiser endpointDescriptionAdvertiser; private ServiceRegistration endpointDescriptionAdvertiserRegistration; - private TopologyManager topologyManager; + private BasicTopologyManager basicTopologyManager; /* * (non-Javadoc) @@ -73,9 +73,9 @@ public class Activator implements BundleActivator { startEndpointDescriptionAdvertiser(); - topologyManager = new TopologyManager(context); + basicTopologyManager = new BasicTopologyManager(context); // start topology manager first - topologyManager.start(); + basicTopologyManager.start(); // start endpointDescriptionLocator endpointDescriptionLocator.start(); } @@ -91,9 +91,9 @@ public class Activator implements BundleActivator { endpointDescriptionLocator.close(); endpointDescriptionLocator = null; } - if (topologyManager != null) { - topologyManager.close(); - topologyManager = null; + if (basicTopologyManager != null) { + basicTopologyManager.close(); + basicTopologyManager = null; } stopRemoteServiceAdmin(); stopEndpointDescriptionAdvertiser(); diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java index 7e2721824..ad70d0977 100644 --- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java +++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java @@ -24,6 +24,7 @@ import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.PropertiesUtil; import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceReference;
import org.osgi.service.remoteserviceadmin.ExportRegistration;
import org.osgi.service.remoteserviceadmin.ImportRegistration;
@@ -180,7 +181,18 @@ public abstract class AbstractTopologyManager { this.getClass(), message);
}
- protected void handleEndpointAdded(EndpointDescription endpointDescription) {
+ protected void handleEndpointAdded(
+ org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
+ String matchedFilter) {
+ if (endpoint instanceof EndpointDescription)
+ handleEndpointAdded((EndpointDescription) endpoint, matchedFilter);
+ else
+ logWarning("endpointAdded",
+ "ECF Topology Manager: Ignoring Non-ECF endpointAdded="
+ + endpoint + ",matchedFilter=" + matchedFilter);
+ }
+
+ protected void handleEndpointAdded(EndpointDescription endpointDescription, String matchedFilter) {
// First, select importing remote service admin
org.osgi.service.remoteserviceadmin.RemoteServiceAdmin rsa = getRemoteServiceAdmin();
@@ -223,7 +235,35 @@ public abstract class AbstractTopologyManager { + importRegistration, t);
}
- protected void handleEndpointRemoved(EndpointDescription endpointDescription) {
+ protected void handleEndpointRemoved(org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
+ String matchedFilter) {
+ if (endpoint instanceof EndpointDescription)
+ handleEndpointRemoved((EndpointDescription) endpoint, matchedFilter);
+ else
+ logWarning("endpointRemoved",
+ "ECF Topology Manager: Ignoring Non-ECF endpointRemoved="
+ + endpoint + ",matchedFilter=" + matchedFilter);
+ }
+
+ protected void handleEvent(ServiceEvent event, Collection contexts) {
+ switch (event.getType()) {
+ case ServiceEvent.MODIFIED:
+ handleServiceModifying(event.getServiceReference());
+ break;
+ case ServiceEvent.MODIFIED_ENDMATCH:
+ break;
+ case ServiceEvent.REGISTERED:
+ handleServiceRegistering(event.getServiceReference());
+ break;
+ case ServiceEvent.UNREGISTERING:
+ handleServiceUnregistering(event.getServiceReference());
+ break;
+ default:
+ break;
+ }
+ }
+
+ protected void handleEndpointRemoved(EndpointDescription endpointDescription, String matchedFilter) {
trace("handleEndpointRemoved", "endpointDescription="
+ endpointDescription);
unimportService(endpointDescription);
diff --git a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManager.java b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/BasicTopologyManager.java index 7039b7e79..55750ca66 100644 --- a/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/TopologyManager.java +++ b/incubation/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/BasicTopologyManager.java @@ -19,14 +19,14 @@ import org.osgi.framework.ServiceRegistration; import org.osgi.framework.hooks.service.EventHook;
import org.osgi.service.remoteserviceadmin.EndpointListener;
-public class TopologyManager extends AbstractTopologyManager implements
+public class BasicTopologyManager extends AbstractTopologyManager implements
EventHook, EndpointListener {
private ServiceRegistration endpointListenerRegistration;
private ServiceRegistration eventHookRegistration;
- public TopologyManager(BundleContext context) {
+ public BasicTopologyManager(BundleContext context) {
super(context);
}
@@ -48,57 +48,32 @@ public class TopologyManager extends AbstractTopologyManager implements EventHook.class.getName(), this, null);
}
- public void close() {
- if (eventHookRegistration != null) {
- eventHookRegistration.unregister();
- eventHookRegistration = null;
- }
- if (endpointListenerRegistration != null) {
- endpointListenerRegistration.unregister();
- endpointListenerRegistration = null;
- }
- super.close();
- }
-
public void endpointAdded(
org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
String matchedFilter) {
- if (endpoint instanceof EndpointDescription)
- handleEndpointAdded((EndpointDescription) endpoint);
- else
- logWarning("endpointAdded",
- "ECF Topology Manager: Ignoring Non-ECF endpointAdded="
- + endpoint + ",matchedFilter=" + matchedFilter);
+ handleEndpointAdded(endpoint,matchedFilter);
}
public void endpointRemoved(
org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
String matchedFilter) {
- if (endpoint instanceof EndpointDescription)
- handleEndpointRemoved((EndpointDescription) endpoint);
- else
- logWarning("endpointRemoved",
- "ECF Topology Manager: Ignoring Non-ECF endpointRemoved="
- + endpoint + ",matchedFilter=" + matchedFilter);
+ handleEndpointRemoved(endpoint,matchedFilter);
}
public void event(ServiceEvent event, Collection contexts) {
- switch (event.getType()) {
- case ServiceEvent.MODIFIED:
- handleServiceModifying(event.getServiceReference());
- break;
- case ServiceEvent.MODIFIED_ENDMATCH:
- break;
- case ServiceEvent.REGISTERED:
- handleServiceRegistering(event.getServiceReference());
- break;
- case ServiceEvent.UNREGISTERING:
- handleServiceUnregistering(event.getServiceReference());
- break;
- default:
- break;
- }
+ handleEvent(event,contexts);
+ }
+ public void close() {
+ if (eventHookRegistration != null) {
+ eventHookRegistration.unregister();
+ eventHookRegistration = null;
+ }
+ if (endpointListenerRegistration != null) {
+ endpointListenerRegistration.unregister();
+ endpointListenerRegistration = null;
+ }
+ super.close();
}
}
|