org.eclipse.emf.cdo.spi.server
Class StoreAccessorBase

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.lifecycle.Lifecycle
          extended by org.eclipse.emf.cdo.spi.server.StoreAccessorBase
All Implemented Interfaces:
IQueryHandlerProvider, IStoreAccessor, InternalCDOBranchManager.BranchLoader, InternalCDOCommitInfoManager.CommitInfoLoader, INotifier, ILifecycle, ILifecycle.DeferrableActivation
Direct Known Subclasses:
StoreAccessor

public abstract class StoreAccessorBase
extends Lifecycle
implements IStoreAccessor

If the meaning of this type isn't clear, there really should be more of a description here...

Since:
4.0

Nested Class Summary
static class StoreAccessorBase.CommitDataRevisionHandler
          If the meaning of this type isn't clear, there really should be more of a description here...
 
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.IStoreAccessor
IStoreAccessor.CommitContext, IStoreAccessor.DurableLocking, IStoreAccessor.DurableLocking2, IStoreAccessor.QueryResourcesContext, IStoreAccessor.QueryXRefsContext, IStoreAccessor.Raw
 
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader
InternalCDOBranchManager.BranchLoader.BranchInfo, InternalCDOBranchManager.BranchLoader.SubBranchInfo
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivation
 
Field Summary
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Fields inherited from interface org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader
NEW_BRANCH, NEW_LOCAL_BRANCH
 
Constructor Summary
protected StoreAccessorBase(Store store, ISession session)
           
protected StoreAccessorBase(Store store, ITransaction transaction)
           
 
Method Summary
 void addIDMappings(InternalCommitContext commitContext, OMMonitor monitor)
          Add ID mappings for all new objects of a transaction to the commit context.
 void commit(OMMonitor monitor)
          Flushes to the back-end and makes available the data for others.
protected abstract  void doCommit(OMMonitor monitor)
           
protected  void doPassivate()
           
protected abstract  void doRollback(IStoreAccessor.CommitContext commitContext)
           
protected  void doUnpassivate()
           
protected abstract  void doWrite(InternalCommitContext context, OMMonitor monitor)
           
protected abstract  CDOID getNextCDOID(CDORevision revision)
           
 InternalSession getSession()
          Returns the session this accessor is associated with.
 Store getStore()
          Returns the store this accessor is associated with.
 ITransaction getTransaction()
          Returns the transaction this accessor is associated with if IStoreAccessor.isReader() returns false, null otherwise.
 boolean isReader()
          Returns true if this accessor has been configured for read-only access to the back-end, false otherwise.
 CDOCommitData loadCommitData(long timeStamp)
           
 CDOID readResourceID(CDOID folderID, String name, CDOBranchPoint branchPoint)
          Returns the CDOID of the resource node with the given folderID and name if a resource with this folderID and name exists in the store, null otherwise.
 void release()
           
 void rollback()
          Note: IStoreAccessor.write(InternalCommitContext, OMMonitor) and IStoreAccessor.rollback() could be called from different threads.
 void write(InternalCommitContext context, OMMonitor monitor)
          Called before committing.
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, 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.server.IStoreAccessor
createChunkReader, handleLobs, handleRevisions, loadLob, loadPackageUnit, queryLobs, queryResources, queryXRefs, readChangeSet, readPackageUnits, readRevision, readRevisionByVersion, writePackageUnits
 
Methods inherited from interface org.eclipse.emf.cdo.server.IQueryHandlerProvider
getQueryHandler
 
Methods inherited from interface org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader
createBranch, loadBranch, loadBranches, loadSubBranches
 
Methods inherited from interface org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager.CommitInfoLoader
loadCommitInfos
 
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
 

Constructor Detail

StoreAccessorBase

protected StoreAccessorBase(Store store,
                            ISession session)

StoreAccessorBase

protected StoreAccessorBase(Store store,
                            ITransaction transaction)
Method Detail

getStore

public Store getStore()
Description copied from interface: IStoreAccessor
Returns the store this accessor is associated with.

Specified by:
getStore in interface IStoreAccessor

isReader

public boolean isReader()
Description copied from interface: IStoreAccessor
Returns true if this accessor has been configured for read-only access to the back-end, false otherwise.

Specified by:
isReader in interface IStoreAccessor

getSession

public InternalSession getSession()
Description copied from interface: IStoreAccessor
Returns the session this accessor is associated with.

Specified by:
getSession in interface IStoreAccessor
Since:
3.0

getTransaction

public ITransaction getTransaction()
Description copied from interface: IStoreAccessor
Returns the transaction this accessor is associated with if IStoreAccessor.isReader() returns false, null otherwise.

Specified by:
getTransaction in interface IStoreAccessor

release

public void release()
Specified by:
release in interface IStoreAccessor

write

public final void write(InternalCommitContext context,
                        OMMonitor monitor)
Description copied from interface: IStoreAccessor
Called before committing. An instance of this accessor represents an instance of a back-end transaction. Could be called multiple times before commit it called. IStoreAccessor.commit(OMMonitor) or IStoreAccessor.rollback() will be called after any numbers of IStoreAccessor.write(InternalCommitContext, OMMonitor).

Note: IStoreAccessor.write(InternalCommitContext, OMMonitor) and IStoreAccessor.commit(OMMonitor) could be called from different threads.

Specified by:
write in interface IStoreAccessor
Since:
3.0

doWrite

protected abstract void doWrite(InternalCommitContext context,
                                OMMonitor monitor)

commit

public final void commit(OMMonitor monitor)
Description copied from interface: IStoreAccessor
Flushes to the back-end and makes available the data for others.

Note: IStoreAccessor.write(InternalCommitContext, OMMonitor) and IStoreAccessor.commit(OMMonitor) could be called from different threads.

Note: Implementors should detect if dirty write occurred. In this case it should throw an exception.

 if (revision.getVersion() != revisionDelta.getOriginVersion())
 {
   throw new ConcurrentModificationException("Trying to update object " + revisionDelta.getID()
       + " that was already modified");
 }
 

Specified by:
commit in interface IStoreAccessor
Since:
3.0

doCommit

protected abstract void doCommit(OMMonitor monitor)
Since:
3.0

rollback

public final void rollback()
Description copied from interface: IStoreAccessor
Note: IStoreAccessor.write(InternalCommitContext, OMMonitor) and IStoreAccessor.rollback() could be called from different threads.

Specified by:
rollback in interface IStoreAccessor

doRollback

protected abstract void doRollback(IStoreAccessor.CommitContext commitContext)

readResourceID

public CDOID readResourceID(CDOID folderID,
                            String name,
                            CDOBranchPoint branchPoint)
Description copied from interface: IStoreAccessor
Returns the CDOID of the resource node with the given folderID and name if a resource with this folderID and name exists in the store, null otherwise.

Specified by:
readResourceID in interface IStoreAccessor
Since:
3.0

loadCommitData

public CDOCommitData loadCommitData(long timeStamp)
Specified by:
loadCommitData in interface InternalCDOCommitInfoManager.CommitInfoLoader
Since:
3.0

addIDMappings

public void addIDMappings(InternalCommitContext commitContext,
                          OMMonitor monitor)
Add ID mappings for all new objects of a transaction to the commit context. The implementor must, for each new object of the commit context, determine a permanent CDOID and make it known to the context by calling InternalCommitContext.addIDMapping(CDOID, CDOID).

Since:
3.0

getNextCDOID

protected abstract CDOID getNextCDOID(CDORevision revision)

doPassivate

protected void doPassivate()
                    throws Exception
Throws:
Exception

doUnpassivate

protected void doUnpassivate()
                      throws Exception
Throws:
Exception


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.