org.apache.axis

Class SimpleChain

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).

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

Field Summary
protected Vectorhandlers
protected booleaninvoked
Method Summary
voidaddHandler(Handler handler)
booleancanHandleBlock(QName qname)
voidcleanup()
booleancontains(Handler handler)
voidgenerateWSDL(MessageContext msgContext)
Iterate over the chain letting each handler have a crack at contributing to a WSDL description.
ElementgetDeploymentData(Document doc)
Handler[]getHandlers()
voidinit()
voidinvoke(MessageContext msgContext)
Iterate over the chain invoking each handler.
voidonFault(MessageContext msgContext)
Notify the handlers in this chain because some handler later on has faulted - in reverse order.

Field Detail

handlers

protected Vector handlers

invoked

protected boolean invoked

Method Detail

addHandler

public void addHandler(Handler handler)

canHandleBlock

public boolean canHandleBlock(QName qname)

cleanup

public void cleanup()

contains

public boolean contains(Handler handler)

generateWSDL

public void generateWSDL(MessageContext msgContext)
Iterate over the chain letting each handler have a crack at contributing to a WSDL description.

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)

getHandlers

public Handler[] getHandlers()

init

public void init()

invoke

public void invoke(MessageContext msgContext)
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.

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!

Parameters: msgContext the context to process

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