| 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
|
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. |
boolean |
send(Packet packet)
Sends a packet on this channel.
|
boolean |
send(Packet packet,
boolean flush,
boolean batch) |
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)
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
|
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 boolean supports(byte packetType)
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 boolean sendAndFlush(Packet packet)
ChannelsendAndFlush in interface Channelpacket - the packet to sendpublic boolean send(Packet packet)
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 boolean send(Packet packet, boolean flush, boolean batch)
public Packet sendBlocking(Packet packet, byte expectedPacket) throws HornetQException
sendBlocking in interface Channelpacket - the packet to sendexpectedPacket - the packet being expected.HornetQException - 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()
Channelpublic void transferConnection(CoreRemotingConnection newConnection)
ChanneltransferConnection in interface ChannelnewConnection - the new connectionpublic void replayCommands(int otherLastConfirmedCommandID)
ChannelreplayCommands in interface ChannelotherLastConfirmedCommandID - the last confirmed packetpublic void lock()
Channelpublic 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 packethandlePacket in interface Channelpacket - the packet to process.Copyright © 2013 JBoss, a division of Red Hat. All rights reserved.