com.sun.xml.ws.handler
Class HandlerTube

java.lang.Object
  extended by com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl
      extended by com.sun.xml.ws.api.pipe.helper.AbstractFilterTubeImpl
          extended by com.sun.xml.ws.handler.HandlerTube
All Implemented Interfaces:
Pipe, Tube
Direct Known Subclasses:
ClientLogicalHandlerTube, ClientMessageHandlerTube, ClientSOAPHandlerTube, ServerLogicalHandlerTube, ServerMessageHandlerTube, ServerSOAPHandlerTube

public abstract class HandlerTube
extends AbstractFilterTubeImpl


Nested Class Summary
(package private) static class HandlerTube.HandlerTubeExchange
          This class is used primarily to exchange information or status between LogicalHandlerTube and SOAPHandlerTube
 
Field Summary
(package private)  HandlerTube cousinTube
          handle hold reference to other Tube for inter-tube communication
protected  List<javax.xml.ws.handler.Handler> handlers
           
(package private)  Packet packet
           
protected  WSDLPort port
           
(package private)  HandlerProcessor processor
           
(package private)  boolean remedyActionTaken
           
(package private)  boolean requestProcessingSucessful
           
 
Fields inherited from class com.sun.xml.ws.api.pipe.helper.AbstractFilterTubeImpl
next
 
Constructor Summary
protected HandlerTube(HandlerTube that, TubeCloner cloner)
          Copy constructor for Tube.copy(TubeCloner).
  HandlerTube(Tube next, HandlerTube cousinTube)
           
  HandlerTube(Tube next, WSDLPort port)
           
 
Method Summary
(package private) abstract  boolean callHandlersOnRequest(MessageUpdatableContext context, boolean oneWay)
           
(package private) abstract  void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault)
           
 void close(javax.xml.ws.handler.MessageContext msgContext)
          Calls close on previously invoked handlers.
protected  void closeClientsideHandlers(javax.xml.ws.handler.MessageContext msgContext)
          Called by close(MessageContext mc) in a Client Handlertube
(package private) abstract  void closeHandlers(javax.xml.ws.handler.MessageContext mc)
          On Client, Override by calling #closeClientHandlers(MessageContext mc) On Server, Override by calling #closeServerHandlers(MessageContext mc) The difference is the order in which they are closed.
protected  void closeServersideHandlers(javax.xml.ws.handler.MessageContext msgContext)
          Called by close(MessageContext mc) in a Server Handlertube
(package private) abstract  MessageUpdatableContext getContext(Packet p)
           
protected  void initiateClosing(javax.xml.ws.handler.MessageContext mc)
          Must be overridden by HandlerTube that drives other handler tubes for processing a message.
 boolean isHandlerChainEmpty()
           
 NextAction processException(Throwable t)
          Default no-op implementation.
 NextAction processRequest(Packet request)
          Default no-op implementation.
 NextAction processResponse(Packet response)
          Default no-op implementation.
(package private)  void setHandleFalse()
           
(package private)  void setHandleFault()
           
(package private) abstract  void setUpProcessor()
           
 
Methods inherited from class com.sun.xml.ws.api.pipe.helper.AbstractFilterTubeImpl
preDestroy
 
Methods inherited from class com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl
copy, copy, doInvoke, doInvokeAndForget, doReturnWith, doSuspend, doThrow, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cousinTube

HandlerTube cousinTube
handle hold reference to other Tube for inter-tube communication


handlers

protected List<javax.xml.ws.handler.Handler> handlers

processor

HandlerProcessor processor

remedyActionTaken

boolean remedyActionTaken

port

@Nullable
protected final WSDLPort port

requestProcessingSucessful

boolean requestProcessingSucessful

packet

Packet packet
Constructor Detail

HandlerTube

public HandlerTube(Tube next,
                   WSDLPort port)

HandlerTube

public HandlerTube(Tube next,
                   HandlerTube cousinTube)

HandlerTube

protected HandlerTube(HandlerTube that,
                      TubeCloner cloner)
Copy constructor for Tube.copy(TubeCloner).

Method Detail

processRequest

public NextAction processRequest(Packet request)
Description copied from class: AbstractFilterTubeImpl
Default no-op implementation.

Specified by:
processRequest in interface Tube
Overrides:
processRequest in class AbstractFilterTubeImpl
Parameters:
request - The packet that represents a request message. If the packet has a non-null message, it must be a valid unconsumed Message. This message represents the SOAP message to be sent as a request.

The packet is also allowed to carry no message, which indicates that this is an output-only request. (that's called "solicit", right? - KK)

Returns:
A NextAction object that represents the next action to be taken by the JAX-WS runtime.

processResponse

public NextAction processResponse(Packet response)
Description copied from class: AbstractFilterTubeImpl
Default no-op implementation.

Specified by:
processResponse in interface Tube
Overrides:
processResponse in class AbstractFilterTubeImpl
Parameters:
response - If the packet has a non-null message, it must be a valid unconsumed Message. This message represents a response to the request message passed to Tube.processRequest(Packet) earlier.

The packet is also allowed to carry no message, which indicates that there was no response. This is used for things like one-way message and/or one-way transports. TODO: exception handling semantics need more discussion

Returns:
A NextAction object that represents the next action to be taken by the JAX-WS runtime.

processException

public NextAction processException(Throwable t)
Description copied from class: AbstractFilterTubeImpl
Default no-op implementation.

Specified by:
processException in interface Tube
Overrides:
processException in class AbstractFilterTubeImpl
Returns:
A NextAction object that represents the next action to be taken by the JAX-WS runtime.

initiateClosing

protected void initiateClosing(javax.xml.ws.handler.MessageContext mc)
Must be overridden by HandlerTube that drives other handler tubes for processing a message. On Client-side: ClientLogicalHandlerTube drives the Handler Processing. On Server-side: In case SOAP Binding, ServerMessageHandlerTube drives the Handler Processing. In case XML/HTTP Binding, ServerLogicalHandlerTube drives the Handler Processing. If its a top HandlerTube, should override by calling #close(MessaggeContext);


close

public final void close(javax.xml.ws.handler.MessageContext msgContext)
Calls close on previously invoked handlers. Also, Cleans up any state left over in the Tube instance from the current invocation, as Tube instances can be reused after the completion of MEP. On Client, SOAPHandlers are closed first and then LogicalHandlers On Server, LogicalHandlers are closed first and then SOAPHandlers


closeHandlers

abstract void closeHandlers(javax.xml.ws.handler.MessageContext mc)
On Client, Override by calling #closeClientHandlers(MessageContext mc) On Server, Override by calling #closeServerHandlers(MessageContext mc) The difference is the order in which they are closed.

Parameters:
mc -

closeClientsideHandlers

protected void closeClientsideHandlers(javax.xml.ws.handler.MessageContext msgContext)
Called by close(MessageContext mc) in a Client Handlertube


closeServersideHandlers

protected void closeServersideHandlers(javax.xml.ws.handler.MessageContext msgContext)
Called by close(MessageContext mc) in a Server Handlertube


callHandlersOnResponse

abstract void callHandlersOnResponse(MessageUpdatableContext context,
                                     boolean handleFault)

callHandlersOnRequest

abstract boolean callHandlersOnRequest(MessageUpdatableContext context,
                                       boolean oneWay)

setUpProcessor

abstract void setUpProcessor()

isHandlerChainEmpty

public final boolean isHandlerChainEmpty()

getContext

abstract MessageUpdatableContext getContext(Packet p)

setHandleFault

final void setHandleFault()

setHandleFalse

final void setHandleFalse()