Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-05-16 04:56:42 +0000
committerslewis2005-05-16 04:56:42 +0000
commitbb8be18974bb24bf58ab02fca1d19b899c0e50f0 (patch)
tree456f349506b1c9aaa607fb12664cab3d7d931f59 /framework/bundles/org.eclipse.ecf.discovery/src
parentb9ae9e3363ca812742ab363910017c20e9b0d07d (diff)
downloadorg.eclipse.ecf-bb8be18974bb24bf58ab02fca1d19b899c0e50f0.tar.gz
org.eclipse.ecf-bb8be18974bb24bf58ab02fca1d19b899c0e50f0.tar.xz
org.eclipse.ecf-bb8be18974bb24bf58ab02fca1d19b899c0e50f0.zip
Moved ServiceContainerEvent and ServiceInfo classes into org.ecilpse.ecf.discovery package. Added access methods to IDiscoveryContainer
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainer.java13
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java (renamed from framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/impl/ServiceContainerEvent.java)14
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java (renamed from framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/impl/ServiceInfo.java)26
3 files changed, 41 insertions, 12 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainer.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainer.java
index 56df50f78..73eb04a04 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainer.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/IDiscoveryContainer.java
@@ -9,10 +9,17 @@
package org.eclipse.ecf.discovery;
+import java.io.IOException;
+
+import org.eclipse.ecf.core.identity.ServiceID;
+
public interface IDiscoveryContainer {
- public void addServiceListener(IServiceListener listener);
- public void removeServiceListener(IServiceListener listener);
+ public void addServiceListener(ServiceID type, IServiceListener listener);
+ public void removeServiceListener(ServiceID type, IServiceListener listener);
public void addServiceTypeListener(IServiceTypeListener listener);
public void removeServiceTypeListener(IServiceTypeListener listener);
- public void registerService(IServiceInfo serviceInfo);
+ public void registerService(IServiceInfo serviceInfo) throws IOException;
+ public void unregisterService(IServiceInfo serviceInfo);
+ public void unregisterAllServices();
+ public IServiceInfo [] getServices(ServiceID type);
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/impl/ServiceContainerEvent.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
index 5e04a0339..cfd57227f 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/impl/ServiceContainerEvent.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceContainerEvent.java
@@ -7,23 +7,23 @@
* Contributors: Composent, Inc. - initial API and implementation
******************************************************************************/
-package org.eclipse.ecf.discovery.impl;
+package org.eclipse.ecf.discovery;
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.discovery.IServiceEvent;
-import org.eclipse.ecf.discovery.IServiceInfo;
public class ServiceContainerEvent implements IServiceEvent {
private static final long serialVersionUID = 1L;
protected IServiceInfo info;
+
protected ID containerID;
-
+
public ServiceContainerEvent(IServiceInfo info, ID containerID) {
this.info = info;
this.containerID = containerID;
}
+
public IServiceInfo getServiceInfo() {
return info;
}
@@ -32,4 +32,10 @@ public class ServiceContainerEvent implements IServiceEvent {
return containerID;
}
+ public String toString() {
+ StringBuffer buf = new StringBuffer("ServiceContainerEvent[");
+ buf.append("serviceinfo=")
+ .append(info).append("]");
+ return buf.toString();
+ }
}
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/impl/ServiceInfo.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
index 1a28aa1a2..9982096c0 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/impl/ServiceInfo.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/ServiceInfo.java
@@ -7,27 +7,32 @@
* Contributors: Composent, Inc. - initial API and implementation
******************************************************************************/
-package org.eclipse.ecf.discovery.impl;
+package org.eclipse.ecf.discovery;
import java.io.Serializable;
import java.net.InetAddress;
import java.util.Map;
import org.eclipse.ecf.core.identity.ServiceID;
-import org.eclipse.ecf.discovery.IServiceInfo;
public class ServiceInfo implements IServiceInfo, Serializable {
private static final long serialVersionUID = 1L;
-
+
InetAddress addr = null;
+
ServiceID serviceID;
+
int port;
+
int priority;
+
int weight;
+
Map properties;
-
- public ServiceInfo(InetAddress address, ServiceID id, int port, int priority, int weight, Map props) {
+
+ public ServiceInfo(InetAddress address, ServiceID id, int port,
+ int priority, int weight, Map props) {
this.addr = address;
this.serviceID = id;
this.port = port;
@@ -35,6 +40,7 @@ public class ServiceInfo implements IServiceInfo, Serializable {
this.weight = weight;
this.properties = props;
}
+
public InetAddress getAddress() {
return addr;
}
@@ -42,6 +48,7 @@ public class ServiceInfo implements IServiceInfo, Serializable {
protected void setAddress(InetAddress address) {
this.addr = address;
}
+
public ServiceID getServiceID() {
return serviceID;
}
@@ -61,4 +68,13 @@ public class ServiceInfo implements IServiceInfo, Serializable {
public Map getProperties() {
return properties;
}
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer("ServiceInfo[");
+ buf.append("addr=").append(addr).append(";id=").append(serviceID).append(
+ ";port=").append(port).append(";priority=").append(priority)
+ .append(";weight=").append(weight).append(";props=").append(
+ properties).append("]");
+ return buf.toString();
+ }
}

Back to the top