Class SessionHolder

java.lang.Object
net.simplace.sim.wrapper.rest.session.SessionHolder

public class SessionHolder extends Object
Wraps a SimplaceWrapper instance for exactly one REST session. Each session has its own wrapper instance (own iCurrentSession, own simulation queue), but shares the global static FWSimEngine configuration (work/output/data/projects directory) with all other sessions in the same JVM process.
  • Constructor Details

    • SessionHolder

      public SessionHolder(String id, SimplaceWrapper wrapper)
      Parameters:
      id - session id
      wrapper - the wrapper of this session
  • Method Details

    • getId

      public String getId()
      Returns:
      the session id
    • getWrapper

      public SimplaceWrapper getWrapper()
      Returns:
      the wrapper of this session
    • getExecutionLock

      @Deprecated public ReentrantLock getExecutionLock()
      Deprecated.
      not used, all engine calls are serialised by SessionManager.ENGINE_LOCK
      Returns:
      the per-session lock (currently not used)
    • getLastAccessed

      public Instant getLastAccessed()
      Returns:
      the time of the last access (for the idle timeout)
    • touch

      public void touch()
      Marks the session as accessed now (resets the idle timeout).