Package com.dynatrace.openkit.core
Class SessionWatchdog
- java.lang.Object
-
- com.dynatrace.openkit.core.SessionWatchdog
-
public class SessionWatchdog extends java.lang.ObjectThe SessionWatchdog is responsible to perform certain actions for a session at a specific point in time. Currently following actions are performed:- Sessions which could not be closed after session splitting will be closed after a certain grace period.
- Session proxies which require splitting after a maximum session duration or by idle timeout
-
-
Constructor Summary
Constructors Constructor Description SessionWatchdog(Logger logger, SessionWatchdogContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToSplitByTimeout(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.voidcloseOrEnqueueForClosing(SessionImpl session, int closeGracePeriodInMillis)Tries to close/end the given session or enqueues it for closing if closing was not possiblevoiddequeueFromClosing(SessionImpl session)Removes the given session for auto-closing from this watchdogvoidinitialize()voidremoveFromSplitByTimeout(SessionProxyImpl sessionProxy)Removes the given session proxy from automatically splitting it after idle or session max time expired.voidshutdown()
-
-
-
Constructor Detail
-
SessionWatchdog
public SessionWatchdog(Logger logger, SessionWatchdogContext context)
-
-
Method Detail
-
initialize
public void initialize()
-
shutdown
public void shutdown()
-
closeOrEnqueueForClosing
public void closeOrEnqueueForClosing(SessionImpl session, int closeGracePeriodInMillis)
Tries to close/end the given session or enqueues it for closing if closing was not possible- Parameters:
session- the session to be closed or enqueued for closing.closeGracePeriodInMillis- the grace period after which the session is to be closed for good.
-
dequeueFromClosing
public void dequeueFromClosing(SessionImpl session)
Removes the given session for auto-closing from this watchdog- 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.
-
-