com.sun.xml.ws.handler
Class HandlerProcessor<C extends MessageUpdatableContext>

java.lang.Object
  extended by com.sun.xml.ws.handler.HandlerProcessor<C>
Direct Known Subclasses:
SOAPHandlerProcessor, XMLHandlerProcessor

abstract class HandlerProcessor<C extends MessageUpdatableContext>
extends Object


Nested Class Summary
static class HandlerProcessor.Direction
           
static class HandlerProcessor.RequestOrResponse
           
 
Field Summary
(package private)  WSBinding binding
           
(package private)  boolean isClient
           
(package private) static Logger logger
           
 
Constructor Summary
protected HandlerProcessor(HandlerTube owner, WSBinding binding, List<? extends javax.xml.ws.handler.Handler> chain)
          The handlers that are passed in will be sorted into logical and soap handlers.
 
Method Summary
 boolean callHandlersRequest(HandlerProcessor.Direction direction, C context, boolean responseExpected)
          TODO: Just putting thoughts, Current contract: This is Called during Request Processing.
 void callHandlersResponse(HandlerProcessor.Direction direction, C context, boolean isFault)
          TODO: Just putting thoughts, Current contract: This is Called during Response Processing.
(package private)  void closeHandlers(javax.xml.ws.handler.MessageContext context, int start, int end)
          Calls close on the handlers from the starting index through the ending index (inclusive).
(package private)  int getIndex()
          Gives index of the handler in the chain to know what handlers in the chain are invoked
(package private) abstract  void insertFaultMessage(C context, javax.xml.ws.ProtocolException exception)
          When a ProtocolException is thrown, this is called.
(package private)  void setIndex(int i)
          This is called when a handler returns false or throws a RuntimeException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isClient

boolean isClient

logger

static final Logger logger

binding

WSBinding binding
Constructor Detail

HandlerProcessor

protected HandlerProcessor(HandlerTube owner,
                           WSBinding binding,
                           List<? extends javax.xml.ws.handler.Handler> chain)
The handlers that are passed in will be sorted into logical and soap handlers. During this sorting, the understood headers are also obtained from any soap handlers.

Parameters:
chain - A list of handler objects, which can be protocol or logical handlers.
Method Detail

getIndex

int getIndex()
Gives index of the handler in the chain to know what handlers in the chain are invoked


setIndex

void setIndex(int i)
This is called when a handler returns false or throws a RuntimeException


callHandlersRequest

public boolean callHandlersRequest(HandlerProcessor.Direction direction,
                                   C context,
                                   boolean responseExpected)
TODO: Just putting thoughts, Current contract: This is Called during Request Processing. return true, if all handlers in the chain return true Current Pipe can call nextPipe.process(); return false, One of the handlers has returned false or thrown a RuntimeException. Remedy Actions taken: 1) In this case, The processor will setIndex()to track what handlers are invoked until that point. 2) Previously invoked handlers are again invoked (handleMessage() or handleFault()) to take remedy action. CurrentPipe should NOT call nextPipe.process() While closing handlers, check getIndex() to get the invoked handlers.

Throws:
RuntimeException - this happens when a RuntimeException occurs during handleMessage during Request processing or during remedy action 2) CurrentPipe should NOT call nextPipe.process() and throw the exception to the previous Pipe While closing handlers, check getIndex() to get the invoked handlers.

callHandlersResponse

public void callHandlersResponse(HandlerProcessor.Direction direction,
                                 C context,
                                 boolean isFault)
TODO: Just putting thoughts, Current contract: This is Called during Response Processing. Runs all handlers until handle returns false or throws a RuntimeException CurrentPipe should close all the handlers in the chain. throw RuntimeException, this happens when a RuntimeException occurs during normal Response processing or remedy action 2) taken during callHandlersRequest(). CurrentPipe should close all the handlers in the chain. *


insertFaultMessage

abstract void insertFaultMessage(C context,
                                 javax.xml.ws.ProtocolException exception)
When a ProtocolException is thrown, this is called. If it's XML/HTTP Binding, clear the the message If its SOAP/HTTP Binding, put right SOAP Fault version


closeHandlers

void closeHandlers(javax.xml.ws.handler.MessageContext context,
                   int start,
                   int end)
Calls close on the handlers from the starting index through the ending index (inclusive). Made indices inclusive to allow both directions more easily.