Class SessionRegistry

java.lang.Object
org.serviceconnector.registry.Registry<String,Session>
org.serviceconnector.registry.SessionRegistry
All Implemented Interfaces:
IRegistryMXBean

public class SessionRegistry extends Registry<String,Session>
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
  • Constructor Details

    • SessionRegistry

      public SessionRegistry()
      Instantiates a SessionRegistry.
  • Method Details

    • addSession

      public void addSession(String key, Session session)
      Adds the session.
      Parameters:
      key - the key
      session - the session
    • removeSession

      public void removeSession(Session session)
      Removes the session.
      Parameters:
      session - the session
    • removeSession

      public void removeSession(String key)
      Removes the session.
      Parameters:
      key - the key
    • getSession

      public Session getSession(String key)
      Gets the session.
      Parameters:
      key - the key
      Returns:
      the session
    • getSessions

      public Session[] getSessions()
      Gets all sessions.
      Returns:
      the sessions
    • resetSessionTimeout

      public void resetSessionTimeout(Session session, double newTimeoutMillis)
      Reset session timeout.
      Parameters:
      session - the session
      newTimeoutMillis - the new timeout in milliseconds
    • dump

      public void dump(XMLDumpWriter writer) throws Exception
      Dump the sessions into the xml writer.
      Parameters:
      writer - the writer
      Throws:
      Exception - the exception