org.apache.axis

Class SimpleChain

Implemented Interfaces:
Chain, Handler, Serializable
Known Direct Subclasses:
SimpleTargetedChain

public class SimpleChain
extends BasicHandler
implements Chain

A Simple Chain is a 'composite' Handler in that it aggregates a collection of Handlers and also acts as a Handler which delegates its operations to the collection.

A Simple Chain initially has no Handlers. Handlers may be added until the chain is invoke()d after which Handlers may not be added (and any attempt to do so will throw an exception).

Authors:
Doug Davis (dug@us.ibm.com)
Glyn Normington (norm@uk.ibm.com)

Field Summary

protected Vector
handlers
protected boolean
invoked

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

makeLockable, name, options

Method Summary

void
addHandler(Handler handler)
boolean
canHandleBlock(QName qname)
void
cleanup()
boolean
contains(Handler handler)
void
generateWSDL(MessageContext msgContext)
Iterate over the chain letting each handler have a crack at contributing to a WSDL description.
Element
getDeploymentData(Document doc)
Handler[]
getHandlers()
void
init()
void
invoke(MessageContext msgContext)
Iterate over the chain invoking each handler.
void
onFault(MessageContext msgContext)
Notify the handlers in this chain because some handler later on has faulted - in reverse order.

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

handlers

protected Vector handlers


invoked

protected boolean invoked

Method Details

addHandler

public void addHandler(Handler handler)
Specified by:
addHandler in interface Chain


canHandleBlock

public boolean canHandleBlock(QName qname)
Specified by:
canHandleBlock in interface Handler
Overrides:
canHandleBlock in interface BasicHandler


cleanup

public void cleanup()
Specified by:
cleanup in interface Handler
Overrides:
cleanup in interface BasicHandler


contains

public boolean contains(Handler handler)
Specified by:
contains in interface Chain


generateWSDL

public void generateWSDL(MessageContext msgContext)
            throws AxisFault
Iterate over the chain letting each handler have a crack at contributing to a WSDL description.
Specified by:
generateWSDL in interface Handler
Overrides:
generateWSDL in interface BasicHandler

Parameters:
msgContext - the MessageContext to write the WSDL out to

Throws:
AxisFault - if there was a problem writing the WSDL


getDeploymentData

public Element getDeploymentData(Document doc)
Specified by:
getDeploymentData in interface Handler
Overrides:
getDeploymentData in interface BasicHandler


getHandlers

public Handler[] getHandlers()
Specified by:
getHandlers in interface Chain


init

public void init()
Specified by:
init in interface Handler
Overrides:
init in interface BasicHandler


invoke

public void invoke(MessageContext msgContext)
            throws AxisFault
Iterate over the chain invoking each handler. If there's a fault then call 'onFault' for each completed handler in reverse order, then rethrow the exception.
Specified by:
invoke in interface Handler

Throws:
AxisFault - if there was a fault with any of the handlers


onFault

public void onFault(MessageContext msgContext)
Notify the handlers in this chain because some handler later on has faulted - in reverse order. If any handlers have been added since we visited the chain, they will get notified too!
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.