public class RemotingConnectionImpl extends AbstractRemotingConnection implements CoreRemotingConnection
closeListeners, creationTime, dataReceived, executor, failureListeners, transportConnection
Constructor and Description |
---|
RemotingConnectionImpl(PacketDecoder packetDecoder,
Connection transportConnection,
long blockingCallTimeout,
long blockingCallFailoverTimeout,
List<Interceptor> incomingInterceptors,
List<Interceptor> outgoingInterceptors) |
Modifier and Type | Method and Description |
---|---|
boolean |
blockUntilWritable(int size,
long timeout) |
void |
bufferReceived(Object connectionID,
ActiveMQBuffer buffer)
called by the remoting connection when a buffer is received.
|
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(ActiveMQException me,
String scaleDownTargetNodeID)
called when the underlying connection fails.
|
void |
flush()
flush all outstanding data from the connection.
|
long |
generateChannelID()
generate a unique (within this connection) channel id
|
long |
getBlockingCallFailoverTimeout()
Returns the current timeout for blocking calls
|
long |
getBlockingCallTimeout()
Returns the current timeout for blocking calls
|
Channel |
getChannel(long channelID,
int confWindowSize)
Returns the channel with the channel id specified.
|
int |
getChannelVersion()
The client protocol used on the communication.
|
ActiveMQPrincipal |
getDefaultActiveMQPrincipal()
Returns the default security principal
|
long |
getIDGeneratorSequence()
Returns the next id to be chosen.
|
String |
getProtocolName()
Returns the name of the protocol for this Remoting Connection
|
Object |
getTransferLock()
Returns the transfer lock used when transferring connections.
|
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. |
boolean |
isSupportReconnect()
This will check if reconnects are supported on the protocol and configuration.
|
void |
killMessage(SimpleString nodeID)
if slow consumer is killed,send the msessage to client.
|
void |
putChannel(long channelID,
Channel channel)
add the channel with the specified channel id
|
protected void |
removeAllChannels() |
boolean |
removeChannel(long channelID)
remove the channel with the specified channel id
|
void |
scheduledFlush() |
void |
setChannelVersion(int clientVersion)
Sets the client protocol used on the communication.
|
void |
syncIDGeneratorSequence(long id)
Resets the id generator used to generate id's.
|
String |
toString() |
addCloseListener, addFailureListener, callClosingListeners, callFailureListeners, checkDataReceived, createTransportBuffer, fail, getClientID, getCreationTime, getFailureListeners, getID, getLocalAddress, getRemoteAddress, getSubject, getTransportConnection, isSupportsFlowControl, isWritable, removeCloseListener, removeCloseListeners, removeFailureListener, removeFailureListeners, setClientID, setCloseListeners, setFailureListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isVersionBeforeAddressChange
addCloseListener, addFailureListener, checkDataReceived, createTransportBuffer, fail, getClientID, getCreationTime, getFailureListeners, getID, getRemoteAddress, getSubject, getTransportConnection, isSameTarget, isSupportsFlowControl, isWritable, removeCloseListener, removeCloseListeners, removeFailureListener, removeFailureListeners, setClientID, setCloseListeners, setFailureListeners
public RemotingConnectionImpl(PacketDecoder packetDecoder, Connection transportConnection, long blockingCallTimeout, long blockingCallFailoverTimeout, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
public void scheduledFlush()
scheduledFlush
in interface RemotingConnection
scheduledFlush
in class AbstractRemotingConnection
public int getChannelVersion()
CoreRemotingConnection
getChannelVersion
in interface CoreRemotingConnection
public void setChannelVersion(int clientVersion)
CoreRemotingConnection
setChannelVersion
in interface CoreRemotingConnection
clientVersion
- the channelVersion to setpublic Channel getChannel(long channelID, int confWindowSize)
CoreRemotingConnection
If it does not exist create it with the confirmation window size.
getChannel
in interface CoreRemotingConnection
channelID
- the channel idconfWindowSize
- the confirmation window sizepublic boolean removeChannel(long channelID)
CoreRemotingConnection
removeChannel
in interface CoreRemotingConnection
channelID
- the channel idpublic void putChannel(long channelID, Channel channel)
CoreRemotingConnection
putChannel
in interface CoreRemotingConnection
channelID
- the channel idchannel
- the channelpublic void fail(ActiveMQException me, String scaleDownTargetNodeID)
RemotingConnection
fail
in interface RemotingConnection
me
- the exception that caused the failurescaleDownTargetNodeID
- the ID of the node where scale down is targetedpublic void destroy()
RemotingConnection
destroy
in interface RemotingConnection
public boolean blockUntilWritable(int size, long timeout)
blockUntilWritable
in interface CoreRemotingConnection
size
- size we are trying to writepublic void disconnect(boolean criticalError)
RemotingConnection
disconnect
in interface RemotingConnection
public void disconnect(String scaleDownNodeID, boolean criticalError)
RemotingConnection
disconnect
in interface RemotingConnection
public long generateChannelID()
CoreRemotingConnection
generateChannelID
in interface CoreRemotingConnection
public void syncIDGeneratorSequence(long id)
CoreRemotingConnection
syncIDGeneratorSequence
in interface CoreRemotingConnection
id
- the first id to set it topublic long getIDGeneratorSequence()
CoreRemotingConnection
getIDGeneratorSequence
in interface CoreRemotingConnection
public Object getTransferLock()
CoreRemotingConnection
getTransferLock
in interface CoreRemotingConnection
public boolean isClient()
RemotingConnection
RemotingConnection
is a clientisClient
in interface RemotingConnection
public boolean isDestroyed()
RemotingConnection
RemotingConnection
has been destroyed.isDestroyed
in interface RemotingConnection
public long getBlockingCallTimeout()
CoreRemotingConnection
getBlockingCallTimeout
in interface CoreRemotingConnection
public long getBlockingCallFailoverTimeout()
CoreRemotingConnection
getBlockingCallFailoverTimeout
in interface CoreRemotingConnection
public void flush()
RemotingConnection
flush
in interface RemotingConnection
public ActiveMQPrincipal getDefaultActiveMQPrincipal()
CoreRemotingConnection
getDefaultActiveMQPrincipal
in interface CoreRemotingConnection
public boolean isSupportReconnect()
RemotingConnection
isSupportReconnect
in interface RemotingConnection
isSupportReconnect
in class AbstractRemotingConnection
public String getProtocolName()
getProtocolName
in interface RemotingConnection
public void bufferReceived(Object connectionID, ActiveMQBuffer buffer)
BufferHandler
bufferReceived
in interface BufferHandler
bufferReceived
in class AbstractRemotingConnection
connectionID
- the connection the buffer was received onbuffer
- the buffer to decodepublic String getTransportLocalAddress()
RemotingConnection
getTransportLocalAddress
in interface RemotingConnection
protected void removeAllChannels()
public void killMessage(SimpleString nodeID)
RemotingConnection
killMessage
in interface RemotingConnection
Copyright © 2018 JBoss by Red Hat. All rights reserved.