Package com.tangosol.coherence.servlet
Class AbstractReapTask
java.lang.Object
com.tangosol.coherence.servlet.AbstractReapTask
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
IncrementalReapTask,ParallelReapTask
Base class for reaping tasks. It takes care of scheduling the next reap cycle
and provides common data members.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longThe amount of time the reap task waited in-queue to run.protected longThe time stamp for when this reap cycle started. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReapTask(SessionHelper sessionHelper, SessionReaperStatistics statistics, Iterator iterIds) Construct an AbstractReapTask. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCheck the specified session to see if it has expired, and in that case invalidate it.protected voiddone()Indicate that the reaping is done in this cycle.protected SessionHelper.SessionReaperDaemonprotected intprotected SessionHelperprotected Iteratorprotected booleanisDone()protected booleanprotected abstract voidreap()The method that implements the actual reaping.voidrun()The task process: Process a portion of the reaping cycle.protected voidSchedules the next reaping cycle.
-
Field Details
-
mStartTime
protected long mStartTimeThe time stamp for when this reap cycle started. -
mQueueWaitTime
protected long mQueueWaitTimeThe amount of time the reap task waited in-queue to run.
-
-
Constructor Details
-
AbstractReapTask
public AbstractReapTask(SessionHelper sessionHelper, SessionReaperStatistics statistics, Iterator iterIds) Construct an AbstractReapTask.- Parameters:
sessionHelper- a session helperstatistics- a session reaper statisticsiterIds- an iterator of session IDs to check
-
-
Method Details
-
run
public void run()The task process: Process a portion of the reaping cycle. -
scheduleNextCycle
protected void scheduleNextCycle()Schedules the next reaping cycle. -
done
protected void done()Indicate that the reaping is done in this cycle. -
reap
protected abstract void reap()The method that implements the actual reaping. -
getSessionIdIterator
-
checkAndInvalidate
Check the specified session to see if it has expired, and in that case invalidate it.- Parameters:
id- a session id
-
getSessionHelper
-
getDaemon
-
isDone
protected boolean isDone() -
getNrOfInvalidatedSessions
protected int getNrOfInvalidatedSessions() -
logInvalidationExceptions
protected boolean logInvalidationExceptions()
-