Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-09-23 06:54:03 +0000
committerEike Stepper2010-09-23 06:54:03 +0000
commit2d5df13924babda608baad24c03325b04704dd16 (patch)
treead94e15e03299566a176be7648b83fbb9b1f0bee
parent0cd622fe5a73fe52102fab890da165941eeb26ea (diff)
downloadcdo-2d5df13924babda608baad24c03325b04704dd16.tar.gz
cdo-2d5df13924babda608baad24c03325b04704dd16.tar.xz
cdo-2d5df13924babda608baad24c03325b04704dd16.zip
[325928] Provide FailoverMonitor server and FailoverAgents to coordinate fail-over scenarios
https://bugs.eclipse.org/bugs/show_bug.cgi?id=325928
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/FailoverCDOSessionImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java24
2 files changed, 19 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/FailoverCDOSessionImpl.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/FailoverCDOSessionImpl.java
index a0693b3603..9d23bd9c98 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/FailoverCDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/FailoverCDOSessionImpl.java
@@ -33,9 +33,11 @@ public class FailoverCDOSessionImpl extends CDONet4jSessionImpl
protected void sessionProtocolDeactivated()
{
fireFailoverEvent(CDOSessionFailoverEvent.Type.STARTED);
+
unhookSessionProtocol();
getConfiguration().failover(FailoverCDOSessionImpl.this);
hookSessionProtocol();
+
fireFailoverEvent(CDOSessionFailoverEvent.Type.FINISHED);
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 3daadf6b4b..b229bac387 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -1000,12 +1000,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
getConfiguration().activateSession(this);
checkState(sessionProtocol, "sessionProtocol"); //$NON-NLS-1$
checkState(remoteSessionManager, "remoteSessionManager"); //$NON-NLS-1$
- if (exceptionHandler != null)
- {
- sessionProtocol = new DelegatingSessionProtocol(sessionProtocol);
- }
-
- EventUtil.addListener(sessionProtocol, sessionProtocolListener);
+ hookSessionProtocol();
}
@Override
@@ -1030,11 +1025,26 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
invalidationRunner = null;
}
- EventUtil.removeListener(sessionProtocol, sessionProtocolListener);
+ unhookSessionProtocol();
getConfiguration().deactivateSession(this);
super.doDeactivate();
}
+ protected void hookSessionProtocol()
+ {
+ if (exceptionHandler != null)
+ {
+ sessionProtocol = new DelegatingSessionProtocol(sessionProtocol);
+ }
+
+ EventUtil.addListener(sessionProtocol, sessionProtocolListener);
+ }
+
+ protected void unhookSessionProtocol()
+ {
+ EventUtil.removeListener(sessionProtocol, sessionProtocolListener);
+ }
+
protected void sessionProtocolDeactivated()
{
deactivate();

Back to the top