Package org.serviceconnector.registry
Class SessionRegistry
java.lang.Object
org.serviceconnector.registry.Registry<String,Session>
org.serviceconnector.registry.SessionRegistry
- All Implemented Interfaces:
IRegistryMXBean
The Class SessionRegistry. Registry stores entries for properly created sessions. Registry is also responsible for observing the session timeout and initiating clean up in case
of a broken session. Session timer gets initialized by adding the session. Resetting the timer needs to be done outside the registry by calling reset method.
- Author:
- JTraber
-
Field Summary
Fields inherited from class org.serviceconnector.registry.Registry
registryMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSession(String key, Session session) Adds the session.voiddump(XMLDumpWriter writer) Dump the sessions into the xml writer.getSession(String key) Gets the session.Session[]Gets all sessions.voidremoveSession(String key) Removes the session.voidremoveSession(Session session) Removes the session.voidresetSessionTimeout(Session session, double newTimeoutMillis) Reset session timeout.Methods inherited from class org.serviceconnector.registry.Registry
containsKey, get, getEntries, getSize, keySet, keySetArray, put, remove, toString
-
Constructor Details
-
SessionRegistry
public SessionRegistry()Instantiates a SessionRegistry.
-
-
Method Details
-
addSession
Adds the session.- Parameters:
key- the keysession- the session
-
removeSession
Removes the session.- Parameters:
session- the session
-
removeSession
Removes the session.- Parameters:
key- the key
-
getSession
Gets the session.- Parameters:
key- the key- Returns:
- the session
-
getSessions
Gets all sessions.- Returns:
- the sessions
-
resetSessionTimeout
Reset session timeout.- Parameters:
session- the sessionnewTimeoutMillis- the new timeout in milliseconds
-
dump
Dump the sessions into the xml writer.- Parameters:
writer- the writer- Throws:
Exception- the exception
-