Class MyThread
- java.lang.Object
-
- java.lang.Thread
-
- edu.uiuc.ncsa.security.core.cache.MyThread
-
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
Cleanup
,LastAccessedThread
public class MyThread extends Thread
Top-level thread class for anything that needs to run in OA4MP. Has barebones logging, getting alarms and sleep intervals plus stopThread method to shut it down cleanly.Created by Jeff Gaynor
on 3/29/23 at 1:10 PM
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description long
cleanupInterval
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description MyThread(String name, MyLoggingFacade logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
debug(String x)
protected void
debug(String x, Throwable t)
Collection<LocalTime>
getAlarms()
long
getCleanupInterval()
The amount of time, in milliseconds, to wait between attempts to age the cache.protected long
getNextSleepInterval()
protected void
info(String x)
boolean
isStopThread()
Is this thread set to stop?boolean
isTestMode()
void
setAlarms(Collection<LocalTime> alarms)
void
setCleanupInterval(long cleanupInterval)
void
setStopThread(boolean stopThread)
Sets the flag to stop this thread.void
setTestMode(boolean testMode)
protected void
warn(String x)
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
MyThread
public MyThread(String name, MyLoggingFacade logger)
-
-
Method Detail
-
isTestMode
public boolean isTestMode()
-
setTestMode
public void setTestMode(boolean testMode)
-
getCleanupInterval
public long getCleanupInterval()
The amount of time, in milliseconds, to wait between attempts to age the cache.- Returns:
-
setCleanupInterval
public void setCleanupInterval(long cleanupInterval)
-
getAlarms
public Collection<LocalTime> getAlarms()
-
setAlarms
public void setAlarms(Collection<LocalTime> alarms)
-
isStopThread
public boolean isStopThread()
Is this thread set to stop?- Returns:
-
setStopThread
public void setStopThread(boolean stopThread)
Sets the flag to stop this thread. The next time the thread wakes up after this is enabled, the thread will exit. This allows for a clean shutdown of caching.- Parameters:
stopThread
-
-
info
protected void info(String x)
-
warn
protected void warn(String x)
-
debug
protected void debug(String x)
-
getNextSleepInterval
protected long getNextSleepInterval()
-
-