Package org.apache.axis.handlers
Class BasicHandler
java.lang.Object
org.apache.axis.handlers.BasicHandler
- All Implemented Interfaces:
Serializable
,Handler
- Direct Known Subclasses:
AxisEngine
,BasicProvider
,CommonsHTTPSender
,DebugHandler
,EchoHandler
,ErrorHandler
,FaultableHandler
,HTTPActionHandler
,HTTPAuthHandler
,HTTPSender
,JavaSender
,JAXRPCHandler
,JMSSender
,JWSHandler
,LocalResponder
,LocalSender
,LogHandler
,LogMessage
,MailSender
,MD5AttachHandler
,MustUnderstandChecker
,SimpleAuthenticationHandler
,SimpleAuthorizationHandler
,SimpleChain
,SimpleSessionHandler
,SOAPMonitorHandler
,URLMapper
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
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandleBlock
(QName qname) Indicate if this handler can processqname
.void
cleanup()
Cleanup is called when the chain containing this Handler object is done processing the chain.void
generateWSDL
(MessageContext msgContext) Obtain WSDL information.This will return the root element of an XML doc that describes the deployment information about this handler.getName()
Return the name (i.e.Returns the option corresponding to the 'name' givenReturn the entire list of optionsReturn a list of QNames which this Handler understands.void
init()
Stubbed-out methods.protected void
void
onFault
(MessageContext msgContext) Called when a subsequent handler throws a fault.void
Set the name (i.e.void
Set the given option (name/value) in this handler's bag of optionsboolean
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'.
-
Field Details
-
makeLockable
protected boolean makeLockable -
options
-
name
-
-
Constructor Details
-
BasicHandler
public BasicHandler()
-
-
Method Details
-
setOptionsLockable
protected void setOptionsLockable(boolean makeLockable) Should this Handler use a LockableHashtable for options? Default is 'false'. -
initHashtable
protected void initHashtable() -
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. -
cleanup
public void cleanup()Description copied from interface:Handler
Cleanup is called when the chain containing this Handler object is done processing the chain. -
canHandleBlock
Description copied from interface:Handler
Indicate if this handler can processqname
.- Specified by:
canHandleBlock
in interfaceHandler
- Parameters:
qname
- theQName
to check- Returns:
- true if this
Handler
can handleqname
, false otherwise
-
onFault
Description copied from interface:Handler
Called when a subsequent handler throws a fault. -
setOption
Set the given option (name/value) in this handler's bag of options -
setOptionDefault
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;
-
getOption
Returns the option corresponding to the 'name' given -
getOptions
Return the entire list of options- Specified by:
getOptions
in interfaceHandler
- Returns:
- a
Hashset
containing all name/value pairs
-
setOptions
Description copied from interface:Handler
Sets a whole list of options.- Specified by:
setOptions
in interfaceHandler
- Parameters:
opts
- aHashtable
of name-value pairs to use
-
setName
Set the name (i.e. registry key) of this Handler -
getName
Return the name (i.e. registry key) for this Handler -
getDeploymentData
Description copied from interface:Handler
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.- Specified by:
getDeploymentData
in interfaceHandler
- Parameters:
doc
- aDocument
within which to build the deployment data- Returns:
- an Element representing the deployment data
-
generateWSDL
Description copied from interface:Handler
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.- Specified by:
generateWSDL
in interfaceHandler
- Parameters:
msgContext
- theMessageContext
to generate the WSDL to- Throws:
AxisFault
- if there was a problem generating the WSDL
-
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.- Specified by:
getUnderstoodHeaders
in interfaceHandler
- Returns:
- a List of
QName
instances
-