Interface MultiUserSessionPool


public interface MultiUserSessionPool
A pool of sessions for multiple session infos.
Allows different users to use multiple sessions in parallel.
Author:
harald
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    close(SessionInfo sessionInfo)
    Closes all sessions currently open for a given session info.
    Useful to force logout for a user.
    It is not an error, if there were no open sessions for the session info at all.
    get(SessionInfo sessionInfo)
    Gets a session from the pool for a given session info.
    int
    Gets the maximum pool size per session info.
    int
    Gets the maximum pool size for all sessions.
    Gets the name of this pool.
    int
    Gets the current number of session instances.
    boolean
    Returns whether the pool is shutdown.
    void
    put(Session session)
    Returns a session back to the pool.
    Returning a closed session will remove it from the pool.
    void
    Closes all sessions in the pool, cleans up and makes the pool unusable.
  • Method Details

    • get

      Session get(SessionInfo sessionInfo)
      Gets a session from the pool for a given session info.
      Parameters:
      sessionInfo - the session info
      Returns:
      the session, never null
    • put

      void put(Session session)
      Returns a session back to the pool.
      Returning a closed session will remove it from the pool.
      Parameters:
      session - the session
    • close

      void close(SessionInfo sessionInfo)
      Closes all sessions currently open for a given session info.
      Useful to force logout for a user.
      It is not an error, if there were no open sessions for the session info at all.
      Parameters:
      sessionInfo - the session info
    • getName

      String getName()
      Gets the name of this pool.
      Returns:
      the name
    • getMaxSize

      int getMaxSize()
      Gets the maximum pool size per session info.
      Returns:
      the max. number of concurrent session instances, 0 = unlimited
    • getMaxTotalSize

      int getMaxTotalSize()
      Gets the maximum pool size for all sessions.
      Returns:
      the max. number of concurrent session instances, 0 = unlimited
    • getSize

      int getSize()
      Gets the current number of session instances.
      Returns:
      the number of sessions managed by this pool
    • shutdown

      void shutdown()
      Closes all sessions in the pool, cleans up and makes the pool unusable.
    • isShutdown

      boolean isShutdown()
      Returns whether the pool is shutdown.
      Returns:
      true if shutdown