Package net.schmizz.keepalive
Class KeepAlive
- java.lang.Object
-
- java.lang.Thread
-
- net.schmizz.keepalive.KeepAlive
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
KeepAliveRunner
public abstract class KeepAlive extends java.lang.Thread
-
-
Field Summary
Fields Modifier and Type Field Description protected ConnectionImpl
conn
protected int
keepAliveInterval
protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Modifier Constructor Description protected
KeepAlive(ConnectionImpl conn, java.lang.String name)
-
Method Summary
Modifier and Type Method Description protected abstract void
doKeepAlive()
int
getKeepAliveInterval()
boolean
isEnabled()
void
run()
void
setKeepAliveInterval(int keepAliveInterval)
-
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
-
-
-
-
Field Detail
-
log
protected final org.slf4j.Logger log
-
conn
protected final ConnectionImpl conn
-
keepAliveInterval
protected int keepAliveInterval
-
-
Constructor Detail
-
KeepAlive
protected KeepAlive(ConnectionImpl conn, java.lang.String name)
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
-
getKeepAliveInterval
public int getKeepAliveInterval()
-
setKeepAliveInterval
public void setKeepAliveInterval(int keepAliveInterval)
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
doKeepAlive
protected abstract void doKeepAlive() throws TransportException, ConnectionException
-
-