public class TcpPingInterceptor extends ChannelInterceptorBase implements TcpPingInterceptorMBean
| Modifier and Type | Class and Description |
|---|---|
protected class |
TcpPingInterceptor.PingThread |
ChannelInterceptor.InterceptorEvent| Modifier and Type | Field and Description |
|---|---|
protected static AtomicInteger |
cnt |
protected long |
interval |
protected boolean |
running |
protected static StringManager |
sm |
protected boolean |
staticOnly |
protected static byte[] |
TCP_PING_DATA |
protected TcpPingInterceptor.PingThread |
thread |
protected boolean |
useThread |
optionFlag| Constructor and Description |
|---|
TcpPingInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
long |
getInterval() |
boolean |
getStaticOnly() |
boolean |
getUseThread() |
void |
heartbeat()
The
heartbeat() method gets invoked periodically
to allow interceptors to clean up resources, time out object and
perform actions that are unrelated to sending/receiving data. |
void |
messageReceived(ChannelMessage msg)
the
messageReceived is invoked when a message is received. |
protected void |
sendPing() |
protected void |
sendPingMessage(Member[] members) |
void |
setInterval(long interval) |
void |
setStaticOnly(boolean staticOnly) |
void |
setUseThread(boolean useThread) |
void |
start(int svc)
Starts up the channel.
|
void |
stop(int svc)
Shuts down the channel.
|
fireInterceptorEvent, getChannel, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, memberAdded, memberDisappeared, okToProcess, sendMessage, setChannel, setNext, setOptionFlag, setPreviousclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOptionFlagprotected static final StringManager sm
protected static final byte[] TCP_PING_DATA
protected long interval
protected boolean useThread
protected boolean staticOnly
protected volatile boolean running
protected TcpPingInterceptor.PingThread thread
protected static final AtomicInteger cnt
public void start(int svc)
throws ChannelException
ChannelInterceptorBasestart in interface ChannelInterceptorstart in class ChannelInterceptorBasesvc - int value of ChannelException - if a startup error occurs or the service is already started.Channelpublic void stop(int svc)
throws ChannelException
ChannelInterceptorBasestop in interface ChannelInterceptorstop in class ChannelInterceptorBasesvc - int value of ChannelException - if a startup error occurs or the service is already started.Channelpublic void heartbeat()
ChannelInterceptorheartbeat() method gets invoked periodically
to allow interceptors to clean up resources, time out object and
perform actions that are unrelated to sending/receiving data.heartbeat in interface ChannelInterceptorheartbeat in interface Heartbeatheartbeat in class ChannelInterceptorBasepublic long getInterval()
getInterval in interface TcpPingInterceptorMBeanpublic void setInterval(long interval)
public void setUseThread(boolean useThread)
public void setStaticOnly(boolean staticOnly)
public boolean getUseThread()
getUseThread in interface TcpPingInterceptorMBeanpublic boolean getStaticOnly()
protected void sendPing()
protected void sendPingMessage(Member[] members)
public void messageReceived(ChannelMessage msg)
ChannelInterceptormessageReceived is invoked when a message is received.
ChannelMessage.getAddress() is the sender, or the reply-to address
if it has been overwritten.messageReceived in interface ChannelInterceptormessageReceived in class ChannelInterceptorBasemsg - ChannelMessageCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.