Package org.eclipse.emf.cdo.server
Class StoreThreadLocal
- java.lang.Object
- 
- org.eclipse.emf.cdo.server.StoreThreadLocal
 
- 
 public final class StoreThreadLocal extends java.lang.ObjectProvides server-side consumers with thestore accessorthat is valid in the context of a specificsessionduring read operations or a specificcommit contextduring write operations.- Since:
- 2.0
- Author:
- Eike Stepper
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classStoreThreadLocal.NoSessionRegisteredExceptionAnIllegalStateExceptionthat can be thrown fromgetSession().
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static IStoreAccessorgetAccessor()static IStoreAccessor.CommitContextgetCommitContext()static InternalSessiongetSession()Returns the session associated with the current thread.static booleanhasAccessor()static booleanhasCommitContext()static booleanhasSession()static voidrelease()static voidremove()static voidsetAccessor(IStoreAccessor accessor)static voidsetCommitContext(IStoreAccessor.CommitContext commitContext)static voidsetSession(InternalSession session)static java.lang.Runnablewrap(ISession session, java.lang.Runnable runnable)static <T> java.util.concurrent.Callable<T>wrap(ISession session, java.util.concurrent.Callable<T> callable)
 
- 
- 
- 
Method Detail- 
wrappublic static java.lang.Runnable wrap(ISession session, java.lang.Runnable runnable) - Since:
- 4.11
 
 - 
wrappublic static <T> java.util.concurrent.Callable<T> wrap(ISession session, java.util.concurrent.Callable<T> callable) - Since:
- 4.11
 
 - 
setSessionpublic static void setSession(InternalSession session) - Since:
- 3.0
 
 - 
getSessionpublic static InternalSession getSession() throws StoreThreadLocal.NoSessionRegisteredException Returns the session associated with the current thread.- Returns:
- Never null.
- Throws:
- java.lang.IllegalStateException- if no session is associated with the current thread.
- StoreThreadLocal.NoSessionRegisteredException
- Since:
- 3.0
 
 - 
hasSessionpublic static boolean hasSession() - Since:
- 4.2
 
 - 
setAccessorpublic static void setAccessor(IStoreAccessor accessor) 
 - 
getAccessorpublic static IStoreAccessor getAccessor() throws StoreThreadLocal.NoSessionRegisteredException 
 - 
hasAccessorpublic static boolean hasAccessor() - Since:
- 4.7
 
 - 
setCommitContextpublic static void setCommitContext(IStoreAccessor.CommitContext commitContext) 
 - 
getCommitContextpublic static IStoreAccessor.CommitContext getCommitContext() 
 - 
hasCommitContextpublic static boolean hasCommitContext() - Since:
- 4.7
 
 - 
releasepublic static void release() - Since:
- 4.2
 
 - 
removepublic static void remove() - Since:
- 4.5
 
 
- 
 
-