org.apache.axis.providers.java

Class EJBProvider

Implemented Interfaces:
Handler, Serializable

public class EJBProvider
extends RPCProvider

A basic EJB Provider
Authors:
Carl Woolf (cwoolf@macromedia.com)
Tom Jordahl (tomj@macromedia.com)
C?dric Chabanois (cchabanois@ifrance.com)

Field Summary

static String
OPTION_BEANNAME
static String
OPTION_HOMEINTERFACENAME
static String
OPTION_LOCALHOMEINTERFACENAME
static String
OPTION_LOCALINTERFACENAME
static String
OPTION_REMOTEINTERFACENAME
protected static Class[]
empty_class_array
protected static Object[]
empty_object_array
protected static Log
entLog
static String
jndiContextClass
static String
jndiPassword
static String
jndiURL
static String
jndiUsername
protected static Log
log

Fields inherited from class org.apache.axis.providers.java.RPCProvider

log

Fields inherited from class org.apache.axis.providers.java.JavaProvider

OPTION_ALLOWEDMETHODS, OPTION_CLASSNAME, OPTION_SCOPE, entLog, log

Fields inherited from class org.apache.axis.providers.BasicProvider

OPTION_EXTRACLASSES, OPTION_WSDL_INPUTSCHEMA, OPTION_WSDL_PORTTYPE, OPTION_WSDL_SERVICEELEMENT, OPTION_WSDL_SERVICEPORT, OPTION_WSDL_SOAPACTION_MODE, OPTION_WSDL_TARGETNAMESPACE, entLog, log

Fields inherited from class org.apache.axis.handlers.BasicHandler

makeLockable, name, options

Method Summary

protected InitialContext
getCachedContext()
protected InitialContext
getContext(Properties properties)
protected Object
getEJBHome(InitialContext context, String beanJndiName)
protected Class
getServiceClass(String beanJndiName, SOAPService service, MessageContext msgContext)
Get the class description for the EJB Remote or Local Interface, which is what we are interested in exposing to the world (i.e.
protected String
getServiceClassNameOptionName()
Return the option in the configuration that contains the service class name.
protected String
getStrOption(String optionName, Handler service)
Get a String option by looking first in the service options, and then at the Handler's options.
protected Object
invokeMethod(MessageContext msgContext, Method method, Object obj, Object[] argValues)
Override the default implementation such that we can include special handling for java.rmi.ServerException.
protected Object
makeNewServiceObject(MessageContext msgContext, String clsName)
Return a object which implements the service.

Methods inherited from class org.apache.axis.providers.java.RPCProvider

checkMethodName, createResponseBody, getBody, getOperationDesc, invokeMethod, processMessage

Methods inherited from class org.apache.axis.providers.java.JavaProvider

getServiceClass, getServiceClassName, getServiceClassNameOptionName, getServiceObject, initServiceDesc, invoke, makeNewServiceObject, processMessage

Methods inherited from class org.apache.axis.providers.BasicProvider

addOperation, generateWSDL, getOperationName, getOperationNames, getOperationQNames, initServiceDesc

Methods inherited from class org.apache.axis.handlers.BasicHandler

canHandleBlock, cleanup, generateWSDL, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, init, initHashtable, onFault, setName, setOption, setOptionDefault, setOptions, setOptionsLockable

Field Details

OPTION_BEANNAME

public static final String OPTION_BEANNAME

OPTION_HOMEINTERFACENAME

public static final String OPTION_HOMEINTERFACENAME

OPTION_LOCALHOMEINTERFACENAME

public static final String OPTION_LOCALHOMEINTERFACENAME

OPTION_LOCALINTERFACENAME

public static final String OPTION_LOCALINTERFACENAME

OPTION_REMOTEINTERFACENAME

public static final String OPTION_REMOTEINTERFACENAME

empty_class_array

protected static final Class[] empty_class_array

empty_object_array

protected static final Object[] empty_object_array

entLog

protected static Log entLog

jndiContextClass

public static final String jndiContextClass

jndiPassword

public static final String jndiPassword

jndiURL

public static final String jndiURL

jndiUsername

public static final String jndiUsername

log

protected static Log log

Method Details

getCachedContext

protected InitialContext getCachedContext()
            throws javax.naming.NamingException

getContext

protected InitialContext getContext(Properties properties)
            throws AxisFault,
                   javax.naming.NamingException

getEJBHome

protected Object getEJBHome(InitialContext context,
                            String beanJndiName)
            throws AxisFault,
                   javax.naming.NamingException

getServiceClass

protected Class getServiceClass(String beanJndiName,
                                SOAPService service,
                                MessageContext msgContext)
            throws AxisFault
Get the class description for the EJB Remote or Local Interface, which is what we are interested in exposing to the world (i.e. in WSDL).
Overrides:
getServiceClass in interface JavaProvider
Parameters:
beanJndiName - the JNDI name of the EJB
msgContext - the message context (can be null)
Returns:
the class info of the EJB remote or local interface

getServiceClassNameOptionName

protected String getServiceClassNameOptionName()
Return the option in the configuration that contains the service class name. In the EJB case, it is the JNDI name of the bean.
Overrides:
getServiceClassNameOptionName in interface JavaProvider

getStrOption

protected String getStrOption(String optionName,
                              Handler service)
Get a String option by looking first in the service options, and then at the Handler's options. This allows defaults to be specified at the provider level, and then overriden for particular services.
Parameters:
optionName - the option to retrieve
Returns:
String the value of the option or null if not found in either scope

invokeMethod

protected Object invokeMethod(MessageContext msgContext,
                              Method method,
                              Object obj,
                              Object[] argValues)
            throws Exception
Override the default implementation such that we can include special handling for java.rmi.ServerException.

Converts java.rmi.ServerException exceptions to InvocationTargetException exceptions with the same cause. This allows the axis framework to create a SOAP fault.

Overrides:
invokeMethod in interface RPCProvider
See Also:
org.apache.axis.providers.java.RPCProvider.invokeMethod(org.apache.axis.MessageContext, java.lang.reflect.Method, java.lang.Object, java.lang.Object[])

makeNewServiceObject

protected Object makeNewServiceObject(MessageContext msgContext,
                                      String clsName)
            throws Exception
Return a object which implements the service.
Overrides:
makeNewServiceObject in interface JavaProvider
Parameters:
msgContext - the message context
clsName - The JNDI name of the EJB home class
Returns:
an object that implements the service

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.