org.codehaus.ivory.provider
Class AvalonProvider
java.lang.Object
|
+--org.apache.axis.handlers.BasicHandler
|
+--org.apache.axis.providers.BasicProvider
|
+--org.apache.axis.providers.java.JavaProvider
|
+--org.apache.axis.providers.java.RPCProvider
|
+--org.codehaus.ivory.provider.AvalonProvider
- All Implemented Interfaces:
- org.apache.axis.Handler, java.io.Serializable
- 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>
- Author:
- Marcus Crafter
- See Also:
- Serialized Form
Field Summary |
static java.lang.String |
ROLE
Constant which represents the name of the ROLE this
provider should lookup to service a request with. |
static java.lang.String |
SERVICE_MANAGER
Constant used to retrieve the ServiceManager reference
from the MessageContext object. |
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_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.apache.axis.handlers.BasicHandler |
makeLockable, name, options |
Method Summary |
protected java.lang.Class |
getServiceClass(java.lang.String role,
org.apache.axis.handlers.soap.SOAPService service,
org.apache.axis.MessageContext msgContext)
Get the service class description |
protected java.lang.Object |
makeNewServiceObject(org.apache.axis.MessageContext msgContext,
java.lang.String role)
Returns the service object. |
Methods inherited from class org.apache.axis.providers.java.RPCProvider |
checkMethodName, invokeMethod, processMessage |
Methods inherited from class org.apache.axis.providers.java.JavaProvider |
generateWSDL, getServiceClassName, getServiceClassNameOptionName, getServiceObject, initServiceDesc, invoke |
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, setOptionsLockable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SERVICE_MANAGER
public static final java.lang.String SERVICE_MANAGER
- Constant used to retrieve the ServiceManager reference
from the MessageContext object.
- See Also:
- Constant Field Values
ROLE
public static final java.lang.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
AvalonProvider
public AvalonProvider()
makeNewServiceObject
protected java.lang.Object makeNewServiceObject(org.apache.axis.MessageContext msgContext,
java.lang.String role)
throws java.lang.Exception
- Returns the service object.
- Overrides:
makeNewServiceObject
in class org.apache.axis.providers.java.JavaProvider
- Parameters:
msgContext
- the message contextrole
- the Avalon ROLE to lookup to find the service object implementation
- Returns:
- an object that implements the service
- Throws:
java.lang.Exception
- if an error occurs
getServiceClass
protected java.lang.Class getServiceClass(java.lang.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 nameservice
- a SOAPService
instancemsgContext
- the message context
- Returns:
- service class description
- Throws:
org.apache.axis.AxisFault
- if an error occurs
Copyright © -2003 Codehaus. All Rights Reserved.