Package org.apache.axis.handlers
Class BasicHandler
- java.lang.Object
-
- org.apache.axis.handlers.BasicHandler
-
- All Implemented Interfaces:
java.io.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
public abstract class BasicHandler extends java.lang.Object implements Handler
BasicHandleris 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanmakeLockableprotected java.lang.Stringnameprotected java.util.Hashtableoptions
-
Constructor Summary
Constructors Constructor Description BasicHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandleBlock(QName qname)Indicate if this handler can processqname.voidcleanup()Cleanup is called when the chain containing this Handler object is done processing the chain.voidgenerateWSDL(MessageContext msgContext)Obtain WSDL information.org.w3c.dom.ElementgetDeploymentData(org.w3c.dom.Document doc)This will return the root element of an XML doc that describes the deployment information about this handler.java.lang.StringgetName()Return the name (i.e.java.lang.ObjectgetOption(java.lang.String name)Returns the option corresponding to the 'name' givenjava.util.HashtablegetOptions()Return the entire list of optionsjava.util.ListgetUnderstoodHeaders()Return a list of QNames which this Handler understands.voidinit()Stubbed-out methods.protected voidinitHashtable()voidonFault(MessageContext msgContext)Called when a subsequent handler throws a fault.voidsetName(java.lang.String name)Set the name (i.e.voidsetOption(java.lang.String name, java.lang.Object value)Set the given option (name/value) in this handler's bag of optionsbooleansetOptionDefault(java.lang.String name, java.lang.Object value)Set a default value for the given option: if the option is not already set, then set it.voidsetOptions(java.util.Hashtable opts)Sets a whole list of options.protected voidsetOptionsLockable(boolean makeLockable)Should this Handler use a LockableHashtable for options? Default is 'false'.
-
-
-
Method Detail
-
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:HandlerCleanup is called when the chain containing this Handler object is done processing the chain.
-
canHandleBlock
public boolean canHandleBlock(QName qname)
Description copied from interface:HandlerIndicate if this handler can processqname.- Specified by:
canHandleBlockin interfaceHandler- Parameters:
qname- theQNameto check- Returns:
- true if this
Handlercan handleqname, false otherwise
-
onFault
public void onFault(MessageContext msgContext)
Description copied from interface:HandlerCalled when a subsequent handler throws a fault.
-
setOption
public void setOption(java.lang.String name, java.lang.Object value)Set the given option (name/value) in this handler's bag of options
-
setOptionDefault
public boolean setOptionDefault(java.lang.String name, java.lang.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;
-
getOption
public java.lang.Object getOption(java.lang.String name)
Returns the option corresponding to the 'name' given
-
getOptions
public java.util.Hashtable getOptions()
Return the entire list of options- Specified by:
getOptionsin interfaceHandler- Returns:
- a
Hashsetcontaining all name/value pairs
-
setOptions
public void setOptions(java.util.Hashtable opts)
Description copied from interface:HandlerSets a whole list of options.- Specified by:
setOptionsin interfaceHandler- Parameters:
opts- aHashtableof name-value pairs to use
-
setName
public void setName(java.lang.String name)
Set the name (i.e. registry key) of this Handler
-
getName
public java.lang.String getName()
Return the name (i.e. registry key) for this Handler
-
getDeploymentData
public org.w3c.dom.Element getDeploymentData(org.w3c.dom.Document doc)
Description copied from interface:HandlerThis 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:
getDeploymentDatain interfaceHandler- Parameters:
doc- aDocumentwithin which to build the deployment data- Returns:
- an Element representing the deployment data
-
generateWSDL
public void generateWSDL(MessageContext msgContext) throws AxisFault
Description copied from interface:HandlerObtain 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:
generateWSDLin interfaceHandler- Parameters:
msgContext- theMessageContextto generate the WSDL to- Throws:
AxisFault- if there was a problem generating the WSDL
-
getUnderstoodHeaders
public java.util.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.- Specified by:
getUnderstoodHeadersin interfaceHandler- Returns:
- a List of
QNameinstances
-
-