public abstract class PingThread
extends java.lang.Thread
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 overrided to define
what to do when a connection appears to be dead.
Constructor and Description |
---|
PingThread(Channel channel) |
PingThread(Channel channel,
long interval) |
PingThread(Channel channel,
long timeout,
long interval) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
onDead()
Deprecated.
as of 2.9
Override
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. |
protected void |
onDead(java.lang.Throwable diagnosis)
Called when ping failed.
|
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
public PingThread(Channel channel, long timeout, long interval)
public PingThread(Channel channel, long interval)
public PingThread(Channel channel)
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected abstract void onDead()
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.protected void onDead(java.lang.Throwable diagnosis)
Copyright © 2012. All Rights Reserved.