Documentation of 'cc.redberry.core.context.ContextManager' Java class
ContextManager
cc.redberry.core.context

Class ContextManager



  • public final class ContextManager
    extends java.lang.Object
    This class implements context management logic.

    It holds current thread-local context of Redberry session (see description for Context class). It is possible to set context explicitly using setCurrentContext(Context) method. Each thread is linked to its own context. All child threads created via ExecutorService from getExecutorService() have same context.

    Since:
    1.0
    • Method Detail

      • getCurrentContext

        public static Context getCurrentContext()
        Returns the current context of Redberry session.
        Returns:
        the current context of Redberry session.
      • initializeNew

        public static Context initializeNew()
        This method initializes and sets current session context by the default value defined in DefaultContextFactory. After this step, all tensors that exist in the thread will be invalidated.
        Returns:
        created context
      • initializeNew

        public static Context initializeNew(ContextSettings contextSettings)
        This method initializes and sets current session context from the specified context settings (ContextSettings). After invocation of this method, all the tensors that exist in the current thread will be invalidated.
        Returns:
        created context
      • setCurrentContext

        public static void setCurrentContext(Context context)
        Sets current thread-local context to the specified one. After this step, all the tensors that exist in the thread will be invalidated.
        Parameters:
        context - context
      • getExecutorService

        public static java.util.concurrent.ExecutorService getExecutorService()
        Returns thread-local ExecutorService with fixed context. All threads linked to this ExecutorService will have same context.
        Returns:
        thread-local ExecutorService with fixed context

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.