Class AmqpJmsObjectMessageFacade
- java.lang.Object
-
- org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade
-
- org.apache.qpid.jms.provider.amqp.message.AmqpJmsObjectMessageFacade
-
- All Implemented Interfaces:
JmsMessageFacade
,JmsObjectMessageFacade
,TraceableMessage
public class AmqpJmsObjectMessageFacade extends AmqpJmsMessageFacade implements JmsObjectMessageFacade
Wrapper around an AMQP Message instance that will be treated as a JMS ObjectMessage type.
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade
connection
-
-
Constructor Summary
Constructors Constructor Description AmqpJmsObjectMessageFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JmsObjectMessage
asJmsMessage()
void
clearBody()
Clears the contents of this Message.AmqpJmsObjectMessageFacade
copy()
Create a new instance and perform a deep copy of this object's contents.byte
getJmsMsgType()
java.io.Serializable
getObject()
Gets the Object value that is contained in the provider message.boolean
hasBody()
Returns true if the underlying message has a body, false if the body is empty.void
initialize(AmqpConnection connection)
Initialize the state of this message for send.void
initialize(AmqpConsumer consumer)
Initialize the state of this message for receive.boolean
isAmqpTypedEncoding()
void
onSend(long producerTtl)
Called before a message is sent to allow a Message instance to move the contents from a logical data structure to a binary form for transmission, or other processing such as setting proper message headers etc.void
setObject(java.io.Serializable value)
Stores the given object into the provider Message.-
Methods inherited from class org.apache.qpid.jms.provider.amqp.message.AmqpJmsMessageFacade
applicationPropertyExists, clearProperties, copyInto, encodeMessage, filterTracingAnnotations, getAmqpTimeToLiveOverride, getApplicationProperty, getApplicationPropertyNames, getContentType, getCorrelationId, getCorrelationIdBytes, getDeliveryCount, getDeliveryTime, getDestination, getExpiration, getGroupId, getGroupSequence, getMessageId, getPriority, getProperty, getPropertyNames, getProviderMessageIdObject, getRedeliveryCount, getReplyTo, getReplyToGroupId, getTimestamp, getTracingAnnotation, getTracingContext, getType, getUserId, getUserIdBytes, hasAmqpTimeToLiveOverride, initializeEmptyBody, isDeliveryTimeTransmitted, isPersistent, isRedelivered, onDispatch, propertyExists, removeTracingAnnotation, removeTracingContext, setAmqpTimeToLiveOverride, setApplicationProperty, setContentType, setCorrelationId, setCorrelationIdBytes, setDeliveryCount, setDeliveryTime, setDestination, setExpiration, setGroupId, setGroupSequence, setMessageId, setPersistent, setPriority, setProperty, setProviderMessageIdObject, setRedelivered, setRedeliveryCount, setReplyTo, setReplyToGroupId, setTimestamp, setTracingAnnotation, setTracingContext, setType, setUserId, setUserIdBytes
-
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.jms.message.facade.JmsMessageFacade
clearProperties, encodeMessage, getCorrelationId, getCorrelationIdBytes, getDeliveryCount, getDeliveryTime, getDestination, getExpiration, getGroupId, getGroupSequence, getMessageId, getPriority, getProperty, getPropertyNames, getProviderMessageIdObject, getRedeliveryCount, getReplyTo, getTimestamp, getType, getUserId, getUserIdBytes, isDeliveryTimeTransmitted, isPersistent, isRedelivered, onDispatch, propertyExists, setCorrelationId, setCorrelationIdBytes, setDeliveryCount, setDeliveryTime, setDestination, setExpiration, setGroupId, setGroupSequence, setMessageId, setPersistent, setPriority, setProperty, setProviderMessageIdObject, setRedelivered, setRedeliveryCount, setReplyTo, setTimestamp, setType, setUserId, setUserIdBytes
-
Methods inherited from interface org.apache.qpid.jms.tracing.TraceableMessage
filterTracingAnnotations, getTracingAnnotation, getTracingContext, removeTracingAnnotation, removeTracingContext, setTracingAnnotation, setTracingContext
-
-
-
-
Method Detail
-
initialize
public void initialize(AmqpConnection connection)
Description copied from class:AmqpJmsMessageFacade
Initialize the state of this message for send.- Overrides:
initialize
in classAmqpJmsMessageFacade
- Parameters:
connection
- The connection that this message is linked to.
-
initialize
public void initialize(AmqpConsumer consumer)
Description copied from class:AmqpJmsMessageFacade
Initialize the state of this message for receive.- Overrides:
initialize
in classAmqpJmsMessageFacade
- Parameters:
consumer
- The consumer that this message was read from.
-
getJmsMsgType
public byte getJmsMsgType()
- Overrides:
getJmsMsgType
in classAmqpJmsMessageFacade
- Returns:
- the appropriate byte value that indicates the type of message this is.
-
isAmqpTypedEncoding
public boolean isAmqpTypedEncoding()
-
copy
public AmqpJmsObjectMessageFacade copy() throws javax.jms.JMSException
Description copied from interface:JmsMessageFacade
Create a new instance and perform a deep copy of this object's contents.- Specified by:
copy
in interfaceJmsMessageFacade
- Specified by:
copy
in interfaceJmsObjectMessageFacade
- Overrides:
copy
in classAmqpJmsMessageFacade
- Returns:
- a copy of this JmsMessageFacade instance.
- Throws:
javax.jms.JMSException
- if an error occurs while copying the message.
-
getObject
public java.io.Serializable getObject() throws java.io.IOException, java.lang.ClassNotFoundException
Description copied from interface:JmsObjectMessageFacade
Gets the Object value that is contained in the provider message. If the Object is stored in some serialized form then the Provider must de-serialize the object prior to returning it.- Specified by:
getObject
in interfaceJmsObjectMessageFacade
- Returns:
- the de-serialized version of the contained object.
- Throws:
java.io.IOException
- if the provider fails to get the object due to some internal error.java.lang.ClassNotFoundException
- if object de-serialization fails because the ClassLoader cannot find the Class locally.
-
setObject
public void setObject(java.io.Serializable value) throws java.io.IOException
Description copied from interface:JmsObjectMessageFacade
Stores the given object into the provider Message. In order for the provider to be fully JMS compliant the set Object should be immediately serialized and stored so that future modifications to the object are not reflected in the stored version of the object.- Specified by:
setObject
in interfaceJmsObjectMessageFacade
- Parameters:
value
- the new value to write to the provider message.- Throws:
java.io.IOException
- if the provider fails to store the object due to some internal error.
-
clearBody
public void clearBody()
Description copied from interface:JmsMessageFacade
Clears the contents of this Message.- Specified by:
clearBody
in interfaceJmsMessageFacade
- Overrides:
clearBody
in classAmqpJmsMessageFacade
-
hasBody
public boolean hasBody()
Description copied from interface:JmsMessageFacade
Returns true if the underlying message has a body, false if the body is empty.- Specified by:
hasBody
in interfaceJmsMessageFacade
- Overrides:
hasBody
in classAmqpJmsMessageFacade
- Returns:
- true if the underlying message has a body, false if the body is empty.
-
onSend
public void onSend(long producerTtl) throws javax.jms.JMSException
Description copied from interface:JmsMessageFacade
Called before a message is sent to allow a Message instance to move the contents from a logical data structure to a binary form for transmission, or other processing such as setting proper message headers etc. The method allows for passing through producer configuration details not explicitly mapped into the JMS Message allowing the facade to create the most correct and compact message on the wire.- Specified by:
onSend
in interfaceJmsMessageFacade
- Overrides:
onSend
in classAmqpJmsMessageFacade
- Parameters:
producerTtl
- the time to live value configured on the producer when sent.- Throws:
javax.jms.JMSException
- if an error occurs while preparing the message for send.
-
asJmsMessage
public JmsObjectMessage asJmsMessage()
- Overrides:
asJmsMessage
in classAmqpJmsMessageFacade
-
-