public class RemotingConnectionImpl extends Object implements CoreRemotingConnection
| Constructor and Description |
|---|
RemotingConnectionImpl(PacketDecoder packetDecoder,
Connection transportConnection,
long blockingCallTimeout,
long blockingCallFailoverTimeout,
List<Interceptor> incomingInterceptors,
List<Interceptor> outgoingInterceptors) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseListener(CloseListener listener)
add a CloseListener.
|
void |
addFailureListener(FailureListener listener)
add a failure listener.
|
void |
bufferReceived(Object connectionID,
HornetQBuffer buffer)
called by the remoting connection when a buffer is received.
|
boolean |
checkDataReceived()
returns true if any data has been received since the last time this method was called.
|
HornetQBuffer |
createTransportBuffer(int size)
creates a new HornetQBuffer of the specified size.
|
void |
destroy()
destroys this connection.
|
void |
disconnect(boolean criticalError)
Disconnect the connection, closing all channels
|
void |
fail(HornetQException me)
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.
|
long |
getCreationTime()
Returns the creation time of the
RemotingConnection. |
HornetQPrincipal |
getDefaultHornetQPrincipal()
Returns the default security principal
|
List<FailureListener> |
getFailureListeners()
return all the failure listeners
|
Object |
getID()
Returns the unique id of the
RemotingConnection. |
long |
getIDGeneratorSequence()
Returns the next id to be chosen.
|
String |
getRemoteAddress()
returns a string representation of the remote address of this connection
|
Object |
getTransferLock()
Returns the transfer lock used when transferring connections.
|
Connection |
getTransportConnection()
return the underlying Connection.
|
boolean |
isClient()
Returns whether or not the
RemotingConnection is a client |
boolean |
isDestroyed()
Returns true if this
RemotingConnection has been destroyed. |
void |
putChannel(long channelID,
Channel channel)
add the channel with the specified channel id
|
boolean |
removeChannel(long channelID)
remove the channel with the specified channel id
|
boolean |
removeCloseListener(CloseListener listener)
remove a Close Listener
|
List<CloseListener> |
removeCloseListeners() |
boolean |
removeFailureListener(FailureListener listener)
remove the failure listener
|
List<FailureListener> |
removeFailureListeners() |
void |
setClientID(String cID) |
void |
setClientVersion(int clientVersion)
Sets the client protocol used on the communication.
|
void |
setCloseListeners(List<CloseListener> listeners) |
void |
setFailureListeners(List<FailureListener> listeners)
set the failure listeners.
|
void |
syncIDGeneratorSequence(long id)
Resets the id generator used to generate id's.
|
String |
toString() |
public RemotingConnectionImpl(PacketDecoder packetDecoder, Connection transportConnection, long blockingCallTimeout, long blockingCallFailoverTimeout, List<Interceptor> incomingInterceptors, List<Interceptor> outgoingInterceptors)
public Connection getTransportConnection()
RemotingConnectiongetTransportConnection in interface RemotingConnectionpublic List<FailureListener> getFailureListeners()
RemotingConnectiongetFailureListeners in interface RemotingConnectionpublic void setFailureListeners(List<FailureListener> listeners)
RemotingConnectionThese will be called in the event of the connection being closed. Any previosuly added listeners will be removed.
setFailureListeners in interface RemotingConnectionlisteners - the listeners to add.public int getClientVersion()
CoreRemotingConnectiongetClientVersion in interface CoreRemotingConnectionpublic void setClientVersion(int clientVersion)
CoreRemotingConnectionsetClientVersion in interface CoreRemotingConnectionclientVersion - the clientVersion to setpublic Object getID()
RemotingConnectionRemotingConnection.getID in interface RemotingConnectionpublic String getRemoteAddress()
RemotingConnectiongetRemoteAddress in interface RemotingConnectionpublic long getCreationTime()
RemotingConnectionRemotingConnection.getCreationTime in interface RemotingConnectionpublic Channel getChannel(long channelID, int confWindowSize)
CoreRemotingConnectionIf it does not exist create it with the confirmation window size.
getChannel in interface CoreRemotingConnectionchannelID - the channel idconfWindowSize - the confirmation window sizepublic boolean removeChannel(long channelID)
CoreRemotingConnectionremoveChannel in interface CoreRemotingConnectionchannelID - the channel idpublic void putChannel(long channelID,
Channel channel)
CoreRemotingConnectionputChannel in interface CoreRemotingConnectionchannelID - the channel idchannel - the channelpublic void addFailureListener(FailureListener listener)
RemotingConnectionThe listener will be called in the event of connection failure.
addFailureListener in interface RemotingConnectionlistener - the listenerpublic boolean removeFailureListener(FailureListener listener)
RemotingConnectionremoveFailureListener in interface RemotingConnectionlistener - the lister to removepublic void addCloseListener(CloseListener listener)
RemotingConnectionThis will be called in the event of the connection being closed.
addCloseListener in interface RemotingConnectionlistener - the listener to addpublic boolean removeCloseListener(CloseListener listener)
RemotingConnectionremoveCloseListener in interface RemotingConnectionlistener - the listener to removepublic List<CloseListener> removeCloseListeners()
removeCloseListeners in interface RemotingConnectionpublic List<FailureListener> removeFailureListeners()
removeFailureListeners in interface RemotingConnectionpublic void setCloseListeners(List<CloseListener> listeners)
setCloseListeners in interface RemotingConnectionpublic HornetQBuffer createTransportBuffer(int size)
RemotingConnectioncreateTransportBuffer in interface RemotingConnectionsize - the size of buffer requiredpublic void fail(HornetQException me)
RemotingConnectionfail in interface RemotingConnectionme - the exception that caused the failurepublic void destroy()
RemotingConnectiondestroy in interface RemotingConnectionpublic void disconnect(boolean criticalError)
RemotingConnectiondisconnect in interface RemotingConnectionpublic long generateChannelID()
CoreRemotingConnectiongenerateChannelID in interface CoreRemotingConnectionpublic void syncIDGeneratorSequence(long id)
CoreRemotingConnectionsyncIDGeneratorSequence in interface CoreRemotingConnectionid - the first id to set it topublic long getIDGeneratorSequence()
CoreRemotingConnectiongetIDGeneratorSequence in interface CoreRemotingConnectionpublic Object getTransferLock()
CoreRemotingConnectiongetTransferLock in interface CoreRemotingConnectionpublic boolean isClient()
RemotingConnectionRemotingConnection is a clientisClient in interface RemotingConnectionpublic boolean isDestroyed()
RemotingConnectionRemotingConnection has been destroyed.isDestroyed in interface RemotingConnectionpublic long getBlockingCallTimeout()
CoreRemotingConnectiongetBlockingCallTimeout in interface CoreRemotingConnectionpublic long getBlockingCallFailoverTimeout()
CoreRemotingConnectiongetBlockingCallFailoverTimeout in interface CoreRemotingConnectionpublic boolean checkDataReceived()
RemotingConnectioncheckDataReceived in interface RemotingConnectionpublic void flush()
RemotingConnectionflush in interface RemotingConnectionpublic HornetQPrincipal getDefaultHornetQPrincipal()
CoreRemotingConnectiongetDefaultHornetQPrincipal in interface CoreRemotingConnectionpublic void bufferReceived(Object connectionID, HornetQBuffer buffer)
BufferHandlerbufferReceived in interface BufferHandlerconnectionID - the connection the buffer was received onbuffer - the buffer to decodepublic void setClientID(String cID)
public String getClientID()
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.