Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Alexander Kuppe2014-01-25 17:43:04 +0000
committerMarkus Alexander Kuppe2014-01-25 17:43:04 +0000
commitc8aaa3c7722f2595535cee5f272bab0660dadf50 (patch)
tree4d3ae69335c2acd62212d8233b9f93eaa0d10d96
parent1e5dbf9293c8af8990172afa43dafb659dba08af (diff)
downloadorg.eclipse.ecf-c8aaa3c7722f2595535cee5f272bab0660dadf50.tar.gz
org.eclipse.ecf-c8aaa3c7722f2595535cee5f272bab0660dadf50.tar.xz
org.eclipse.ecf-c8aaa3c7722f2595535cee5f272bab0660dadf50.zip
bug 426374: Notify IServiceListeners of previously registered services
Bug-URL: https://bugs.eclipse.org/bugs/show_bug.cgi?id=426374
-rw-r--r--examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java11
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery.ui.model/src/org/eclipse/ecf/discovery/ui/model/resource/ServiceResource.java71
2 files changed, 43 insertions, 39 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java
index e3da7cd04..1f5526731 100644
--- a/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java
+++ b/examples/bundles/org.eclipse.ecf.example.collab/src/org/eclipse/ecf/internal/example/collab/start/Discovery.java
@@ -12,11 +12,7 @@ package org.eclipse.ecf.internal.example.collab.start;
import org.eclipse.ecf.core.ContainerFactory;
import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.discovery.IDiscoveryContainerAdapter;
-import org.eclipse.ecf.discovery.IServiceEvent;
-import org.eclipse.ecf.discovery.IServiceListener;
-import org.eclipse.ecf.discovery.IServiceTypeEvent;
-import org.eclipse.ecf.discovery.IServiceTypeListener;
+import org.eclipse.ecf.discovery.*;
public class Discovery {
@@ -59,5 +55,10 @@ public class Discovery {
// TODO Auto-generated method stub
}
+
+ public boolean triggerDiscovery() {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery.ui.model/src/org/eclipse/ecf/discovery/ui/model/resource/ServiceResource.java b/framework/bundles/org.eclipse.ecf.discovery.ui.model/src/org/eclipse/ecf/discovery/ui/model/resource/ServiceResource.java
index 621dc6ac6..fe31f73fc 100644
--- a/framework/bundles/org.eclipse.ecf.discovery.ui.model/src/org/eclipse/ecf/discovery/ui/model/resource/ServiceResource.java
+++ b/framework/bundles/org.eclipse.ecf.discovery.ui.model/src/org/eclipse/ecf/discovery/ui/model/resource/ServiceResource.java
@@ -74,11 +74,10 @@ public class ServiceResource extends ResourceImpl implements Resource {
ModelPlugin
.getDefault()
.getLog()
- .log(
- new Status(
- IStatus.WARNING,
- ModelPlugin.PLUGIN_ID,
- Messages.ServiceResource_NO_DISCOVERY_CONTAINER_AVAILABLE));
+ .log(new Status(
+ IStatus.WARNING,
+ ModelPlugin.PLUGIN_ID,
+ Messages.ServiceResource_NO_DISCOVERY_CONTAINER_AVAILABLE));
}
} catch (ContainerCreateException e1) {
container = null;
@@ -86,16 +85,17 @@ public class ServiceResource extends ResourceImpl implements Resource {
ModelPlugin
.getDefault()
.getLog()
- .log(
- new Status(
- IStatus.WARNING,
- ModelPlugin.PLUGIN_ID,
- Messages.ServiceResource_NO_DISCOVERY_CONTAINER_AVAILABLE,
- e1));
+ .log(new Status(
+ IStatus.WARNING,
+ ModelPlugin.PLUGIN_ID,
+ Messages.ServiceResource_NO_DISCOVERY_CONTAINER_AVAILABLE,
+ e1));
return;
} catch (ContainerConnectException e) {
- ModelPlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, ModelPlugin.PLUGIN_ID, e
+ ModelPlugin
+ .getDefault()
+ .getLog()
+ .log(new Status(IStatus.ERROR, ModelPlugin.PLUGIN_ID, e
.getMessage(), e));
} finally {
lock.release();
@@ -169,18 +169,18 @@ public class ServiceResource extends ResourceImpl implements Resource {
ModelPlugin
.getDefault()
.getLog()
- .log(
- new Status(
- IStatus.INFO,
- ModelPlugin.PLUGIN_ID,
- NLS
- .bind(
- Messages.ServiceResource_NoEMFServiceModel,
- anUri)));
+ .log(new Status(
+ IStatus.INFO,
+ ModelPlugin.PLUGIN_ID,
+ NLS.bind(
+ Messages.ServiceResource_NoEMFServiceModel,
+ anUri)));
} else {
- ModelPlugin.getDefault().getLog().log(
- new Status(IStatus.INFO, ModelPlugin.PLUGIN_ID, e
- .getMessage()));
+ ModelPlugin
+ .getDefault()
+ .getLog()
+ .log(new Status(IStatus.INFO,
+ ModelPlugin.PLUGIN_ID, e.getMessage()));
}
}
emfIServiceInfo = ModelFactory.eINSTANCE.createIServiceInfo();
@@ -214,9 +214,9 @@ public class ServiceResource extends ResourceImpl implements Resource {
// set Authority to host and port of the service
final java.net.URI location = anIServiceInfo.getLocation();
final String authority = location.getAuthority();
- uri = URI.createHierarchicalURI(uri.scheme(), authority, uri
- .device(), uri.segments(), location.getQuery(), location
- .getFragment());
+ uri = URI.createHierarchicalURI(uri.scheme(), authority,
+ uri.device(), uri.segments(), location.getQuery(),
+ location.getFragment());
return uri;
}
@@ -248,8 +248,8 @@ public class ServiceResource extends ResourceImpl implements Resource {
for (java.util.Iterator itr = host.getServices().iterator(); itr
.hasNext();) {
IServiceInfo emfIServiceInfo = (IServiceInfo) itr.next();
- if (aComparator.compare(ecfServiceInfo, emfIServiceInfo
- .getEcfServiceInfo()) == 0) {
+ if (aComparator.compare(ecfServiceInfo,
+ emfIServiceInfo.getEcfServiceInfo()) == 0) {
return emfIServiceInfo;
}
}
@@ -289,11 +289,10 @@ public class ServiceResource extends ResourceImpl implements Resource {
}
getResourceSet().getResources().removeAll(resources);
- Trace
- .trace(
- ModelPlugin.PLUGIN_ID,
- ModelPlugin.PLUGIN_ID + "/methods/tracing", ServiceResource.class, //$NON-NLS-1$
- "serviceUndiscovered", "Removed service " + emfIServiceInfo); //$NON-NLS-1$ //$NON-NLS-2$
+ Trace.trace(
+ ModelPlugin.PLUGIN_ID,
+ ModelPlugin.PLUGIN_ID + "/methods/tracing", ServiceResource.class, //$NON-NLS-1$
+ "serviceUndiscovered", "Removed service " + emfIServiceInfo); //$NON-NLS-1$ //$NON-NLS-2$
// remove the host if no services left for this particular host
IHost host = findIHost(getInetAddress(ecfServiceInfo
@@ -415,6 +414,10 @@ public class ServiceResource extends ResourceImpl implements Resource {
return -1;
}
}
+
+ public boolean triggerDiscovery() {
+ return false;
+ }
}
public ServiceResource(URI uri) {

Back to the top