Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2015-09-25 21:28:14 +0000
committerslewis2015-09-25 21:28:14 +0000
commit42c34d3d39d68d8439e9cfb1879e10c70bbd6c74 (patch)
treeb064e1e4c8938cbac89d0f021c5f4e1a122dc8b0
parentcaa78a5b7ba1d4a39f66a0fbfe372b8ea608a0eb (diff)
downloadorg.eclipse.ecf-42c34d3d39d68d8439e9cfb1879e10c70bbd6c74.tar.gz
org.eclipse.ecf-42c34d3d39d68d8439e9cfb1879e10c70bbd6c74.tar.xz
org.eclipse.ecf-42c34d3d39d68d8439e9cfb1879e10c70bbd6c74.zip
Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=478452R-Release_HEAD-sdk_feature-170_170
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java80
1 files changed, 46 insertions, 34 deletions
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java
index a4b962145..69c8b103a 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/AbstractTopologyManager.java
@@ -290,7 +290,9 @@ public abstract class AbstractTopologyManager {
trace("handleECFEndpointAdded", "endpointDescription=" //$NON-NLS-1$ //$NON-NLS-2$
+ endpointDescription);
// Import service
- getRemoteServiceAdmin().importService(endpointDescription);
+ RemoteServiceAdmin rsa = (RemoteServiceAdmin) getRemoteServiceAdmin();
+ if (rsa != null)
+ rsa.importService(endpointDescription);
}
/**
@@ -301,14 +303,15 @@ public abstract class AbstractTopologyManager {
trace("handleECFEndpointRemoved", "endpointDescription=" //$NON-NLS-1$ //$NON-NLS-2$
+ endpointDescription);
RemoteServiceAdmin rsa = (RemoteServiceAdmin) getRemoteServiceAdmin();
- List<RemoteServiceAdmin.ImportRegistration> importedRegistrations = rsa
- .getImportedRegistrations();
- org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed = (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription) endpointDescription;
- for (RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
- if (importedRegistration.match(ed)) {
- trace("handleEndpointRemoved", "closing importedRegistration=" //$NON-NLS-1$ //$NON-NLS-2$
- + importedRegistration);
- importedRegistration.close();
+ if (rsa != null) {
+ List<RemoteServiceAdmin.ImportRegistration> importedRegistrations = rsa.getImportedRegistrations();
+ org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed = (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription) endpointDescription;
+ for (RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
+ if (importedRegistration.match(ed)) {
+ trace("handleEndpointRemoved", "closing importedRegistration=" //$NON-NLS-1$ //$NON-NLS-2$
+ + importedRegistration);
+ importedRegistration.close();
+ }
}
}
}
@@ -320,14 +323,15 @@ public abstract class AbstractTopologyManager {
trace("handleECFEndpointModified", "endpointDescription=" //$NON-NLS-1$ //$NON-NLS-2$
+ endpoint);
RemoteServiceAdmin rsa = (RemoteServiceAdmin) getRemoteServiceAdmin();
- List<RemoteServiceAdmin.ImportRegistration> importedRegistrations = rsa
- .getImportedRegistrations();
- org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed = (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription) endpoint;
- for (RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
- if (importedRegistration.match(ed)) {
- trace("handleECFEndpointModified", "updating importedRegistration=" //$NON-NLS-1$ //$NON-NLS-2$
- + importedRegistration);
- importedRegistration.update(endpoint);
+ if (rsa != null) {
+ List<RemoteServiceAdmin.ImportRegistration> importedRegistrations = rsa.getImportedRegistrations();
+ org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed = (org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription) endpoint;
+ for (RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
+ if (importedRegistration.match(ed)) {
+ trace("handleECFEndpointModified", "updating importedRegistration=" //$NON-NLS-1$ //$NON-NLS-2$
+ + importedRegistration);
+ importedRegistration.update(endpoint);
+ }
}
}
}
@@ -432,33 +436,41 @@ public abstract class AbstractTopologyManager {
exportedInterfaces);
trace("handleServiceRegistering", "serviceReference=" //$NON-NLS-1$ //$NON-NLS-2$
+ serviceReference + " exportProperties=" + exportProperties); //$NON-NLS-1$
+ org.osgi.service.remoteserviceadmin.RemoteServiceAdmin rsa = getRemoteServiceAdmin();
// Do the export with RSA
- getRemoteServiceAdmin().exportService(serviceReference,
+ if (rsa != null)
+ rsa.exportService(serviceReference,
exportProperties);
}
protected void handleServiceModifying(ServiceReference serviceReference) {
- List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations = ((RemoteServiceAdmin) getRemoteServiceAdmin())
- .getExportedRegistrations();
- for (RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
- if (exportedRegistration.match(serviceReference)) {
- trace("handleServiceModifying", "modifying exportRegistration for serviceReference=" //$NON-NLS-1$ //$NON-NLS-2$
- + serviceReference);
- EndpointDescription updatedED = (EndpointDescription) exportedRegistration.update(null);
- if (updatedED == null)
- logWarning("handleServiceModifying", "ExportRegistration.update failed with exception="+exportedRegistration.getException()); //$NON-NLS-1$//$NON-NLS-2$
+ RemoteServiceAdmin rsa = (RemoteServiceAdmin) getRemoteServiceAdmin();
+ if (rsa != null) {
+ List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations = rsa.getExportedRegistrations();
+ for (RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
+ if (exportedRegistration.match(serviceReference)) {
+ trace("handleServiceModifying", "modifying exportRegistration for serviceReference=" //$NON-NLS-1$ //$NON-NLS-2$
+ + serviceReference);
+ EndpointDescription updatedED = (EndpointDescription) exportedRegistration.update(null);
+ if (updatedED == null)
+ logWarning("handleServiceModifying", "ExportRegistration.update failed with exception=" //$NON-NLS-1$//$NON-NLS-2$
+ + exportedRegistration.getException());
+ }
}
}
}
protected void handleServiceUnregistering(ServiceReference serviceReference) {
- List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations = ((RemoteServiceAdmin) getRemoteServiceAdmin())
- .getExportedRegistrations();
- for (RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
- if (exportedRegistration.match(serviceReference)) {
- trace("handleServiceUnregistering", "closing exportRegistration for serviceReference=" //$NON-NLS-1$ //$NON-NLS-2$
- + serviceReference);
- exportedRegistration.close();
+ RemoteServiceAdmin rsa = (RemoteServiceAdmin) getRemoteServiceAdmin();
+ if (rsa != null) {
+ List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations = ((RemoteServiceAdmin) getRemoteServiceAdmin())
+ .getExportedRegistrations();
+ for (RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
+ if (exportedRegistration.match(serviceReference)) {
+ trace("handleServiceUnregistering", "closing exportRegistration for serviceReference=" //$NON-NLS-1$ //$NON-NLS-2$
+ + serviceReference);
+ exportedRegistration.close();
+ }
}
}
}

Back to the top