Class AmqpTypedObjectDelegate
- java.lang.Object
-
- org.apache.qpid.jms.provider.amqp.message.AmqpTypedObjectDelegate
-
- All Implemented Interfaces:
AmqpObjectTypeDelegate
public class AmqpTypedObjectDelegate extends Object implements AmqpObjectTypeDelegate
Wrapper around an AMQP Message instance that will be treated as a JMS ObjectMessage type.
-
-
Constructor Summary
Constructors Constructor Description AmqpTypedObjectDelegate(AmqpJmsMessageFacade parent)Create a new delegate that uses Java serialization to store the message content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyInto(AmqpObjectTypeDelegate copy)Copy the internal data into the given instance.SerializablegetObject()Read a Serialized object from the AMQP message using the strategy implemented by this delegate.booleanhasBody()booleanisAmqpTypeEncoded()voidonSend()Signals that the message is about to be sent so we should ensure proper state of the marshaled object and message annotations prior to that.voidsetObject(Serializable value)Given a serializable instance, store the value into the AMQP message using the strategy implemented by this delegate.
-
-
-
Constructor Detail
-
AmqpTypedObjectDelegate
public AmqpTypedObjectDelegate(AmqpJmsMessageFacade parent)
Create a new delegate that uses Java serialization to store the message content.- Parameters:
parent- the AMQP message facade instance where the object is to be stored / read.
-
-
Method Detail
-
getObject
public Serializable getObject() throws IOException, ClassNotFoundException
Description copied from interface:AmqpObjectTypeDelegateRead a Serialized object from the AMQP message using the strategy implemented by this delegate.- Specified by:
getObjectin interfaceAmqpObjectTypeDelegate- Returns:
- an Object that has been read from the stored object data in the message.
- Throws:
IOException- if an error occurs while reading the stored object.ClassNotFoundException- if no class can be found for the stored type.
-
setObject
public void setObject(Serializable value) throws IOException
Description copied from interface:AmqpObjectTypeDelegateGiven a serializable instance, store the value into the AMQP message using the strategy implemented by this delegate.- Specified by:
setObjectin interfaceAmqpObjectTypeDelegate- Parameters:
value- A serializable object instance to be stored in the message.- Throws:
IOException- if an error occurs during the store operation.
-
onSend
public void onSend()
Description copied from interface:AmqpObjectTypeDelegateSignals that the message is about to be sent so we should ensure proper state of the marshaled object and message annotations prior to that.- Specified by:
onSendin interfaceAmqpObjectTypeDelegate
-
copyInto
public void copyInto(AmqpObjectTypeDelegate copy) throws Exception
Description copied from interface:AmqpObjectTypeDelegateCopy the internal data into the given instance.- Specified by:
copyIntoin interfaceAmqpObjectTypeDelegate- Parameters:
copy- the new delegate that will receive a copy of this instances object data.- Throws:
Exception- if an error occurs while copying the contents to the target.
-
isAmqpTypeEncoded
public boolean isAmqpTypeEncoded()
- Specified by:
isAmqpTypeEncodedin interfaceAmqpObjectTypeDelegate
-
hasBody
public boolean hasBody()
- Specified by:
hasBodyin interfaceAmqpObjectTypeDelegate
-
-