cgl.narada.wsinfra
Class WsProcessor

java.lang.Object
  extended by cgl.narada.wsinfra.WsProcessor
Direct Known Subclasses:
WseSinkProcessor, WseSourceProcessor, WseSubscriptionManagerProcessor, WsrmSinkNode, WsrmSinkNodeHelper, WsrmSourceNode, WsrmSourceNodeHelper, WsrSinkNode, WsrSinkNodeHelper, WsrSourceNode, WsrSourceNodeHelper

public abstract class WsProcessor
extends Object

All Ws specifications extend this processor. This processor provides the entry point to connect WsMessageFlow implementations with the actual processing of exchanges in various protocols.


Constructor Summary
WsProcessor()
           
 
Method Summary
 void enrouteToApplication(EnvelopeDocument envelopeDocument)
          This method routes an envelope document enroute to the application.
 void enrouteToNetwork(EnvelopeDocument envelopeDocument)
          This method routes an envelope document enroute to the network.
 void enrouteToNetwork(EnvelopeDocument envelopeDocument, String sendTo)
          This method routes an envelope document enroute to the network.
abstract  WsMessageFlow getMessageFlow()
          Gets the message flow which the processor should use.
 boolean isFault(AddressingHeaders addressingHeaders)
          Check to see if the addressing headers indicate that this is a fault.
 void manageFaultException(WsFaultException wsFaultException, int direction)
          This method will convert the fault to an appropriate fault document and route it back either to the application or over the network.
abstract  boolean processExchange(EnvelopeDocument envelopeDocument, int direction)
          This is the method which all implementations of the various WS specifications will override.
 boolean processExchange(SOAPContext soapContext, int direction)
          Process the exchange.
 boolean processExchange(SOAPMessage soapMessage, int direction)
          Process the exchange.
abstract  void setMessageFlow(WsMessageFlow messageFlow)
          Sets the message flow which the processor should use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsProcessor

public WsProcessor()
Method Detail

setMessageFlow

public abstract void setMessageFlow(WsMessageFlow messageFlow)
                             throws DeploymentException
Sets the message flow which the processor should use.

Throws:
DeploymentException

getMessageFlow

public abstract WsMessageFlow getMessageFlow()
Gets the message flow which the processor should use.


processExchange

public boolean processExchange(SOAPContext soapContext,
                               int direction)
                        throws UnknownExchangeException,
                               IncorrectExchangeException,
                               MessageFlowException,
                               ProcessingException
Process the exchange. The argument also indicates the direction in which the exchange has actually traversed.

Throws:
UnknownExchangeException
IncorrectExchangeException
MessageFlowException
ProcessingException

isFault

public boolean isFault(AddressingHeaders addressingHeaders)
Check to see if the addressing headers indicate that this is a fault. If so, return true else return false.


processExchange

public boolean processExchange(SOAPMessage soapMessage,
                               int direction)
                        throws UnknownExchangeException,
                               IncorrectExchangeException,
                               MessageFlowException,
                               ProcessingException
Process the exchange. The argument also indicates the direction in which the exchange has actually traversed.

Throws:
UnknownExchangeException
IncorrectExchangeException
MessageFlowException
ProcessingException

processExchange

public abstract boolean processExchange(EnvelopeDocument envelopeDocument,
                                        int direction)
                                 throws UnknownExchangeException,
                                        IncorrectExchangeException,
                                        ProcessingException,
                                        MessageFlowException
This is the method which all implementations of the various WS specifications will override. Note that deployement need only pass the JAVA-WORLD javax.xml.SOAPMessage and all the processing and conversions take place automatically.

Throws:
UnknownExchangeException
IncorrectExchangeException
ProcessingException
MessageFlowException

manageFaultException

public void manageFaultException(WsFaultException wsFaultException,
                                 int direction)
                          throws MessageFlowException
This method will convert the fault to an appropriate fault document and route it back either to the application or over the network.

Throws:
MessageFlowException

enrouteToNetwork

public void enrouteToNetwork(EnvelopeDocument envelopeDocument,
                             String sendTo)
                      throws MessageFlowException
This method routes an envelope document enroute to the network. Appropriate conversion to the SOAPMessage object is made, and the enrouteToNetwork(SOAPMessage, sendTo) method of the registered WsMessageFlow is invoked.

Throws:
MessageFlowException

enrouteToNetwork

public void enrouteToNetwork(EnvelopeDocument envelopeDocument)
                      throws MessageFlowException
This method routes an envelope document enroute to the network. The method first computes the destination sendTo based on the [wsa:To] element. Then the appropriate conversion to the SOAPMessage object is made, and the enrouteToNetwork(SOAPMessage, sendTo) method of the registered WsMessageFlow is invoked.

Throws:
MessageFlowException

enrouteToApplication

public void enrouteToApplication(EnvelopeDocument envelopeDocument)
                          throws MessageFlowException
This method routes an envelope document enroute to the application. Appropriate conversion to the SOAPMessage object is made, and the enrouteToApplication(SOAPMessage) method of the registered WsMessageFlow is invoked.

Throws:
MessageFlowException


For comments and suggestions please send e-mail to The NaradaBrokering Project