diff options
author | Eike Stepper | 2010-02-03 09:02:56 +0000 |
---|---|---|
committer | Eike Stepper | 2010-02-03 09:02:56 +0000 |
commit | 8d7152b4786c2b9fe3a2ec6523d67a3d5f0a6702 (patch) | |
tree | cb511ebf0cd3caec38590f0f02ec0c32f7710b60 | |
parent | 772962ec1834d9468e7a3f0720e2829007ef8a26 (diff) | |
download | cdo-8d7152b4786c2b9fe3a2ec6523d67a3d5f0a6702.tar.gz cdo-8d7152b4786c2b9fe3a2ec6523d67a3d5f0a6702.tar.xz cdo-8d7152b4786c2b9fe3a2ec6523d67a3d5f0a6702.zip |
[256936] Support for Offline Mode
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256936
-rw-r--r-- | plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java | 1 | ||||
-rw-r--r-- | plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/Store.java | 73 |
2 files changed, 49 insertions, 25 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java index f936625e52..78921f48a3 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java @@ -38,7 +38,6 @@ import java.util.Map; */ public interface InternalRepository extends IRepository, PackageLoader, BranchLoader, RevisionLoader { - public void setName(String name); public InternalStore getStore(); diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/Store.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/Store.java index 3d1f9a2935..c652484f12 100644 --- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/Store.java +++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/Store.java @@ -21,10 +21,10 @@ import org.eclipse.emf.cdo.internal.server.Repository; import org.eclipse.emf.cdo.server.IRepository; import org.eclipse.emf.cdo.server.ISession; import org.eclipse.emf.cdo.server.ISessionManager; -import org.eclipse.emf.cdo.server.IStore; import org.eclipse.emf.cdo.server.IStoreAccessor; import org.eclipse.emf.cdo.server.ITransaction; import org.eclipse.emf.cdo.server.IView; +import org.eclipse.emf.cdo.server.InternalStore; import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision; import org.eclipse.net4j.util.StringUtil; @@ -45,7 +45,7 @@ import java.util.Set; * @author Eike Stepper * @since 2.0 */ -public abstract class Store extends Lifecycle implements IStore +public abstract class Store extends Lifecycle implements InternalStore { /** * @since 3.0 @@ -75,17 +75,23 @@ public abstract class Store extends Lifecycle implements IStore private InternalRepository repository; + /** + * Is protected against concurrent thread access through {@link Repository#createBranchLock}. + */ + @ExcludeFromDump + private transient int lastBranchID; + @ExcludeFromDump private transient long lastMetaID; @ExcludeFromDump private transient Object lastMetaIDLock = new Object(); - /** - * Is protected against concurrent thread access through {@link Repository#createBranchLock}. - */ @ExcludeFromDump - private transient int lastBranchID; + private transient long lastCommitTime; + + @ExcludeFromDump + private transient Object lastCommitTimeLock = new Object(); @ExcludeFromDump private transient ProgressDistributor indicatingCommitDistributor = new ProgressDistributor.Geometric() @@ -180,6 +186,30 @@ public abstract class Store extends Lifecycle implements IStore this.revisionParallelism = revisionParallelism; } + /** + * @since 3.0 + */ + public int getLastBranchID() + { + return lastBranchID; + } + + /** + * @since 3.0 + */ + public void setLastBranchID(int lastBranchID) + { + this.lastBranchID = lastBranchID; + } + + /** + * @since 3.0 + */ + public int getNextBranchID() + { + return ++lastBranchID; + } + public long getLastMetaID() { synchronized (lastMetaIDLock) @@ -206,28 +236,23 @@ public abstract class Store extends Lifecycle implements IStore } } - /** - * @since 3.0 - */ - public int getLastBranchID() - { - return lastBranchID; - } - - /** - * @since 3.0 - */ - public void setLastBranchID(int lastBranchID) + public long getLastCommitTime() { - this.lastBranchID = lastBranchID; + synchronized (lastCommitTimeLock) + { + return lastCommitTime; + } } - /** - * @since 3.0 - */ - public int getNextBranchID() + public void setLastCommitTime(long lastCommitTime) { - return ++lastBranchID; + synchronized (lastCommitTimeLock) + { + if (this.lastCommitTime < lastCommitTime) + { + this.lastCommitTime = lastCommitTime; + } + } } public IStoreAccessor getReader(ISession session) |