org.systinet.wasp.handler
Class WaspGenericHandler

java.lang.Object
  extended byjavax.xml.rpc.handler.GenericHandler
      extended byorg.systinet.wasp.handler.WaspGenericHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
UnreferencedAttachmentsHandler

public abstract class WaspGenericHandler
extends GenericHandler

WaspGenericHandler is a WSO2 SOA Enablement Server modification of JAX-RPC handler. Invocation of jax-rpc handler methods is not symetrical in client-server view. The schema of invocation is as follows:

  CLIENT
                              request
  handleRequest()             ------>           handleRequest()

                              response
  handleResponse()            <-------          handleResponse()

 
It is well enough until your want to create uniform handler for server and client. Imagine handler maintaining mutual authentication. HandleRequest() on client will perform credentials setup , while handleRequest() on server should perform credentials check. HandleResponse() on server will perform credentials setup , while handleResponse() on client should perform credentials check. Developer must have either two different implementation(special for client and server) or deal with handler location in its implementation. This is exactly what this helper do. Invocation looks like this:

  CLIENT
                              request
  handleOutput()              ------>           handleInput()

                              response
  handleInput()               <-------          handleOutput()

 

Since:
4.6
Component:
Core

Field Summary
protected  QName[] headers
          The headers initialized by HandlerInfo.
 
Constructor Summary
WaspGenericHandler()
           
 
Method Summary
 QName[] getHeaders()
          Returns understands headers.
 boolean handleInput(MessageContext context)
          This method is called by either handleRequest(javax.xml.rpc.handler.MessageContext)(on server) or handleResponse(javax.xml.rpc.handler.MessageContext)(on client).
 boolean handleOutput(MessageContext context)
          This method is called by either handleRequest(javax.xml.rpc.handler.MessageContext)(on server) or handleResponse(javax.xml.rpc.handler.MessageContext)(on client).
 boolean handleRequest(MessageContext context)
          Calls either handleInput(javax.xml.rpc.handler.MessageContext) or handleOutput(javax.xml.rpc.handler.MessageContext) depending on processing location(server or client)
 boolean handleResponse(MessageContext context)
          Calls either handleInput(javax.xml.rpc.handler.MessageContext) or handleOutput(javax.xml.rpc.handler.MessageContext) depending on processing location(server or client)
 void init(HandlerInfo config)
          Retrieves headers from the given config.
 
Methods inherited from class javax.xml.rpc.handler.GenericHandler
destroy, handleFault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headers

protected volatile QName[] headers
The headers initialized by HandlerInfo.

See Also:
init(javax.xml.rpc.handler.HandlerInfo)
Constructor Detail

WaspGenericHandler

public WaspGenericHandler()
Method Detail

handleRequest

public final boolean handleRequest(MessageContext context)
Calls either handleInput(javax.xml.rpc.handler.MessageContext) or handleOutput(javax.xml.rpc.handler.MessageContext) depending on processing location(server or client)

Specified by:
handleRequest in interface Handler
Overrides:
handleRequest in class GenericHandler
Parameters:
context - SOAPMessageContext
Returns:
invocation result, true means process next handler, false means stop processing and return response to client(on server) or stop processing and deserialize response(on client)
See Also:
Handler.handleRequest(javax.xml.rpc.handler.MessageContext)

handleResponse

public final boolean handleResponse(MessageContext context)
Calls either handleInput(javax.xml.rpc.handler.MessageContext) or handleOutput(javax.xml.rpc.handler.MessageContext) depending on processing location(server or client)

Specified by:
handleResponse in interface Handler
Overrides:
handleResponse in class GenericHandler
Parameters:
context - SOAPMessageContext
Returns:
invocation result, true means process next handler, false means stop processing and return response to client(on server) or stop processing and deserialize response(on client)
See Also:
Handler.handleResponse(javax.xml.rpc.handler.MessageContext)

handleInput

public boolean handleInput(MessageContext context)
This method is called by either handleRequest(javax.xml.rpc.handler.MessageContext)(on server) or handleResponse(javax.xml.rpc.handler.MessageContext)(on client). It used as a helper for symetric handler implementation. It is substitution of deprecated headerprocessor invocation logic.

Parameters:
context - SOAPMessageContext
Returns:
invocation result, true means process next handler, false means stop processing and return response to client(on server) or stop processing and deserialize response(on client)

handleOutput

public boolean handleOutput(MessageContext context)
This method is called by either handleRequest(javax.xml.rpc.handler.MessageContext)(on server) or handleResponse(javax.xml.rpc.handler.MessageContext)(on client). It used as a helper for symetric handler implementation. It is substitution of deprecated headerprocessor invocation logic.

Parameters:
context - SOAPMessageContext
Returns:
invocation result, true means process next handler, false means stop processing and return response to client(on server) or stop processing and deserialize response(on client)

init

public void init(HandlerInfo config)
Retrieves headers from the given config.

Specified by:
init in interface Handler
Overrides:
init in class GenericHandler
See Also:
Handler.init(javax.xml.rpc.handler.HandlerInfo)

getHeaders

public QName[] getHeaders()
Returns understands headers. Descendants can override this method to supply hardcoded understand headers.

Specified by:
getHeaders in interface Handler
Specified by:
getHeaders in class GenericHandler
Returns:
this understood headers.