Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2010-04-16 10:32:24 +0000
committerEike Stepper2010-04-16 10:32:24 +0000
commitb0ed914d7cb22b48db305265874df4d23bd93db7 (patch)
tree8453e1ba50b7699a65dce3dced49baf8cdd82e6f /plugins
parenta094f65b0c4d26b2f56c9722786f95cbd5ce9260 (diff)
downloadcdo-b0ed914d7cb22b48db305265874df4d23bd93db7.tar.gz
cdo-b0ed914d7cb22b48db305265874df4d23bd93db7.tar.xz
cdo-b0ed914d7cb22b48db305265874df4d23bd93db7.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.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java21
3 files changed, 41 insertions, 16 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 9959766232..759f0d9b9d 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
@@ -50,6 +50,19 @@ public class FailoverParticipant extends SynchronizableRepository
super.changingType(oldType, newType);
}
+ @Override
+ protected void initRootResource()
+ {
+ if (getType() == BACKUP)
+ {
+ super.initRootResource();
+ }
+ else
+ {
+ doInitRootResource();
+ }
+ }
+
protected void doStartSynchronization()
{
super.startSynchronization();
@@ -90,6 +103,6 @@ public class FailoverParticipant extends SynchronizableRepository
}
}
- return super.createCommitContext(transaction);
+ return createNormalCommitContext(transaction);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java
index 11dc7c1e86..a3c3b97d1c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/OfflineClone.java
@@ -10,6 +10,10 @@
*/
package org.eclipse.emf.cdo.internal.server.syncing;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.spi.server.InternalCommitContext;
+import org.eclipse.emf.cdo.spi.server.InternalTransaction;
+
/**
* @author Eike Stepper
*/
@@ -31,4 +35,21 @@ public class OfflineClone extends SynchronizableRepository
{
throw new UnsupportedOperationException();
}
+
+ @Override
+ public InternalCommitContext createCommitContext(InternalTransaction transaction)
+ {
+ CDOBranch branch = transaction.getBranch();
+ if (branch.isLocal())
+ {
+ return createNormalCommitContext(transaction);
+ }
+
+ if (getState() != ONLINE)
+ {
+ return createBranchingCommitContext(transaction, branch);
+ }
+
+ return createWriteThroughCommitContext(transaction);
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index 919609f6ae..ecc11288b1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -193,21 +193,7 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
@Override
- public InternalCommitContext createCommitContext(InternalTransaction transaction)
- {
- CDOBranch branch = transaction.getBranch();
- if (branch.isLocal())
- {
- return createNormalCommitContext(transaction);
- }
-
- if (getState() != ONLINE)
- {
- return createBranchingCommitContext(transaction, branch);
- }
-
- return createWriteThroughCommitContext(transaction);
- }
+ public abstract InternalCommitContext createCommitContext(InternalTransaction transaction);
protected InternalCommitContext createNormalCommitContext(InternalTransaction transaction)
{
@@ -300,6 +286,11 @@ public abstract class SynchronizableRepository extends Repository.Default implem
}
}
+ protected void doInitRootResource()
+ {
+ super.initRootResource();
+ }
+
@Override
protected void initRootResource()
{

Back to the top