org.apache.axis.handlers
Class BasicHandler
java.lang.Object
org.apache.axis.handlers.BasicHandler
- Handler, Serializable
public abstract class BasicHandler
extends java.lang.Object
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.
- Glen Daniels (gdaniels@allaire.com)
- Doug Davis (dug@us.ibm.com
boolean | canHandleBlock(QName qname) - Indicate if this handler can process
qname .
|
void | cleanup() - Cleanup is called when the chain containing this Handler object
is done processing the chain.
|
void | generateWSDL(MessageContext msgContext) - Obtain WSDL information.
|
Element | getDeploymentData(Document doc) - This will return the root element of an XML doc that describes the
deployment information about this handler.
|
String | getName() - Return the name (i.e.
|
Object | getOption(String name) - Returns the option corresponding to the 'name' given
|
Hashtable | getOptions() - Return the entire list of options
|
List | getUnderstoodHeaders() - Return a list of QNames which this Handler understands.
|
void | init() - Stubbed-out methods.
|
protected void | initHashtable()
|
void | onFault(MessageContext msgContext) - Called when a subsequent handler throws a fault.
|
void | setName(String name) - Set the name (i.e.
|
void | setOption(String name, Object value) - Set the given option (name/value) in this handler's bag of options
|
boolean | setOptionDefault(String name, Object value) - Set a default value for the given option:
if the option is not already set, then set it.
|
void | setOptions(Hashtable opts) - Sets a whole list of options.
|
protected void | setOptionsLockable(boolean makeLockable) - Should this Handler use a LockableHashtable for options?
Default is 'false'.
|
makeLockable
protected boolean makeLockable
name
protected String name
options
protected Hashtable options
canHandleBlock
public boolean canHandleBlock(QName qname)
Indicate if this handler can process qname
.
- canHandleBlock in interface Handler
qname
- the QName
to check
- 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.
- cleanup in interface Handler
generateWSDL
public void generateWSDL(MessageContext msgContext)
throws AxisFault
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.
- generateWSDL in interface Handler
msgContext
- the MessageContext
to generate the WSDL
to
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.
- getDeploymentData in interface Handler
doc
- a Document
within which to build the deployment
data
- an Element representing the deployment data
getName
public String getName()
Return the name (i.e. registry key) for this Handler
- getName in interface Handler
getOption
public Object getOption(String name)
Returns the option corresponding to the 'name' given
- getOption in interface Handler
getOptions
public Hashtable getOptions()
Return the entire list of options
- getOptions in interface Handler
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.
- getUnderstoodHeaders in interface Handler
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.
- init in interface Handler
initHashtable
protected void initHashtable()
onFault
public void onFault(MessageContext msgContext)
Called when a subsequent handler throws a fault.
- onFault in interface Handler
msgContext
- the MessageContext
to process the fault
to
setName
public void setName(String name)
Set the name (i.e. registry key) of this Handler
- setName in interface Handler
setOption
public void setOption(String name,
Object value)
Set the given option (name/value) in this handler's bag of options
- setOption in interface Handler
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)
Sets a whole list of options.
- setOptions in interface Handler
opts
- a Hashtable
of name-value pairs to use
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.