org.apache.axis.providers.java
Class JavaProvider

java.lang.Object
  |
  +--org.apache.axis.handlers.BasicHandler
        |
        +--org.apache.axis.providers.BasicProvider
              |
              +--org.apache.axis.providers.java.JavaProvider
All Implemented Interfaces:
Handler, java.io.Serializable
Direct Known Subclasses:
MsgProvider, RPCProvider

public abstract class JavaProvider
extends BasicProvider

Base class for Java dispatching. Fetches various fields out of envelope, looks up service object (possibly using session state), and delegates envelope body processing to subclass via abstract processMessage method.

Author:
Doug Davis (dug@us.ibm.com), Carl Woolf (cwoolf@macromedia.com)
See Also:
Serialized Form

Field Summary
protected static org.apache.commons.logging.Log log
           
static java.lang.String OPTION_ALLOWEDMETHODS
           
static java.lang.String OPTION_CLASSNAME
           
static java.lang.String OPTION_CLASSPATH
           
static java.lang.String OPTION_IS_STATIC
           
static java.lang.String OPTION_SCOPE
           
static java.lang.String OPTION_WSDL_PORTTYPE
           
static java.lang.String OPTION_WSDL_SERVICEELEMENT
           
static java.lang.String OPTION_WSDL_SERVICEPORT
           
static java.lang.String OPTION_WSDL_TARGETNAMESPACE
           
 
Fields inherited from class org.apache.axis.handlers.BasicHandler
name, options
 
Constructor Summary
JavaProvider()
           
 
Method Summary
 void generateWSDL(MessageContext msgContext)
          Generate the WSDL for this service.
 AxisServiceConfig getConfiguration(java.lang.Object obj)
          For a given object or class, if there is a static method called "getAxisServiceConfig()", we call it and return the value as an AxisServiceConfig object.
protected  java.lang.Class getServiceClass(MessageContext msgContext, java.lang.String clsName)
          Returns the Class info about the service class.
protected  java.lang.String getServiceClassName(Handler service)
          Return the class name of the service
protected  java.lang.String getServiceClassNameOptionName()
          Return the option in the configuration that contains the service class name
 java.lang.Object getServiceObject(MessageContext msgContext, Handler service, java.lang.String clsName, IntHolder scopeHolder)
          Get the service object whose method actually provides the service.
 void invoke(MessageContext msgContext)
          Invoke the message by obtaining various common fields, looking up the service object (via getServiceObject), and actually processing the message (via processMessage).
protected  java.lang.Object makeNewServiceObject(MessageContext msgContext, java.lang.String clsName)
          Default java service object comes from simply instantiating the class wrapped in jc
abstract  void processMessage(MessageContext msgContext, java.lang.String serviceName, java.lang.String allowedMethods, SOAPEnvelope reqEnv, SOAPEnvelope resEnv, JavaClass jc, java.lang.Object obj)
          Process the current message.
 
Methods inherited from class org.apache.axis.providers.BasicProvider
addOperation, getOperationName, getOperationNames, getOperationQNames
 
Methods inherited from class org.apache.axis.handlers.BasicHandler
canHandleBlock, cleanup, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, init, initHashtable, onFault, setName, setOption, setOptionDefault, setOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

OPTION_CLASSNAME

public static final java.lang.String OPTION_CLASSNAME

OPTION_ALLOWEDMETHODS

public static final java.lang.String OPTION_ALLOWEDMETHODS

OPTION_IS_STATIC

public static final java.lang.String OPTION_IS_STATIC

OPTION_CLASSPATH

public static final java.lang.String OPTION_CLASSPATH

OPTION_WSDL_PORTTYPE

public static final java.lang.String OPTION_WSDL_PORTTYPE

OPTION_WSDL_SERVICEELEMENT

public static final java.lang.String OPTION_WSDL_SERVICEELEMENT

OPTION_WSDL_SERVICEPORT

public static final java.lang.String OPTION_WSDL_SERVICEPORT

OPTION_WSDL_TARGETNAMESPACE

public static final java.lang.String OPTION_WSDL_TARGETNAMESPACE

OPTION_SCOPE

public static final java.lang.String OPTION_SCOPE
Constructor Detail

JavaProvider

public JavaProvider()
Method Detail

getServiceObject

public java.lang.Object getServiceObject(MessageContext msgContext,
                                         Handler service,
                                         java.lang.String clsName,
                                         IntHolder scopeHolder)
                                  throws java.lang.Exception
Get the service object whose method actually provides the service. May look up in session table.

processMessage

public abstract void processMessage(MessageContext msgContext,
                                    java.lang.String serviceName,
                                    java.lang.String allowedMethods,
                                    SOAPEnvelope reqEnv,
                                    SOAPEnvelope resEnv,
                                    JavaClass jc,
                                    java.lang.Object obj)
                             throws java.lang.Exception
Process the current message. Side-effect resEnv to create return value.
Parameters:
msgContext - self-explanatory
serviceName - the class name of the ServiceHandler
allowedMethods - the 'method name' of ditto
reqEnv - the request envelope
resEnv - the response envelope
jc - the JavaClass of the service object
obj - the service object itself

invoke

public void invoke(MessageContext msgContext)
            throws AxisFault
Invoke the message by obtaining various common fields, looking up the service object (via getServiceObject), and actually processing the message (via processMessage).
Overrides:
invoke in class BasicHandler

generateWSDL

public void generateWSDL(MessageContext msgContext)
                  throws AxisFault
Generate the WSDL for this service. Put in the "WSDL" property of the message context as a org.w3c.dom.Document
Overrides:
generateWSDL in class BasicHandler

makeNewServiceObject

protected java.lang.Object makeNewServiceObject(MessageContext msgContext,
                                                java.lang.String clsName)
                                         throws java.lang.Exception
Default java service object comes from simply instantiating the class wrapped in jc

getServiceClassName

protected java.lang.String getServiceClassName(Handler service)
Return the class name of the service

getServiceClassNameOptionName

protected java.lang.String getServiceClassNameOptionName()
Return the option in the configuration that contains the service class name

getServiceClass

protected java.lang.Class getServiceClass(MessageContext msgContext,
                                          java.lang.String clsName)
                                   throws java.lang.Exception
Returns the Class info about the service class.

getConfiguration

public AxisServiceConfig getConfiguration(java.lang.Object obj)
For a given object or class, if there is a static method called "getAxisServiceConfig()", we call it and return the value as an AxisServiceConfig object. This allows us to obtain metadata about a class' configuration without instantiating an object of that class.
Parameters:
obj - an object, which may be a Class


Copyright © 2002 Apache XML Project. All Rights Reserved.