public abstract class AbstractRemotingConnection extends Object implements RemotingConnection
| Modifier and Type | Field and Description |
|---|---|
protected List<org.apache.activemq.artemis.core.remoting.CloseListener> |
closeListeners |
protected long |
creationTime |
protected boolean |
dataReceived |
protected Executor |
executor |
protected List<org.apache.activemq.artemis.core.remoting.FailureListener> |
failureListeners |
protected Connection |
transportConnection |
| Constructor and Description |
|---|
AbstractRemotingConnection(Connection transportConnection,
Executor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(org.apache.activemq.artemis.core.remoting.CloseListener listener)
add a CloseListener.
|
void |
addFailureListener(org.apache.activemq.artemis.core.remoting.FailureListener listener)
add a failure listener.
|
void |
bufferReceived(Object connectionID,
ActiveMQBuffer buffer)
called by the remoting connection when a buffer is received.
|
protected void |
callClosingListeners() |
protected void |
callFailureListeners(ActiveMQException me,
String scaleDownTargetNodeID) |
boolean |
checkDataReceived()
returns true if any data has been received since the last time this method was called.
|
ActiveMQBuffer |
createTransportBuffer(int size)
creates a new ActiveMQBuffer of the specified size.
|
void |
fail(ActiveMQException me)
called when the underlying connection fails.
|
long |
getCreationTime()
Returns the creation time of the
RemotingConnection. |
List<org.apache.activemq.artemis.core.remoting.FailureListener> |
getFailureListeners()
return all the failure listeners
|
Object |
getID()
Returns the unique id of the
RemotingConnection. |
String |
getLocalAddress() |
String |
getRemoteAddress()
returns a string representation of the remote address of this connection
|
Connection |
getTransportConnection()
return the underlying Connection.
|
boolean |
isSupportReconnect()
This will check if reconnects are supported on the protocol and configuration.
|
boolean |
isSupportsFlowControl()
Return true if the protocol supports flow control.
|
boolean |
isWritable(ReadyListener callback) |
boolean |
removeCloseListener(org.apache.activemq.artemis.core.remoting.CloseListener listener)
remove a Close Listener
|
List<org.apache.activemq.artemis.core.remoting.CloseListener> |
removeCloseListeners() |
boolean |
removeFailureListener(org.apache.activemq.artemis.core.remoting.FailureListener listener)
remove the failure listener
|
List<org.apache.activemq.artemis.core.remoting.FailureListener> |
removeFailureListeners() |
void |
setCloseListeners(List<org.apache.activemq.artemis.core.remoting.CloseListener> listeners) |
void |
setFailureListeners(List<org.apache.activemq.artemis.core.remoting.FailureListener> listeners)
set the failure listeners.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, disconnect, disconnect, fail, flush, isClient, isDestroyed, killMessageprotected final List<org.apache.activemq.artemis.core.remoting.FailureListener> failureListeners
protected final List<org.apache.activemq.artemis.core.remoting.CloseListener> closeListeners
protected final Connection transportConnection
protected final Executor executor
protected final long creationTime
protected volatile boolean dataReceived
public AbstractRemotingConnection(Connection transportConnection, Executor executor)
public List<org.apache.activemq.artemis.core.remoting.FailureListener> getFailureListeners()
RemotingConnectiongetFailureListeners in interface RemotingConnectionpublic boolean isWritable(ReadyListener callback)
isWritable in interface RemotingConnectionprotected void callFailureListeners(ActiveMQException me, String scaleDownTargetNodeID)
protected void callClosingListeners()
public void setFailureListeners(List<org.apache.activemq.artemis.core.remoting.FailureListener> listeners)
RemotingConnectionThese will be called in the event of the connection being closed. Any previously added listeners will be removed.
setFailureListeners in interface RemotingConnectionlisteners - the listeners to add.public Object getID()
RemotingConnectionRemotingConnection.getID in interface RemotingConnectionpublic String getLocalAddress()
public String getRemoteAddress()
RemotingConnectiongetRemoteAddress in interface RemotingConnectionpublic void addFailureListener(org.apache.activemq.artemis.core.remoting.FailureListener listener)
RemotingConnectionThe listener will be called in the event of connection failure.
addFailureListener in interface RemotingConnectionlistener - the listenerpublic boolean removeFailureListener(org.apache.activemq.artemis.core.remoting.FailureListener listener)
RemotingConnectionremoveFailureListener in interface RemotingConnectionlistener - the lister to removepublic void addCloseListener(org.apache.activemq.artemis.core.remoting.CloseListener listener)
RemotingConnectionThis will be called in the event of the connection being closed.
addCloseListener in interface RemotingConnectionlistener - the listener to addpublic boolean removeCloseListener(org.apache.activemq.artemis.core.remoting.CloseListener listener)
RemotingConnectionremoveCloseListener in interface RemotingConnectionlistener - the listener to removepublic List<org.apache.activemq.artemis.core.remoting.CloseListener> removeCloseListeners()
removeCloseListeners in interface RemotingConnectionpublic List<org.apache.activemq.artemis.core.remoting.FailureListener> removeFailureListeners()
removeFailureListeners in interface RemotingConnectionpublic void setCloseListeners(List<org.apache.activemq.artemis.core.remoting.CloseListener> listeners)
setCloseListeners in interface RemotingConnectionpublic ActiveMQBuffer createTransportBuffer(int size)
RemotingConnectioncreateTransportBuffer in interface RemotingConnectionsize - the size of buffer requiredpublic Connection getTransportConnection()
RemotingConnectiongetTransportConnection in interface RemotingConnectionpublic long getCreationTime()
RemotingConnectionRemotingConnection.getCreationTime in interface RemotingConnectionpublic boolean checkDataReceived()
RemotingConnectioncheckDataReceived in interface RemotingConnectionpublic boolean isSupportReconnect()
RemotingConnectionisSupportReconnect in interface RemotingConnectionpublic void fail(ActiveMQException me)
RemotingConnectionfail in interface RemotingConnectionme - the exception that caused the failurepublic void bufferReceived(Object connectionID, ActiveMQBuffer buffer)
BufferHandlerbufferReceived in interface BufferHandlerconnectionID - the connection the buffer was received onbuffer - the buffer to decodepublic boolean isSupportsFlowControl()
RemotingConnectionisSupportsFlowControl in interface RemotingConnectionCopyright © 2018 The Apache Software Foundation. All rights reserved.