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 Summary
Nested Classes Modifier and Type Class Description static classStoreThreadLocal.NoSessionRegisteredExceptionAnIllegalStateExceptionthat can be thrown fromgetSession().
-
Method Summary
All 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
-
wrap
public static java.lang.Runnable wrap(ISession session, java.lang.Runnable runnable)
- Since:
- 4.11
-
wrap
public static <T> java.util.concurrent.Callable<T> wrap(ISession session, java.util.concurrent.Callable<T> callable)
- Since:
- 4.11
-
setSession
public static void setSession(InternalSession session)
- Since:
- 3.0
-
getSession
public 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
-
hasSession
public static boolean hasSession()
- Since:
- 4.2
-
setAccessor
public static void setAccessor(IStoreAccessor accessor)
-
getAccessor
public static IStoreAccessor getAccessor() throws StoreThreadLocal.NoSessionRegisteredException
-
hasAccessor
public static boolean hasAccessor()
- Since:
- 4.7
-
setCommitContext
public static void setCommitContext(IStoreAccessor.CommitContext commitContext)
-
getCommitContext
public static IStoreAccessor.CommitContext getCommitContext()
-
hasCommitContext
public static boolean hasCommitContext()
- Since:
- 4.7
-
release
public static void release()
- Since:
- 4.2
-
remove
public static void remove()
- Since:
- 4.5
-
-