Package org.apache.axis.configuration
Class SimpleProvider
- java.lang.Object
-
- org.apache.axis.configuration.SimpleProvider
-
- All Implemented Interfaces:
EngineConfiguration
- Direct Known Subclasses:
BasicClientConfig,BasicServerConfig
public class SimpleProvider extends java.lang.Object implements EngineConfiguration
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
Constructors Constructor Description SimpleProvider()Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRole(java.lang.String role)Add a role to the configuration's global listvoidconfigureEngine(AxisEngine engine)Configure an AxisEngine.voiddeployService(java.lang.String name, SOAPService service)voiddeployService(QName qname, SOAPService service)voiddeployTransport(java.lang.String name, Handler transport)voiddeployTransport(QName qname, Handler transport)java.util.IteratorgetDeployedServices()Get an enumeration of the services deployed to this enginejava.util.HashtablegetGlobalOptions()Returns the global configuration options.HandlergetGlobalRequest()Returns a global request handler.HandlergetGlobalResponse()Returns a global response handler.HandlergetHandler(QName qname)Retrieve an instance of the named handler.java.util.ListgetRoles()Get a list of roles that this engine plays globally.SOAPServicegetService(QName qname)Retrieve an instance of the named service.SOAPServicegetServiceByNamespaceURI(java.lang.String namespace)Get a service which has been mapped to a particular namespaceHandlergetTransport(QName qname)Retrieve an instance of the named transport.TypeMappinggetTypeMapping(java.lang.String encodingStyle)TypeMappingRegistrygetTypeMappingRegistry()Get our TypeMappingRegistry.voidremoveRole(java.lang.String role)Remove a role from the configuration's global listvoidsetGlobalOptions(java.util.Hashtable options)Set the global options HashtablevoidsetGlobalRequest(Handler globalRequest)Set the global request HandlervoidsetGlobalResponse(Handler globalResponse)Set the global response HandlervoidsetRoles(java.util.List roles)Set the global role list for this configuration.voidwriteEngineConfig(AxisEngine engine)We don't write ourselves out, so this is a noop.
-
-
-
Constructor Detail
-
SimpleProvider
public SimpleProvider()
Default constructor.
-
SimpleProvider
public SimpleProvider(EngineConfiguration defaultConfiguration)
Constructor which takes an EngineConfiguration which will be used as the default.
-
SimpleProvider
public SimpleProvider(TypeMappingRegistry typeMappingRegistry)
Construct a SimpleProvider using the supplied TypeMappingRegistry.- Parameters:
typeMappingRegistry-
-
-
Method Detail
-
configureEngine
public void configureEngine(AxisEngine engine) throws ConfigurationException
Configure an AxisEngine. Right now just calls the default configuration if there is one, since we don't do anything special.- Specified by:
configureEnginein interfaceEngineConfiguration- Parameters:
engine- the AxisEngine we'll deploy state to- Throws:
ConfigurationException- if there was a problem
-
writeEngineConfig
public void writeEngineConfig(AxisEngine engine) throws ConfigurationException
We don't write ourselves out, so this is a noop.- Specified by:
writeEngineConfigin interfaceEngineConfiguration- Parameters:
engine- the AxisEngine from which to read state.- Throws:
ConfigurationException- if there was a problem
-
getGlobalOptions
public java.util.Hashtable getGlobalOptions() throws ConfigurationExceptionReturns the global configuration options.- Specified by:
getGlobalOptionsin interfaceEngineConfiguration- Returns:
- the global options as a
Hashtable - Throws:
ConfigurationException- if the global options could not be returned
-
setGlobalOptions
public void setGlobalOptions(java.util.Hashtable options)
Set the global options Hashtable- Parameters:
options-
-
getGlobalRequest
public Handler getGlobalRequest() throws ConfigurationException
Returns a global request handler.- Specified by:
getGlobalRequestin interfaceEngineConfiguration- Returns:
- the
Handlerthat globally handles requests - Throws:
ConfigurationException- if there was some error fetching the handler
-
setGlobalRequest
public void setGlobalRequest(Handler globalRequest)
Set the global request Handler- Parameters:
globalRequest-
-
getGlobalResponse
public Handler getGlobalResponse() throws ConfigurationException
Returns a global response handler.- Specified by:
getGlobalResponsein interfaceEngineConfiguration- Returns:
- the
Handlerthat globally handles responses - Throws:
ConfigurationException- if there was some error fetching the handler
-
setGlobalResponse
public void setGlobalResponse(Handler globalResponse)
Set the global response Handler- Parameters:
globalResponse-
-
getTypeMappingRegistry
public TypeMappingRegistry getTypeMappingRegistry() throws ConfigurationException
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:
getTypeMappingRegistryin interfaceEngineConfiguration- Returns:
- the type mapping registry
- Throws:
ConfigurationException- if there was an error resolving the registry
-
getTypeMapping
public TypeMapping getTypeMapping(java.lang.String encodingStyle) throws ConfigurationException
- Throws:
ConfigurationException
-
getTransport
public Handler getTransport(QName qname) throws ConfigurationException
Description copied from interface:EngineConfigurationRetrieve an instance of the named transport.- Specified by:
getTransportin interfaceEngineConfiguration- Parameters:
qname- theQNameof the transport- Returns:
- a
Handlerimplementing the transport - Throws:
ConfigurationException- if there was an error resolving the transport
-
getService
public SOAPService getService(QName qname) throws ConfigurationException
Description copied from interface:EngineConfigurationRetrieve an instance of the named service.- Specified by:
getServicein interfaceEngineConfiguration- Parameters:
qname- theQNameidentifying theService- Returns:
- the
Serviceassociated withqname - Throws:
ConfigurationException- if there was an error resolving the qname
-
getServiceByNamespaceURI
public SOAPService getServiceByNamespaceURI(java.lang.String namespace) throws ConfigurationException
Get a service which has been mapped to a particular namespace- Specified by:
getServiceByNamespaceURIin 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
public Handler getHandler(QName qname) throws ConfigurationException
Description copied from interface:EngineConfigurationRetrieve an instance of the named handler.- Specified by:
getHandlerin interfaceEngineConfiguration- Parameters:
qname- theQNameidentifying theHandler- Returns:
- the
Handlerassociated withqname - Throws:
ConfigurationException- if there was a failure in resolvingqname
-
deployService
public void deployService(QName qname, SOAPService service)
-
deployService
public void deployService(java.lang.String name, SOAPService service)
-
deployTransport
public void deployTransport(java.lang.String name, Handler transport)
-
getDeployedServices
public java.util.Iterator getDeployedServices() throws ConfigurationExceptionGet an enumeration of the services deployed to this engine- Specified by:
getDeployedServicesin interfaceEngineConfiguration- Returns:
- an
Iteratorover theServiceDescobjects - Throws:
ConfigurationException- if the deployed services could not be returned- See Also:
ServiceDesc
-
setRoles
public void setRoles(java.util.List roles)
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
public void addRole(java.lang.String role)
Add a role to the configuration's global list- Parameters:
role-
-
removeRole
public void removeRole(java.lang.String role)
Remove a role from the configuration's global list- Parameters:
role-
-
getRoles
public java.util.List getRoles()
Get a list of roles that this engine plays globally. Services within the engine configuration may also add additional roles.- Specified by:
getRolesin interfaceEngineConfiguration- Returns:
- a
Listof the roles for this engine
-
-