org.apache.qpid.management.domain.services
Class MessageTokenizer

java.lang.Object
  extended by org.apache.qpid.management.domain.services.MessageTokenizer
All Implemented Interfaces:
Enumeration<org.apache.qpid.api.Message>

 class MessageTokenizer
extends Object
implements Enumeration<org.apache.qpid.api.Message>

The message tokenizer class allows a multi message listener to break a message into tokens where each token is itself a valid AMQP message.

See Also:
QPID-1368

Field Summary
(package private) static byte[] MAGIC_NUMBER_BYTES
           
 
Constructor Summary
MessageTokenizer(org.apache.qpid.api.Message compoundMessage)
          Builds a new Message tokenizer with the given message.
 
Method Summary
 int countTokens()
          Retruns the number of the tokens produced by this tokenizer.
 boolean hasMoreElements()
           
(package private)  int indexOf(byte[] source, int startIndex)
           
 org.apache.qpid.api.Message nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGIC_NUMBER_BYTES

static byte[] MAGIC_NUMBER_BYTES
Constructor Detail

MessageTokenizer

MessageTokenizer(org.apache.qpid.api.Message compoundMessage)
           throws IOException
Builds a new Message tokenizer with the given message. Note that if the given message is not a "compound" message this tokenizer will producer only one token; That is, the token is a message equals to the given message.

Parameters:
compoundMessage - the compound message
Throws:
IOException - when it's not possible to read the given message content.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface Enumeration<org.apache.qpid.api.Message>

nextElement

public org.apache.qpid.api.Message nextElement()
Specified by:
nextElement in interface Enumeration<org.apache.qpid.api.Message>

countTokens

public int countTokens()
Retruns the number of the tokens produced by this tokenizer.

Returns:
the number of the tokens produced by this tokenizer.

indexOf

int indexOf(byte[] source,
            int startIndex)


Licensed to the Apache Software Foundation