|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rabbitmq.client.impl.ShutdownNotifierComponent com.rabbitmq.client.impl.AMQChannel
public abstract class AMQChannel
Base class modelling an AMQ channel. Subclasses implement
Channel.close()
and
processAsync()
, and may choose to override
processShutdownSignal()
and
rpc()
.
ChannelN
,
Connection
Nested Class Summary | |
---|---|
static class |
AMQChannel.BlockingRpcContinuation<T>
|
static interface |
AMQChannel.RpcContinuation
|
static class |
AMQChannel.SimpleBlockingRpcContinuation
|
Field Summary | |
---|---|
boolean |
_blockContent
Whether transmission of content-bearing methods should be blocked |
protected java.lang.Object |
_channelMutex
Protected; used instead of synchronizing on the channel itself, so that clients can themselves use the channel to synchronize on. |
Constructor Summary | |
---|---|
AMQChannel(AMQConnection connection,
int channelNumber)
Construct a channel on the given connection, with the given channel number. |
Method Summary | |
---|---|
void |
enqueueRpc(AMQChannel.RpcContinuation k)
|
void |
ensureIsOpen()
|
AMQCommand |
exnWrappingRpc(Method m)
Placeholder until we address bug 15786 (implementing a proper exception hierarchy). |
int |
getChannelNumber()
Public API - Retrieves this channel's channel number. |
AMQConnection |
getConnection()
|
void |
handleCompleteInboundCommand(AMQCommand command)
Private API - handle a command which has been assembled |
void |
handleFrame(Frame frame)
Private API - When the Connection receives a Frame for this channel, it passes it to this method. |
boolean |
isOutstandingRpc()
|
AMQChannel.RpcContinuation |
nextOutstandingRpc()
|
void |
notifyOutstandingRpc(ShutdownSignalException signal)
|
abstract boolean |
processAsync(Command command)
Protected API - called by nextCommand to check possibly handle an incoming Command before it is returned to the caller of nextCommand. |
void |
processShutdownSignal(ShutdownSignalException signal,
boolean ignoreClosed,
boolean notifyRpc)
Protected API - respond, in the driver thread, to a ShutdownSignalException . |
void |
quiescingRpc(Method m,
AMQChannel.RpcContinuation k)
|
void |
quiescingTransmit(AMQCommand c)
|
void |
quiescingTransmit(Method m)
|
AMQCommand |
rpc(Method m)
Protected API - sends a Method to the broker and waits for the
next in-bound Command from the broker: only for use from
non-connection-MainLoop threads! |
void |
rpc(Method m,
AMQChannel.RpcContinuation k)
|
java.lang.String |
toString()
|
void |
transmit(AMQCommand c)
|
void |
transmit(Method m)
|
static java.io.IOException |
wrap(ShutdownSignalException ex)
Placeholder until we address bug 15786 (implementing a proper exception hierarchy). |
static java.io.IOException |
wrap(ShutdownSignalException ex,
java.lang.String message)
|
Methods inherited from class com.rabbitmq.client.impl.ShutdownNotifierComponent |
---|
addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener, setShutdownCauseIfOpen |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.lang.Object _channelMutex
public boolean _blockContent
Constructor Detail |
---|
public AMQChannel(AMQConnection connection, int channelNumber)
connection
- the underlying connection for this channelchannelNumber
- the allocated reference number for this channelMethod Detail |
---|
public int getChannelNumber()
public void handleFrame(Frame frame) throws java.io.IOException
frame
- the incoming frame
java.io.IOException
- if an error is encounteredpublic static java.io.IOException wrap(ShutdownSignalException ex)
ex
- the exception to wrap
public static java.io.IOException wrap(ShutdownSignalException ex, java.lang.String message)
public AMQCommand exnWrappingRpc(Method m) throws java.io.IOException
java.io.IOException
public void handleCompleteInboundCommand(AMQCommand command) throws java.io.IOException
command
- the incoming command
java.io.IOException
- if there's any problem
java.io.IOException
public void enqueueRpc(AMQChannel.RpcContinuation k)
public boolean isOutstandingRpc()
public AMQChannel.RpcContinuation nextOutstandingRpc()
public void ensureIsOpen() throws AlreadyClosedException
AlreadyClosedException
public AMQCommand rpc(Method m) throws java.io.IOException, ShutdownSignalException
Method
to the broker and waits for the
next in-bound Command from the broker: only for use from
non-connection-MainLoop threads!
java.io.IOException
ShutdownSignalException
public void rpc(Method m, AMQChannel.RpcContinuation k) throws java.io.IOException
java.io.IOException
public void quiescingRpc(Method m, AMQChannel.RpcContinuation k) throws java.io.IOException
java.io.IOException
public abstract boolean processAsync(Command command) throws java.io.IOException
command
- the command to handle asynchronously
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public void processShutdownSignal(ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc)
ShutdownSignalException
.
signal
- the signal to handleignoreClosed
- the flag indicating whether to ignore the AlreadyClosedException
thrown when the channel is already closednotifyRpc
- the flag indicating whether any remaining rpc continuation should be
notified with the given signalpublic void notifyOutstandingRpc(ShutdownSignalException signal)
public void transmit(Method m) throws java.io.IOException
java.io.IOException
public void transmit(AMQCommand c) throws java.io.IOException
java.io.IOException
public void quiescingTransmit(Method m) throws java.io.IOException
java.io.IOException
public void quiescingTransmit(AMQCommand c) throws java.io.IOException
java.io.IOException
public AMQConnection getConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |