org.apache.axis

Interface Handler

public interface Handler extends Serializable

An AXIS handler.

Author: Doug Davis (dug@us.ibm.com)

Method Summary
booleancanHandleBlock(QName qname)
Indicate if this handler can process qname.
voidcleanup()
Cleanup is called when the chain containing this Handler object is done processing the chain.
voidgenerateWSDL(MessageContext msgContext)
Obtain WSDL information.
ElementgetDeploymentData(Document doc)
This will return the root element of an XML doc that describes the deployment information about this handler.
StringgetName()
Return the name (i.e. registry key) for this Handler.
ObjectgetOption(String name)
Returns the option corresponding to the 'name' given.
HashtablegetOptions()
Return the entire list of options.
ListgetUnderstoodHeaders()
Return a list of QNames which this Handler understands.
voidinit()
Init is called when the chain containing this Handler object is instantiated.
voidinvoke(MessageContext msgContext)
Invoke is called to do the actual work of the Handler object.
voidonFault(MessageContext msgContext)
Called when a subsequent handler throws a fault.
voidsetName(String name)
Set the name (i.e. registry key) of this Handler.
voidsetOption(String name, Object value)
Add the given option (name/value) to this handler's bag of options.
voidsetOptions(Hashtable opts)
Sets a whole list of options.

Method Detail

canHandleBlock

public boolean canHandleBlock(QName qname)
Indicate if this handler can process qname.

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.

generateWSDL

public void generateWSDL(MessageContext msgContext)
Obtain WSDL information. Some Handlers will implement this by merely setting properties in the MessageContext, others (providers) will take responsibility for doing the "real work" of generating WSDL for a given service.

Parameters: msgContext the MessageContext to generate the WSDL to

Throws: AxisFault if there was a problem generating the WSDL

getDeploymentData

public Element getDeploymentData(Document doc)
This 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.

Parameters: doc a Document within which to build the deployment data

Returns: an Element representing the deployment data

getName

public String getName()
Return the name (i.e. registry key) for this Handler.

Returns: the name for this Handler

getOption

public Object getOption(String name)
Returns the option corresponding to the 'name' given.

Parameters: name the name of the option

Returns: the value of the option

getOptions

public Hashtable getOptions()
Return the entire list of options.

Returns: a Hashset containing all name/value pairs

getUnderstoodHeaders

public List getUnderstoodHeaders()
Return a list of QNames which this Handler understands. By returning a particular QName here, we are committing to fulfilling any contracts defined in the specification of the SOAP header with that QName.

Returns: a List of QName instances

init

public void init()
Init is called when the chain containing this Handler object is instantiated.

invoke

public void invoke(MessageContext msgContext)
Invoke is called to do the actual work of the Handler object. If there is a fault during the processing of this method it is invoke's job to catch the exception and undo any partial work that has been completed. Once we leave 'invoke' if a fault is thrown, this classes 'onFault' method will be called. Invoke should rethrow any exceptions it catches, wrapped in an AxisFault.

Parameters: msgContext the MessageContext to process with this Handler.

Throws: AxisFault if the handler encounters an error

onFault

public void onFault(MessageContext msgContext)
Called when a subsequent handler throws a fault.

Parameters: msgContext the MessageContext to process the fault to

setName

public void setName(String name)
Set the name (i.e. registry key) of this Handler.

Parameters: name the new name

setOption

public void setOption(String name, Object value)
Add the given option (name/value) to this handler's bag of options.

Parameters: name the name of the option value the new value of the option

setOptions

public void setOptions(Hashtable opts)
Sets a whole list of options.

Parameters: opts a Hashtable of name-value pairs to use

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