gov.nasa.worldwind.util
Class NetworkCheckThread
java.lang.Object
java.lang.Thread
gov.nasa.worldwind.util.NetworkCheckThread
- All Implemented Interfaces:
- Runnable
public class NetworkCheckThread
- extends Thread
Periodically checks network availability.
|
Method Summary |
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 |
DEFAULT_NET_CHECK_INTERVAL
protected static final long DEFAULT_NET_CHECK_INTERVAL
- See Also:
- Constant Field Values
isNetAvailable
protected AtomicBoolean isNetAvailable
netChecInterval
protected AtomicLong netChecInterval
showNetStatus
protected AtomicBoolean showNetStatus
NetworkCheckThread
public NetworkCheckThread(AtomicBoolean showNetStatus,
AtomicBoolean isNetAvailable,
Long interval)
- Constructs a new instance of this class. Once started, the thread checks network availability at a specified
frequency and stores the result in an atomic variable specified to the constructor. The thread terminates when
it's interrupted or when a specified boolean atomic variable has the value
false.
- Parameters:
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.
run
public void run()
- Specified by:
run in interface Runnable- Overrides:
run in class Thread