|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.mgmt.transport.grizzly.grizzly1_9.GrizzlyMessageProtocolParser
public class GrizzlyMessageProtocolParser
Message protocol format is:
Message Header is MessageImpl.HEADER_LENGTH and composed of following fields.
magicNumber integer MessageImpl.MAGIC_NUMBER
version integer MessageImpl.VERSION
type integer Message.getType() for possible values
messageLength integer MessageImpl.maxTotalMessageLength
Message Body is composed of following fields.
payload byte[messageLen]
MessageHeader Message#parseHeader(com.sun.enterprise.mgmt.transport.Buffer, int)
MessageBody Message#parseMessage(com.sun.enterprise.mgmt.transport.Buffer, int, int)
| Field Summary |
|---|
| Fields inherited from interface com.sun.grizzly.ProtocolParser |
|---|
MESSAGE, PARSER |
| Constructor Summary | |
|---|---|
protected |
GrizzlyMessageProtocolParser()
|
protected |
GrizzlyMessageProtocolParser(com.sun.grizzly.SSLConfig sslConfig)
|
| Method Summary | |
|---|---|
static ParserFilter |
createParserProtocolFilter(com.sun.grizzly.SSLConfig sslConfig)
|
Message |
getNextMessage()
Get the next complete message from the buffer, which can then be processed by the next filter in the protocol chain. |
boolean |
hasMoreBytesToParse()
Are there more bytes to be parsed in the ByteBuffer given
to this ProtocolParser's ProtocolParser.startBuffer(ByteBuffer) ?
This method is typically called after processing the protocol message,
to determine if the ByteBuffer has more bytes which
need to parsed into a next message. |
boolean |
hasNextMessage()
Indicates whether the buffer has a complete message that can be returned from ProtocolParser.getNextMessage(). |
boolean |
isError()
|
boolean |
isExpectingMoreData()
Is this ProtocolParser expecting more data ? This method is typically called after a call to ProtocolParser.hasNextMessage() to determine if the
ByteBuffer which has been parsed contains a partial message |
boolean |
releaseBuffer()
No more parsing will be done on the buffer passed to ProtocolParser.startBuffer(ByteBuffer). |
void |
startBuffer(ByteBuffer bb)
Set the buffer to be parsed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected GrizzlyMessageProtocolParser()
protected GrizzlyMessageProtocolParser(com.sun.grizzly.SSLConfig sslConfig)
| Method Detail |
|---|
public static ParserFilter createParserProtocolFilter(com.sun.grizzly.SSLConfig sslConfig)
public boolean isError()
public boolean isExpectingMoreData()
ProtocolParser.hasNextMessage() to determine if the
ByteBuffer which has been parsed contains a partial message
isExpectingMoreData in interface com.sun.grizzly.ProtocolParser<Message>public boolean hasMoreBytesToParse()
ByteBuffer given
to this ProtocolParser's ProtocolParser.startBuffer(ByteBuffer) ?
This method is typically called after processing the protocol message,
to determine if the ByteBuffer has more bytes which
need to parsed into a next message.
hasMoreBytesToParse in interface com.sun.grizzly.ProtocolParser<Message>public Message getNextMessage()
getNextMessage in interface com.sun.grizzly.ProtocolParser<Message>public boolean hasNextMessage()
ProtocolParser.getNextMessage(). Smart
implementations of this will set up all the information so that an
actual call to ProtocolParser.getNextMessage() doesn't need to
re-parse the data.
hasNextMessage in interface com.sun.grizzly.ProtocolParser<Message>public void startBuffer(ByteBuffer bb)
ProtocolParser.getNextMessage() will return distinct messages,
and the buffer can be restored after parsing when the
ProtocolParser.releaseBuffer() method is called.
startBuffer in interface com.sun.grizzly.ProtocolParser<Message>public boolean releaseBuffer()
ProtocolParser.startBuffer(ByteBuffer).
Set up the buffer so that its position is the first byte that was
not part of a full message, and its limit is the original limit of
the buffer.
releaseBuffer in interface com.sun.grizzly.ProtocolParser<Message>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||