Package org.apache.activemq.transport
Class AbstractInactivityMonitor
- java.lang.Object
-
- org.apache.activemq.transport.TransportFilter
-
- org.apache.activemq.transport.AbstractInactivityMonitor
-
- All Implemented Interfaces:
Service,Transport,TransportListener
- Direct Known Subclasses:
InactivityMonitor,StompInactivityMonitor
public abstract class AbstractInactivityMonitor extends TransportFilter
Used to make sure that commands are arriving periodically from the peer of the transport.
-
-
Field Summary
Fields Modifier and Type Field Description protected WireFormatwireFormat-
Fields inherited from class org.apache.activemq.transport.TransportFilter
next, transportListener
-
-
Constructor Summary
Constructors Constructor Description AbstractInactivityMonitor(Transport next, WireFormat wireFormat)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleanconfiguredOk()longgetConnectAttemptTimeout()longgetInitialDelayTime()longgetReadCheckTime()longgetWriteCheckTime()booleanisKeepAliveResponseRequired()booleanisMonitorStarted()voidonCommand(Object command)called to process a commandvoidoneway(Object o)A one way asynchronous sendvoidonException(IOException error)An unrecoverable exception has occured on the transportprotected abstract voidprocessInboundWireFormatInfo(WireFormatInfo info)protected abstract voidprocessOutboundWireFormatInfo(WireFormatInfo info)voidsetConnectAttemptTimeout(long connectionTimeout)voidsetInitialDelayTime(long initialDelayTime)voidsetKeepAliveResponseRequired(boolean value)voidsetReadCheckTime(long readCheckTime)voidsetUseKeepAlive(boolean val)voidsetWriteCheckTime(long writeCheckTime)voidstart()voidstartConnectCheckTask()voidstartConnectCheckTask(long connectionTimeout)protected voidstartMonitorThreads()voidstop()voidstopConnectCheckTask()protected voidstopMonitorThreads()-
Methods inherited from class org.apache.activemq.transport.TransportFilter
asyncRequest, getNext, getPeerCertificates, getReceiveCounter, getRemoteAddress, getTransportListener, getWireFormat, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, reconnect, request, request, setPeerCertificates, setTransportListener, toString, transportInterupted, transportResumed, updateURIs
-
-
-
-
Field Detail
-
wireFormat
protected WireFormat wireFormat
-
-
Constructor Detail
-
AbstractInactivityMonitor
public AbstractInactivityMonitor(Transport next, WireFormat wireFormat)
-
-
Method Detail
-
start
public void start() throws Exception- Specified by:
startin interfaceService- Overrides:
startin classTransportFilter- Throws:
Exception- See Also:
Service.start()
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceService- Overrides:
stopin classTransportFilter- Throws:
Exception- See Also:
Service.stop()
-
processInboundWireFormatInfo
protected abstract void processInboundWireFormatInfo(WireFormatInfo info) throws IOException
- Throws:
IOException
-
processOutboundWireFormatInfo
protected abstract void processOutboundWireFormatInfo(WireFormatInfo info) throws IOException
- Throws:
IOException
-
onCommand
public void onCommand(Object command)
Description copied from interface:TransportListenercalled to process a command- Specified by:
onCommandin interfaceTransportListener- Overrides:
onCommandin classTransportFilter
-
oneway
public void oneway(Object o) throws IOException
Description copied from interface:TransportA one way asynchronous send- Specified by:
onewayin interfaceTransport- Overrides:
onewayin classTransportFilter- Throws:
IOException
-
onException
public void onException(IOException error)
Description copied from interface:TransportListenerAn unrecoverable exception has occured on the transport- Specified by:
onExceptionin interfaceTransportListener- Overrides:
onExceptionin classTransportFilter
-
setUseKeepAlive
public void setUseKeepAlive(boolean val)
-
getConnectAttemptTimeout
public long getConnectAttemptTimeout()
-
setConnectAttemptTimeout
public void setConnectAttemptTimeout(long connectionTimeout)
-
getReadCheckTime
public long getReadCheckTime()
-
setReadCheckTime
public void setReadCheckTime(long readCheckTime)
-
getWriteCheckTime
public long getWriteCheckTime()
-
setWriteCheckTime
public void setWriteCheckTime(long writeCheckTime)
-
getInitialDelayTime
public long getInitialDelayTime()
-
setInitialDelayTime
public void setInitialDelayTime(long initialDelayTime)
-
isKeepAliveResponseRequired
public boolean isKeepAliveResponseRequired()
-
setKeepAliveResponseRequired
public void setKeepAliveResponseRequired(boolean value)
-
isMonitorStarted
public boolean isMonitorStarted()
-
configuredOk
protected abstract boolean configuredOk() throws IOException- Throws:
IOException
-
startConnectCheckTask
public void startConnectCheckTask()
-
startConnectCheckTask
public void startConnectCheckTask(long connectionTimeout)
-
stopConnectCheckTask
public void stopConnectCheckTask()
-
startMonitorThreads
protected void startMonitorThreads() throws IOException- Throws:
IOException
-
stopMonitorThreads
protected void stopMonitorThreads()
-
-