Package org.apache.axis
Class SimpleChain
java.lang.Object
org.apache.axis.handlers.BasicHandler
org.apache.axis.SimpleChain
- All Implemented Interfaces:
Serializable,Chain,Handler
- Direct Known Subclasses:
SimpleTargetedChain
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)
- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.axis.handlers.BasicHandler
makeLockable, name, options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHandler(Handler handler) Adds a handler to the end of the chain.booleancanHandleBlock(QName qname) Indicate if this handler can processqname.voidcleanup()Cleanup is called when the chain containing this Handler object is done processing the chain.booleanDiscover if a handler is in this chain.voidgenerateWSDL(MessageContext msgContext) Iterate over the chain letting each handler have a crack at contributing to a WSDL description.This will return the root element of an XML doc that describes the deployment information about this handler.Handler[]Get the list of handlers in the chain.voidinit()Stubbed-out methods.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.Methods inherited from class org.apache.axis.handlers.BasicHandler
getName, getOption, getOptions, getUnderstoodHeaders, initHashtable, setName, setOption, setOptionDefault, setOptions, setOptionsLockableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.axis.Handler
getName, getOption, getOptions, getUnderstoodHeaders, setName, setOption, setOptions
-
Field Details
-
handlers
-
invoked
protected boolean invoked
-
-
Constructor Details
-
SimpleChain
public SimpleChain()
-
-
Method Details
-
init
public void init()Description copied from class:BasicHandlerStubbed-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:
initin interfaceHandler- Overrides:
initin classBasicHandler
-
cleanup
public void cleanup()Description copied from interface:HandlerCleanup is called when the chain containing this Handler object is done processing the chain.- Specified by:
cleanupin interfaceHandler- Overrides:
cleanupin classBasicHandler
-
invoke
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. -
generateWSDL
Iterate over the chain letting each handler have a crack at contributing to a WSDL description.- Specified by:
generateWSDLin interfaceHandler- Overrides:
generateWSDLin classBasicHandler- Parameters:
msgContext- theMessageContextto write the WSDL out to- Throws:
AxisFault- if there was a problem writing the WSDL
-
onFault
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:
onFaultin interfaceHandler- Overrides:
onFaultin classBasicHandler- Parameters:
msgContext- the context to process
-
canHandleBlock
Description copied from interface:HandlerIndicate if this handler can processqname.- Specified by:
canHandleBlockin interfaceHandler- Overrides:
canHandleBlockin classBasicHandler- Parameters:
qname- theQNameto check- Returns:
- true if this
Handlercan handleqname, false otherwise
-
addHandler
Description copied from interface:ChainAdds a handler to the end of the chain. May not be called after invoke.- Specified by:
addHandlerin interfaceChain- Parameters:
handler- theHandlerto be added
-
contains
Description copied from interface:ChainDiscover if a handler is in this chain. -
getHandlers
Description copied from interface:ChainGet the list of handlers in the chain. Is Handler[] the right form?- Specified by:
getHandlersin interfaceChain- Returns:
- an array of
Handlers that have been added
-
getDeploymentData
Description copied from interface:HandlerThis will return the root element of an XML doc that describes the deployment information about this handler. This is NOT the WSDL, this is all of the static internal data use by Axis - WSDL takes into account run-time information (like which service we're talking about) this is just the data that's stored in the registry. Used by the 'list' Admin function.- Specified by:
getDeploymentDatain interfaceHandler- Overrides:
getDeploymentDatain classBasicHandler- Parameters:
doc- aDocumentwithin which to build the deployment data- Returns:
- an Element representing the deployment data
-