public class NetworkCheckThread
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
protected static long |
DEFAULT_NET_CHECK_INTERVAL |
protected java.util.concurrent.atomic.AtomicBoolean |
isNetAvailable |
protected java.util.concurrent.atomic.AtomicLong |
netChecInterval |
protected java.util.concurrent.atomic.AtomicBoolean |
showNetStatus |
Constructor and Description |
---|
NetworkCheckThread(java.util.concurrent.atomic.AtomicBoolean showNetStatus,
java.util.concurrent.atomic.AtomicBoolean isNetAvailable,
java.lang.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 java.util.concurrent.atomic.AtomicBoolean isNetAvailable
protected java.util.concurrent.atomic.AtomicLong netChecInterval
protected java.util.concurrent.atomic.AtomicBoolean showNetStatus
public NetworkCheckThread(java.util.concurrent.atomic.AtomicBoolean showNetStatus, java.util.concurrent.atomic.AtomicBoolean isNetAvailable, java.lang.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.