Class MultiTaskSession

  • All Implemented Interfaces:
    AutoCloseable, Runnable, Session

    public class MultiTaskSession
    extends AbstractSession
    A Session implementation that queues tasks given to it and executes them in a serial fashion within the same thread which thus allows multiple tasks to be executed in the same transaction. The first SessionTask to execute is supplied on the constructor and additional ones may be added as they arrive with submitTask(SessionTask) where they will be added to a queue where they will await execution in the thread bound to this session.
    • Constructor Detail

      • MultiTaskSession

        public MultiTaskSession​(SessionTask initialSessionTask,
                                String sessionId,
                                ConcurrentMap<String,​Session> sessions)
        Creates a new MultiTaskSession object providing the initial starting SessionTask that gets executed by the session when it starts.
        Parameters:
        initialSessionTask - The tasks that starts the session.
        sessionId - The id of the session
        sessions - The session id to Session instances mapping