Package hudson.remoting
Class PingThread
java.lang.Object
java.lang.Thread
hudson.remoting.PingThread
- All Implemented Interfaces:
Runnable
Periodically perform a ping.
Useful when a connection needs to be kept alive by sending data, or when the disconnection is not properly detected.
onDead()
method needs to be overridden to define
what to do when a connection appears to be dead.
- Since:
- 1.170
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionPingThread
(Channel channel) PingThread
(Channel channel, long interval) PingThread
(Channel channel, long timeout, long interval) -
Method Summary
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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
PingThread
-
PingThread
-
PingThread
-
-
Method Details
-
run
public void run() -
onDead
Deprecated.as of 2.9 OverrideonDead(Throwable)
to receive the cause, but also override this method and provide a fallback behaviour to be backward compatible with earlier version of remoting library.Called when ping failed. -
onDead
Called when ping failed.- Since:
- 2.9
-
onDead(Throwable)
to receive the cause, but also override this method and provide a fallback behaviour to be backward compatible with earlier version of remoting library.