From d3d54f27b1c256e2416c4cd0e873d2764b5edcaf Mon Sep 17 00:00:00 2001 From: Eike Stepper Date: Wed, 25 Apr 2018 05:11:15 +0200 Subject: [534014] ReconnectingSession fails to reconnect the second time https://bugs.eclipse.org/bugs/show_bug.cgi?id=534014--- .../cdo/internal/net4j/RecoveringCDOSessionImpl.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'plugins/org.eclipse.emf.cdo.net4j/src') diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java index 04ac972933..5f67b15497 100644 --- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/RecoveringCDOSessionImpl.java @@ -123,9 +123,8 @@ public abstract class RecoveringCDOSessionImpl extends CDONet4jSessionImpl unhookSessionProtocol(); List runnables = recoverSession(); - // Check if the the sessionProtocol was replaced. (This may not be the case + // Check if the sessionProtocol was replaced. (This may not be the case // if the protocol is wrapped inside a DelegatingSessionProtocol.) - // CDOSessionProtocol newSessionProtocol = getSessionProtocol(); if (newSessionProtocol != oldSessionProtocol) { @@ -223,6 +222,17 @@ public abstract class RecoveringCDOSessionImpl extends CDONet4jSessionImpl } } + @Override + public void setSessionProtocol(CDOSessionProtocol sessionProtocol) + { + super.setSessionProtocol(sessionProtocol); + + // Bug 534014: The DelegatingSessionProtocol of this session is deactivated by CDOSessionImpl.sessionProtocolListener + // when the delegate protocol becomes inactive. The super.setSessionProtocol() method just replaces the delegate + // protocol but doesn't reactivate the DelegatingSessionProtocol. Reactivate it now. + LifecycleUtil.activate(getSessionProtocol()); + } + protected IConnector removeTCPConnector() { return (IConnector)container.removeElement("org.eclipse.net4j.connectors", "tcp", repositoryConnectorDescription); @@ -276,7 +286,7 @@ public abstract class RecoveringCDOSessionImpl extends CDONet4jSessionImpl /** * @author Eike Stepper */ - public final class OpenViewRunnable implements AfterRecoveryRunnable + private static final class OpenViewRunnable implements AfterRecoveryRunnable { private int viewID; @@ -300,7 +310,7 @@ public abstract class RecoveringCDOSessionImpl extends CDONet4jSessionImpl /** * @author Eike Stepper */ - private static class AutoCloser implements IListener + private static final class AutoCloser implements IListener { public void notifyEvent(IEvent event) { -- cgit v1.2.3