org.springframework.integration.message
Class GenericMessage<T>
java.lang.Object
org.springframework.integration.message.GenericMessage<T>
- All Implemented Interfaces:
- Message<T>
- Direct Known Subclasses:
- ErrorMessage, StringMessage
public class GenericMessage<T>
- extends java.lang.Object
- implements Message<T>
Base Message class defining common properties such as id, header, and lock.
- Author:
- Mark Fisher
Constructor Summary |
GenericMessage(java.lang.Object id,
T payload)
Create a new message with the given id and payload. |
GenericMessage(T payload)
Create a new message with the given payload. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GenericMessage
public GenericMessage(java.lang.Object id,
T payload)
- Create a new message with the given id and payload.
- Parameters:
id
- unique identifier for this messagepayload
- the message payload
GenericMessage
public GenericMessage(T payload)
- Create a new message with the given payload. The id will be generated by
the default
UidGenerator
strategy.
- Parameters:
payload
- the message payload
getId
public java.lang.Object getId()
- Specified by:
getId
in interface Message<T>
getHeader
public MessageHeader getHeader()
- Specified by:
getHeader
in interface Message<T>
setHeader
protected void setHeader(MessageHeader header)
getPayload
public T getPayload()
- Specified by:
getPayload
in interface Message<T>
setPayload
protected void setPayload(T newPayload)