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.
|
String |
getClientID() |
int |
getClientVersion()
The client protocol used on the communication.
|
ActiveMQPrincipal |
getDefaultActiveMQPrincipal()
Returns the default security principal
|
long |
getIDGeneratorSequence()
Returns the next id to be chosen.
|
Object |
getTransferLock()
Returns the transfer lock used when transferring connections.
|
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 |
setClientID(String cID) |
void |
setClientVersion(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, getCreationTime, getFailureListeners, getID, getLocalAddress, getRemoteAddress, getTransportConnection, isSupportsFlowControl, isWritable, removeCloseListener, removeCloseListeners, removeFailureListener, removeFailureListeners, setCloseListeners, setFailureListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addCloseListener, addFailureListener, checkDataReceived, createTransportBuffer, fail, getCreationTime, getFailureListeners, getID, getRemoteAddress, getTransportConnection, isSupportsFlowControl, isWritable, removeCloseListener, removeCloseListeners, removeFailureListener, removeFailureListeners, setCloseListeners, setFailureListeners
public RemotingConnectionImpl(PacketDecoder packetDecoder, Connection transportConnection, long blockingCallTimeout, long blockingCallFailoverTimeout, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
public int getClientVersion()
CoreRemotingConnection
getClientVersion
in interface CoreRemotingConnection
public void setClientVersion(int clientVersion)
CoreRemotingConnection
setClientVersion
in interface CoreRemotingConnection
clientVersion
- the clientVersion 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 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 decodeprotected void removeAllChannels()
public void setClientID(String cID)
public String getClientID()
public void killMessage(SimpleString nodeID)
RemotingConnection
killMessage
in interface RemotingConnection
Copyright © 2017 JBoss by Red Hat. All rights reserved.