Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-04-15 06:32:16 +0000
committerEike Stepper2010-04-15 06:32:16 +0000
commit5677e90533b641e016dfd417f14011b948c1ddb5 (patch)
tree3730aa8565a448e77ec7c7595dc396325387fc44 /plugins
parent4b93f7ba31388a75a835d7bb098518043cb56f85 (diff)
downloadcdo-5677e90533b641e016dfd417f14011b948c1ddb5.tar.gz
cdo-5677e90533b641e016dfd417f14011b948c1ddb5.tar.xz
cdo-5677e90533b641e016dfd417f14011b948c1ddb5.zip
[256936] Support for Offline Mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256936
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/FailoverParticipant.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java3
2 files changed, 17 insertions, 5 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 04b443f7ef..1c47f7e3e4 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
@@ -19,6 +19,10 @@ import org.eclipse.emf.cdo.spi.server.InternalTransaction;
*/
public class FailoverParticipant extends SynchronizableRepository
{
+ private static final CDOCommonRepository.Type MASTER = CDOCommonRepository.Type.MASTER;
+
+ private static final CDOCommonRepository.Type BACKUP = CDOCommonRepository.Type.BACKUP;
+
public FailoverParticipant()
{
setState(State.OFFLINE);
@@ -27,15 +31,24 @@ public class FailoverParticipant extends SynchronizableRepository
@Override
public void setType(Type type)
{
- checkArg(type == CDOCommonRepository.Type.MASTER || type == CDOCommonRepository.Type.BACKUP,
- "Type must be MASTER or BACKUP");
+ checkArg(type == MASTER || type == BACKUP, "Type must be MASTER or BACKUP");
super.setType(type);
}
@Override
+ protected void changingType(Type oldType, Type newType)
+ {
+ if (newType == MASTER)
+ {
+ }
+
+ super.changingType(oldType, newType);
+ }
+
+ @Override
public InternalCommitContext createCommitContext(InternalTransaction transaction)
{
- if (getType() == CDOCommonRepository.Type.BACKUP)
+ if (getType() == BACKUP)
{
if (transaction.getSession() != getReplicatorSession())
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java
index e26ed917d4..c038d7b18f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/ISynchronizableRepository.java
@@ -10,12 +10,11 @@
*/
package org.eclipse.emf.cdo.server;
-
/**
* @author Eike Stepper
* @since 3.0
*/
-public interface ISynchronizableRepository
+public interface ISynchronizableRepository extends IRepository
{
public IRepositorySynchronizer getSynchronizer();

Back to the top