站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 jaxrpc API Documentation 英文版文档

BasicHandler (JAXRPC API) - JBoss 3.2.7 jaxrpc API Documentation 英文版文档


org.apache.axis.handlers
Class BasicHandler

java.lang.Object
  extended byorg.apache.axis.handlers.BasicHandler
All Implemented Interfaces:
Handler, Serializable
Direct Known Subclasses:
AxisEngine, BasicProvider, DebugHandler, EchoHandler, ErrorHandler, FaultableHandler, HTTPActionHandler, HTTPAuthHandler, HTTPSender, JavaSender, JAXRPCHandler, JMSSender, LocalResponder, LocalSender, LogHandler, LogMessage, MD5AttachHandler, SimpleAuthenticationHandler, SimpleAuthorizationHandler, SimpleChain, SimpleSessionHandler, SOAPMonitorHandler, URLMapper

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
See Also:
Serialized Form

Field Summary
protected  boolean makeLockable
           
protected  String name
           
protected  Hashtable options
           
 
Constructor Summary
BasicHandler()
           
 
Method Summary
 boolean canHandleBlock(javax.xml.namespace.QName qname)
          Can this Handler process this 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()
           
abstract  void invoke(MessageContext msgContext)
          Must implement this in subclasses.
 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'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

makeLockable

protected boolean makeLockable

options

protected Hashtable options

name

protected String name
Constructor Detail

BasicHandler

public BasicHandler()
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.

Specified by:
init in interface Handler

cleanup

public void cleanup()
Description copied from interface: Handler
Cleanup is called when the chain containing this Handler object is done processing the chain.

Specified by:
cleanup in interface Handler

canHandleBlock

public boolean canHandleBlock(javax.xml.namespace.QName qname)
Description copied from interface: Handler
Can this Handler process this QName?

Specified by:
canHandleBlock in interface Handler

onFault

public void onFault(MessageContext msgContext)
Description copied from interface: Handler
Called when a subsequent handler throws a fault.

Specified by:
onFault in interface Handler

invoke

public abstract void invoke(MessageContext msgContext)
                     throws AxisFault
Must implement this in subclasses.

Specified by:
invoke in interface Handler
Throws:
AxisFault

setOption

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

Specified by:
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;


getOption

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

Specified by:
getOption in interface Handler

getOptions

public Hashtable getOptions()
Return the entire list of options

Specified by:
getOptions in interface Handler

setOptions

public void setOptions(Hashtable opts)
Description copied from interface: Handler
Sets a whole list of options

Specified by:
setOptions in interface Handler

setName

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

Specified by:
setName in interface Handler

getName

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

Specified by:
getName in interface Handler

getDeploymentData

public Element getDeploymentData(Document doc)
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 interface Handler

generateWSDL

public void generateWSDL(MessageContext msgContext)
                  throws AxisFault
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 interface Handler
Throws:
AxisFault

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.

Specified by:
getUnderstoodHeaders in interface Handler


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.