public class SessionHelper.SessionReaperDaemon extends TaskDaemon implements SessionReaperStatistics
Modifier and Type | Class and Description |
---|---|
class |
SessionHelper.SessionReaperDaemon.IncrementalReapTask |
class |
SessionHelper.SessionReaperDaemon.StartReapingTask
A task that starts a reaping cycle.
|
TaskDaemon.PeriodicTask
Daemon.DaemonWorker
Base.LoggingWriter, Base.StackFrame
Constructor and Description |
---|
SessionReaperDaemon(String sName,
int nPriority)
Construct a SessionReaperDaemon.
|
Modifier and Type | Method and Description |
---|---|
long |
getAverageReapDuration()
Gets the average reap duration since the statistics was reset.
|
long |
getAverageReapedSessions()
Gets the average number of reaped sessions in a reap cycle since the statistics was reset.
|
long |
getAverageReapQueueWaitDuration()
Return the average number of milliseconds reap tasks wait in the queue prior to running.
|
int |
getEstimatedReaperSessionCount()
Determine the estimated number of sessions that will be reaped by
the reaper when it runs next.
|
long |
getLastReapDuration()
Gets the duration for the last reap cycle.
|
long |
getLastReapQueueWaitDuration()
Return the time the last reap task spent in the queue prior to running.
|
long |
getLastReapTime()
Determine the last time that session reaping started.
|
long |
getMaxReapDuration()
Gets the maximum reap duration since the statistics was reset.
|
long |
getMaxReapedSessions()
Gets the maximum number of sessions reaped in a reap cycle since the statistics was reset.
|
long |
getMaxReapQueueWaitDuration()
Return the max time in milliseconds a reap task has spent in the queue prior to running since the statistics were
last reset.
|
long |
getNextReapTime()
Gets the start time for the next reap cycle.
|
long |
getReapedSessions()
Gets the number of sessions that were reaped during the last reap cycle.
|
int |
getTotalReapCycles()
Determine the total number of reaping cycles that this node has
performed.
|
long |
getTotalReapedSessions()
Gets the number of sessions that were reaped since the statistics was reset.
|
void |
incTotalReapCycles()
Increment the total number of reaping cycles that this node has
performed.
|
SessionHelper.SessionReaperDaemon.StartReapingTask |
instantiateStartReapingTask()
Factory method: Instantiate a task that starts a reaping cycle.
|
protected boolean |
isFullReapDue()
Determine if this node should run a full reaper scan.
|
protected void |
onException(Throwable e,
Runnable task)
Process an exception that is thrown during a task execution.
|
void |
resetStatistics()
Resets the statistics held by this object.
|
void |
run()
The task process: Process a portion of the reaping cycle.
|
void |
scheduleTask(Runnable task,
long ldt)
Schedule a task to be run at the specified time, or as soon after
as possible.
|
void |
setEstimatedReaperSessionCount(int c)
Update the estimated number of sessions that will be reaped by the
reaper when it runs next.
|
void |
setLastReapDuration(long time)
Sets the duration for the last reap cycle.
|
void |
setLastReapQueueWaitDuration(long time)
Sets the duration the last reap task spent in the queue prior to running.
|
void |
setLastReapTime(long dt)
Update the last time that session reaping started.
|
void |
setNextReapTime(long d)
Sets the start time for the next reap cycle.
|
void |
setReapedSessions(long l)
Sets the number of sessions that were reaped during the last reap cycle.
|
executePeriodicTask, executeTask, getDescription, getIdleTimeout, getMostRecentTaskTime, getTasks, instantiatePeriodicTask, isFinishing, run, schedulePeriodicTask, setFinishing, setIdleTimeout, stop, takeNextRipeTask, toString, updateMostRecentTaskTime
changeState, configureWorker, ensureThreadGroup, finishStarting, finishStopping, getConfiguredName, getConfiguredPriority, getContext, getGuardRegisterAction, getMaxWaitMillis, getState, getThread, getThreadContextClassLoader, getWorker, guardIfNeeded, heartbeat, heartbeat, instantiateWorker, isGuarded, isOnWorkerThread, isRunning, isStopping, recover, setConfiguredName, setConfiguredPriority, setContext, setGuardPolicy, setGuardRegisterAction, setThreadContextClassLoader, shutdown, start, stop, terminate, toStateString
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
public SessionReaperDaemon(String sName, int nPriority)
sName
- the daemon namenPriority
- the daemon prioritypublic void scheduleTask(Runnable task, long ldt)
scheduleTask
in class TaskDaemon
task
- a Runnable object to invokeldt
- a datetime value at which to run the taskpublic void run()
run
in interface Runnable
run
in class TaskDaemon
protected void onException(Throwable e, Runnable task)
onException
in class TaskDaemon
e
- Throwable object (a RuntimeException or an Error)task
- the task that caused the exceptionpublic int getEstimatedReaperSessionCount()
public void setEstimatedReaperSessionCount(int c)
c
- the number of sessions that were reaped by the previous
reap cyclepublic int getTotalReapCycles()
public void incTotalReapCycles()
protected boolean isFullReapDue()
public void setLastReapQueueWaitDuration(long time)
setLastReapQueueWaitDuration
in interface SessionReaperStatistics
time
- the duration in millisecondspublic long getLastReapQueueWaitDuration()
getLastReapQueueWaitDuration
in interface SessionReaperStatistics
public long getAverageReapQueueWaitDuration()
getAverageReapQueueWaitDuration
in interface SessionReaperStatistics
public long getMaxReapQueueWaitDuration()
SessionReaperStatistics
getMaxReapQueueWaitDuration
in interface SessionReaperStatistics
public long getLastReapDuration()
getLastReapDuration
in interface SessionReaperStatistics
public void setLastReapDuration(long time)
setLastReapDuration
in interface SessionReaperStatistics
time
- The duration in milliseconds.public long getReapedSessions()
getReapedSessions
in interface SessionReaperStatistics
public void setReapedSessions(long l)
setReapedSessions
in interface SessionReaperStatistics
l
- The number of sessions.public long getTotalReapedSessions()
getTotalReapedSessions
in interface SessionReaperStatistics
public long getLastReapTime()
getLastReapTime
in interface SessionReaperStatistics
public void setLastReapTime(long dt)
setLastReapTime
in interface SessionReaperStatistics
dt
- the last time that session reaping startedpublic long getNextReapTime()
getNextReapTime
in interface SessionReaperStatistics
public void setNextReapTime(long d)
setNextReapTime
in interface SessionReaperStatistics
d
- The time in milliseconds when the next reap cycle is schedule to start.public long getAverageReapDuration()
getAverageReapDuration
in interface SessionReaperStatistics
public long getAverageReapedSessions()
getAverageReapedSessions
in interface SessionReaperStatistics
public long getMaxReapDuration()
getMaxReapDuration
in interface SessionReaperStatistics
public long getMaxReapedSessions()
getMaxReapedSessions
in interface SessionReaperStatistics
public void resetStatistics()
resetStatistics
in interface SessionReaperStatistics
public SessionHelper.SessionReaperDaemon.StartReapingTask instantiateStartReapingTask()