org.jvnet.ws.message
Class MessageContext

java.lang.Object
  extended by org.jvnet.ws.message.PropertySet
      extended by org.jvnet.ws.message.DistributedPropertySet
          extended by org.jvnet.ws.message.MessageContext

public abstract class MessageContext
extends DistributedPropertySet

MessageContext represents a container of a SOAP message and all the properties including the transport headers. MessageContext is a composite PropertySet that combines properties exposed from multiple PropertySets into one.

This implementation allows one PropertySet to assemble all properties exposed from other "satellite" PropertySets. (A satellite may itself be a DistributedPropertySet, so in general this can form a tree.)

Author:
shih-chang.chen@oracle.com

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jvnet.ws.message.PropertySet
PropertySet.Accessor, PropertySet.Property, PropertySet.PropertyMap
 
Constructor Summary
MessageContext()
           
 
Method Summary
abstract  SOAPMessage getAsSOAPMessage()
          Gets the SAAJ SOAPMessage representation of the SOAP message.
abstract  SOAPMessage getSOAPMessage()
          Deprecated. use getAsSOAPMessage
abstract  ContentType writeTo(OutputStream out)
          Writes the XML infoset portion of this MessageContext (from <soap:Envelope> to </soap:Envelope>).
abstract  ContentType writeTo(WritableByteChannel buffer)
          The version of writeTo(OutputStream) that writes to NIO ByteBuffer.
 
Methods inherited from class org.jvnet.ws.message.DistributedPropertySet
addSatellite, addSatellite, copySatelliteInto, copySatelliteInto, get, getSatellite, put, remove, removeSatellite, supports
 
Methods inherited from class org.jvnet.ws.message.PropertySet
containsKey, createMapView, getPropertyMap, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageContext

public MessageContext()
Method Detail

getAsSOAPMessage

public abstract SOAPMessage getAsSOAPMessage()
                                      throws SOAPException
Gets the SAAJ SOAPMessage representation of the SOAP message.

Returns:
The SOAPMessage
Throws:
SOAPException

getSOAPMessage

public abstract SOAPMessage getSOAPMessage()
                                    throws SOAPException
Deprecated. use getAsSOAPMessage

Gets the SAAJ SOAPMessage representation of the SOAP message.

Returns:
The SOAPMessage
Throws:
SOAPException

writeTo

public abstract ContentType writeTo(OutputStream out)
                             throws IOException
Writes the XML infoset portion of this MessageContext (from <soap:Envelope> to </soap:Envelope>).

Parameters:
out - Must not be null. The caller is responsible for closing the stream, not the callee.
Returns:
The MIME content type of the encoded message (such as "application/xml"). This information is often necessary by transport.
Throws:
IOException - if a OutputStream throws IOException.

writeTo

public abstract ContentType writeTo(WritableByteChannel buffer)
The version of writeTo(OutputStream) that writes to NIO ByteBuffer.

TODO: for the convenience of implementation, write an adapter that wraps WritableByteChannel to OutputStream.



Copyright © 2005-2012 Oracle Corporation. All Rights Reserved.