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.Modifier and Type | Field and Description |
---|---|
protected boolean |
makeLockable |
protected String |
name |
protected Hashtable |
options |
Constructor and Description |
---|
BasicHandler() |
Modifier and Type | Method and Description |
---|---|
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. registry key) for this Handler
|
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. registry key) of this Handler
|
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?
|
protected boolean makeLockable
protected Hashtable options
protected String name
protected void setOptionsLockable(boolean makeLockable)
protected void initHashtable()
public void init()
public void cleanup()
Handler
public boolean canHandleBlock(QName qname)
Handler
qname
.canHandleBlock
in interface Handler
qname
- the QName
to checkHandler
can handle qname,
false otherwise
public void onFault(MessageContext msgContext)
Handler
public void setOption(String name, Object value)
public boolean setOptionDefault(String name, Object value)
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;
public Hashtable getOptions()
getOptions
in interface Handler
Hashset
containing all name/value pairspublic void setOptions(Hashtable opts)
Handler
setOptions
in interface Handler
opts
- a Hashtable
of name-value pairs to usepublic void setName(String name)
public String getName()
public Element getDeploymentData(Document doc)
Handler
getDeploymentData
in interface Handler
doc
- a Document
within which to build the deployment
datapublic void generateWSDL(MessageContext msgContext) throws AxisFault
Handler
generateWSDL
in interface Handler
msgContext
- the MessageContext
to generate the WSDL
toAxisFault
- if there was a problem generating the WSDLpublic List getUnderstoodHeaders()
getUnderstoodHeaders
in interface Handler
QName
instancesCopyright © The Apache Software Foundation. All Rights Reserved.