Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2014-03-18 20:56:47 +0000
committerslewis2014-03-18 20:56:47 +0000
commitcfdfce08aca32695a8c751cbb4eb25962fe37f2e (patch)
tree5d0c65ec34de9ce826110dfa4ee733948a1601f5 /compendium
parentb487e9c178f2c36ea5e5dfe4dfdb777b1fb47ed3 (diff)
downloadorg.eclipse.ecf-cfdfce08aca32695a8c751cbb4eb25962fe37f2e.tar.gz
org.eclipse.ecf-cfdfce08aca32695a8c751cbb4eb25962fe37f2e.tar.xz
org.eclipse.ecf-cfdfce08aca32695a8c751cbb4eb25962fe37f2e.zip
Additions to support EndpointEventListener in AbstractTopologyManager
and BasicTopologyManager. Also updated distribution and remoteserviceadmin bundle minor version. Change-Id: Ic7026f114ff0d095cbfd9f5d55ce0ac6f2975aa5
Diffstat (limited to 'compendium')
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF2
-rw-r--r--compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManagerImpl.java66
2 files changed, 66 insertions, 2 deletions
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF
index 49c75a958..93b67ff29 100644
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ecf.osgi.services.distribution
-Bundle-Version: 2.0.300.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-Activator: org.eclipse.ecf.internal.osgi.services.distribution.Activator
Bundle-Vendor: %pluginProvider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManagerImpl.java b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManagerImpl.java
index 6109a4dd7..78ca3ceb2 100644
--- a/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManagerImpl.java
+++ b/compendium/bundles/org.eclipse.ecf.osgi.services.distribution/src/org/eclipse/ecf/internal/osgi/services/distribution/BasicTopologyManagerImpl.java
@@ -9,11 +9,13 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceReference;
+import org.osgi.service.remoteserviceadmin.EndpointEvent;
+import org.osgi.service.remoteserviceadmin.EndpointEventListener;
import org.osgi.service.remoteserviceadmin.EndpointListener;
import org.osgi.service.remoteserviceadmin.RemoteServiceAdminEvent;
public class BasicTopologyManagerImpl extends AbstractTopologyManager implements
- EndpointListener {
+ EndpointListener, EndpointEventListener {
private static final boolean allowLoopbackReference = new Boolean(
System.getProperty(
@@ -118,6 +120,12 @@ public class BasicTopologyManagerImpl extends AbstractTopologyManager implements
public void endpointAdded(
org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
String matchedFilter) {
+ handleEndpointAdded(endpoint, matchedFilter);
+ }
+
+ protected void handleEndpointAdded(
+ org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
+ String matchedFilter) {
if (matchedFilter.equals(endpointListenerScope))
if (endpoint instanceof EndpointDescription)
handleECFEndpointAdded((EndpointDescription) endpoint);
@@ -141,6 +149,12 @@ public class BasicTopologyManagerImpl extends AbstractTopologyManager implements
public void endpointRemoved(
org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
String matchedFilter) {
+ handleEndpointRemoved(endpoint, matchedFilter);
+ }
+
+ protected void handleEndpointRemoved(
+ org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
+ String matchedFilter) {
if (matchedFilter.equals(endpointListenerScope))
if (endpoint instanceof EndpointDescription)
handleECFEndpointRemoved((EndpointDescription) endpoint);
@@ -195,4 +209,54 @@ public class BasicTopologyManagerImpl extends AbstractTopologyManager implements
"handleRemoteAdminEvent", "RemoteServiceAdminEvent=" + rsaEvent + " received with unrecognized type"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
+
+ /**
+ * Implementation of
+ * org.osgi.service.remoteserviceadmin.EndpointEventListener for rfc 203/RSA
+ * 1.1
+ *
+ * @see EndpointEventListener#endpointChanged(EndpointEvent, String)
+ */
+ public void endpointChanged(EndpointEvent event, String matchedFilter) {
+ int eventType = event.getType();
+ org.osgi.service.remoteserviceadmin.EndpointDescription ed = event
+ .getEndpoint();
+ switch (eventType) {
+ case EndpointEvent.ADDED:
+ handleEndpointAdded(ed, matchedFilter);
+ break;
+ case EndpointEvent.REMOVED:
+ handleEndpointRemoved(ed, matchedFilter);
+ break;
+ case EndpointEvent.MODIFIED:
+ handleEndpointModified(ed, matchedFilter);
+ break;
+ case EndpointEvent.MODIFIED_ENDMATCH:
+ endpointModifiedEndMatch(ed, matchedFilter);
+ break;
+ }
+ }
+
+ protected void endpointModifiedEndMatch(
+ org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
+ String matchedFilter) {
+ // By default do nothing for end match. subclasses may decide
+ // to change this behavior
+ }
+
+ protected void handleEndpointModified(
+ org.osgi.service.remoteserviceadmin.EndpointDescription endpoint,
+ String matchedFilter) {
+ if (matchedFilter.equals(endpointListenerScope))
+ if (endpoint instanceof EndpointDescription)
+ handleECFEndpointModified((EndpointDescription) endpoint);
+ else
+ handleNonECFEndpointModified(this, endpoint);
+ else if (matchedFilter.equals(NO_ECF_SCOPE))
+ if (endpoint instanceof EndpointDescription)
+ handleECFEndpointModified((EndpointDescription) endpoint);
+ else
+ advertiseEndpointDescription(endpoint);
+ }
+
}

Back to the top