|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rabbitmq.client.impl.AMQCommand
public class AMQCommand
AMQ-specific implementation of Command
which accumulates
method, header and body from a series of frames, unless these are
supplied at construction time.
Field Summary | |
---|---|
static int |
EMPTY_FRAME_SIZE
EMPTY_FRAME_SIZE = 8 = 1 + 2 + 4 + 1 1 byte of frame type 2 bytes of channel number 4 bytes of frame payload length 1 byte of payload trailer FRAME_END byte See checkEmptyFrameSize() , an assertion checked at
startup. |
Constructor Summary | |
---|---|
AMQCommand()
Construct a command ready to fill in by reading frames |
|
AMQCommand(Method method)
Construct a command with just a method, and without header or body. |
|
AMQCommand(Method method,
AMQContentHeader contentHeader,
byte[] body)
Construct a command with a specified method, header and body. |
Method Summary | |
---|---|
static void |
checkPreconditions()
Called to check internal code assumptions. |
byte[] |
getContentBody()
Public API - Retrieves the body byte array that travelled as part of this Command, if any. |
AMQContentHeader |
getContentHeader()
Public API - Retrieves the ContentHeader subclass instance held as part of this Command, if any. |
Method |
getMethod()
Public API - Retrieves the Method held within this Command. |
boolean |
handleFrame(Frame f)
|
java.lang.String |
toString()
|
java.lang.String |
toString(boolean suppressBody)
|
void |
transmit(AMQChannel channel)
Sends this command down the named channel on the channel's connection, possibly in multiple frames. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EMPTY_FRAME_SIZE
checkEmptyFrameSize()
, an assertion checked at
startup.
Constructor Detail |
---|
public AMQCommand()
public AMQCommand(Method method)
method
- the wrapped methodpublic AMQCommand(Method method, AMQContentHeader contentHeader, byte[] body)
method
- the wrapped methodcontentHeader
- the wrapped content headerbody
- the message body dataMethod Detail |
---|
public Method getMethod()
Method
held within this Command. Downcast to
concrete (implementation-specific!) subclasses as necessary.
getMethod
in interface Command
public AMQContentHeader getContentHeader()
AMQP.BasicProperties
, as appropriate.
getContentHeader
in interface Command
ContentHeader
, or null if nonepublic byte[] getContentBody()
getContentBody
in interface Command
public boolean handleFrame(Frame f) throws java.io.IOException
java.io.IOException
public void transmit(AMQChannel channel) throws java.io.IOException
channel
- the channel on which to transmit the command
java.io.IOException
- if an error is encounteredpublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(boolean suppressBody)
public static void checkPreconditions()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |