Class DelegatingCDORevisionManager
- java.lang.Object
-
- org.eclipse.net4j.util.event.Notifier
-
- org.eclipse.net4j.util.lifecycle.Lifecycle
-
- org.eclipse.emf.cdo.spi.common.revision.DelegatingCDORevisionManager
-
- All Implemented Interfaces:
CDORevisionCacheAdder,CDORevisionManager,InternalCDORevisionManager,org.eclipse.net4j.util.event.INotifier,org.eclipse.net4j.util.event.INotifier.INotifier2,org.eclipse.net4j.util.lifecycle.IDeactivateable,org.eclipse.net4j.util.lifecycle.ILifecycle,org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
public abstract class DelegatingCDORevisionManager extends org.eclipse.net4j.util.lifecycle.Lifecycle implements InternalCDORevisionManager
If the meaning of this type isn't clear, there really should be more of a description here...- Since:
- 3.0
- Author:
- Eike Stepper
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation
-
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2
-
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager
InternalCDORevisionManager.RevisionLoader, InternalCDORevisionManager.RevisionLoader2, InternalCDORevisionManager.RevisionLocker
-
-
Constructor Summary
Constructors Constructor Description DelegatingCDORevisionManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddRevision(CDORevision revision)Adds the given revision to this cache.booleancontainsRevision(CDOID id, CDOBranchPoint branchPoint)Returnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch point(branch + timestamp),falseotherwise.booleancontainsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)Returnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch version(branch + version),falseotherwise.protected voiddoActivate()protected voiddoDeactivate()InternalCDORevisionCachegetCache()protected abstract InternalCDORevisionManagergetDelegate()CDORevisionFactorygetFactory()EClassgetObjectType(CDOID id)Returns thetypeof an object if a revision for that object is in the revision cache,nullotherwise.InternalCDORevisiongetRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)Returns therevisionwith the givenIDat the givenbranch point(branch + timestamp), optionally demand loading it if it is not already in thecache.InternalCDORevisiongetRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)InternalCDORevisiongetRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)Returns therevisionwith the givenIDat the givenbranch version(branch + version), optionally demand loading it if it is not already in thecache.InternalCDORevisionManager.RevisionLoadergetRevisionLoader()InternalCDORevisionManager.RevisionLockergetRevisionLocker()java.util.List<CDORevision>getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)Returns therevisionswith the givenIDsat the givenbranch point(branch + timestamp), optionally demand loading them if they are not already in thecache.java.util.List<CDORevision>getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)protected booleanisDelegatingLifecycle()booleanisSupportingAudits()booleanisSupportingBranches()voidreviseLatest(CDOID id, CDOBranch branch)Called on client via postCommit when there is no version of detached objects available.voidreviseVersion(CDOID id, CDOBranchVersion branchVersion, long timeStamp)voidsetCache(CDORevisionCache cache)voidsetFactory(CDORevisionFactory factory)voidsetRevisionLoader(InternalCDORevisionManager.RevisionLoader revisionLoader)voidsetRevisionLocker(InternalCDORevisionManager.RevisionLocker revisionLocker)voidsetSupportingAudits(boolean on)voidsetSupportingBranches(boolean on)-
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
-
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionManager
getObjectLifetime, getObjectType, handleRevisions
-
Methods inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
activate, deactivate, getLifecycleState, isActive
-
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Methods inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager
getBaseRevision
-
-
-
-
Method Detail
-
getCache
public InternalCDORevisionCache getCache()
- Specified by:
getCachein interfaceInternalCDORevisionManager
-
setCache
public void setCache(CDORevisionCache cache)
- Specified by:
setCachein interfaceInternalCDORevisionManager- Since:
- 4.0
-
setFactory
public void setFactory(CDORevisionFactory factory)
- Specified by:
setFactoryin interfaceInternalCDORevisionManager
-
getFactory
public CDORevisionFactory getFactory()
- Specified by:
getFactoryin interfaceInternalCDORevisionManager
-
getRevisionLoader
public InternalCDORevisionManager.RevisionLoader getRevisionLoader()
- Specified by:
getRevisionLoaderin interfaceInternalCDORevisionManager
-
setRevisionLoader
public void setRevisionLoader(InternalCDORevisionManager.RevisionLoader revisionLoader)
- Specified by:
setRevisionLoaderin interfaceInternalCDORevisionManager
-
getRevisionLocker
public InternalCDORevisionManager.RevisionLocker getRevisionLocker()
- Specified by:
getRevisionLockerin interfaceInternalCDORevisionManager
-
setRevisionLocker
public void setRevisionLocker(InternalCDORevisionManager.RevisionLocker revisionLocker)
- Specified by:
setRevisionLockerin interfaceInternalCDORevisionManager
-
isSupportingAudits
public boolean isSupportingAudits()
- Specified by:
isSupportingAuditsin interfaceInternalCDORevisionManager- Since:
- 4.0
-
setSupportingAudits
public void setSupportingAudits(boolean on)
- Specified by:
setSupportingAuditsin interfaceInternalCDORevisionManager- Since:
- 4.0
-
isSupportingBranches
public boolean isSupportingBranches()
- Specified by:
isSupportingBranchesin interfaceInternalCDORevisionManager
-
setSupportingBranches
public void setSupportingBranches(boolean on)
- Specified by:
setSupportingBranchesin interfaceInternalCDORevisionManager
-
addRevision
public void addRevision(CDORevision revision)
Description copied from interface:CDORevisionCacheAdderAdds the given revision to this cache.- Specified by:
addRevisionin interfaceCDORevisionCacheAdder- Since:
- 4.0
-
containsRevision
public boolean containsRevision(CDOID id, CDOBranchPoint branchPoint)
Description copied from interface:CDORevisionManagerReturnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch point(branch + timestamp),falseotherwise.
-
containsRevisionByVersion
public boolean containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)
Description copied from interface:CDORevisionManagerReturnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch version(branch + version),falseotherwise.- Specified by:
containsRevisionByVersionin interfaceCDORevisionManager- See Also:
CDORevisionManager.getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
-
getObjectType
public EClass getObjectType(CDOID id)
Description copied from interface:CDORevisionManagerReturns thetypeof an object if a revision for that object is in the revision cache,nullotherwise.Same as calling
getObjectType(id, null).- Specified by:
getObjectTypein interfaceCDORevisionManager- See Also:
EObject.eClass(),CDORevisionManager.getObjectType(CDOID, CDOBranchManager)
-
getRevisionByVersion
public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)
Description copied from interface:CDORevisionManagerReturns therevisionwith the givenIDat the givenbranch version(branch + version), optionally demand loading it if it is not already in thecache.Prefetching of nested containment levels is not support by this method because the version of a particular revision can not serve as a reasonable baseline criterium for a consistent graph of multiple revisions.
- Specified by:
getRevisionByVersionin interfaceCDORevisionManager- Specified by:
getRevisionByVersionin interfaceInternalCDORevisionManagerreferenceChunk- The number of targetIDsto load for each many-valued reference in the returned revision, orCDORevision.UNCHUNKEDfor all such list elements (IDs).loadOnDemand- If the requested revision is not contained in the revision cache it depends on this parameter's value whether the revision is loaded from the server ornullis returned.- See Also:
CDORevisionManager.getRevision(CDOID, CDOBranchPoint, int, int, boolean)
-
getRevision
public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
Description copied from interface:CDORevisionManagerReturns therevisionwith the givenIDat the givenbranch point(branch + timestamp), optionally demand loading it if it is not already in thecache.- Specified by:
getRevisionin interfaceCDORevisionManager- Specified by:
getRevisionin interfaceInternalCDORevisionManagerreferenceChunk- The number of targetIDsto load for each many-valued reference in the returned revision, orCDORevision.UNCHUNKEDfor all such list elements (IDs).prefetchDepth- The number of nested containment levels to load revisions for in one round trip. Use the symbolic constantsCDORevision.DEPTH_INFINITEto prefetch all contained revisions orCDORevision.DEPTH_NONEto not prefetch anything. Only the explicitly requested revision is returned by this method. If additional revisions are prefetched they are placed in the revision cache to speed up subsequent calls to this method.loadOnDemand- If the requested revision is not contained in the revision cache it depends on this parameter's value whether the revision is loaded from the server ornullis returned.- See Also:
CDORevisionManager.getRevisions(List, CDOBranchPoint, int, int, boolean),CDORevisionManager.getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
-
getRevision
public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
- Specified by:
getRevisionin interfaceInternalCDORevisionManager
-
getRevisions
public java.util.List<CDORevision> getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
Description copied from interface:CDORevisionManagerReturns therevisionswith the givenIDsat the givenbranch point(branch + timestamp), optionally demand loading them if they are not already in thecache.- Specified by:
getRevisionsin interfaceCDORevisionManagerreferenceChunk- The number of targetIDsto load for each many-valued reference in the returned revisions, orCDORevision.UNCHUNKEDfor all such list elements (IDs).prefetchDepth- The number of nested containment levels to load revisions for in one round trip. Use the symbolic constantsCDORevision.DEPTH_INFINITEto prefetch all contained revisions orCDORevision.DEPTH_NONEto not prefetch anything. Only the explicitly requested revisions are returned by this method. If additional revisions are prefetched they are placed in the revision cache to speed up subsequent calls to this method.loadOnDemand- If one or more of the requested revisions is/are not contained in the revision cache it depends on this parameter's value whether the revision(s) is/are loaded from the server ornullis placed in the list that is returned.- See Also:
CDORevisionManager.getRevision(CDOID, CDOBranchPoint, int, int, boolean)
-
getRevisions
public java.util.List<CDORevision> getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
- Specified by:
getRevisionsin interfaceInternalCDORevisionManager
-
reviseLatest
public void reviseLatest(CDOID id, CDOBranch branch)
Description copied from interface:InternalCDORevisionManagerCalled on client via postCommit when there is no version of detached objects available.- Specified by:
reviseLatestin interfaceInternalCDORevisionManager
-
reviseVersion
public void reviseVersion(CDOID id, CDOBranchVersion branchVersion, long timeStamp)
- Specified by:
reviseVersionin interfaceInternalCDORevisionManager
-
doActivate
protected void doActivate() throws java.lang.Exception- Overrides:
doActivatein classorg.eclipse.net4j.util.lifecycle.Lifecycle- Throws:
java.lang.Exception
-
doDeactivate
protected void doDeactivate() throws java.lang.Exception- Overrides:
doDeactivatein classorg.eclipse.net4j.util.lifecycle.Lifecycle- Throws:
java.lang.Exception
-
isDelegatingLifecycle
protected boolean isDelegatingLifecycle()
-
getDelegate
protected abstract InternalCDORevisionManager getDelegate()
-
-