public interface MultiUserSessionPool
A pool of sessions for multiple session infos.
Allows different users to use multiple sessions in parallel.
Allows different users to use multiple sessions in parallel.
- Author:
- harald
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose(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.intGets the maximum pool size.getName()Gets the name of this pool.intgetSize()Gets the current number of session instances.booleanReturns whether the pool is shutdown.voidReturns a session back to the pool.
Returning a closed session will remove it from the pool.voidshutdown()Closes all sessions in the pool, cleans up and makes the pool unusable.
-
Method Details
-
get
Gets a session from the pool for a given session info.- Parameters:
sessionInfo- the session info- Returns:
- the session, never null
-
put
Returns a session back to the pool.
Returning a closed session will remove it from the pool.- Parameters:
session- the session
-
close
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.- 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
-