org.codehaus.activesoap
Class MessageExchange

java.lang.Object
  extended byorg.codehaus.activesoap.MessageExchange

public class MessageExchange
extends Object

Represents the context of the processing of a single message, providing access to the current REST or SOAP service on which the message is invoked and providing access to pre-request properties which can be used to communicate among Handler instances.

Version:
$Revision: 1.3 $

Constructor Summary
MessageExchange(RestService service, XMLStreamReader in, XMLStreamWriter out)
           
MessageExchange(RestService service, XMLStreamReader in, XMLStreamWriter out, Map properties)
           
 
Method Summary
 void copy(XMLStreamReader in, XMLStreamWriter out)
          A helper method which streams the input to the output
 XMLStreamReader getIn()
           
 XMLStreamWriter getOut()
           
 Object getProperty(Object name)
          Looks up the property for the given key which is typically a String or QName or a QName returning the value or null if it is not present.
 Set getPropertyNames()
          Return a collection of the available property names which are typically String or QName instances
 RestService getService()
          Returns the current service instance which is processing the message so that we can access the details such as the handler registry
 SoapService getSoapService()
          Returns the current SOAP service instance, if we are using the SOAP protocol so that you can access the SOAP details such as available roles, SOAP version, intermidate mode etc.
 boolean isRepairingNamespace()
           
 MessageExchange newInstance(XMLStreamReader in, XMLStreamWriter out)
          Creates a new message exchange with different input and output
 void setProperty(Object name, Object value)
          Sets the value of the given property name (which is typically a String or a QName) to the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageExchange

public MessageExchange(RestService service,
                       XMLStreamReader in,
                       XMLStreamWriter out)

MessageExchange

public MessageExchange(RestService service,
                       XMLStreamReader in,
                       XMLStreamWriter out,
                       Map properties)
Method Detail

newInstance

public MessageExchange newInstance(XMLStreamReader in,
                                   XMLStreamWriter out)
Creates a new message exchange with different input and output


getProperty

public Object getProperty(Object name)
Looks up the property for the given key which is typically a String or QName or a QName returning the value or null if it is not present.

Parameters:
name - is typically a String or a QName
Returns:
the value or null if there is no property defined for the given name

setProperty

public void setProperty(Object name,
                        Object value)
Sets the value of the given property name (which is typically a String or a QName) to the value.

Parameters:
name - is the name of the property which is usually a String or a QName but could be any object
value - the value of the new attribute

getPropertyNames

public Set getPropertyNames()
Return a collection of the available property names which are typically String or QName instances


getIn

public XMLStreamReader getIn()

getOut

public XMLStreamWriter getOut()

copy

public void copy(XMLStreamReader in,
                 XMLStreamWriter out)
          throws XMLStreamException
A helper method which streams the input to the output

Throws:
XMLStreamException

isRepairingNamespace

public boolean isRepairingNamespace()

getService

public RestService getService()
Returns the current service instance which is processing the message so that we can access the details such as the handler registry


getSoapService

public SoapService getSoapService()
Returns the current SOAP service instance, if we are using the SOAP protocol so that you can access the SOAP details such as available roles, SOAP version, intermidate mode etc.

Returns:
the SOAP service if the current service or null if the current service is a pure REST service and does not use the SOAP protocol.


Copyright © 2004-2005 LogicBlaze, Inc.. All Rights Reserved.