public abstract class DelegatingCDORevisionManager extends Lifecycle implements InternalCDORevisionManager
InternalCDORevisionManager.RevisionLoader, InternalCDORevisionManager.RevisionLoader2, InternalCDORevisionManager.RevisionLocker
ILifecycle.DeferrableActivation
Constructor and Description |
---|
DelegatingCDORevisionManager() |
Modifier and Type | Method and Description |
---|---|
void |
addRevision(CDORevision revision)
Adds the given revision to this cache.
|
boolean |
containsRevision(CDOID id,
CDOBranchPoint branchPoint)
Returns
true if the revision cache contains a revision
with the given ID at the given branch point (branch + timestamp),
false otherwise. |
boolean |
containsRevisionByVersion(CDOID id,
CDOBranchVersion branchVersion)
Returns
true if the revision cache contains a revision
with the given ID at the given branch version (branch + version),
false otherwise. |
protected void |
doActivate() |
protected void |
doDeactivate() |
InternalCDORevisionCache |
getCache() |
protected abstract InternalCDORevisionManager |
getDelegate() |
CDORevisionFactory |
getFactory() |
EClass |
getObjectType(CDOID id)
Returns the
type of an object if a revision for that object is in the revision
cache, null otherwise. |
InternalCDORevision |
getRevision(CDOID id,
CDOBranchPoint branchPoint,
int referenceChunk,
int prefetchDepth,
boolean loadOnDemand)
Returns the
revision with the given ID at the given branch
point (branch + timestamp), optionally demand loading it if it is not already in the cache . |
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 the
revision with the given ID at the given branch version (branch + version), optionally demand loading it if it is not already in the
cache . |
InternalCDORevisionManager.RevisionLoader |
getRevisionLoader() |
InternalCDORevisionManager.RevisionLocker |
getRevisionLocker() |
List<CDORevision> |
getRevisions(List<CDOID> ids,
CDOBranchPoint branchPoint,
int referenceChunk,
int prefetchDepth,
boolean loadOnDemand)
Returns the
revisions with the given IDs at the given branch point (branch + timestamp), optionally demand loading them if they are not already in the
cache . |
List<CDORevision> |
getRevisions(List<CDOID> ids,
CDOBranchPoint branchPoint,
int referenceChunk,
int prefetchDepth,
boolean loadOnDemand,
SyntheticCDORevision[] synthetics) |
protected boolean |
isDelegatingLifecycle() |
boolean |
isSupportingAudits() |
boolean |
isSupportingBranches() |
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) |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getObjectLifetime, getObjectType, handleRevisions
activate, deactivate, getLifecycleState, isActive
addListener, getListeners, hasListeners, removeListener
public InternalCDORevisionCache getCache()
getCache
in interface InternalCDORevisionManager
public void setCache(CDORevisionCache cache)
setCache
in interface InternalCDORevisionManager
public void setFactory(CDORevisionFactory factory)
setFactory
in interface InternalCDORevisionManager
public CDORevisionFactory getFactory()
getFactory
in interface InternalCDORevisionManager
public InternalCDORevisionManager.RevisionLoader getRevisionLoader()
getRevisionLoader
in interface InternalCDORevisionManager
public void setRevisionLoader(InternalCDORevisionManager.RevisionLoader revisionLoader)
setRevisionLoader
in interface InternalCDORevisionManager
public InternalCDORevisionManager.RevisionLocker getRevisionLocker()
getRevisionLocker
in interface InternalCDORevisionManager
public void setRevisionLocker(InternalCDORevisionManager.RevisionLocker revisionLocker)
setRevisionLocker
in interface InternalCDORevisionManager
public boolean isSupportingAudits()
isSupportingAudits
in interface InternalCDORevisionManager
public void setSupportingAudits(boolean on)
setSupportingAudits
in interface InternalCDORevisionManager
public boolean isSupportingBranches()
isSupportingBranches
in interface InternalCDORevisionManager
public void setSupportingBranches(boolean on)
setSupportingBranches
in interface InternalCDORevisionManager
public void addRevision(CDORevision revision)
CDORevisionCacheAdder
addRevision
in interface CDORevisionCacheAdder
public boolean containsRevision(CDOID id, CDOBranchPoint branchPoint)
CDORevisionManager
true
if the revision cache
contains a revision
with the given ID
at the given branch point
(branch + timestamp),
false
otherwise.public boolean containsRevisionByVersion(CDOID id, CDOBranchVersion branchVersion)
CDORevisionManager
true
if the revision cache
contains a revision
with the given ID
at the given branch version
(branch + version),
false
otherwise.containsRevisionByVersion
in interface CDORevisionManager
CDORevisionManager.getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
public EClass getObjectType(CDOID id)
CDORevisionManager
type
of an object if a revision for that object is in the revision
cache, null
otherwise.
Same as calling getObjectType(id, null)
.
getObjectType
in interface CDORevisionManager
EObject.eClass()
,
CDORevisionManager.getObjectType(CDOID, CDOBranchManager)
public InternalCDORevision getRevisionByVersion(CDOID id, CDOBranchVersion branchVersion, int referenceChunk, boolean loadOnDemand)
CDORevisionManager
revision
with the given ID
at the given branch version
(branch + version), optionally demand loading it if it is not already in the
cache
.
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.
getRevisionByVersion
in interface CDORevisionManager
getRevisionByVersion
in interface InternalCDORevisionManager
referenceChunk
- The number of target IDs
to load for each many-valued reference in the returned revision, or
CDORevision.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 or null
is returned.CDORevisionManager.getRevision(CDOID, CDOBranchPoint, int, int, boolean)
public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
CDORevisionManager
revision
with the given ID
at the given branch
point
(branch + timestamp), optionally demand loading it if it is not already in the cache
.getRevision
in interface CDORevisionManager
getRevision
in interface InternalCDORevisionManager
referenceChunk
- The number of target IDs
to load for each many-valued reference in the returned revision, or
CDORevision.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
constants CDORevision.DEPTH_INFINITE
to prefetch all contained revisions or
CDORevision.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 or null
is returned.CDORevisionManager.getRevisions(List, CDOBranchPoint, int, int, boolean)
,
CDORevisionManager.getRevisionByVersion(CDOID, CDOBranchVersion, int, boolean)
public InternalCDORevision getRevision(CDOID id, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
getRevision
in interface InternalCDORevisionManager
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand)
CDORevisionManager
revisions
with the given IDs
at the given branch point
(branch + timestamp), optionally demand loading them if they are not already in the
cache
.getRevisions
in interface CDORevisionManager
referenceChunk
- The number of target IDs
to load for each many-valued reference in the returned revisions,
or CDORevision.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
constants CDORevision.DEPTH_INFINITE
to prefetch all contained revisions or
CDORevision.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 or null
is placed in
the list that is returned.CDORevisionManager.getRevision(CDOID, CDOBranchPoint, int, int, boolean)
public List<CDORevision> getRevisions(List<CDOID> ids, CDOBranchPoint branchPoint, int referenceChunk, int prefetchDepth, boolean loadOnDemand, SyntheticCDORevision[] synthetics)
getRevisions
in interface InternalCDORevisionManager
public void reviseLatest(CDOID id, CDOBranch branch)
InternalCDORevisionManager
reviseLatest
in interface InternalCDORevisionManager
public void reviseVersion(CDOID id, CDOBranchVersion branchVersion, long timeStamp)
reviseVersion
in interface InternalCDORevisionManager
protected void doActivate() throws Exception
doActivate
in class Lifecycle
Exception
protected void doDeactivate() throws Exception
doDeactivate
in class Lifecycle
Exception
protected boolean isDelegatingLifecycle()
protected abstract InternalCDORevisionManager getDelegate()
Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html