org.apache.qpid.client.message
Class MessageFactoryRegistry

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

public class MessageFactoryRegistry
extends Object


Field Summary
protected  org.slf4j.Logger _logger
          This class logger
 
Constructor Summary
MessageFactoryRegistry()
           
 
Method Summary
 AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory, String mimeType)
           
 AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered, org.apache.qpid.framing.AMQShortString exchange, org.apache.qpid.framing.AMQShortString routingKey, org.apache.qpid.framing.ContentHeaderBody contentHeader, List bodies)
          Create a message.
 AbstractJMSMessage createMessage(org.apache.qpid.transport.MessageTransfer transfer)
           
 MessageFactory deregisterFactory(String mimeType)
           
static MessageFactoryRegistry newDefaultRegistry()
          Construct a new registry with the default message factories registered
 void registerFactory(String mimeType, MessageFactory mf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected final org.slf4j.Logger _logger
This class logger

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(String mimeType,
                            MessageFactory mf)

deregisterFactory

public MessageFactory deregisterFactory(String mimeType)

createMessage

public AbstractJMSMessage createMessage(long deliveryTag,
                                        boolean redelivered,
                                        org.apache.qpid.framing.AMQShortString exchange,
                                        org.apache.qpid.framing.AMQShortString routingKey,
                                        org.apache.qpid.framing.ContentHeaderBody contentHeader,
                                        List bodies)
                                 throws org.apache.qpid.AMQException,
                                        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 @return the message.
Throws:
org.apache.qpid.AMQException
JMSException

createMessage

public AbstractJMSMessage createMessage(org.apache.qpid.transport.MessageTransfer transfer)
                                 throws org.apache.qpid.AMQException,
                                        JMSException
Throws:
org.apache.qpid.AMQException
JMSException

createMessage

public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory,
                                        String mimeType)
                                 throws org.apache.qpid.AMQException,
                                        JMSException
Throws:
org.apache.qpid.AMQException
JMSException


Licensed to the Apache Software Foundation