Class HazelcastSessionDataStore

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.session.AbstractSessionDataStore
org.eclipse.jetty.hazelcast.session.HazelcastSessionDataStore
All Implemented Interfaces:
org.eclipse.jetty.server.session.SessionDataMap, org.eclipse.jetty.server.session.SessionDataStore, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

@ManagedObject public class HazelcastSessionDataStore extends org.eclipse.jetty.server.session.AbstractSessionDataStore implements org.eclipse.jetty.server.session.SessionDataStore
Session data stored in Hazelcast
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.server.session.AbstractSessionDataStore

    _context, _gracePeriodSec, _lastExpiryCheckTime, _lastOrphanSweepTime, _savePeriodSec, DEFAULT_GRACE_PERIOD_SEC, DEFAULT_SAVE_PERIOD_SEC

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    doCheckExpired(Set<String> candidates, long time)
     
    void
    doCleanOrphans(long timeLimit)
     
    boolean
     
    doGetExpired(long time)
     
    org.eclipse.jetty.server.session.SessionData
     
    void
    doStore(String id, org.eclipse.jetty.server.session.SessionData data, long lastSaveTime)
     
     
    com.hazelcast.map.IMap<String,org.eclipse.jetty.server.session.SessionData>
     
    void
    initialize(org.eclipse.jetty.server.session.SessionContext context)
     
    boolean
     
    boolean
     
    void
    setSessionDataMap(com.hazelcast.map.IMap<String,org.eclipse.jetty.server.session.SessionData> sessionDataMap)
     
    void
    setUseQueries(boolean useQueries)
    Control whether or not to execute queries to find expired sessions - ie sessions for this context that are no longer actively referenced by any jetty instance and should be expired.

    Methods inherited from class org.eclipse.jetty.server.session.AbstractSessionDataStore

    checkStarted, cleanOrphans, doStart, exists, getExpired, getGracePeriodSec, getSavePeriodSec, load, newSessionData, setGracePeriodSec, setSavePeriodSec, store, toString

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, destroy, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop

    Methods inherited from interface org.eclipse.jetty.server.session.SessionDataMap

    load, store

    Methods inherited from interface org.eclipse.jetty.server.session.SessionDataStore

    exists, getExpired, newSessionData
  • Constructor Details

    • HazelcastSessionDataStore

      public HazelcastSessionDataStore()
  • Method Details

    • setUseQueries

      public void setUseQueries(boolean useQueries)
      Control whether or not to execute queries to find expired sessions - ie sessions for this context that are no longer actively referenced by any jetty instance and should be expired. If you use this feature, be aware that if your session stores any attributes that use classes from within your webapp, or from within jetty, you will need to make sure those classes are available to all of your hazelcast instances, whether embedded or remote.
      Parameters:
      useQueries - true means unreferenced sessions will be actively sought and expired. False means that they will remain in hazelcast until some other mechanism removes them.
    • isUseQueries

      public boolean isUseQueries()
    • doLoad

      public org.eclipse.jetty.server.session.SessionData doLoad(String id) throws Exception
      Specified by:
      doLoad in class org.eclipse.jetty.server.session.AbstractSessionDataStore
      Throws:
      Exception
    • delete

      public boolean delete(String id) throws Exception
      Specified by:
      delete in interface org.eclipse.jetty.server.session.SessionDataMap
      Throws:
      Exception
    • getSessionDataMap

      public com.hazelcast.map.IMap<String,org.eclipse.jetty.server.session.SessionData> getSessionDataMap()
    • setSessionDataMap

      public void setSessionDataMap(com.hazelcast.map.IMap<String,org.eclipse.jetty.server.session.SessionData> sessionDataMap)
    • initialize

      public void initialize(org.eclipse.jetty.server.session.SessionContext context) throws Exception
      Specified by:
      initialize in interface org.eclipse.jetty.server.session.SessionDataMap
      Overrides:
      initialize in class org.eclipse.jetty.server.session.AbstractSessionDataStore
      Throws:
      Exception
    • doStore

      public void doStore(String id, org.eclipse.jetty.server.session.SessionData data, long lastSaveTime) throws Exception
      Specified by:
      doStore in class org.eclipse.jetty.server.session.AbstractSessionDataStore
      Throws:
      Exception
    • isPassivating

      public boolean isPassivating()
      Specified by:
      isPassivating in interface org.eclipse.jetty.server.session.SessionDataStore
    • doCleanOrphans

      public void doCleanOrphans(long timeLimit)
      Specified by:
      doCleanOrphans in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • doGetExpired

      public Set<String> doGetExpired(long time)
      Specified by:
      doGetExpired in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • doCheckExpired

      public Set<String> doCheckExpired(Set<String> candidates, long time)
      Specified by:
      doCheckExpired in class org.eclipse.jetty.server.session.AbstractSessionDataStore
    • doExists

      public boolean doExists(String id) throws Exception
      Specified by:
      doExists in class org.eclipse.jetty.server.session.AbstractSessionDataStore
      Throws:
      Exception
    • getCacheKey

      public String getCacheKey(String id)