| Modifier and Type | Class and Description |
|---|---|
static class |
ChannelImpl.CHANNEL_ID |
| Constructor and Description |
|---|
ChannelImpl(CoreRemotingConnection connection,
long id,
int confWindowSize,
List<Interceptor> interceptors) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCommands()
clears any commands from the cache that are yet to be confirmed.
|
void |
close()
Closes this channel.
|
void |
confirm(Packet packet)
sends a confirmation of a packet being received.
|
void |
flushConfirmations()
flushes any confirmations on to the connection.
|
int |
getConfirmationWindowSize()
returns the confirmation window size this channel is using.
|
CoreRemotingConnection |
getConnection()
returns the
CoreRemotingConnection being used by the channel |
ChannelHandler |
getHandler()
Gets the
ChannelHandler that this channel should
forward received packets to. |
long |
getID()
Returns the id of this channel.
|
int |
getLastConfirmedCommandID()
returns the last confirmed packet command id
|
Lock |
getLock()
returns the channel lock
|
int |
getReconnectID()
This number increases every time the channel reconnects successfully.
|
void |
handlePacket(Packet packet)
Called by
CoreRemotingConnection when a packet is received. |
static String |
invokeInterceptors(Packet packet,
List<Interceptor> interceptors,
RemotingConnection connection) |
void |
lock()
locks the channel.
|
void |
replayCommands(int otherLastConfirmedCommandID)
resends any packets that have not received confirmations yet.
|
void |
returnBlocking()
forces any
Channel.sendBlocking(Packet, byte) request to return with an exception. |
void |
returnBlocking(Throwable cause)
forces any
Channel.sendBlocking(Packet, byte) request to return with an exception. |
boolean |
send(Packet packet)
Sends a packet on this channel.
|
boolean |
send(Packet packet,
int reconnectID)
Sends a packet on this channel.
|
boolean |
sendAndFlush(Packet packet)
Sends a packet on this channel and then blocks until it has been written to the connection.
|
boolean |
sendBatched(Packet packet)
Sends a packet on this channel using batching algorithm if appropriate
|
Packet |
sendBlocking(Packet packet,
byte expectedPacket)
Sends a packet on this channel and then blocks until a response is received or a timeout
occurs.
|
Packet |
sendBlocking(Packet packet,
int reconnectID,
byte expectedPacket)
Due to networking issues or server issues the server may take longer to answer than expected..
|
void |
setCommandConfirmationHandler(CommandConfirmationHandler handler)
sets the handler to use when a confirmation is received.
|
void |
setHandler(ChannelHandler handler)
Sets the
ChannelHandler that this channel should
forward received packets to. |
void |
setTransferring(boolean transferring)
notifies the channel if it is transferring its connection.
|
boolean |
supports(byte packetType)
For protocol check
|
boolean |
supports(byte packetType,
int version)
For protocol check
|
String |
toString() |
void |
transferConnection(CoreRemotingConnection newConnection)
Transfers the connection used by this channel to the one specified.
|
void |
unlock()
unlocks the channel.
|
public ChannelImpl(CoreRemotingConnection connection, long id, int confWindowSize, List<Interceptor> interceptors)
public int getReconnectID()
ChannelgetReconnectID in interface Channelpublic boolean supports(byte packetType)
Channelpublic boolean supports(byte packetType,
int version)
Channelpublic long getID()
Channelpublic int getLastConfirmedCommandID()
ChannelgetLastConfirmedCommandID in interface Channelpublic int getConfirmationWindowSize()
ChannelgetConfirmationWindowSize in interface Channelpublic void returnBlocking()
ChannelChannel.sendBlocking(Packet, byte) request to return with an exception.returnBlocking in interface Channelpublic void returnBlocking(Throwable cause)
ChannelChannel.sendBlocking(Packet, byte) request to return with an exception.returnBlocking in interface Channelpublic boolean sendAndFlush(Packet packet)
ChannelsendAndFlush in interface Channelpacket - the packet to sendpublic boolean send(Packet packet)
Channelpublic boolean send(Packet packet, int reconnectID)
Channelpublic boolean sendBatched(Packet packet)
ChannelsendBatched in interface Channelpacket - the packet to sendpublic void setTransferring(boolean transferring)
ChannelsetTransferring in interface Channeltransferring - whether the channel is transferringpublic Packet sendBlocking(Packet packet, byte expectedPacket) throws ActiveMQException
ChannelsendBlocking in interface Channelpacket - the packet to sendexpectedPacket - the packet being expected.ActiveMQException - if an error occurs during the sendpublic Packet sendBlocking(Packet packet, int reconnectID, byte expectedPacket) throws ActiveMQException
sendBlocking in interface Channelpacket - the packet to sendexpectedPacket - the packet being expected.ActiveMQException - if an error occurs during the sendpublic static String invokeInterceptors(Packet packet, List<Interceptor> interceptors, RemotingConnection connection)
packet - the packet to interceptfalse or null if no interceptors
returned false.public void setCommandConfirmationHandler(CommandConfirmationHandler handler)
ChannelsetCommandConfirmationHandler in interface Channelhandler - the handler to callpublic void setHandler(ChannelHandler handler)
ChannelChannelHandler that this channel should
forward received packets to.setHandler in interface Channelhandler - the handlerpublic ChannelHandler getHandler()
ChannelChannelHandler that this channel should
forward received packets to.getHandler in interface Channelpublic void close()
Channelonce closed no packets can be sent.
public void transferConnection(CoreRemotingConnection newConnection)
ChannelAll new packets will be sent via this connection.
transferConnection in interface ChannelnewConnection - the new connectionpublic void replayCommands(int otherLastConfirmedCommandID)
ChannelTypically called after a connection has been transferred.
replayCommands in interface ChannelotherLastConfirmedCommandID - the last confirmed packetpublic void lock()
ChannelWhile locked no packets can be sent or received
public void unlock()
Channelpublic CoreRemotingConnection getConnection()
ChannelCoreRemotingConnection being used by the channelgetConnection in interface Channelpublic void flushConfirmations()
ChannelflushConfirmations in interface Channelpublic void confirm(Packet packet)
Channelpublic void clearCommands()
ChannelclearCommands in interface Channelpublic void handlePacket(Packet packet)
ChannelCoreRemotingConnection when a packet is received.
This method should then call its ChannelHandler after appropriate processing of
the packet
handlePacket in interface Channelpacket - the packet to process.Copyright © 2018 JBoss by Red Hat. All rights reserved.