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

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.Store
All Implemented Interfaces:
IStore, 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:
LongIDStore

public abstract class Store
extends org.eclipse.net4j.util.lifecycle.Lifecycle
implements IStore

Since:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.cdo.server.IStore
IStore.ChangeFormat, IStore.RevisionParallelism, IStore.RevisionTemporality
 
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
protected static long CRASHED
           
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
Store(java.lang.String type, java.util.Set<IStore.ChangeFormat> supportedChangeFormats, java.util.Set<IStore.RevisionTemporality> supportedRevisionTemporalities, java.util.Set<IStore.RevisionParallelism> supportedRevisionParallelisms)
           
 
Method Summary
static IStoreAccessor.QueryResourcesContext.ExactMatch createExactMatchContext(CDOID folderID, java.lang.String name, long timeStamp)
           
protected abstract  IStoreAccessor createReader(ISession session)
          Creates and returns a new IStoreAccessor instance.
protected abstract  IStoreAccessor createWriter(ITransaction transaction)
          Creates and returns a new IStoreAccessor instance.
 org.eclipse.net4j.util.om.monitor.ProgressDistributor getIndicatingCommitDistributor()
           
 long getLastMetaID()
           
 CDOIDMetaRange getNextMetaIDRange(int count)
           
 IStoreAccessor getReader(ISession session)
          Returns a reader that can be used to read from this store in the context of the given session.
protected abstract  StoreAccessorPool getReaderPool(ISession session, boolean forReleasing)
          Returns a pool that may contain IStoreAccessor instances that are compatible with the given session.
 IRepository getRepository()
           
 IStore.RevisionParallelism getRevisionParallelism()
           
 IStore.RevisionTemporality getRevisionTemporality()
           
 java.util.Set<IStore.ChangeFormat> getSupportedChangeFormats()
           
 java.util.Set<IStore.RevisionParallelism> getSupportedRevisionParallelisms()
           
 java.util.Set<IStore.RevisionTemporality> getSupportedRevisionTemporalities()
           
 java.lang.String getType()
           
 IStoreAccessor getWriter(ITransaction transaction)
          Returns a writer that can be used to write to this store in the context of the given view.
protected abstract  StoreAccessorPool getWriterPool(IView view, boolean forReleasing)
          Returns a pool that may contain IStoreAccessor instances that are compatible with the given session.
protected  void releaseAccessor(StoreAccessor accessor)
           
protected static
<T> java.util.Set<T>
set(T... elements)
           
 void setLastMetaID(long lastMetaID)
           
 void setRepository(IRepository repository)
          Internal.
 void setRevisionParallelism(IStore.RevisionParallelism revisionParallelism)
           
 void setRevisionTemporality(IStore.RevisionTemporality revisionTemporality)
           
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, 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.IStore
getCDOIDLibraryDescriptor, getCDOIDLibraryProvider, getCDOIDObjectFactory, getCreationTime, isFirstTime
 

Field Detail

CRASHED

protected static final long CRASHED
See Also:
Constant Field Values
Constructor Detail

Store

public Store(java.lang.String type,
             java.util.Set<IStore.ChangeFormat> supportedChangeFormats,
             java.util.Set<IStore.RevisionTemporality> supportedRevisionTemporalities,
             java.util.Set<IStore.RevisionParallelism> supportedRevisionParallelisms)
Method Detail

getType

public java.lang.String getType()
Specified by:
getType in interface IStore

getRepository

public IRepository getRepository()
Specified by:
getRepository in interface IStore

setRepository

public void setRepository(IRepository repository)
Description copied from interface: IStore
Internal.

Specified by:
setRepository in interface IStore

getSupportedChangeFormats

public java.util.Set<IStore.ChangeFormat> getSupportedChangeFormats()
Specified by:
getSupportedChangeFormats in interface IStore

getSupportedRevisionTemporalities

public java.util.Set<IStore.RevisionTemporality> getSupportedRevisionTemporalities()
Specified by:
getSupportedRevisionTemporalities in interface IStore

getSupportedRevisionParallelisms

public java.util.Set<IStore.RevisionParallelism> getSupportedRevisionParallelisms()
Specified by:
getSupportedRevisionParallelisms in interface IStore

getRevisionTemporality

public IStore.RevisionTemporality getRevisionTemporality()
Specified by:
getRevisionTemporality in interface IStore

setRevisionTemporality

public void setRevisionTemporality(IStore.RevisionTemporality revisionTemporality)
Specified by:
setRevisionTemporality in interface IStore

getRevisionParallelism

public IStore.RevisionParallelism getRevisionParallelism()
Specified by:
getRevisionParallelism in interface IStore

setRevisionParallelism

public void setRevisionParallelism(IStore.RevisionParallelism revisionParallelism)
Specified by:
setRevisionParallelism in interface IStore

getLastMetaID

public long getLastMetaID()

setLastMetaID

public void setLastMetaID(long lastMetaID)

getNextMetaIDRange

public CDOIDMetaRange getNextMetaIDRange(int count)
Specified by:
getNextMetaIDRange in interface IStore

getReader

public IStoreAccessor getReader(ISession session)
Description copied from interface: IStore
Returns a reader that can be used to read from this store in the context of the given session.

Specified by:
getReader in interface IStore
Parameters:
session - The session that should be used as a context for read access or null. The store implementor is free to interpret and use the session in a manner suitable for him or ignore it at all. It is meant only as a hint. Implementor can use it as a key into a cache and/or register a LifecycleEventAdapter with it to intercept cleanup on session close. Note however that the session can be null, for example during startup of the server while the repositories are initialized but before any user session has been opened.
Returns:
a reader that can be used to read from this store in the context of the given session, never null.

getWriter

public IStoreAccessor getWriter(ITransaction transaction)
Description copied from interface: IStore
Returns a writer that can be used to write to this store in the context of the given view. The given view is always marked as a transaction.

Specified by:
getWriter in interface IStore
Parameters:
transaction - The view that must be used as a context for write access. The store implementor is free to interpret and use the view in a manner suitable for him or ignore it at all. It is meant only as a hint. Implementor can use it as a key into a cache and/or register a LifecycleEventAdapter with it to intercept cleanup on view close.
Returns:
a writer that can be used to write to this store in the context of the given view, never null.

getIndicatingCommitDistributor

public org.eclipse.net4j.util.om.monitor.ProgressDistributor getIndicatingCommitDistributor()
Specified by:
getIndicatingCommitDistributor in interface IStore

releaseAccessor

protected void releaseAccessor(StoreAccessor accessor)

getReaderPool

protected abstract StoreAccessorPool getReaderPool(ISession session,
                                                   boolean forReleasing)
Returns a pool that may contain IStoreAccessor instances that are compatible with the given session. The implementor may return null to indicate that no pooling occurs. It's also left to the implementors choice how to determine the appropriate pool instance to be used for the given session, for example it could always return the same pool instance, regardless of the given session.

If the implementor of this method decides to create pools that are only compatible with certain sessions or views, then it is his responsibility to listen to REMOVED events sent by either the ISessionManager (indicating that a session is closed) or any of its sessions (indicating that a view is closed). Note: Closing a session implies that all contained views are closed sliently without firing respective events!

Parameters:
session - The context which the pool must be compatible with. Must not be null.
forReleasing - Enables lazy pool creation. The implementor is not supposed to create a new pool if false is passed. If true is passed it's up to the implementor whether to create a new pool or not.

getWriterPool

protected abstract StoreAccessorPool getWriterPool(IView view,
                                                   boolean forReleasing)
Returns a pool that may contain IStoreAccessor instances that are compatible with the given session. The implementor may return null to indicate that no pooling occurs. It's also left to the implementors choice how to determine the appropriate pool instance to be used for the given session, for example it could always return the same pool instance, regardless of the given session.

If the implementor of this method decides to create pools that are only compatible with certain sessions or views, then it is his responsibility to listen to REMOVED events sent by either the ISessionManager (indicating that a session is closed) or any of its sessions (indicating that a view is closed). Note: Closing a session implies that all contained views are closed sliently without firing respective events!

Parameters:
view - The context which the pool must be compatible with. Must not be null.
forReleasing - Enables lazy pool creation. The implementor is not supposed to create a new pool if false is passed. If true is passed it's up to the implementor whether to create a new pool or not.

createReader

protected abstract IStoreAccessor createReader(ISession session)
Creates and returns a new IStoreAccessor instance. The caller of this method is responsible for activating the new instance.


createWriter

protected abstract IStoreAccessor createWriter(ITransaction transaction)
Creates and returns a new IStoreAccessor instance. The caller of this method is responsible for activating the new instance.


createExactMatchContext

public static IStoreAccessor.QueryResourcesContext.ExactMatch createExactMatchContext(CDOID folderID,
                                                                                      java.lang.String name,
                                                                                      long timeStamp)

set

protected static <T> java.util.Set<T> set(T... elements)

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