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,CDORevisionInterner,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
Wrapper base for revision-manager decorators. It forwards cache, loading, interning, and lifecycle operations to a
delegate so an implementation can customize selected manager behavior without replacing the underlying revision
storage and loader.
- Since:
- 3.0
- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.event.Notifier.CancelationNested classes/interfaces inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionManager
CDORevisionManager.RequestNested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager
InternalCDORevisionManager.RevisionLoader, InternalCDORevisionManager.RevisionLoader2, InternalCDORevisionManager.RevisionLoader3, InternalCDORevisionManager.RevisionLoader4, InternalCDORevisionManager.RevisionLocker -
Field Summary
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRevision(CDORevision revision) Deprecated.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 voidprotected voidgetBaseRevision(CDORevision revision, int referenceChunk, boolean loadOnDemand) Deprecated.getBaseRevision(CDORevision revision, CDORevisionManager.Request.Config config) Loads the base revision using the canonical configuration-based path.getCache()protected abstract InternalCDORevisionManagergetObjectLifetime(CDOID id, CDOBranchPoint branchPoint) getObjectType(CDOID id) Returns thetypeof an object if a revision for that object is in the revision cache,nullotherwise.getObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand) Returns thetypeof an object.getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand) Deprecated.getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) Deprecated.getRevision(CDOID id, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config) Loads revisions using the canonical request configuration.getRevision(CDOID id, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, SyntheticCDORevision[] synthetics) Loads one revision through the canonical configuration-based path.getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand) Deprecated.getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, CDORevisionManager.Request.Config config) Loads a revision by version through the canonical configuration-based path.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand) Deprecated.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean prefetchLockStates, boolean loadOnDemand, SyntheticCDORevision[] synthetics) Deprecated.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, List<CDORevision> additionalRevisions) Deprecated.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) Deprecated.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config) Loads revisions using the canonical request configuration.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, List<CDORevision> additionalRevisions) Loads revisions using the canonical request configuration and collects additionally prefetched revisions in the supplied result channel.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, SyntheticCDORevision[] synthetics) Loads revisions through the canonical configuration-based path.getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, SyntheticCDORevision[] synthetics, List<CDORevision> additionalRevisions) Loads revisions through the canonical configuration-based path, preserving both result channels separately from the request configuration.voidhandleRevisions(EClass eClass, CDOBranch branch, boolean exactBranch, long timeStamp, boolean exactTime, CDORevisionHandler handler) internRevision(CDORevision revision) Interns the given revision and returns either the given revision or a revision with the samekeythat was interned previously.protected booleanbooleanbooleanvoidprefetchRevisions(CDOID id, CDOBranchPoint branchPoint, int prefetchDepth, boolean prefetchLockStates, Consumer<CDORevision> consumer) 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, toStringMethods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionManager
requestMethods inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
activate, deactivate, getLifecycleState, isActiveMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Constructor Details
-
DelegatingCDORevisionManager
public DelegatingCDORevisionManager()
-
-
Method Details
-
getCache
- Specified by:
getCachein interfaceInternalCDORevisionManager
-
setCache
- Specified by:
setCachein interfaceInternalCDORevisionManager- Since:
- 4.0
-
setFactory
- Specified by:
setFactoryin interfaceInternalCDORevisionManager
-
getFactory
- Specified by:
getFactoryin interfaceInternalCDORevisionManager
-
getRevisionLoader
- Specified by:
getRevisionLoaderin interfaceInternalCDORevisionManager
-
setRevisionLoader
- Specified by:
setRevisionLoaderin interfaceInternalCDORevisionManager
-
getRevisionLocker
- Specified by:
getRevisionLockerin interfaceInternalCDORevisionManager
-
setRevisionLocker
- 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
Deprecated.Description copied from interface:CDORevisionCacheAdderAdds the given revision to this cache.- Specified by:
addRevisionin interfaceCDORevisionCacheAdder- Specified by:
addRevisionin interfaceInternalCDORevisionManager- Since:
- 4.0
-
internRevision
Description copied from interface:CDORevisionInternerInterns the given revision and returns either the given revision or a revision with the samekeythat was interned previously.The returned revision is only different from the passed revision if this interner contains a previously cached, different revision instance with an equal
revision key.- Specified by:
internRevisionin interfaceCDORevisionInterner
-
containsRevision
Description copied from interface:CDORevisionManagerReturnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch point(branch + timestamp),falseotherwise.- Specified by:
containsRevisionin interfaceCDORevisionManager- See Also:
-
containsRevisionByVersion
Description copied from interface:CDORevisionManagerReturnstrueif therevision cachecontains arevisionwith the givenIDat the givenbranch version(branch + version),falseotherwise.- Specified by:
containsRevisionByVersionin interfaceCDORevisionManager- See Also:
-
getObjectType
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:
-
getObjectType
Description copied from interface:CDORevisionManagerReturns thetypeof an object.If no revision for that object is found in the revision cache the following is tried:
- If
branchManagerForLoadOnDemandis notnullthe first revision of the object in the main branch is loaded from the server and its type is returned. - Otherwise (i.e., if
branchManagerForLoadOnDemandisnullor the object does not exist)nullis returned.
A
branch manageris required instead of just a boolean value to specify whether to demand-load or not because this revision manager must be able to access themain branchwhile demand-loading.- Specified by:
getObjectTypein interfaceCDORevisionManager- See Also:
- If
-
getObjectLifetime
- Specified by:
getObjectLifetimein interfaceCDORevisionManager
-
getRevision
public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config) Description copied from interface:CDORevisionManagerLoads revisions using the canonical request configuration.- Specified by:
getRevisionin interfaceCDORevisionManager- Specified by:
getRevisionin interfaceInternalCDORevisionManager- Parameters:
id- the ID of the requested objectbranchPoint- the branch point at which to load the revisionconfig- the immutable loading configuration- Returns:
- the revision, or
nullif it does not exist or lookup is cache-only and the cache misses - See Also:
-
getRevision
public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, SyntheticCDORevision[] synthetics) Description copied from interface:InternalCDORevisionManagerLoads one revision through the canonical configuration-based path.- Specified by:
getRevisionin interfaceInternalCDORevisionManager- Parameters:
id- the ID of the requested objectbranchPoint- the branch point at which to load the revisionconfig- the immutable loading optionssynthetics- an optional array through which a synthetic revision is supplied- Returns:
- the revision, or
nullif it does not exist or lookup is cache-only and the cache misses
-
getRevisions
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config) Description copied from interface:CDORevisionManagerLoads revisions using the canonical request configuration. Options that do not apply to this operation are ignored.- Specified by:
getRevisionsin interfaceCDORevisionManager- Parameters:
ids- the IDs of the requested objectsbranchPoint- the branch point at which to load the revisionsconfig- the immutable loading configuration- Returns:
- the requested revisions, with
nullentries for revisions that could not be found - See Also:
-
getRevisions
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, SyntheticCDORevision[] synthetics) Description copied from interface:InternalCDORevisionManagerLoads revisions through the canonical configuration-based path. Synthetic revisions are a result channel and are deliberately kept separate from the request configuration.- Specified by:
getRevisionsin interfaceInternalCDORevisionManager- Parameters:
ids- the IDs of the requested objectsbranchPoint- the branch point at which to load the revisionsconfig- the immutable loading optionssynthetics- an optional array through which synthetic revisions are supplied- Returns:
- the requested revisions, with
nullentries for revisions that could not be found
-
getRevisions
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, List<CDORevision> additionalRevisions) Description copied from interface:CDORevisionManagerLoads revisions using the canonical request configuration and collects additionally prefetched revisions in the supplied result channel. Options that do not apply to this operation are ignored.- Specified by:
getRevisionsin interfaceCDORevisionManager- Parameters:
ids- the IDs of the requested objectsbranchPoint- the branch point at which to load the revisionsconfig- the immutable loading configurationadditionalRevisions- the optional result channel for additionally prefetched revisions- Returns:
- the requested revisions, with
nullentries for revisions that could not be found - See Also:
-
getRevisions
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, CDORevisionManager.Request.Config config, SyntheticCDORevision[] synthetics, List<CDORevision> additionalRevisions) Description copied from interface:InternalCDORevisionManagerLoads revisions through the canonical configuration-based path, preserving both result channels separately from the request configuration.- Specified by:
getRevisionsin interfaceInternalCDORevisionManager- Parameters:
ids- the IDs of the requested objectsbranchPoint- the branch point at which to load the revisionsconfig- the immutable loading optionssynthetics- an optional array through which synthetic revisions are suppliedadditionalRevisions- an optional list for revisions prefetched in addition to the requested revisions- Returns:
- the requested revisions, with
nullentries for revisions that could not be found
-
getRevisionByVersion
public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, CDORevisionManager.Request.Config config) Description copied from interface:InternalCDORevisionManagerLoads a revision by version through the canonical configuration-based path.- Specified by:
getRevisionByVersionin interfaceCDORevisionManager- Specified by:
getRevisionByVersionin interfaceInternalCDORevisionManager- Parameters:
id- the ID of the requested objectbranchVersion- the branch version at which to load the revisionconfig- the immutable loading options- Returns:
- the revision, or
nullif it does not exist or lookup is cache-only and the cache misses - See Also:
-
getBaseRevision
public InternalCDORevision getBaseRevision(CDORevision revision, CDORevisionManager.Request.Config config) Description copied from interface:InternalCDORevisionManagerLoads the base revision using the canonical configuration-based path.- Specified by:
getBaseRevisionin interfaceInternalCDORevisionManager- Parameters:
revision- the revision whose base revision is requestedconfig- the immutable loading options- Returns:
- the base revision, or
nullif it does not exist or lookup is cache-only and the cache misses
-
prefetchRevisions
public void prefetchRevisions(CDOID id, CDOBranchPoint branchPoint, int prefetchDepth, boolean prefetchLockStates, Consumer<CDORevision> consumer) - Specified by:
prefetchRevisionsin interfaceInternalCDORevisionManager
-
handleRevisions
public void handleRevisions(EClass eClass, CDOBranch branch, boolean exactBranch, long timeStamp, boolean exactTime, CDORevisionHandler handler) - Specified by:
handleRevisionsin interfaceCDORevisionManager
-
reviseLatest
Description copied from interface:InternalCDORevisionManagerCalled on client via postCommit when there is no version of detached objects available.- Specified by:
reviseLatestin interfaceInternalCDORevisionManager
-
reviseVersion
- Specified by:
reviseVersionin interfaceInternalCDORevisionManager
-
doActivate
- Overrides:
doActivatein classorg.eclipse.net4j.util.lifecycle.Lifecycle- Throws:
Exception
-
doDeactivate
- Overrides:
doDeactivatein classorg.eclipse.net4j.util.lifecycle.Lifecycle- Throws:
Exception
-
isDelegatingLifecycle
protected boolean isDelegatingLifecycle() -
getDelegate
-
getBaseRevision
@Deprecated public InternalCDORevision getBaseRevision(CDORevision revision, int referenceChunk, boolean loadOnDemand) Deprecated.- Specified by:
getBaseRevisionin interfaceInternalCDORevisionManager
-
getRevisionByVersion
@Deprecated public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand) Deprecated.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 criterion for a consistent graph of multiple revisions.
- Specified by:
getRevisionByVersionin interfaceCDORevisionManager- Specified by:
getRevisionByVersionin interfaceInternalCDORevisionManager- Parameters:
referenceChunk- 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:
-
getRevision
@Deprecated public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand) Deprecated.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 interfaceInternalCDORevisionManager- Parameters:
referenceChunk- 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:
-
getRevision
@Deprecated public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) Deprecated.- Specified by:
getRevisionin interfaceInternalCDORevisionManager
-
getRevisions
@Deprecated public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand) Deprecated.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 interfaceCDORevisionManager- Parameters:
referenceChunk- 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:
-
getRevisions
@Deprecated public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics) Deprecated.- Specified by:
getRevisionsin interfaceInternalCDORevisionManager
-
getRevisions
@Deprecated public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean prefetchLockStates, boolean loadOnDemand, SyntheticCDORevision[] synthetics) Deprecated.- Specified by:
getRevisionsin interfaceInternalCDORevisionManager
-
getRevisions
@Deprecated public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, List<CDORevision> additionalRevisions) Deprecated.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 interfaceCDORevisionManager- Parameters:
referenceChunk- 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.additionalRevisions- If non-null, a list to add additionally prefetched revisions to.- Since:
- 4.15
- See Also:
-