public interface RemotingConnection extends BufferHandler
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.
|
Future |
asyncFail(org.apache.activemq.artemis.api.core.ActiveMQException me)
Same thing as fail, but using an executor.
|
boolean |
checkDataReceived()
returns true if any data has been received since the last time this method was called.
|
org.apache.activemq.artemis.api.core.ActiveMQBuffer |
createTransportBuffer(int size)
creates a new ActiveMQBuffer of the specified size.
|
void |
destroy()
destroys this connection.
|
void |
disconnect(boolean criticalError)
Disconnect the connection, closing all channels
|
void |
disconnect(String scaleDownNodeID,
boolean criticalError)
Disconnect the connection, closing all channels
|
void |
fail(org.apache.activemq.artemis.api.core.ActiveMQException me)
called when the underlying connection fails.
|
void |
fail(org.apache.activemq.artemis.api.core.ActiveMQException me,
String scaleDownTargetNodeID)
called when the underlying connection fails.
|
void |
flush()
flush all outstanding data from the connection.
|
String |
getClientID()
Returns the Client ID associated with this connection
|
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 |
getProtocolName()
Returns the name of the protocol for this Remoting Connection
|
String |
getRemoteAddress()
returns a string representation of the remote address of this connection
|
Subject |
getSubject()
the possibly null identity associated with this connection
|
Connection |
getTransportConnection()
return the underlying Connection.
|
String |
getTransportLocalAddress()
Returns a string representation of the local address this connection is connected to.
|
boolean |
isClient()
Returns whether or not the
RemotingConnection is a client |
boolean |
isDestroyed()
Returns true if this
RemotingConnection has been destroyed. |
default boolean |
isSameTarget(TransportConfiguration... configs) |
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) |
void |
killMessage(org.apache.activemq.artemis.api.core.SimpleString nodeID)
if slow consumer is killed,send the msessage to client.
|
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 |
scheduledFlush() |
void |
setClientID(String cID)
Sets the client ID associated with this connection
|
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.
|
bufferReceived
Object getID()
RemotingConnection
.long getCreationTime()
RemotingConnection
.String getRemoteAddress()
void scheduledFlush()
void addFailureListener(org.apache.activemq.artemis.core.remoting.FailureListener listener)
The listener will be called in the event of connection failure.
listener
- the listenerboolean removeFailureListener(org.apache.activemq.artemis.core.remoting.FailureListener listener)
listener
- the lister to removevoid addCloseListener(org.apache.activemq.artemis.core.remoting.CloseListener listener)
This will be called in the event of the connection being closed.
listener
- the listener to addboolean removeCloseListener(org.apache.activemq.artemis.core.remoting.CloseListener listener)
listener
- the listener to removeList<org.apache.activemq.artemis.core.remoting.CloseListener> removeCloseListeners()
void setCloseListeners(List<org.apache.activemq.artemis.core.remoting.CloseListener> listeners)
List<org.apache.activemq.artemis.core.remoting.FailureListener> getFailureListeners()
List<org.apache.activemq.artemis.core.remoting.FailureListener> removeFailureListeners()
void setFailureListeners(List<org.apache.activemq.artemis.core.remoting.FailureListener> listeners)
These will be called in the event of the connection being closed. Any previously added listeners will be removed.
listeners
- the listeners to add.org.apache.activemq.artemis.api.core.ActiveMQBuffer createTransportBuffer(int size)
size
- the size of buffer requiredvoid fail(org.apache.activemq.artemis.api.core.ActiveMQException me)
me
- the exception that caused the failureFuture asyncFail(org.apache.activemq.artemis.api.core.ActiveMQException me)
me
- void fail(org.apache.activemq.artemis.api.core.ActiveMQException me, String scaleDownTargetNodeID)
me
- the exception that caused the failurescaleDownTargetNodeID
- the ID of the node where scale down is targetedvoid destroy()
Connection getTransportConnection()
boolean isClient()
RemotingConnection
is a clientboolean isDestroyed()
RemotingConnection
has been destroyed.void disconnect(boolean criticalError)
void disconnect(String scaleDownNodeID, boolean criticalError)
boolean checkDataReceived()
void flush()
boolean isWritable(ReadyListener callback)
void killMessage(org.apache.activemq.artemis.api.core.SimpleString nodeID)
boolean isSupportReconnect()
boolean isSupportsFlowControl()
Subject getSubject()
String getProtocolName()
void setClientID(String cID)
String getClientID()
String getTransportLocalAddress()
default boolean isSameTarget(TransportConfiguration... configs)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.