org.apache.cocoon.components.axis.providers
Class AvalonProvider

java.lang.Object
  extended by org.apache.axis.handlers.BasicHandler
      extended by org.apache.axis.providers.BasicProvider
          extended by org.apache.axis.providers.java.JavaProvider
              extended by org.apache.axis.providers.java.RPCProvider
                  extended by org.apache.cocoon.components.axis.providers.AvalonProvider
All Implemented Interfaces:
Serializable, org.apache.axis.Handler

public class AvalonProvider
extends org.apache.axis.providers.java.RPCProvider

Provider class which allows you to specify an Avalon ROLE for servicing Axis SOAP requests.

The specified ROLE corresponds to a particular implementation which is retrieved by a given Avalon ComponentManager. For more information about Avalon, see the Avalon. website.

To use this class, you need to add your Avalon ComponentManager instance to the MessageContext that is Axis uses to process messages with.

To do this you could for example subclass the AxisServlet and override the createMessageContext() method adding the ComponentManager, eg:

   protected MessageContext createMessageContext(...)
   {
      MessageContext context = super.createMessageContext();
      context.setProperty(AvalonProvider.COMPONENT_MANAGER, m_manager);
      return context;
   }
  
and appropriately add the AvalonProvider to the list of handlers in your server-config.wsdd (suggestions on how to improve this are welcomed)

This provider will use that ComponentManager reference to retrieve objects.

In your deployment descriptor use the following syntax:

  <service name="myservice" provider="java:Avalon">
    <parameter name="role" value="my.avalon.role.name"/>
    <parameter name="className" value="my.avalon.roles.interface.name"/>
    <parameter name="allowedMethods" value="allowed.methods"/>
  </service>
 

Version:
CVS $Id: AvalonProvider.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Marcus Crafter
See Also:
Serialized Form

Field Summary
static String COMPONENT_MANAGER
          Constant used to retrieve the ComponentManager reference from the MessageContext object.
static String ROLE
          Constant which represents the name of the ROLE this provider should lookup to service a request with.
 
Fields inherited from class org.apache.axis.providers.java.RPCProvider
log
 
Fields inherited from class org.apache.axis.providers.java.JavaProvider
entLog, OPTION_ALLOWEDMETHODS, OPTION_CLASSNAME, OPTION_SCOPE
 
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
 
Fields inherited from class org.apache.axis.handlers.BasicHandler
makeLockable, name, options
 
Constructor Summary
AvalonProvider()
           
 
Method Summary
protected  Class getServiceClass(String role, org.apache.axis.handlers.soap.SOAPService service, org.apache.axis.MessageContext msgContext)
          Get the service class description
protected  String getServiceClassNameOptionName()
          Return the option in the configuration that contains the service class name.
protected  Object makeNewServiceObject(org.apache.axis.MessageContext msgContext, String role)
          Returns the service object.
 
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
getServiceClassName, getServiceObject, initServiceDesc, invoke
 
Methods inherited from class org.apache.axis.providers.BasicProvider
addOperation, generateWSDL, 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, setOptionsLockable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_MANAGER

public static final String COMPONENT_MANAGER
Constant used to retrieve the ComponentManager reference from the MessageContext object.

See Also:
Constant Field Values

ROLE

public static final String ROLE
Constant which represents the name of the ROLE this provider should lookup to service a request with. This is specified in the <parameter name="" value=""/> part of the deployment xml.

See Also:
Constant Field Values
Constructor Detail

AvalonProvider

public AvalonProvider()
Method Detail

makeNewServiceObject

protected Object makeNewServiceObject(org.apache.axis.MessageContext msgContext,
                                      String role)
                               throws Exception
Returns the service object.

Overrides:
makeNewServiceObject in class org.apache.axis.providers.java.JavaProvider
Parameters:
msgContext - the message context
role - the Avalon ROLE to lookup to find the service object implementation
Returns:
an object that implements the service
Throws:
Exception - if an error occurs

getServiceClassNameOptionName

protected String getServiceClassNameOptionName()
Return the option in the configuration that contains the service class name. In the Avalon case, it is the ROLE name to lookup.

Overrides:
getServiceClassNameOptionName in class org.apache.axis.providers.java.JavaProvider

getServiceClass

protected Class getServiceClass(String role,
                                org.apache.axis.handlers.soap.SOAPService service,
                                org.apache.axis.MessageContext msgContext)
                         throws org.apache.axis.AxisFault
Get the service class description

Overrides:
getServiceClass in class org.apache.axis.providers.java.JavaProvider
Parameters:
role - the Avalon ROLE name
service - a SOAPService instance
msgContext - the message context
Returns:
service class description
Throws:
org.apache.axis.AxisFault - if an error occurs


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.