com.caucho.jms.message
Class MessageFactory

java.lang.Object
  extended by com.caucho.jms.message.MessageFactory

public class MessageFactory
extends java.lang.Object

A message factory


Constructor Summary
MessageFactory()
           
 
Method Summary
 MessageImpl copy(Message msg)
          Copy the message.
 MessageImpl createMessage(int type)
          Creates a message based on the type.
 TextMessage createTextMessage()
          Creates a new JMS text message.
 TextMessage createTextMessage(java.lang.String msg)
          Creates a new JMS text message.
 MessageType getMessageType(Message msg)
          Returns the message type.
 java.io.InputStream headerToInputStream(Message msg)
          Creates an input stream from the header.
 void writeHeader(WriteStream out, Message msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFactory

public MessageFactory()
Method Detail

createTextMessage

public TextMessage createTextMessage()
Creates a new JMS text message.


createTextMessage

public TextMessage createTextMessage(java.lang.String msg)
                              throws JMSException
Creates a new JMS text message.

Parameters:
msg - initial message text
Throws:
JMSException

getMessageType

public MessageType getMessageType(Message msg)
Returns the message type.


createMessage

public MessageImpl createMessage(int type)
Creates a message based on the type.


copy

public MessageImpl copy(Message msg)
                 throws JMSException
Copy the message.

Throws:
JMSException

headerToInputStream

public java.io.InputStream headerToInputStream(Message msg)
Creates an input stream from the header.


writeHeader

public void writeHeader(WriteStream out,
                        Message msg)