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

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.StoreAccessor
All Implemented Interfaces:
IQueryHandlerProvider, IStoreAccessor, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.event.INotifier.Introspection, org.eclipse.net4j.util.lifecycle.ILifecycle, org.eclipse.net4j.util.lifecycle.ILifecycle.Introspection
Direct Known Subclasses:
LongIDStoreAccessor

public abstract class StoreAccessor
extends org.eclipse.net4j.util.lifecycle.Lifecycle
implements IStoreAccessor

Since:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.IStoreAccessor
IStoreAccessor.AdditionalRevisionCache, IStoreAccessor.CommitContext, IStoreAccessor.QueryResourcesContext
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
org.eclipse.net4j.util.lifecycle.ILifecycle.Introspection
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.Introspection
 
Field Summary
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
protected StoreAccessor(Store store, ISession session)
           
protected StoreAccessor(Store store, ITransaction transaction)
           
 
Method Summary
protected abstract  void addIDMappings(IStoreAccessor.CommitContext context, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
          Add ID mappings for all new objects of a transaction to the commit context.
protected abstract  void detachObjects(CDOID[] detachedObjects, long revised, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
           
protected abstract  void doActivate()
           
protected abstract  void doDeactivate()
           
protected abstract  void doPassivate()
           
protected abstract  void doUnpassivate()
           
 ISession 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.
 CDOID readResourceID(CDOID folderID, java.lang.String name, long timeStamp)
          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(CommitContext, OMMonitor) and IStoreAccessor.rollback() could be called from different threads.
protected abstract  void rollback(IStoreAccessor.CommitContext commitContext)
           
 InternalCDORevision verifyRevision(InternalCDORevision revision)
           
 void write(IStoreAccessor.CommitContext context, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
          Called before committing.
protected abstract  void writeRevisionDeltas(InternalCDORevisionDelta[] revisionDeltas, long created, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
           
protected abstract  void writeRevisions(InternalCDORevision[] revisions, org.eclipse.net4j.util.om.monitor.OMMonitor monitor)
           
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, getListeners, getNotificationExecutorService, hasListeners, listenersEmptyChanged, 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
commit, createChunkReader, loadPackageUnit, queryResources, readPackageUnits, readRevision, readRevisionByTime, readRevisionByVersion, refreshRevisions, writePackageUnits
 
Methods inherited from interface org.eclipse.emf.cdo.server.IQueryHandlerProvider
getQueryHandler
 

Constructor Detail

StoreAccessor

protected StoreAccessor(Store store,
                        ISession session)

StoreAccessor

protected StoreAccessor(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 ISession getSession()
Description copied from interface: IStoreAccessor
Returns the session this accessor is associated with.

Specified by:
getSession in interface IStoreAccessor

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

readResourceID

public CDOID readResourceID(CDOID folderID,
                            java.lang.String name,
                            long timeStamp)
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

verifyRevision

public InternalCDORevision verifyRevision(InternalCDORevision revision)
Specified by:
verifyRevision in interface IStoreAccessor

write

public void write(IStoreAccessor.CommitContext context,
                  org.eclipse.net4j.util.om.monitor.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(CommitContext, OMMonitor).

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

Specified by:
write in interface IStoreAccessor

rollback

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

Specified by:
rollback in interface IStoreAccessor

rollback

protected abstract void rollback(IStoreAccessor.CommitContext commitContext)

release

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

addIDMappings

protected abstract void addIDMappings(IStoreAccessor.CommitContext context,
                                      org.eclipse.net4j.util.om.monitor.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 CommitContext#addIDMapping(CDOIDTemp, CDOID).


writeRevisions

protected abstract void writeRevisions(InternalCDORevision[] revisions,
                                       org.eclipse.net4j.util.om.monitor.OMMonitor monitor)

writeRevisionDeltas

protected abstract void writeRevisionDeltas(InternalCDORevisionDelta[] revisionDeltas,
                                            long created,
                                            org.eclipse.net4j.util.om.monitor.OMMonitor monitor)

detachObjects

protected abstract void detachObjects(CDOID[] detachedObjects,
                                      long revised,
                                      org.eclipse.net4j.util.om.monitor.OMMonitor monitor)

doActivate

protected abstract void doActivate()
                            throws java.lang.Exception
Overrides:
doActivate in class org.eclipse.net4j.util.lifecycle.Lifecycle
Throws:
java.lang.Exception

doDeactivate

protected abstract void doDeactivate()
                              throws java.lang.Exception
Overrides:
doDeactivate in class org.eclipse.net4j.util.lifecycle.Lifecycle
Throws:
java.lang.Exception

doPassivate

protected abstract void doPassivate()
                             throws java.lang.Exception
Throws:
java.lang.Exception

doUnpassivate

protected abstract void doUnpassivate()
                               throws java.lang.Exception
Throws:
java.lang.Exception

Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
All Rights Reserved.