org.apache.axis.handlers

Class BasicHandler

public abstract class BasicHandler extends Object implements Handler

BasicHandler is a utility class which implements simple property setting/getting behavior, and stubs out a lot of the Handler methods. Extend this class to make writing your Handlers easier, and then override what you need to.

Author: Glen Daniels (gdaniels@allaire.com) Doug Davis (dug@us.ibm.com

Field Summary
protected booleanmakeLockable
protected Stringname
protected Hashtableoptions
Method Summary
booleancanHandleBlock(QName qname)
voidcleanup()
voidgenerateWSDL(MessageContext msgContext)
ElementgetDeploymentData(Document doc)
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()
Stubbed-out methods.
protected voidinitHashtable()
voidonFault(MessageContext msgContext)
voidsetName(String name)
Set the name (i.e. registry key) of this Handler
voidsetOption(String name, Object value)
Set the given option (name/value) in this handler's bag of options
booleansetOptionDefault(String name, Object value)
Set a default value for the given option: if the option is not already set, then set it. if the option is already set, then do not set it.
voidsetOptions(Hashtable opts)
protected voidsetOptionsLockable(boolean makeLockable)
Should this Handler use a LockableHashtable for options?

Field Detail

makeLockable

protected boolean makeLockable

name

protected String name

options

protected Hashtable options

Method Detail

canHandleBlock

public boolean canHandleBlock(QName qname)

cleanup

public void cleanup()

generateWSDL

public void generateWSDL(MessageContext msgContext)

getDeploymentData

public Element getDeploymentData(Document doc)

getName

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

getOption

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

getOptions

public Hashtable getOptions()
Return the entire list of options

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.

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.

initHashtable

protected void initHashtable()

onFault

public void onFault(MessageContext msgContext)

setName

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

setOption

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

setOptionDefault

public boolean setOptionDefault(String name, Object value)
Set a default value for the given option: if the option is not already set, then set it. if the option is already set, then do not set it.

If this is called multiple times, the first with a non-null value if 'value' will set the default, remaining calls will be ignored.

Returns true if value set (by this call), otherwise false;

setOptions

public void setOptions(Hashtable opts)

setOptionsLockable

protected void setOptionsLockable(boolean makeLockable)
Should this Handler use a LockableHashtable for options? Default is 'false'.
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.