org.apache.servicemix.jbi.messaging
Class NormalizedMessageImpl

java.lang.Object
  extended by org.apache.servicemix.jbi.messaging.NormalizedMessageImpl
All Implemented Interfaces:
Externalizable, Serializable, javax.jbi.messaging.NormalizedMessage, org.apache.servicemix.jbi.api.Message
Direct Known Subclasses:
FaultImpl

public class NormalizedMessageImpl
extends Object
implements javax.jbi.messaging.NormalizedMessage, Externalizable, Message

Represents a JBI NormalizedMessage.

Version:
$Revision: 694632 $
See Also:
Serialized Form

Field Summary
protected  MessageExchangeImpl exchange
           
 
Constructor Summary
NormalizedMessageImpl()
          Constructor
NormalizedMessageImpl(MessageExchangeImpl exchange)
          Constructor
 
Method Summary
 void addAttachment(String id, DataHandler handler)
          Add an attachment
protected  Map createAttachmentsMap()
           
 javax.jbi.messaging.Fault createFault()
           
protected  Map createPropertiesMap()
           
 DataHandler getAttachment(String id)
          Get a named attachement
 Set getAttachmentNames()
          Returns a list of identifiers for each attachment to the message.
protected  Map getAttachments()
           
 Object getBody()
           
 Object getBody(PojoMarshaler marshaler)
           
 Object getBody(org.apache.servicemix.jbi.marshaler.PojoMarshaler marshaler)
           
 String getBodyText()
           
 Source getContent()
           
 javax.jbi.messaging.MessageExchange getExchange()
           
 PojoMarshaler getMarshaler()
           
protected  Map getProperties()
           
 Object getProperty(String name)
          get a named property
 Set getPropertyNames()
           
 Subject getSecuritySubject()
           
 Iterator listAttachments()
           
 void readExternal(ObjectInput in)
          Read from a stream
 void removeAttachment(String id)
          remove an identified attachment
protected  void setAttachments(Map attachments)
           
 void setBody(Object body)
           
 void setBodyText(String xml)
           
 void setContent(Source source)
          set the content fo the message
protected  void setProperties(Map properties)
           
 void setProperty(String name, Object value)
          set a property
 void setSecuritySubject(Subject securitySubject)
          set the security subject
 String toString()
           
 void writeExternal(ObjectOutput out)
          Write to a Stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

exchange

protected transient MessageExchangeImpl exchange
Constructor Detail

NormalizedMessageImpl

public NormalizedMessageImpl()
Constructor


NormalizedMessageImpl

public NormalizedMessageImpl(MessageExchangeImpl exchange)
Constructor

Parameters:
exchange -
Method Detail

getContent

public Source getContent()
Specified by:
getContent in interface javax.jbi.messaging.NormalizedMessage
Returns:
the content of the message

setContent

public void setContent(Source source)
set the content fo the message

Specified by:
setContent in interface javax.jbi.messaging.NormalizedMessage
Parameters:
source -

getSecuritySubject

public Subject getSecuritySubject()
Specified by:
getSecuritySubject in interface javax.jbi.messaging.NormalizedMessage
Returns:
the security subject from the message

setSecuritySubject

public void setSecuritySubject(Subject securitySubject)
set the security subject

Specified by:
setSecuritySubject in interface javax.jbi.messaging.NormalizedMessage
Parameters:
securitySubject -

getProperty

public Object getProperty(String name)
get a named property

Specified by:
getProperty in interface javax.jbi.messaging.NormalizedMessage
Parameters:
name -
Returns:
a property from the message

getPropertyNames

public Set getPropertyNames()
Specified by:
getPropertyNames in interface javax.jbi.messaging.NormalizedMessage
Returns:
an iterator of property names

setProperty

public void setProperty(String name,
                        Object value)
set a property

Specified by:
setProperty in interface javax.jbi.messaging.NormalizedMessage
Parameters:
name -
value -

addAttachment

public void addAttachment(String id,
                          DataHandler handler)
Add an attachment

Specified by:
addAttachment in interface javax.jbi.messaging.NormalizedMessage
Parameters:
id -
handler -

getAttachment

public DataHandler getAttachment(String id)
Get a named attachement

Specified by:
getAttachment in interface javax.jbi.messaging.NormalizedMessage
Parameters:
id - the id of the stored attachment
Returns:
the specified attachment or null if no attachment found for id

listAttachments

public Iterator listAttachments()
Returns:
a list of identifiers for atachments

removeAttachment

public void removeAttachment(String id)
remove an identified attachment

Specified by:
removeAttachment in interface javax.jbi.messaging.NormalizedMessage
Parameters:
id -

getAttachmentNames

public Set getAttachmentNames()
Returns a list of identifiers for each attachment to the message.

Specified by:
getAttachmentNames in interface javax.jbi.messaging.NormalizedMessage
Returns:
iterator over String attachment identifiers

toString

public String toString()
Overrides:
toString in class Object

getBody

public Object getBody()
               throws javax.jbi.messaging.MessagingException
Specified by:
getBody in interface org.apache.servicemix.jbi.api.Message
Throws:
javax.jbi.messaging.MessagingException

getBody

public Object getBody(PojoMarshaler marshaler)
               throws javax.jbi.messaging.MessagingException
Throws:
javax.jbi.messaging.MessagingException

getBody

public Object getBody(org.apache.servicemix.jbi.marshaler.PojoMarshaler marshaler)
               throws javax.jbi.messaging.MessagingException
Specified by:
getBody in interface org.apache.servicemix.jbi.api.Message
Throws:
javax.jbi.messaging.MessagingException

setBody

public void setBody(Object body)
             throws javax.jbi.messaging.MessagingException
Specified by:
setBody in interface org.apache.servicemix.jbi.api.Message
Throws:
javax.jbi.messaging.MessagingException

getBodyText

public String getBodyText()
                   throws TransformerException
Throws:
TransformerException

setBodyText

public void setBodyText(String xml)

getMarshaler

public PojoMarshaler getMarshaler()

getExchange

public javax.jbi.messaging.MessageExchange getExchange()
Specified by:
getExchange in interface org.apache.servicemix.jbi.api.Message

createFault

public javax.jbi.messaging.Fault createFault()
                                      throws javax.jbi.messaging.MessagingException
Specified by:
createFault in interface org.apache.servicemix.jbi.api.Message
Throws:
javax.jbi.messaging.MessagingException

getProperties

protected Map getProperties()

getAttachments

protected Map getAttachments()

setAttachments

protected void setAttachments(Map attachments)

setProperties

protected void setProperties(Map properties)

createPropertiesMap

protected Map createPropertiesMap()

createAttachmentsMap

protected Map createAttachmentsMap()

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Write to a Stream

Specified by:
writeExternal in interface Externalizable
Parameters:
out -
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Read from a stream

Specified by:
readExternal in interface Externalizable
Parameters:
in -
Throws:
IOException
ClassNotFoundException


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.