Class SessionWatchdogContext


  • public class SessionWatchdogContext
    extends java.lang.Object
    A context keeping track of sessions which could not be finished after session splitting by events and which will be closed after a grace period.
    • Constructor Detail

      • SessionWatchdogContext

        public SessionWatchdogContext​(TimingProvider timingProvider)
    • Method Detail

      • execute

        public void execute()
      • requestShutdown

        public void requestShutdown()
        Requests shutdown
      • isShutdownRequested

        public boolean isShutdownRequested()
        indicates whether shutdown was requested before or not.
      • closeOrEnqueueForClosing

        public void closeOrEnqueueForClosing​(SessionImpl session,
                                             long closeGracePeriodInMillis)
        Tries to close the given session. If closing the session is currently not possible (e.g. due to still ongoing child actions / web request tracers) it will be enqueued to be forcefully closed after the given grade period is expired.
        Parameters:
        session - the session to be closed or enqueued
        closeGracePeriodInMillis - the grace period after which the session is closed for good.
      • dequeueFromClosing

        public void dequeueFromClosing​(SessionImpl session)
        Removes the given session from auto-closing after a certain grace period.
        Parameters:
        session - the session to be removed.
      • addToSplitByTimeout

        public void addToSplitByTimeout​(SessionProxyImpl sessionProxy)
        Adds the given session proxy so that it will be automatically split the underlying session when the idle timeout or the max session time is reached.
        Parameters:
        sessionProxy - the session proxy to be added.
      • removeFromSplitByTimeout

        public void removeFromSplitByTimeout​(SessionProxyImpl sessionProxy)
        Removes the given session proxy from automatically splitting it after idle or session max time expired.
        Parameters:
        sessionProxy - the session proxy to be removed.