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 |
createBuffer(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()
RemotingConnection
getTransportConnection
in interface RemotingConnection
public List<FailureListener> getFailureListeners()
RemotingConnection
getFailureListeners
in interface RemotingConnection
public void setFailureListeners(List<FailureListener> listeners)
RemotingConnection
setFailureListeners
in interface RemotingConnection
listeners
- the listeners to add.public int getClientVersion()
CoreRemotingConnection
getClientVersion
in interface CoreRemotingConnection
public void setClientVersion(int clientVersion)
CoreRemotingConnection
setClientVersion
in interface CoreRemotingConnection
clientVersion
- the clientVersion to setpublic Object getID()
RemotingConnection
RemotingConnection
.getID
in interface RemotingConnection
public String getRemoteAddress()
RemotingConnection
getRemoteAddress
in interface RemotingConnection
public long getCreationTime()
RemotingConnection
RemotingConnection
.getCreationTime
in interface RemotingConnection
public 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 addFailureListener(FailureListener listener)
RemotingConnection
addFailureListener
in interface RemotingConnection
listener
- the listenerpublic boolean removeFailureListener(FailureListener listener)
RemotingConnection
removeFailureListener
in interface RemotingConnection
listener
- the lister to removepublic void addCloseListener(CloseListener listener)
RemotingConnection
addCloseListener
in interface RemotingConnection
listener
- the listener to addpublic boolean removeCloseListener(CloseListener listener)
RemotingConnection
removeCloseListener
in interface RemotingConnection
listener
- the listener to removepublic List<CloseListener> removeCloseListeners()
removeCloseListeners
in interface RemotingConnection
public List<FailureListener> removeFailureListeners()
removeFailureListeners
in interface RemotingConnection
public void setCloseListeners(List<CloseListener> listeners)
setCloseListeners
in interface RemotingConnection
public HornetQBuffer createBuffer(int size)
RemotingConnection
createBuffer
in interface RemotingConnection
size
- the size of buffer requiredpublic void fail(HornetQException me)
RemotingConnection
fail
in interface RemotingConnection
me
- the exception that caused the failurepublic void destroy()
RemotingConnection
destroy
in interface RemotingConnection
public void disconnect(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 boolean checkDataReceived()
RemotingConnection
checkDataReceived
in interface RemotingConnection
public void flush()
RemotingConnection
flush
in interface RemotingConnection
public HornetQPrincipal getDefaultHornetQPrincipal()
CoreRemotingConnection
getDefaultHornetQPrincipal
in interface CoreRemotingConnection
public void bufferReceived(Object connectionID, HornetQBuffer buffer)
BufferHandler
bufferReceived
in interface BufferHandler
connectionID
- the connection the buffer was received onbuffer
- the buffer to decodepublic void setClientID(String cID)
public String getClientID()
Copyright © 2014 JBoss, a division of Red Hat. All rights reserved.