Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-11-13 04:04:24 -0500
committerslewis2008-11-13 04:04:24 -0500
commit8eeaf3069e2368a9e0a7c143da404fd6f5a1c513 (patch)
tree30d4d9c035194faf85f59704137f155b531e80d0
parentf93199c5876a44348cdb14ae9512c43af01d3c1b (diff)
downloadorg.eclipse.ecf-8eeaf3069e2368a9e0a7c143da404fd6f5a1c513.tar.gz
org.eclipse.ecf-8eeaf3069e2368a9e0a7c143da404fd6f5a1c513.tar.xz
org.eclipse.ecf-8eeaf3069e2368a9e0a7c143da404fd6f5a1c513.zip
Added handler for disconnect reporting
-rw-r--r--server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractGenericServer.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractGenericServer.java b/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractGenericServer.java
index e091ae0c9..6dd9bff1e 100644
--- a/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractGenericServer.java
+++ b/server-side/bundles/org.eclipse.ecf.server.generic/src/org/eclipse/ecf/server/generic/AbstractGenericServer.java
@@ -3,6 +3,8 @@ package org.eclipse.ecf.server.generic;
import java.io.IOException;
import java.security.PermissionCollection;
import java.util.*;
+import org.eclipse.ecf.core.IContainerListener;
+import org.eclipse.ecf.core.events.*;
import org.eclipse.ecf.core.identity.*;
import org.eclipse.ecf.core.security.IConnectHandlerPolicy;
import org.eclipse.ecf.core.sharedobject.ISharedObjectContainerConfig;
@@ -12,10 +14,35 @@ public abstract class AbstractGenericServer {
protected class GenericServerContainer extends TCPServerSOContainer {
+ private IContainerListener departedListener = new IContainerListener() {
+ public void handleEvent(IContainerEvent event) {
+ if (event instanceof IContainerDisconnectedEvent) {
+ IContainerDisconnectedEvent de = (IContainerDisconnectedEvent) event;
+ handleDisconnect(de.getTargetID());
+ } else if (event instanceof IContainerEjectedEvent) {
+ IContainerEjectedEvent de = (IContainerEjectedEvent) event;
+ handleEject(de.getTargetID());
+ }
+ }
+ };
+
public GenericServerContainer(ISharedObjectContainerConfig config, TCPServerSOContainerGroup listener, String path, int keepAlive) {
super(config, listener, path, keepAlive);
+ addListener(departedListener);
+ }
+
+ public void dispose() {
+ removeListener(departedListener);
+ super.dispose();
}
+ }
+
+ protected void handleDisconnect(ID targetID) {
+ // nothing to do
+ }
+ protected void handleEject(ID targetID) {
+ // nothing to do
}
protected TCPServerSOContainerGroup serverGroup;

Back to the top