javax.xml.rpc.handler
Interface Handler


public interface Handler

A handler provides a mechanism for processing of service context, plugging in additional RPC processing behavior and enhancing functionality of a JAX-RPC runtime system.

A JAX-RPC handler is required to implement the javax.xml.rpc.handler.Handler interface.


Method Summary
 void destroy()
          The destroy method indicates the end of lifecycle for a Handler instance.
 QName[] getHeaders()
          Gets the header blocks processed by this Handler instance.
 void handleFault(MessageContext context)
          The handleFault method processes the SOAP faults based on the SOAP message processing model.
 boolean handleRequest(MessageContext context)
          The handleRequest method processes the request message.
 boolean handleResponse(MessageContext context)
          The handleResponse method processes the response message.
 void init(HandlerInfo config)
          The init method to enable the Handler instance to initialize itself.
 

Method Detail

handleRequest

public boolean handleRequest(MessageContext context)
The handleRequest method processes the request message.
Parameters:
context - - MessageContext parameter provides access to the request message.
Throws:
JAXRPCException - - if any handler specific runtime error happens. The HandlerChain terminates the further processing of this handler chain. SOAPFaultException - if SOAP fault is generated by this handler. The HandlerChain catches this exception, terminates the further processing of the request handlers in this handler chain and invokes the handleFault method on this handler

handleResponse

public boolean handleResponse(MessageContext context)
The handleResponse method processes the response message.
Parameters:
context - - MessageContext parameter provides access to the response message
Returns:
Processing mode. Return true to indicate continued processing of the response handler chain. The HandlerChain invokes the handleRespons method on the next Handler in the handler chain. Return false to indicate blocking of the response handler chain. In this case, no other response handlers in the handler chain are invoked.
Throws:
JAXRPCException - - if any handler specific runtime error happens. The HandlerChain terminates the further processing of this handler chain.

handleFault

public void handleFault(MessageContext context)
The handleFault method processes the SOAP faults based on the SOAP message processing model.
Parameters:
context - - MessageContext parameter provides access to the SOAP message.
Throws:
JAXRPCException - - if any handler specific runtime error

init

public void init(HandlerInfo config)
The init method to enable the Handler instance to initialize itself. The init method passes the handler configuration properties as a Map instance. These configuration properties are used to configure the Handler (for example: setup access to an external resource or service) during initialization.
Parameters:
HandlerInfo - - Configuration for the initialization of this handler
Throws:
JAXRPCException - - If initialization of the handler fails

destroy

public void destroy()
The destroy method indicates the end of lifecycle for a Handler instance. An Handler implementation class should release any resources that it had acquired over its lifecycle. The JAX-RPC runtime system invokes the destroy method, when the Handler instance is no longer needed.
Throws:
JAXRPCException - If any error during destroy

getHeaders

public QName[] getHeaders()
Gets the header blocks processed by this Handler instance.
Returns:
The header blocks.


Copyright © 2001 Apache XML Project. All Rights Reserved.