Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected static long |
DEFAULT_NET_CHECK_INTERVAL |
protected AtomicBoolean |
isNetAvailable |
protected AtomicLong |
netChecInterval |
protected AtomicBoolean |
showNetStatus |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
NetworkCheckThread(AtomicBoolean showNetStatus,
AtomicBoolean isNetAvailable,
Long interval)
Constructs a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
run() |
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
protected static final long DEFAULT_NET_CHECK_INTERVAL
protected AtomicBoolean isNetAvailable
protected AtomicLong netChecInterval
protected AtomicBoolean showNetStatus
public NetworkCheckThread(AtomicBoolean showNetStatus, AtomicBoolean isNetAvailable, Long interval)
false
.showNetStatus
- a reference to an atomic variable indicating whether the thread should continue running.
This variable is tested prior to each network check. The thread terminates when it becomes
false.isNetAvailable
- a reference to an atomic variable in which to write the status of the network check.interval
- the interval at which to perform the network check, or null if the default interval of one
second is to be used.