org.apache.qpid.client.message
Class MessageFactoryRegistry

java.lang.Object
  extended by org.apache.qpid.client.message.MessageFactoryRegistry

public class MessageFactoryRegistry
extends java.lang.Object


Constructor Summary
MessageFactoryRegistry()
           
 
Method Summary
 AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered, AMQShortString exchange, AMQShortString routingKey, ContentHeaderBody contentHeader, java.util.List bodies)
          Create a message.
 AbstractJMSMessage createMessage(java.lang.String mimeType)
           
 MessageFactory deregisterFactory(java.lang.String mimeType)
           
static MessageFactoryRegistry newDefaultRegistry()
          Construct a new registry with the default message factories registered
 void registerFactory(java.lang.String mimeType, MessageFactory mf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFactoryRegistry

public MessageFactoryRegistry()
Method Detail

newDefaultRegistry

public static MessageFactoryRegistry newDefaultRegistry()
Construct a new registry with the default message factories registered

Returns:
a message factory registry

registerFactory

public void registerFactory(java.lang.String mimeType,
                            MessageFactory mf)

deregisterFactory

public MessageFactory deregisterFactory(java.lang.String mimeType)

createMessage

public AbstractJMSMessage createMessage(long deliveryTag,
                                        boolean redelivered,
                                        AMQShortString exchange,
                                        AMQShortString routingKey,
                                        ContentHeaderBody contentHeader,
                                        java.util.List bodies)
                                 throws AMQException,
                                        javax.jms.JMSException
Create a message. This looks up the MIME type from the content header and instantiates the appropriate concrete message type.

Parameters:
deliveryTag - the AMQ message id
redelivered - true if redelivered
contentHeader - the content header that was received
bodies - a list of ContentBody instances
Returns:
the message.
Throws:
AMQException
javax.jms.JMSException

createMessage

public AbstractJMSMessage createMessage(java.lang.String mimeType)
                                 throws AMQException,
                                        javax.jms.JMSException
Throws:
AMQException
javax.jms.JMSException


Copyright © 2007. All Rights Reserved.