Class ManagementRemotingConnection
java.lang.Object
org.apache.activemq.artemis.core.management.impl.ManagementRemotingConnection
- All Implemented Interfaces:
RemotingConnection,BufferHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseListener(CloseListener listener) add a CloseListener.voidaddFailureListener(FailureListener listener) add a failure listener.Same thing as fail, but using an executor. semantic of send here, is asynchrounous.voidbufferReceived(Object connectionID, ActiveMQBuffer buffer) called by the remoting connection when a buffer is received.booleanReturns true if any data has been received since the last time this method was called.voidclose()createTransportBuffer(int size) creates a new ActiveMQBuffer of the specified size.voiddestroy()destroys this connection.voiddisconnect(boolean criticalError) Disconnect the connection, closing all channelsvoiddisconnect(String scaleDownNodeID, boolean criticalError) Disconnect the connection, closing all channelsvoidcalled when the underlying connection fails.voidfail(ActiveMQException me, String scaleDownTargetNodeID) called when the underlying connection fails.voidflush()flush all outstanding data from the connection.Returns the Client ID associated with this connection.longReturns the creation time of theRemotingConnection.Returns all the failure listeners.getID()Returns the unique id of theRemotingConnection.Returns the name of the protocol for this Remoting Connection.Returns a string representation of the remote address of this connection.the possibly null subject associated with this connectionreturn the underlying Connection.Returns a string representation of the local address this connection is connected to This is useful when the server is configured at 0.0.0.0 (or multiple IPs).booleanisClient()Returns true if theRemotingConnectionis a client, otherwise false.booleanReturns true if thisRemotingConnectionhas been destroyed, otherwise false.booleanThis will check if reconnects are supported on the protocol and configuration.booleanReturn true if the protocol supports flow control.booleanisWritable(ReadyListener callback) voidkillMessage(SimpleString nodeID) if slow consumer is killed,send the msessage to client.booleanremoveCloseListener(CloseListener listener) remove a Close ListenerbooleanremoveFailureListener(FailureListener listener) remove the failure listenervoidvoidsetClientID(String cID) Sets the client ID associated with this connectionvoidsetCloseListeners(List<CloseListener> listeners) voidsetFailureListeners(List<FailureListener> listeners) set the failure listeners.voidsetSubject(Subject subject) sets the currently associated subject for this connectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.activemq.artemis.spi.core.remoting.BufferHandler
endOfBatchMethods inherited from interface org.apache.activemq.artemis.spi.core.protocol.RemotingConnection
disconnect, isSameTarget
-
Field Details
-
callback
-
-
Constructor Details
-
ManagementRemotingConnection
public ManagementRemotingConnection()
-
-
Method Details
-
getID
Description copied from interface:RemotingConnectionReturns the unique id of theRemotingConnection.- Specified by:
getIDin interfaceRemotingConnection- Returns:
- the unique id of the
RemotingConnection
-
getCreationTime
public long getCreationTime()Description copied from interface:RemotingConnectionReturns the creation time of theRemotingConnection.- Specified by:
getCreationTimein interfaceRemotingConnection- Returns:
- the creation time of the
RemotingConnection
-
getRemoteAddress
Description copied from interface:RemotingConnectionReturns a string representation of the remote address of this connection.- Specified by:
getRemoteAddressin interfaceRemotingConnection- Returns:
- a string representation of the remote address of this connection
-
scheduledFlush
public void scheduledFlush()- Specified by:
scheduledFlushin interfaceRemotingConnection
-
addFailureListener
Description copied from interface:RemotingConnectionadd a failure listener.The listener will be called in the event of connection failure.
- Specified by:
addFailureListenerin interfaceRemotingConnection- Parameters:
listener- the listener
-
removeFailureListener
Description copied from interface:RemotingConnectionremove the failure listener- Specified by:
removeFailureListenerin interfaceRemotingConnection- Parameters:
listener- the lister to remove- Returns:
- true if removed
-
addCloseListener
Description copied from interface:RemotingConnectionadd a CloseListener.This will be called in the event of the connection being closed.
- Specified by:
addCloseListenerin interfaceRemotingConnection- Parameters:
listener- the listener to add
-
removeCloseListener
Description copied from interface:RemotingConnectionremove a Close Listener- Specified by:
removeCloseListenerin interfaceRemotingConnection- Parameters:
listener- the listener to remove- Returns:
- true if removed
-
removeCloseListeners
- Specified by:
removeCloseListenersin interfaceRemotingConnection
-
setCloseListeners
- Specified by:
setCloseListenersin interfaceRemotingConnection
-
getFailureListeners
Description copied from interface:RemotingConnectionReturns all the failure listeners.- Specified by:
getFailureListenersin interfaceRemotingConnection- Returns:
- all the failure listeners
-
removeFailureListeners
- Specified by:
removeFailureListenersin interfaceRemotingConnection
-
setFailureListeners
Description copied from interface:RemotingConnectionset the failure listeners.These will be called in the event of the connection being closed. Any previously added listeners will be removed.
- Specified by:
setFailureListenersin interfaceRemotingConnection- Parameters:
listeners- the listeners to add.
-
createTransportBuffer
Description copied from interface:RemotingConnectioncreates a new ActiveMQBuffer of the specified size. For the purpose of i/o outgoing packets- Specified by:
createTransportBufferin interfaceRemotingConnection- Parameters:
size- the size of buffer required- Returns:
- the buffer
-
fail
Description copied from interface:RemotingConnectioncalled when the underlying connection fails.- Specified by:
failin interfaceRemotingConnection- Parameters:
me- the exception that caused the failure
-
asyncFail
Description copied from interface:RemotingConnectionSame thing as fail, but using an executor. semantic of send here, is asynchrounous.- Specified by:
asyncFailin interfaceRemotingConnection
-
fail
Description copied from interface:RemotingConnectioncalled when the underlying connection fails.- Specified by:
failin interfaceRemotingConnection- Parameters:
me- the exception that caused the failurescaleDownTargetNodeID- the ID of the node where scale down is targeted
-
destroy
public void destroy()Description copied from interface:RemotingConnectiondestroys this connection.- Specified by:
destroyin interfaceRemotingConnection
-
getTransportConnection
Description copied from interface:RemotingConnectionreturn the underlying Connection.- Specified by:
getTransportConnectionin interfaceRemotingConnection- Returns:
- the connection
-
isClient
public boolean isClient()Description copied from interface:RemotingConnectionReturns true if theRemotingConnectionis a client, otherwise false.- Specified by:
isClientin interfaceRemotingConnection- Returns:
- true if the
RemotingConnectionis a client, otherwise false
-
isDestroyed
public boolean isDestroyed()Description copied from interface:RemotingConnectionReturns true if thisRemotingConnectionhas been destroyed, otherwise false.- Specified by:
isDestroyedin interfaceRemotingConnection- Returns:
- true if this
RemotingConnectionhas been destroyed, otherwise false
-
disconnect
public void disconnect(boolean criticalError) Description copied from interface:RemotingConnectionDisconnect the connection, closing all channels- Specified by:
disconnectin interfaceRemotingConnection
-
disconnect
Description copied from interface:RemotingConnectionDisconnect the connection, closing all channels- Specified by:
disconnectin interfaceRemotingConnection
-
checkDataReceived
public boolean checkDataReceived()Description copied from interface:RemotingConnectionReturns true if any data has been received since the last time this method was called.- Specified by:
checkDataReceivedin interfaceRemotingConnection- Returns:
- true if any data has been received since the last time this method was called
-
flush
public void flush()Description copied from interface:RemotingConnectionflush all outstanding data from the connection.- Specified by:
flushin interfaceRemotingConnection
-
isWritable
- Specified by:
isWritablein interfaceRemotingConnection
-
killMessage
Description copied from interface:RemotingConnectionif slow consumer is killed,send the msessage to client.- Specified by:
killMessagein interfaceRemotingConnection
-
isSupportReconnect
public boolean isSupportReconnect()Description copied from interface:RemotingConnectionThis will check if reconnects are supported on the protocol and configuration. In case it's not supported a connection failure could remove messages right away from pending deliveries.- Specified by:
isSupportReconnectin interfaceRemotingConnection
-
isSupportsFlowControl
public boolean isSupportsFlowControl()Description copied from interface:RemotingConnectionReturn true if the protocol supports flow control. This is because in some cases we may need to hold message producers in cases like disk full. If the protocol doesn't support it we trash the connection and throw exceptions.- Specified by:
isSupportsFlowControlin interfaceRemotingConnection
-
setSubject
Description copied from interface:RemotingConnectionsets the currently associated subject for this connection- Specified by:
setSubjectin interfaceRemotingConnection
-
getSubject
Description copied from interface:RemotingConnectionthe possibly null subject associated with this connection- Specified by:
getSubjectin interfaceRemotingConnection
-
getProtocolName
Description copied from interface:RemotingConnectionReturns the name of the protocol for this Remoting Connection.- Specified by:
getProtocolNamein interfaceRemotingConnection- Returns:
- the name of the protocol for this Remoting Connection
-
setClientID
Description copied from interface:RemotingConnectionSets the client ID associated with this connection- Specified by:
setClientIDin interfaceRemotingConnection
-
getClientID
Description copied from interface:RemotingConnectionReturns the Client ID associated with this connection.- Specified by:
getClientIDin interfaceRemotingConnection- Returns:
- the Client ID associated with this connection
-
getTransportLocalAddress
Description copied from interface:RemotingConnectionReturns a string representation of the local address this connection is connected to This is useful when the server is configured at 0.0.0.0 (or multiple IPs). This will give you the actual IP that's being used.- Specified by:
getTransportLocalAddressin interfaceRemotingConnection- Returns:
- the local address of transport connection
-
bufferReceived
Description copied from interface:BufferHandlercalled by the remoting connection when a buffer is received.- Specified by:
bufferReceivedin interfaceBufferHandler- Parameters:
connectionID- the connection the buffer was received onbuffer- the buffer to decode
-
close
public void close()- Specified by:
closein interfaceRemotingConnection
-