org.objectweb.petals.tools.rmi.common.serializable
Class NormalizedMessage

java.lang.Object
  extended by org.objectweb.petals.tools.rmi.common.serializable.NormalizedMessage
All Implemented Interfaces:
java.io.Serializable, javax.jbi.messaging.NormalizedMessage
Direct Known Subclasses:
Fault

public class NormalizedMessage
extends java.lang.Object
implements javax.jbi.messaging.NormalizedMessage, java.io.Serializable

the normalized message implementation.

Author:
nsalatge
See Also:
Serialized Form

Field Summary
static java.lang.String COMPRESSION
          COMPRESSION constants.
 
Constructor Summary
NormalizedMessage()
          This default constructor creates a new empty NormalizedMessage.
 
Method Summary
 void addAttachment(java.lang.String id, javax.activation.DataHandler attachment)
           
 javax.activation.DataHandler getAttachment(java.lang.String id)
           
 java.util.Set<?> getAttachmentNames()
           
 javax.xml.transform.Source getContent()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.util.Set<?> getPropertyNames()
           
 javax.security.auth.Subject getSecuritySubject()
           
protected  void readObjectDelegate(java.io.ObjectInputStream s)
           
 void removeAttachment(java.lang.String id)
           
 void setContent(javax.xml.transform.Source content)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void setSecuritySubject(javax.security.auth.Subject securitySubject)
           
protected  void writeObjectDelegate(java.io.ObjectOutputStream s)
          Serialization process :
- Serialization of all serializable fields of the NormalizedMessage
- Serialization of all attachement
- Finally, serialization of the content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESSION

public static final java.lang.String COMPRESSION
COMPRESSION constants.

See Also:
Constant Field Values
Constructor Detail

NormalizedMessage

public NormalizedMessage()
This default constructor creates a new empty NormalizedMessage.

Throws:
javax.jbi.messaging.MessagingException - impossible to create a fault
Method Detail

addAttachment

public void addAttachment(java.lang.String id,
                          javax.activation.DataHandler attachment)
                   throws javax.jbi.messaging.MessagingException
Specified by:
addAttachment in interface javax.jbi.messaging.NormalizedMessage
Parameters:
id - the id
attachment - the attachement
Throws:
javax.jbi.messaging.MessagingException - impossible to add an attachement

getAttachment

public javax.activation.DataHandler getAttachment(java.lang.String id)
Specified by:
getAttachment in interface javax.jbi.messaging.NormalizedMessage
Parameters:
id - thye id
Returns:
the data handler

getAttachmentNames

public java.util.Set<?> getAttachmentNames()
Specified by:
getAttachmentNames in interface javax.jbi.messaging.NormalizedMessage
Returns:
the set of keys

getContent

public javax.xml.transform.Source getContent()
Specified by:
getContent in interface javax.jbi.messaging.NormalizedMessage
Returns:
the source

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface javax.jbi.messaging.NormalizedMessage
Parameters:
name - the name
Returns:
the object property

getPropertyNames

public java.util.Set<?> getPropertyNames()
Specified by:
getPropertyNames in interface javax.jbi.messaging.NormalizedMessage
Returns:
the set of properties

getSecuritySubject

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

removeAttachment

public void removeAttachment(java.lang.String id)
                      throws javax.jbi.messaging.MessagingException
Specified by:
removeAttachment in interface javax.jbi.messaging.NormalizedMessage
Parameters:
id - the id
Throws:
javax.jbi.messaging.MessagingException - impossible to remove the attachment

setContent

public void setContent(javax.xml.transform.Source content)
                throws javax.jbi.messaging.MessagingException
Specified by:
setContent in interface javax.jbi.messaging.NormalizedMessage
Parameters:
content - the content
Throws:
javax.jbi.messaging.MessagingException - impossible to set the content

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in interface javax.jbi.messaging.NormalizedMessage
Parameters:
name - the name
value - the value

setSecuritySubject

public void setSecuritySubject(javax.security.auth.Subject securitySubject)
Specified by:
setSecuritySubject in interface javax.jbi.messaging.NormalizedMessage
Parameters:
securitySubject - the security subject

readObjectDelegate

protected void readObjectDelegate(java.io.ObjectInputStream s)
                           throws java.io.IOException
Parameters:
s - the object input stream
Throws:
java.io.IOException - impossible to read object delegate
See Also:
NormalizedMessageImpl#readObject(ObjectInputStream).

writeObjectDelegate

protected void writeObjectDelegate(java.io.ObjectOutputStream s)
                            throws java.io.IOException
Serialization process :
- Serialization of all serializable fields of the NormalizedMessage
- Serialization of all attachement
- Finally, serialization of the content. Content must always be serialized at the end of the serialization process. Because in the deserialization process, a new content will be created with all ending bytes of the Stream.

Parameters:
s - the object output stream
Throws:
java.io.IOException - impossible to write object delegate
See Also:
NormalizedMessageImpl#writeObject(ObjectOutputStream)


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.