org.jibx.ws.context
Class OutContext

java.lang.Object
  extended by org.jibx.ws.context.Context
      extended by org.jibx.ws.context.MessageContext
          extended by org.jibx.ws.context.OutContext

public final class OutContext
extends MessageContext

The context for the processing of an outbound message. The context provides access to the phase object for each phase of processing. It can also be used to store and retrieve state using the Context.setAttribute(String, Object) and Context.getAttribute(String) methods.


Constructor Summary
OutContext()
           
 
Method Summary
 void addHandler(org.jibx.ws.context.Phase phase, OutHandler handler)
          Adds a handler to the specified phase of the outbound message handling.
 boolean hasHandlers(org.jibx.ws.context.Phase phase)
          Returns whether the specified phase has any handlers.
 void invokeBodyWriter(IXMLWriter xmlWriter)
          Invokes the writing of the body of the message.
 void invokeHandlers(org.jibx.ws.context.Phase phase, IXMLWriter xmlWriter)
          Invoke the processing of the phase.
 boolean isOutbound()
          Returns whether the message context is for an outbound or inbound message.
 void reset()
          Resets the state of this context and all associated commands and handlers for subsequent re-use of this context.
 void setBodyWriter(org.jibx.ws.io.PayloadWriter bodyWriter)
          Sets the writer for the body of the message.
 
Methods inherited from class org.jibx.ws.context.MessageContext
getBody, getExchangeContext, setBody
 
Methods inherited from class org.jibx.ws.context.Context
getAttribute, getAttributeNames, removeAttribute, setAttribute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutContext

public OutContext()
Method Detail

setBodyWriter

public void setBodyWriter(org.jibx.ws.io.PayloadWriter bodyWriter)
Sets the writer for the body of the message.

Parameters:
bodyWriter - the message body writer

invokeBodyWriter

public void invokeBodyWriter(IXMLWriter xmlWriter)
                      throws IOException,
                             WsException
Invokes the writing of the body of the message. Assumes that the setBody() method has been called with the body of the message.

Parameters:
xmlWriter - the writer to write the body to
Throws:
IOException - on any I/O error
WsException - on errors other than I/O, for example invalid XML format

addHandler

public void addHandler(org.jibx.ws.context.Phase phase,
                       OutHandler handler)
Adds a handler to the specified phase of the outbound message handling.

Parameters:
phase - the phase to add the handler to
handler - the handler to add

hasHandlers

public boolean hasHandlers(org.jibx.ws.context.Phase phase)
Returns whether the specified phase has any handlers.

Parameters:
phase - the phase
Returns:
true if the specified phase has 1 or more handlers, false otherwise

invokeHandlers

public void invokeHandlers(org.jibx.ws.context.Phase phase,
                           IXMLWriter xmlWriter)
                    throws IOException,
                           WsException
Invoke the processing of the phase.

Parameters:
phase - the phase to invoke the handlers for
xmlWriter - the writer to write XML content to
Throws:
IOException - on any I/O error
WsException - on errors other than I/O, for example invalid XML format

isOutbound

public boolean isOutbound()
Returns whether the message context is for an outbound or inbound message.

Specified by:
isOutbound in class MessageContext
Returns:
true if the context is for an outbound message, false for inbound.

reset

public void reset()
Resets the state of this context and all associated commands and handlers for subsequent re-use of this context.

Overrides:
reset in class MessageContext


Project Web Site