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
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.RevisionLoader3, InternalCDORevisionManager.RevisionLocker
-
-
Constructor Summary
Constructors Constructor Description DelegatingCDORevisionManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addRevision(CDORevision revision)
Deprecated.boolean
containsRevision(CDOID id, CDOBranchPoint branchPoint)
Returnstrue
if therevision cache
contains arevision
with the givenID
at the givenbranch point
(branch + timestamp),false
otherwise.boolean
containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)
Returnstrue
if therevision cache
contains arevision
with the givenID
at the givenbranch version
(branch + version),false
otherwise.protected void
doActivate()
protected void
doDeactivate()
InternalCDORevision
getBaseRevision(CDORevision revision, int referenceChunk, boolean loadOnDemand)
InternalCDORevisionCache
getCache()
protected abstract InternalCDORevisionManager
getDelegate()
CDORevisionFactory
getFactory()
CDOBranchPointRange
getObjectLifetime(CDOID id, CDOBranchPoint branchPoint)
org.eclipse.emf.ecore.EClass
getObjectType(CDOID id)
Returns thetype
of an object if a revision for that object is in the revision cache,null
otherwise.org.eclipse.emf.ecore.EClass
getObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand)
Returns thetype
of an object.InternalCDORevision
getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
Returns therevision
with the givenID
at the givenbranch point
(branch + timestamp), optionally demand loading it if it is not already in thecache
.InternalCDORevision
getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
InternalCDORevision
getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)
Returns therevision
with the givenID
at the givenbranch version
(branch + version), optionally demand loading it if it is not already in thecache
.InternalCDORevisionManager.RevisionLoader
getRevisionLoader()
InternalCDORevisionManager.RevisionLocker
getRevisionLocker()
java.util.List<CDORevision>
getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
Returns therevisions
with the givenIDs
at 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 prefetchLockStates, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
java.util.List<CDORevision>
getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, java.util.List<CDORevision> additionalRevisions)
Returns therevisions
with the givenIDs
at 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)
void
handleRevisions(org.eclipse.emf.ecore.EClass eClass, CDOBranch branch, boolean exactBranch, long timeStamp, boolean exactTime, CDORevisionHandler handler)
CDORevision
internRevision(CDORevision revision)
Interns the given revision and returns either the given revision or a revision with the samekey
that was interned previously.protected boolean
isDelegatingLifecycle()
boolean
isSupportingAudits()
boolean
isSupportingBranches()
void
prefetchRevisions(CDOID id, CDOBranchPoint branchPoint, int prefetchDepth, boolean prefetchLockStates, java.util.function.Consumer<CDORevision> consumer)
void
reviseLatest(CDOID id, CDOBranch branch)
Called on client via postCommit when there is no version of detached objects available.void
reviseVersion(CDOID id, CDOBranchVersion branchVersion, long timeStamp)
void
setCache(CDORevisionCache cache)
void
setFactory(CDORevisionFactory factory)
void
setRevisionLoader(InternalCDORevisionManager.RevisionLoader revisionLoader)
void
setRevisionLocker(InternalCDORevisionManager.RevisionLocker revisionLocker)
void
setSupportingAudits(boolean on)
void
setSupportingBranches(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
-
-
-
-
Method Detail
-
getCache
public InternalCDORevisionCache getCache()
- Specified by:
getCache
in interfaceInternalCDORevisionManager
-
setCache
public void setCache(CDORevisionCache cache)
- Specified by:
setCache
in interfaceInternalCDORevisionManager
- Since:
- 4.0
-
setFactory
public void setFactory(CDORevisionFactory factory)
- Specified by:
setFactory
in interfaceInternalCDORevisionManager
-
getFactory
public CDORevisionFactory getFactory()
- Specified by:
getFactory
in interfaceInternalCDORevisionManager
-
getRevisionLoader
public InternalCDORevisionManager.RevisionLoader getRevisionLoader()
- Specified by:
getRevisionLoader
in interfaceInternalCDORevisionManager
-
setRevisionLoader
public void setRevisionLoader(InternalCDORevisionManager.RevisionLoader revisionLoader)
- Specified by:
setRevisionLoader
in interfaceInternalCDORevisionManager
-
getRevisionLocker
public InternalCDORevisionManager.RevisionLocker getRevisionLocker()
- Specified by:
getRevisionLocker
in interfaceInternalCDORevisionManager
-
setRevisionLocker
public void setRevisionLocker(InternalCDORevisionManager.RevisionLocker revisionLocker)
- Specified by:
setRevisionLocker
in interfaceInternalCDORevisionManager
-
isSupportingAudits
public boolean isSupportingAudits()
- Specified by:
isSupportingAudits
in interfaceInternalCDORevisionManager
- Since:
- 4.0
-
setSupportingAudits
public void setSupportingAudits(boolean on)
- Specified by:
setSupportingAudits
in interfaceInternalCDORevisionManager
- Since:
- 4.0
-
isSupportingBranches
public boolean isSupportingBranches()
- Specified by:
isSupportingBranches
in interfaceInternalCDORevisionManager
-
setSupportingBranches
public void setSupportingBranches(boolean on)
- Specified by:
setSupportingBranches
in interfaceInternalCDORevisionManager
-
addRevision
@Deprecated public void addRevision(CDORevision revision)
Deprecated.Description copied from interface:CDORevisionCacheAdder
Adds the given revision to this cache.- Specified by:
addRevision
in interfaceCDORevisionCacheAdder
- Specified by:
addRevision
in interfaceInternalCDORevisionManager
- Since:
- 4.0
-
internRevision
public CDORevision internRevision(CDORevision revision)
Description copied from interface:CDORevisionInterner
Interns the given revision and returns either the given revision or a revision with the samekey
that 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:
internRevision
in interfaceCDORevisionInterner
-
containsRevision
public boolean containsRevision(CDOID id, CDOBranchPoint branchPoint)
Description copied from interface:CDORevisionManager
Returnstrue
if therevision cache
contains arevision
with the givenID
at the givenbranch point
(branch + timestamp),false
otherwise.
-
containsRevisionByVersion
public boolean containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)
Description copied from interface:CDORevisionManager
Returnstrue
if therevision cache
contains arevision
with the givenID
at the givenbranch version
(branch + version),false
otherwise.- Specified by:
containsRevisionByVersion
in interfaceCDORevisionManager
- See Also:
CDORevisionManager.getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
-
getObjectType
public org.eclipse.emf.ecore.EClass getObjectType(CDOID id)
Description copied from interface:CDORevisionManager
Returns thetype
of an object if a revision for that object is in the revision cache,null
otherwise.Same as calling
getObjectType(id, null)
.- Specified by:
getObjectType
in interfaceCDORevisionManager
- See Also:
EObject.eClass()
,CDORevisionManager.getObjectType(CDOID, CDOBranchManager)
-
getObjectType
public org.eclipse.emf.ecore.EClass getObjectType(CDOID id, CDOBranchManager branchManagerForLoadOnDemand)
Description copied from interface:CDORevisionManager
Returns thetype
of an object.If no revision for that object is found in the revision cache the following is tried:
- If
branchManagerForLoadOnDemand
is notnull
the first revision of the object in the main branch is loaded from the server and its type is returned. - Otherwise (i.e., if
branchManagerForLoadOnDemand
isnull
or the object does not exist)null
is returned.
A
branch manager
is 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 branch
while demand-loading.- Specified by:
getObjectType
in interfaceCDORevisionManager
- See Also:
EObject.eClass()
,CDORevisionManager.getObjectType(CDOID)
- If
-
getObjectLifetime
public CDOBranchPointRange getObjectLifetime(CDOID id, CDOBranchPoint branchPoint)
- Specified by:
getObjectLifetime
in interfaceCDORevisionManager
-
getBaseRevision
public InternalCDORevision getBaseRevision(CDORevision revision, int referenceChunk, boolean loadOnDemand)
- Specified by:
getBaseRevision
in interfaceInternalCDORevisionManager
-
getRevisionByVersion
public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)
Description copied from interface:CDORevisionManager
Returns therevision
with the givenID
at 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:
getRevisionByVersion
in interfaceCDORevisionManager
- Specified by:
getRevisionByVersion
in interfaceInternalCDORevisionManager
referenceChunk
- The number of targetIDs
to load for each many-valued reference in the returned revision, orCDORevision.UNCHUNKED
for 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 ornull
is 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:CDORevisionManager
Returns therevision
with the givenID
at the givenbranch point
(branch + timestamp), optionally demand loading it if it is not already in thecache
.- Specified by:
getRevision
in interfaceCDORevisionManager
- Specified by:
getRevision
in interfaceInternalCDORevisionManager
referenceChunk
- The number of targetIDs
to load for each many-valued reference in the returned revision, orCDORevision.UNCHUNKED
for 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_INFINITE
to prefetch all contained revisions orCDORevision.DEPTH_NONE
to 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 ornull
is 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:
getRevision
in 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:CDORevisionManager
Returns therevisions
with the givenIDs
at the givenbranch point
(branch + timestamp), optionally demand loading them if they are not already in thecache
.- Specified by:
getRevisions
in interfaceCDORevisionManager
referenceChunk
- The number of targetIDs
to load for each many-valued reference in the returned revisions, orCDORevision.UNCHUNKED
for 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_INFINITE
to prefetch all contained revisions orCDORevision.DEPTH_NONE
to 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 ornull
is 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:
getRevisions
in interfaceInternalCDORevisionManager
-
getRevisions
public java.util.List<CDORevision> getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean prefetchLockStates, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
- Specified by:
getRevisions
in interfaceInternalCDORevisionManager
-
getRevisions
public java.util.List<CDORevision> getRevisions(java.util.List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, java.util.List<CDORevision> additionalRevisions)
Description copied from interface:CDORevisionManager
Returns therevisions
with the givenIDs
at the givenbranch point
(branch + timestamp), optionally demand loading them if they are not already in thecache
.- Specified by:
getRevisions
in interfaceCDORevisionManager
referenceChunk
- The number of targetIDs
to load for each many-valued reference in the returned revisions, orCDORevision.UNCHUNKED
for 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_INFINITE
to prefetch all contained revisions orCDORevision.DEPTH_NONE
to 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 ornull
is placed in the list that is returned.additionalRevisions
- If non-null
, a list to add additionally prefetched revisions to.- Since:
- 4.15
- See Also:
CDORevisionManager.getRevision(CDOID, CDOBranchPoint, int, int, boolean)
-
prefetchRevisions
public void prefetchRevisions(CDOID id, CDOBranchPoint branchPoint, int prefetchDepth, boolean prefetchLockStates, java.util.function.Consumer<CDORevision> consumer)
- Specified by:
prefetchRevisions
in interfaceInternalCDORevisionManager
-
handleRevisions
public void handleRevisions(org.eclipse.emf.ecore.EClass eClass, CDOBranch branch, boolean exactBranch, long timeStamp, boolean exactTime, CDORevisionHandler handler)
- Specified by:
handleRevisions
in interfaceCDORevisionManager
-
reviseLatest
public void reviseLatest(CDOID id, CDOBranch branch)
Description copied from interface:InternalCDORevisionManager
Called on client via postCommit when there is no version of detached objects available.- Specified by:
reviseLatest
in interfaceInternalCDORevisionManager
-
reviseVersion
public void reviseVersion(CDOID id, CDOBranchVersion branchVersion, long timeStamp)
- Specified by:
reviseVersion
in interfaceInternalCDORevisionManager
-
doActivate
protected void doActivate() throws java.lang.Exception
- Overrides:
doActivate
in classorg.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
java.lang.Exception
-
doDeactivate
protected void doDeactivate() throws java.lang.Exception
- Overrides:
doDeactivate
in classorg.eclipse.net4j.util.lifecycle.Lifecycle
- Throws:
java.lang.Exception
-
isDelegatingLifecycle
protected boolean isDelegatingLifecycle()
-
getDelegate
protected abstract InternalCDORevisionManager getDelegate()
-
-