|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
no.ntnu.item.router.utilities.ServiceSessionBankCleaner
public class ServiceSessionBankCleaner
A separate thread that is responsible for removing ServiceSession
objects from the ServiceSessionBank
if they are idle.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private ServiceSessionBank |
bank
Holds the ServiceSessionBank |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ServiceSessionBankCleaner(ServiceSessionBank serviceSessionBank)
Constructor, starts the Thread |
Method Summary | |
---|---|
private java.util.List<java.lang.String> |
findInactiveSessions()
|
private boolean |
haveNoRecentMeasurements(ServiceSession session)
Checks if the given session have been inactive for long enough to remove it. |
private void |
removeInactiveSessions(java.util.List<java.lang.String> sessionsToRemove)
|
void |
run()
|
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private ServiceSessionBank bank
ServiceSessionBank
Constructor Detail |
---|
public ServiceSessionBankCleaner(ServiceSessionBank serviceSessionBank)
serviceSessionBank
- the ServiceSessionBank
to watchMethod Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private void removeInactiveSessions(java.util.List<java.lang.String> sessionsToRemove)
private java.util.List<java.lang.String> findInactiveSessions()
private boolean haveNoRecentMeasurements(ServiceSession session)
session
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |