org.springframework.integration.message
Class MessageHeader

java.lang.Object
  extended by org.springframework.integration.message.MessageHeader
All Implemented Interfaces:
java.io.Serializable

public class MessageHeader
extends java.lang.Object
implements java.io.Serializable

A holder for Message metadata. This includes information that may be used by the messaging system (such as correlationId) as well as information that is relevant for specific messaging endpoints. For the latter, String values may be stored as properties and Object values may be stored as attributes.

Author:
Mark Fisher
See Also:
Serialized Form

Field Summary
private  java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> attributes
           
private  java.lang.Object correlationId
           
private  java.util.Date expiration
           
private  MessagePriority priority
           
private  java.util.Properties properties
           
private  java.lang.Object returnAddress
           
private  int sequenceNumber
           
private  int sequenceSize
           
private  java.util.Date timestamp
           
 
Constructor Summary
MessageHeader()
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String key)
           
 java.util.Set<java.lang.String> getAttributeNames()
           
 java.lang.Object getCorrelationId()
           
 java.util.Date getExpiration()
          Return the expiration date for this message or null to indicate 'never expire'.
 MessagePriority getPriority()
           
 java.lang.String getProperty(java.lang.String key)
           
 java.util.Set<java.lang.String> getPropertyNames()
           
 java.lang.Object getReturnAddress()
           
 int getSequenceNumber()
           
 int getSequenceSize()
           
 java.util.Date getTimestamp()
          Return the creation time of this message.
 java.lang.Object removeAttribute(java.lang.String key)
           
 java.lang.String removeProperty(java.lang.String key)
           
 java.lang.Object setAttribute(java.lang.String key, java.lang.Object value)
           
 java.lang.Object setAttributeIfAbsent(java.lang.String key, java.lang.Object value)
           
 void setCorrelationId(java.lang.Object correlationId)
           
 void setExpiration(java.util.Date expiration)
          Set the expiration date for this message or null to indicate 'never expire'.
 void setPriority(MessagePriority priority)
           
 java.lang.String setProperty(java.lang.String key, java.lang.String value)
           
 void setReturnAddress(java.lang.Object returnAddress)
           
 void setSequenceNumber(int sequenceNumber)
           
 void setSequenceSize(int sequenceSize)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timestamp

private final java.util.Date timestamp

expiration

private volatile java.util.Date expiration

correlationId

private volatile java.lang.Object correlationId

returnAddress

private transient volatile java.lang.Object returnAddress

sequenceNumber

private volatile int sequenceNumber

sequenceSize

private volatile int sequenceSize

priority

private volatile MessagePriority priority

properties

private final java.util.Properties properties

attributes

private final java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> attributes
Constructor Detail

MessageHeader

public MessageHeader()
Method Detail

getTimestamp

public java.util.Date getTimestamp()
Return the creation time of this message.


getExpiration

public java.util.Date getExpiration()
Return the expiration date for this message or null to indicate 'never expire'.


setExpiration

public void setExpiration(java.util.Date expiration)
Set the expiration date for this message or null to indicate 'never expire'. The default is null.


getCorrelationId

public java.lang.Object getCorrelationId()

setCorrelationId

public void setCorrelationId(java.lang.Object correlationId)

getReturnAddress

public java.lang.Object getReturnAddress()

setReturnAddress

public void setReturnAddress(java.lang.Object returnAddress)

getSequenceNumber

public int getSequenceNumber()

setSequenceNumber

public void setSequenceNumber(int sequenceNumber)

getSequenceSize

public int getSequenceSize()

setSequenceSize

public void setSequenceSize(int sequenceSize)

getPriority

public MessagePriority getPriority()

setPriority

public void setPriority(MessagePriority priority)

getProperty

public java.lang.String getProperty(java.lang.String key)

setProperty

public java.lang.String setProperty(java.lang.String key,
                                    java.lang.String value)

removeProperty

public java.lang.String removeProperty(java.lang.String key)

getPropertyNames

public java.util.Set<java.lang.String> getPropertyNames()

getAttribute

public java.lang.Object getAttribute(java.lang.String key)

setAttribute

public java.lang.Object setAttribute(java.lang.String key,
                                     java.lang.Object value)

setAttributeIfAbsent

public java.lang.Object setAttributeIfAbsent(java.lang.String key,
                                             java.lang.Object value)

removeAttribute

public java.lang.Object removeAttribute(java.lang.String key)

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object