diff options
| author | slewis | 2015-04-06 20:15:30 +0000 |
|---|---|---|
| committer | slewis | 2015-04-06 20:15:30 +0000 |
| commit | 1de2c84e326b6d7c2283c5f4b0ee1259893bdece (patch) | |
| tree | ec2f599093b5425ba8f03e8bbf5dc7c6053ca778 | |
| parent | bc48c1dbec29e2321169370967aa745d2b769a49 (diff) | |
| download | org.eclipse.ecf-1de2c84e326b6d7c2283c5f4b0ee1259893bdece.tar.gz org.eclipse.ecf-1de2c84e326b6d7c2283c5f4b0ee1259893bdece.tar.xz org.eclipse.ecf-1de2c84e326b6d7c2283c5f4b0ee1259893bdece.zip | |
Commit for enhancement
https://bugs.eclipse.org/bugs/show_bug.cgi?id=463991
Change-Id: Ia04d20f87a249a648becbecedf7b2426fdb1d002
3 files changed, 68 insertions, 3 deletions
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF index becb1e663..3175b7eac 100644 --- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF +++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF @@ -2,13 +2,13 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundle.name Bundle-SymbolicName: org.eclipse.ecf.osgi.services.remoteserviceadmin -Bundle-Version: 4.2.0.qualifier +Bundle-Version: 4.3.0.qualifier Bundle-Activator: org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator Bundle-Vendor: %bundle.provider Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-Localization: bundle Export-Package: org.eclipse.ecf.internal.osgi.services.remoteserviceadmin;x-internal:=true, - org.eclipse.ecf.osgi.services.remoteserviceadmin;version="1.1.0" + org.eclipse.ecf.osgi.services.remoteserviceadmin;version="1.2.0" Require-Bundle: org.eclipse.equinox.common, org.eclipse.ecf.osgi.services.remoteserviceadmin.proxy;bundle-version="1.0.0" Import-Package: javax.xml.parsers, diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescriptionLocator.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescriptionLocator.java index 94125d54e..db3016c4c 100644 --- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescriptionLocator.java +++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/EndpointDescriptionLocator.java @@ -69,7 +69,7 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer; * discovery providers (implementers if {@link IDiscoveryLocator}. * */ -public class EndpointDescriptionLocator { +public class EndpointDescriptionLocator implements IEndpointDescriptionLocator { private BundleContext context; private IExecutor executor; @@ -111,6 +111,8 @@ public class EndpointDescriptionLocator { private String frameworkUUID; + private ServiceRegistration<IEndpointDescriptionLocator> endpointLocatorReg; + private String getFrameworkUUID() { return frameworkUUID; } @@ -343,6 +345,8 @@ public class EndpointDescriptionLocator { | Bundle.STARTING, bundleTrackerCustomizer); // This may trigger local endpoint description discovery bundleTracker.open(); + + this.endpointLocatorReg = this.context.registerService(IEndpointDescriptionLocator.class, this, null); } private void logError(String methodName, String message, Throwable e) { @@ -357,6 +361,10 @@ public class EndpointDescriptionLocator { } public void close() { + if (this.endpointLocatorReg != null) { + this.endpointLocatorReg.unregister(); + this.endpointLocatorReg = null; + } if (bundleTracker != null) { bundleTracker.close(); bundleTracker = null; @@ -1354,4 +1362,28 @@ public class EndpointDescriptionLocator { return false; } } + + /** + * @since 4.3 + */ + public void discoverEndpoint( + org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription endpointDescription) { + queueEndpointEvent(endpointDescription, EndpointEvent.ADDED); + } + + /** + * @since 4.3 + */ + public void updateEndpoint( + org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription endpointDescription) { + queueEndpointEvent(endpointDescription, EndpointEvent.MODIFIED); + } + + /** + * @since 4.3 + */ + public void undiscoverEndpoint( + org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription endpointDescription) { + queueEndpointEvent(endpointDescription, EndpointEvent.REMOVED); + } } diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/IEndpointDescriptionLocator.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/IEndpointDescriptionLocator.java new file mode 100644 index 000000000..8090bb616 --- /dev/null +++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/IEndpointDescriptionLocator.java @@ -0,0 +1,33 @@ +package org.eclipse.ecf.osgi.services.remoteserviceadmin; + +/** + * @since 4.3 + */ +public interface IEndpointDescriptionLocator { + + /** + * Discover the given endpointDescription. This method will not block + * and will result in local EndpointEventListeners to be notified that the + * given endpointDescription is discovered. + * about + * @param endpointDescription must not be null + */ + void discoverEndpoint(EndpointDescription endpointDescription); + /** + * Update the given endpointDescription. This method will not block + * and will result in local EndpointEventListeners to be notified that the + * given endpointDescription is updated. + * about + * @param endpointDescription must not be null + */ + void updateEndpoint(EndpointDescription endpointDescription); + /** + * Remove the given endpointDescription. This method will not block + * and will result in local EndpointEventListeners to be notified that the + * given endpointDescription is removed. + * about + * @param endpointDescription must not be null + */ + void undiscoverEndpoint(EndpointDescription endpointDescription); + +} |
