diff options
Diffstat (limited to 'plugins')
6 files changed, 49 insertions, 27 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java index 79608bb360..9959766232 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java @@ -33,18 +33,49 @@ public class FailoverParticipant extends SynchronizableRepository @Override protected void changingType(Type oldType, Type newType) { - if (newType == MASTER) + if (isActive()) { - // Switch off synchronizer - stopSynchronization(); + if (newType == MASTER) + { + // Switch off synchronizer + doStopSynchronization(); + } + else + { + // Switch on synchronizer + doStartSynchronization(); + } } - else + + super.changingType(oldType, newType); + } + + protected void doStartSynchronization() + { + super.startSynchronization(); + } + + protected void doStopSynchronization() + { + super.stopSynchronization(); + } + + @Override + protected void startSynchronization() + { + if (getType() == BACKUP) { - // Switch on synchronizer - startSynchronization(); + doStartSynchronization(); } + } - super.changingType(oldType, newType); + @Override + protected void stopSynchronization() + { + if (getType() == BACKUP) + { + doStopSynchronization(); + } } @Override diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java index 5a6e1f5851..6a60e00852 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AbstractSyncingTest.java @@ -63,7 +63,10 @@ public abstract class AbstractSyncingTest extends AbstractCDOTest return testProperties; } - protected abstract boolean isSqueezedCommitInfos(); + protected final boolean isSqueezedCommitInfos() + { + return false; + } protected abstract boolean isFailover(); diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java index cebdb504a1..43a565de90 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/FailoverTest.java @@ -25,7 +25,7 @@ import org.eclipse.net4j.util.io.IOUtil; */ public class FailoverTest extends AbstractSyncingTest { - private transient IAcceptor backupAcceptor; + private IAcceptor backupAcceptor; @Override public void tearDown() throws Exception @@ -59,12 +59,6 @@ public class FailoverTest extends AbstractSyncingTest } @Override - protected boolean isSqueezedCommitInfos() - { - return false; - } - - @Override protected boolean isFailover() { return true; diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineSqueezedTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineSqueezedTest.java index cc4df3e2e4..2c3ac48e3c 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineSqueezedTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineSqueezedTest.java @@ -15,9 +15,9 @@ package org.eclipse.emf.cdo.tests; */ public class OfflineSqueezedTest extends OfflineTest { - @Override - protected boolean isSqueezedCommitInfos() - { - return true; - } + // @Override + // protected boolean isSqueezedCommitInfos() + // { + // return true; + // } } diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineTest.java index aa0cd0a6e5..8e6676fa5b 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineTest.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/OfflineTest.java @@ -35,12 +35,6 @@ import java.util.List; public class OfflineTest extends AbstractSyncingTest { @Override - protected boolean isSqueezedCommitInfos() - { - return false; - } - - @Override protected boolean isFailover() { return false; diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java index 00e04d843b..1345c05d12 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/impl/RepositoryConfig.java @@ -207,7 +207,7 @@ public abstract class RepositoryConfig extends Config implements IRepositoryConf { public static final String PROP_TEST_SQUEEZE_COMMIT_INFOS = "test.squeeze.commit.infos"; - public static final String PROP_TEST_FAILOVER = "test.backup.tests"; + public static final String PROP_TEST_FAILOVER = "test.failover"; private static final long serialVersionUID = 1L; |