org.apache.qpid.client.message
Class AbstractAMQMessageDelegate

java.lang.Object
  extended by org.apache.qpid.client.message.AbstractAMQMessageDelegate
All Implemented Interfaces:
AMQMessageDelegate
Direct Known Subclasses:
AMQMessageDelegate_0_10, AMQMessageDelegate_0_8

public abstract class AbstractAMQMessageDelegate
extends Object
implements AMQMessageDelegate

This abstract class provides exchange lookup functionality that is shared between all MessageDelegates. Update facilities are provided so that the 0-10 code base can update the mappings. The 0-8 code base does not have the facility to update the exchange map so it can only use the default mappings. That said any updates that a 0-10 client performs will also benefit any 0-8 connections in this VM.


Constructor Summary
AbstractAMQMessageDelegate()
           
 
Method Summary
protected static boolean exchangeMapContains(String exchange)
          Accessor method to allow lookups of the given exchange name.
protected  AMQDestination generateDestination(org.apache.qpid.framing.AMQShortString exchange, org.apache.qpid.framing.AMQShortString routingKey)
          Called when a Destination is requried.
protected static void updateExchangeType(String exchange, String newtype)
          Update the exchange name to type mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.client.message.AMQMessageDelegate
acknowledge, acknowledgeThis, clearProperties, getAMQSession, getBooleanProperty, getByteProperty, getContentType, getDeliveryTag, getDoubleProperty, getEncoding, getFloatProperty, getIntProperty, getJMSCorrelationID, getJMSCorrelationIDAsBytes, getJMSDeliveryMode, getJMSDestination, getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSReplyTo, getJMSTimestamp, getJMSType, getLongProperty, getObjectProperty, getPropertyNames, getReplyToString, getShortProperty, getStringProperty, propertyExists, removeProperty, setAMQSession, setBooleanProperty, setByteProperty, setContentType, setDoubleProperty, setEncoding, setFloatProperty, setIntProperty, setJMSCorrelationID, setJMSCorrelationIDAsBytes, setJMSDeliveryMode, setJMSDestination, setJMSExpiration, setJMSMessageID, setJMSMessageID, setJMSPriority, setJMSReplyTo, setJMSTimestamp, setJMSType, setLongProperty, setObjectProperty, setShortProperty, setStringProperty
 

Constructor Detail

AbstractAMQMessageDelegate

public AbstractAMQMessageDelegate()
Method Detail

generateDestination

protected AMQDestination generateDestination(org.apache.qpid.framing.AMQShortString exchange,
                                             org.apache.qpid.framing.AMQShortString routingKey)
Called when a Destination is requried. This will create the AMQDestination that is the correct type and value based on the incomming values.

Parameters:
exchange - The exchange name
routingKey - The routing key to be used for the Destination
Returns:
AMQDestination of the correct subtype

updateExchangeType

protected static void updateExchangeType(String exchange,
                                         String newtype)
Update the exchange name to type mapping. If the newType is not known then an UNKNOWN_TYPE is created. Only if the exchange is of a known type: amq.direct, amq.topic, amq.fanout can we create a suitable AMQDestination representation

Parameters:
exchange - the name of the exchange
newtype - the AMQP exchange class name i.e. direct

exchangeMapContains

protected static boolean exchangeMapContains(String exchange)
Accessor method to allow lookups of the given exchange name. This check allows the prevention of extra work required such as asking the broker for the exchange class name.

Parameters:
exchange - the exchange name to lookup
Returns:
true if there is a mapping for this exchange


Licensed to the Apache Software Foundation