org.eclipse.emf.cdo.server

## Class StoreThreadLocal

- java.lang.Object
- - org.eclipse.emf.cdo.server.StoreThreadLocal

-     public final class StoreThreadLocal
      extends java.lang.Object

  Provides server-side consumers with the `store accessor` that is valid in the context of a specific `session` during read operations or a specific `commit context` during write operations.
  Since:
    2.0
  Author:
    Eike Stepper
  Apiviz

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StoreThreadLocal.NoSessionRegisteredException` An `IllegalStateException` that can be thrown from `getSession()`.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static IStoreAccessor` | `getAccessor()`
    `static IStoreAccessor.CommitContext` | `getCommitContext()`
    `static InternalSession` | `getSession()` Returns the session associated with the current thread.
    `static boolean` | `hasAccessor()`
    `static boolean` | `hasCommitContext()`
    `static boolean` | `hasSession()`
    `static void` | `release()`
    `static void` | `remove()`
    `static void` | `setAccessor(IStoreAccessor accessor)`
    `static void` | `setCommitContext(IStoreAccessor.CommitContext commitContext)`
    `static void` | `setSession(InternalSession session)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### 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

      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

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html