org.apache.axis

Class FaultableHandler

Implemented Interfaces:
Handler, Serializable

public class FaultableHandler
extends BasicHandler

A FaultableHandler is essentially a wrapper for any other Handler which provides flexible fault handling semantics.

Authors:
Doug Davis (dug@us.ibm.com)
Glen Daniels (gdaniels@apache.org)

Field Summary

protected static Log
entLog
The Log used for enterprise-centric logging.
protected static Log
log
The Log used to log all events that would be of general interest.
protected Handler
workHandler
The Handler that will do the actual work of handeling the fault.

Fields inherited from class org.apache.axis.handlers.BasicHandler

makeLockable, name, options

Constructor Summary

FaultableHandler(Handler workHandler)
Create a new FaultHandler.

Method Summary

boolean
canHandleBlock(QName qname)
Indicate if this handler can process qname.
void
cleanup()
Cleanup is called when the chain containing this Handler object is done processing the chain.
void
init()
Stubbed-out methods.
void
invoke(MessageContext msgContext)
Invokes the specified handler.
void
onFault(MessageContext msgContext)
Some handler later on has faulted so we need to process the fault.

Methods inherited from class org.apache.axis.handlers.BasicHandler

canHandleBlock, cleanup, generateWSDL, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, init, initHashtable, onFault, setName, setOption, setOptionDefault, setOptions, setOptionsLockable

Field Details

entLog

protected static Log entLog
The Log used for enterprise-centric logging. The enterprise category is for stuff that an enterprise product might want to track, but in a simple environment (like the AXIS build) would be nothing more than a nuisance.


log

protected static Log log
The Log used to log all events that would be of general interest.


workHandler

protected Handler workHandler
The Handler that will do the actual work of handeling the fault.

Constructor Details

FaultableHandler

public FaultableHandler(Handler workHandler)
Create a new FaultHandler.

Parameters:
workHandler - the Handler we're going to wrap with Fault semantics.

Method Details

canHandleBlock

public boolean canHandleBlock(QName qname)
Indicate if this handler can process qname.
Specified by:
canHandleBlock in interface Handler
Overrides:
canHandleBlock in interface BasicHandler

Parameters:
qname - the QName to check

Returns:
true if this Handler can handle qname, false otherwise


cleanup

public void cleanup()
Cleanup is called when the chain containing this Handler object is done processing the chain.
Specified by:
cleanup in interface Handler
Overrides:
cleanup in interface BasicHandler


init

public void init()
Stubbed-out methods. Override in your child class to implement any real behavior. Note that there is NOT a stub for invoke(), since we require any Handler derivative to implement that.
Specified by:
init in interface Handler
Overrides:
init in interface BasicHandler


invoke

public void invoke(MessageContext msgContext)
            throws AxisFault
Invokes the specified handler. If there's a fault the appropriate key will be calculated and used to find the fault chain to be invoked. This assumes that the workHandler has caught the exception and already done its fault processing - as needed.
Specified by:
invoke in interface Handler

Parameters:
msgContext - the MessageContext to process

Throws:
AxisFault - if anything goes terminally wrong


onFault

public void onFault(MessageContext msgContext)
Some handler later on has faulted so we need to process the fault.
Specified by:
onFault in interface Handler
Overrides:
onFault in interface BasicHandler

Parameters:
msgContext - the context to process


Copyright B) 2005 Apache Web Services Project. All Rights Reserved.