Package org.apache.axis.configuration
Class SimpleProvider
java.lang.Object
org.apache.axis.configuration.SimpleProvider
- All Implemented Interfaces:
EngineConfiguration
- Direct Known Subclasses:
BasicClientConfig
,BasicServerConfig
A SimpleProvider is an EngineConfiguration which contains a simple
HashMap-based registry of Handlers, Transports, and Services. This is
for when you want to programatically deploy components which you create.
SimpleProvider may also optionally contain a reference to a "default"
EngineConfiguration, which will be scanned for components not found in
the internal registry. This is handy when you want to start with a base
configuration (like the default WSDD) and then quickly add stuff without
changing the WSDD document.
- Author:
- Glen Daniels (gdaniels@apache.org)
-
Field Summary
Fields inherited from interface org.apache.axis.EngineConfiguration
PROPERTY_NAME
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SimpleProvider
(TypeMappingRegistry typeMappingRegistry) Construct a SimpleProvider using the supplied TypeMappingRegistry.SimpleProvider
(EngineConfiguration defaultConfiguration) Constructor which takes an EngineConfiguration which will be used as the default. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a role to the configuration's global listvoid
configureEngine
(AxisEngine engine) Configure an AxisEngine.void
deployService
(String name, SOAPService service) void
deployService
(QName qname, SOAPService service) void
deployTransport
(String name, Handler transport) void
deployTransport
(QName qname, Handler transport) Get an enumeration of the services deployed to this engineReturns the global configuration options.Returns a global request handler.Returns a global response handler.getHandler
(QName qname) Retrieve an instance of the named handler.getRoles()
Get a list of roles that this engine plays globally.getService
(QName qname) Retrieve an instance of the named service.getServiceByNamespaceURI
(String namespace) Get a service which has been mapped to a particular namespacegetTransport
(QName qname) Retrieve an instance of the named transport.getTypeMapping
(String encodingStyle) Get our TypeMappingRegistry.void
removeRole
(String role) Remove a role from the configuration's global listvoid
setGlobalOptions
(Hashtable options) Set the global options Hashtablevoid
setGlobalRequest
(Handler globalRequest) Set the global request Handlervoid
setGlobalResponse
(Handler globalResponse) Set the global response Handlervoid
Set the global role list for this configuration.void
writeEngineConfig
(AxisEngine engine) We don't write ourselves out, so this is a noop.
-
Constructor Details
-
SimpleProvider
public SimpleProvider()Default constructor. -
SimpleProvider
Constructor which takes an EngineConfiguration which will be used as the default. -
SimpleProvider
Construct a SimpleProvider using the supplied TypeMappingRegistry.- Parameters:
typeMappingRegistry
-
-
-
Method Details
-
configureEngine
Configure an AxisEngine. Right now just calls the default configuration if there is one, since we don't do anything special.- Specified by:
configureEngine
in interfaceEngineConfiguration
- Parameters:
engine
- the AxisEngine we'll deploy state to- Throws:
ConfigurationException
- if there was a problem
-
writeEngineConfig
We don't write ourselves out, so this is a noop.- Specified by:
writeEngineConfig
in interfaceEngineConfiguration
- Parameters:
engine
- the AxisEngine from which to read state.- Throws:
ConfigurationException
- if there was a problem
-
getGlobalOptions
Returns the global configuration options.- Specified by:
getGlobalOptions
in interfaceEngineConfiguration
- Returns:
- the global options as a
Hashtable
- Throws:
ConfigurationException
- if the global options could not be returned
-
setGlobalOptions
Set the global options Hashtable- Parameters:
options
-
-
getGlobalRequest
Returns a global request handler.- Specified by:
getGlobalRequest
in interfaceEngineConfiguration
- Returns:
- the
Handler
that globally handles requests - Throws:
ConfigurationException
- if there was some error fetching the handler
-
setGlobalRequest
Set the global request Handler- Parameters:
globalRequest
-
-
getGlobalResponse
Returns a global response handler.- Specified by:
getGlobalResponse
in interfaceEngineConfiguration
- Returns:
- the
Handler
that globally handles responses - Throws:
ConfigurationException
- if there was some error fetching the handler
-
setGlobalResponse
Set the global response Handler- Parameters:
globalResponse
-
-
getTypeMappingRegistry
Get our TypeMappingRegistry. Returns our specific one if we have one, otherwise the one from our defaultConfiguration. If we don't have one and also don't have a defaultConfiguration, we create one.- Specified by:
getTypeMappingRegistry
in interfaceEngineConfiguration
- Returns:
- the type mapping registry
- Throws:
ConfigurationException
- if there was an error resolving the registry
-
getTypeMapping
- Throws:
ConfigurationException
-
getTransport
Description copied from interface:EngineConfiguration
Retrieve an instance of the named transport.- Specified by:
getTransport
in interfaceEngineConfiguration
- Parameters:
qname
- theQName
of the transport- Returns:
- a
Handler
implementing the transport - Throws:
ConfigurationException
- if there was an error resolving the transport
-
getService
Description copied from interface:EngineConfiguration
Retrieve an instance of the named service.- Specified by:
getService
in interfaceEngineConfiguration
- Parameters:
qname
- theQName
identifying theService
- Returns:
- the
Service
associated withqname
- Throws:
ConfigurationException
- if there was an error resolving the qname
-
getServiceByNamespaceURI
Get a service which has been mapped to a particular namespace- Specified by:
getServiceByNamespaceURI
in interfaceEngineConfiguration
- Parameters:
namespace
- a namespace URI- Returns:
- an instance of the appropriate Service, or null
- Throws:
ConfigurationException
- if there was an error resolving the namespace
-
getHandler
Description copied from interface:EngineConfiguration
Retrieve an instance of the named handler.- Specified by:
getHandler
in interfaceEngineConfiguration
- Parameters:
qname
- theQName
identifying theHandler
- Returns:
- the
Handler
associated withqname
- Throws:
ConfigurationException
- if there was a failure in resolvingqname
-
deployService
-
deployService
-
deployTransport
-
deployTransport
-
getDeployedServices
Get an enumeration of the services deployed to this engine- Specified by:
getDeployedServices
in interfaceEngineConfiguration
- Returns:
- an
Iterator
over theServiceDesc
objects - Throws:
ConfigurationException
- if the deployed services could not be returned- See Also:
-
setRoles
Set the global role list for this configuration. Note that we use the actual passed value, so if anyone else changes that collection, our role list will change. Be careful to pass this a cloned list if you want to change the list later without affecting the config.- Parameters:
roles
-
-
addRole
Add a role to the configuration's global list- Parameters:
role
-
-
removeRole
Remove a role from the configuration's global list- Parameters:
role
-
-
getRoles
Get a list of roles that this engine plays globally. Services within the engine configuration may also add additional roles.- Specified by:
getRoles
in interfaceEngineConfiguration
- Returns:
- a
List
of the roles for this engine
-