Package com.tangosol.coherence.servlet
Class AbstractReapTask
- java.lang.Object
-
- com.tangosol.coherence.servlet.AbstractReapTask
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
IncrementalReapTask
,ParallelReapTask
public abstract class AbstractReapTask extends Object implements Runnable
Base class for reaping tasks. It takes care of scheduling the next reap cycle and provides common data members.
-
-
Field Summary
Fields Modifier and Type Field Description protected long
mQueueWaitTime
The amount of time the reap task waited in-queue to run.protected long
mStartTime
The time stamp for when this reap cycle started.
-
Constructor Summary
Constructors Constructor Description AbstractReapTask(SessionHelper sessionHelper, SessionReaperStatistics statistics, Iterator iterIds)
Construct an AbstractReapTask.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkAndInvalidate(String id)
Check the specified session to see if it has expired, and in that case invalidate it.protected void
done()
Indicate that the reaping is done in this cycle.protected SessionHelper.SessionReaperDaemon
getDaemon()
protected int
getNrOfInvalidatedSessions()
protected SessionHelper
getSessionHelper()
protected Iterator
getSessionIdIterator()
protected boolean
isDone()
protected boolean
logInvalidationExceptions()
protected abstract void
reap()
The method that implements the actual reaping.void
run()
The task process: Process a portion of the reaping cycle.protected void
scheduleNextCycle()
Schedules the next reaping cycle.
-
-
-
Constructor Detail
-
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 Detail
-
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
protected Iterator getSessionIdIterator()
-
checkAndInvalidate
protected void checkAndInvalidate(String id)
Check the specified session to see if it has expired, and in that case invalidate it.- Parameters:
id
- a session id
-
getSessionHelper
protected SessionHelper getSessionHelper()
-
getDaemon
protected SessionHelper.SessionReaperDaemon getDaemon()
-
isDone
protected boolean isDone()
-
getNrOfInvalidatedSessions
protected int getNrOfInvalidatedSessions()
-
logInvalidationExceptions
protected boolean logInvalidationExceptions()
-
-