com.mockrunner.jms
Class MessageManager

java.lang.Object
  extended by com.mockrunner.jms.MessageManager

public class MessageManager
extends java.lang.Object

Can be used to create and access all type of messages. The create methods are usually called by MockSession.


Constructor Summary
MessageManager()
           
 
Method Summary
 MockBytesMessage createBytesMessage()
          Creates a new BytesMessage.
 MockMapMessage createMapMessage()
          Creates a new MapMessage.
 MockMessage createMessage()
          Creates a new Message.
 MockObjectMessage createObjectMessage(java.io.Serializable object)
          Creates a new ObjectMessage.
 MockStreamMessage createStreamMessage()
          Creates a new StreamMessage.
 MockTextMessage createTextMessage(java.lang.String text)
          Creates a new TextMessage.
 MockBytesMessage getBytesMessage(int index)
          Returns a BytesMessage by its index or null, if no such BytesMessage is present.
 java.util.List getBytesMessageList()
          Returns the list of BytesMessage objects.
 MockMapMessage getMapMessage(int index)
          Returns a MapMessage by its index or null, if no such MapMessage is present.
 java.util.List getMapMessageList()
          Returns the list of MapMessage objects.
 MockMessage getMessage(int index)
          Returns a Message by its index or null, if no such Message is present.
 java.util.List getMessageList()
          Returns the list of Message objects.
 MockObjectMessage getObjectMessage(int index)
          Returns a ObjectMessage by its index or null, if no such ObjectMessage is present.
 java.util.List getObjectMessageList()
          Returns the list of ObjectMessage objects.
 MockStreamMessage getStreamMessage(int index)
          Returns a StreamMessage by its index or null, if no such StreamMessage is present.
 java.util.List getStreamMessageList()
          Returns the list of StreamMessage objects.
 MockTextMessage getTextMessage(int index)
          Returns a TextMessage by its index or null, if no such TextMessage is present.
 java.util.List getTextMessageList()
          Returns the list of TextMessage objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageManager

public MessageManager()
Method Detail

createMessage

public MockMessage createMessage()
Creates a new Message. Usually this method is called by MockSession.createMessage().

Returns:
the created Message

getMessage

public MockMessage getMessage(int index)
Returns a Message by its index or null, if no such Message is present.

Parameters:
index - the index of the Message
Returns:
the Message

getMessageList

public java.util.List getMessageList()
Returns the list of Message objects.

Returns:
the Message list

createBytesMessage

public MockBytesMessage createBytesMessage()
Creates a new BytesMessage. Usually this method is called by MockSession.createBytesMessage().

Returns:
the created BytesMessage

getBytesMessage

public MockBytesMessage getBytesMessage(int index)
Returns a BytesMessage by its index or null, if no such BytesMessage is present.

Parameters:
index - the index of the BytesMessage
Returns:
the BytesMessage

getBytesMessageList

public java.util.List getBytesMessageList()
Returns the list of BytesMessage objects.

Returns:
the BytesMessage list

createMapMessage

public MockMapMessage createMapMessage()
Creates a new MapMessage. Usually this method is called by MockSession.createMapMessage().

Returns:
the created MapMessage

getMapMessage

public MockMapMessage getMapMessage(int index)
Returns a MapMessage by its index or null, if no such MapMessage is present.

Parameters:
index - the index of the MapMessage
Returns:
the MapMessage

getMapMessageList

public java.util.List getMapMessageList()
Returns the list of MapMessage objects.

Returns:
the MapMessage list

createTextMessage

public MockTextMessage createTextMessage(java.lang.String text)
Creates a new TextMessage. Usually this method is called by MockSession.createTextMessage().

Returns:
the created TextMessage

getTextMessage

public MockTextMessage getTextMessage(int index)
Returns a TextMessage by its index or null, if no such TextMessage is present.

Parameters:
index - the index of the TextMessage
Returns:
the TextMessage

getTextMessageList

public java.util.List getTextMessageList()
Returns the list of TextMessage objects.

Returns:
the TextMessage list

createStreamMessage

public MockStreamMessage createStreamMessage()
Creates a new StreamMessage. Usually this method is called by MockSession.createStreamMessage().

Returns:
the created StreamMessage

getStreamMessage

public MockStreamMessage getStreamMessage(int index)
Returns a StreamMessage by its index or null, if no such StreamMessage is present.

Parameters:
index - the index of the StreamMessage
Returns:
the StreamMessage

getStreamMessageList

public java.util.List getStreamMessageList()
Returns the list of StreamMessage objects.

Returns:
the StreamMessage list

createObjectMessage

public MockObjectMessage createObjectMessage(java.io.Serializable object)
Creates a new ObjectMessage. Usually this method is called by MockSession.createObjectMessage().

Returns:
the created ObjectMessage

getObjectMessage

public MockObjectMessage getObjectMessage(int index)
Returns a ObjectMessage by its index or null, if no such ObjectMessage is present.

Parameters:
index - the index of the ObjectMessage
Returns:
the ObjectMessage

getObjectMessageList

public java.util.List getObjectMessageList()
Returns the list of ObjectMessage objects.

Returns:
the ObjectMessage list