org.jboss.net.axis.server
Class EJBProvider

java.lang.Object
  extended byorg.jboss.axis.handlers.BasicHandler (src) 
      extended byorg.jboss.axis.providers.BasicProvider (src) 
          extended byorg.jboss.axis.providers.java.JavaProvider (src) 
              extended byorg.jboss.axis.providers.java.RPCProvider (src) 
                  extended byorg.jboss.axis.providers.java.EJBProvider (src) 
                      extended byorg.jboss.net.axis.server.EJBProvider
All Implemented Interfaces:
Handler (src)

public class EJBProvider
extends EJBProvider (src)

A JBoss-compatible EJB Provider that exposes the methods of any session bean as a web service endpoint.

Basically it is a slimmed downed derivative of the Axis-EJBProvider without the usual, corba-related configuration mumbo-jumbo that is operating under the presumption that the right classloader has already been set by the request flow chain (@see org.jboss.net.axis.SetClassLoaderHandler).

Since Version 1.5 and thanks to Kevin Conner, we now also support stateful beans that are tied to the service scope (you should reasonably choose scope="session" in the tag of the corresponding web-service.xml) Note that by using a jaxp lifecycle handler we synchronize with web service scopes that can be shorter-lived than the surrounding http-session. However, as I understood Kevin and from my observations, it seems that Axis and hence the jaxp lifecycle does not get notified upon http-session expiration. Hence our lifecycle listener currently implements the http session lifecycle, too (which is not very transport-agnostic, but who cares at the moment).

EJBProvider is able to recognize an WsdlAwareHttpActionHandler (src) in its transport chain such that it will set the soap-action headers in the wsdl.

Since:
5. Oktober 2001, 13:02

Nested Class Summary
protected static class EJBProvider.EJBServiceLifeCycle (src)
          This is the lifecycle object that is registered in the message scope and that shields the proper bean reference
 
Field Summary
protected  java.lang.reflect.Method ejbCreateMethod
          we are caching the create method for perfomance purposes
protected  java.lang.Object ejbHome
          we are caching the home for perfomance purposes
protected  java.lang.Class remoteClass
          the real remote class we are shielding
 
Fields inherited from class org.jboss.axis.providers.java.EJBProvider (src)
empty_class_array, empty_object_array, jndiContextClass, jndiPassword, jndiURL, jndiUsername, OPTION_BEANNAME, OPTION_HOMEINTERFACENAME, OPTION_LOCALHOMEINTERFACENAME, OPTION_LOCALINTERFACENAME, OPTION_REMOTEINTERFACENAME
 
Fields inherited from class org.jboss.axis.providers.java.RPCProvider (src)
RPC_INVOCATION
 
Fields inherited from class org.jboss.axis.providers.java.JavaProvider (src)
OPTION_ALLOWEDMETHODS, OPTION_CLASSNAME, OPTION_CLASSPATH, OPTION_IS_STATIC, OPTION_SCOPE, OPTION_WSDL_INPUTSCHEMA, OPTION_WSDL_PORTTYPE, OPTION_WSDL_SERVICEELEMENT, OPTION_WSDL_SERVICEPORT, OPTION_WSDL_TARGETNAMESPACE
 
Fields inherited from class org.jboss.axis.handlers.BasicHandler (src)
makeLockable, name, options
 
Constructor Summary
EJBProvider()
          Creates new EJBProvider
 
Method Summary
 void generateWSDL(MessageContext (src)  msgContext)
          Generate the WSDL for this service.
protected  java.lang.reflect.Method getEJBCreateMethod(java.lang.String jndiName)
          access home factory via jndi if reference is not yet cached
protected  java.lang.Object getEJBHome(java.lang.String jndiName)
          access home factory via jndi if reference is not yet cached
protected  java.lang.Class getServiceClass(java.lang.String beanJndiName, SOAPService (src)  service, MessageContext (src)  msgContext)
          Return the class name of the service, note that this could be called outside the correct chain, e.g., by the url mapper.
 void initServiceDesc(SOAPService (src)  service, MessageContext (src)  msgContext)
          Fill in a service description with the correct impl class and typemapping set.
protected  java.lang.Object makeNewServiceObject(MessageContext (src)  msgContext, java.lang.String clsName)
          Return the object which implements the service lifecycle.
 void processMessage(MessageContext (src)  msgContext, SOAPEnvelopeAxisImpl (src)  reqEnv, SOAPEnvelopeAxisImpl (src)  resEnv, java.lang.Object obj)
          Override processMessage of super class in order to unpack the service object from the lifecycle
 
Methods inherited from class org.jboss.axis.providers.java.EJBProvider (src)
getCachedContext, getContext, getEJBHome, getServiceClassNameOptionName, getStrOption
 
Methods inherited from class org.jboss.axis.providers.java.RPCProvider (src)
checkMethodName, createRPCInvocation, invokeMethod, invokeTarget
 
Methods inherited from class org.jboss.axis.providers.java.JavaProvider (src)
getServiceClassName, getServiceObject, invoke, processException
 
Methods inherited from class org.jboss.axis.providers.BasicProvider (src)
addOperation, getOperationName, getOperationNames, getOperationQNames
 
Methods inherited from class org.jboss.axis.handlers.BasicHandler (src)
canHandleBlock, cleanup, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, init, initHashtable, onFault, setName, setOption, setOptionDefault, setOptions, setOptionsLockable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remoteClass

protected java.lang.Class remoteClass
the real remote class we are shielding


ejbHome

protected java.lang.Object ejbHome
we are caching the home for perfomance purposes


ejbCreateMethod

protected java.lang.reflect.Method ejbCreateMethod
we are caching the create method for perfomance purposes

Constructor Detail

EJBProvider

public EJBProvider()
Creates new EJBProvider

Method Detail

getEJBHome

protected java.lang.Object getEJBHome(java.lang.String jndiName)
                               throws javax.naming.NamingException
access home factory via jndi if reference is not yet cached

Throws:
javax.naming.NamingException

getEJBCreateMethod

protected java.lang.reflect.Method getEJBCreateMethod(java.lang.String jndiName)
                                               throws javax.naming.NamingException,
                                                      java.lang.NoSuchMethodException
access home factory via jndi if reference is not yet cached

Throws:
javax.naming.NamingException
java.lang.NoSuchMethodException

makeNewServiceObject

protected java.lang.Object makeNewServiceObject(MessageContext (src)  msgContext,
                                                java.lang.String clsName)
                                         throws java.lang.Exception
Return the object which implements the service lifecycle. Makes the usual lookup->create call w/o the PortableRemoteDaDaDa for the sake of Corba.

Overrides:
makeNewServiceObject in class EJBProvider (src)
Parameters:
msgContext - the message context
clsName - The JNDI name of the EJB home class
Returns:
an object that implements the service
Throws:
java.lang.Exception

getServiceClass

protected java.lang.Class getServiceClass(java.lang.String beanJndiName,
                                          SOAPService (src)  service,
                                          MessageContext (src)  msgContext)
                                   throws AxisFault (src) 
Return the class name of the service, note that this could be called outside the correct chain, e.g., by the url mapper. Hence we need to find the right classloader.

Overrides:
getServiceClass in class EJBProvider (src)
Parameters:
msgContext - the message context (can be null)
beanJndiName - the JNDI name of the EJB
Returns:
the class info of the EJB remote or local interface
Throws:
AxisFault (src)

generateWSDL

public void generateWSDL(MessageContext (src)  msgContext)
                  throws AxisFault (src) 
Generate the WSDL for this service. We need to rearrange the classloader stuff for that purpose similar as we did with the service class interface

Specified by:
generateWSDL in interface Handler (src)
Overrides:
generateWSDL in class JavaProvider (src)
Throws:
AxisFault (src)

processMessage

public void processMessage(MessageContext (src)  msgContext,
                           SOAPEnvelopeAxisImpl (src)  reqEnv,
                           SOAPEnvelopeAxisImpl (src)  resEnv,
                           java.lang.Object obj)
                    throws java.lang.Exception
Override processMessage of super class in order to unpack the service object from the lifecycle

Overrides:
processMessage in class RPCProvider (src)
Parameters:
msgContext - self-explanatory
reqEnv - the request envelope
resEnv - the response envelope
obj - the service object itself
Throws:
java.lang.Exception

initServiceDesc

public void initServiceDesc(SOAPService (src)  service,
                            MessageContext (src)  msgContext)
                     throws AxisFault (src) 
Description copied from class: JavaProvider (src)
Fill in a service description with the correct impl class and typemapping set. This uses methods that can be overridden by other providers (like the EJBProvider) to get the class from the right place.

Overrides:
initServiceDesc in class JavaProvider (src)
Throws:
AxisFault (src)