org.apache.axis.configuration

Class SimpleProvider

public class SimpleProvider extends 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)

Constructor Summary
SimpleProvider()
Default constructor.
SimpleProvider(EngineConfiguration defaultConfiguration)
Constructor which takes an EngineConfiguration which will be used as the default.
SimpleProvider(TypeMappingRegistry typeMappingRegistry)
Construct a SimpleProvider using the supplied TypeMappingRegistry.
Method Summary
voidaddRole(String role)
Add a role to the configuration's global list
voidconfigureEngine(AxisEngine engine)
Configure an AxisEngine.
voiddeployService(QName qname, SOAPService service)
voiddeployService(String name, SOAPService service)
voiddeployTransport(QName qname, Handler transport)
voiddeployTransport(String name, Handler transport)
IteratorgetDeployedServices()
Get an enumeration of the services deployed to this engine
HashtablegetGlobalOptions()
Returns the global configuration options.
HandlergetGlobalRequest()
Returns a global request handler.
HandlergetGlobalResponse()
Returns a global response handler.
HandlergetHandler(QName qname)
ListgetRoles()
Get a list of roles that this engine plays globally.
SOAPServicegetService(QName qname)
SOAPServicegetServiceByNamespaceURI(String namespace)
Get a service which has been mapped to a particular namespace
HandlergetTransport(QName qname)
TypeMappinggetTypeMapping(String encodingStyle)
TypeMappingRegistrygetTypeMappingRegistry()
Get our TypeMappingRegistry.
voidremoveRole(String role)
Remove a role from the configuration's global list
voidsetGlobalOptions(Hashtable options)
Set the global options Hashtable
voidsetGlobalRequest(Handler globalRequest)
Set the global request Handler
voidsetGlobalResponse(Handler globalResponse)
Set the global response Handler
voidsetRoles(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

addRole

public void addRole(String role)
Add a role to the configuration's global list

Parameters: role

configureEngine

public void configureEngine(AxisEngine engine)
Configure an AxisEngine. Right now just calls the default configuration if there is one, since we don't do anything special.

deployService

public void deployService(QName qname, SOAPService service)

deployService

public void deployService(String name, SOAPService service)

deployTransport

public void deployTransport(QName qname, Handler transport)

deployTransport

public void deployTransport(String name, Handler transport)

getDeployedServices

public Iterator getDeployedServices()
Get an enumeration of the services deployed to this engine

getGlobalOptions

public Hashtable getGlobalOptions()
Returns the global configuration options.

getGlobalRequest

public Handler getGlobalRequest()
Returns a global request handler.

getGlobalResponse

public Handler getGlobalResponse()
Returns a global response handler.

getHandler

public Handler getHandler(QName qname)

getRoles

public List getRoles()
Get a list of roles that this engine plays globally. Services within the engine configuration may also add additional roles.

Returns: a List of the roles for this engine

getService

public SOAPService getService(QName qname)

getServiceByNamespaceURI

public SOAPService getServiceByNamespaceURI(String namespace)
Get a service which has been mapped to a particular namespace

Parameters: namespace a namespace URI

Returns: an instance of the appropriate Service, or null

getTransport

public Handler getTransport(QName qname)

getTypeMapping

public TypeMapping getTypeMapping(String encodingStyle)

getTypeMappingRegistry

public TypeMappingRegistry 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.

removeRole

public void removeRole(String role)
Remove a role from the configuration's global list

Parameters: role

setGlobalOptions

public void setGlobalOptions(Hashtable options)
Set the global options Hashtable

Parameters: options

setGlobalRequest

public void setGlobalRequest(Handler globalRequest)
Set the global request Handler

Parameters: globalRequest

setGlobalResponse

public void setGlobalResponse(Handler globalResponse)
Set the global response Handler

Parameters: globalResponse

setRoles

public void setRoles(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

writeEngineConfig

public void writeEngineConfig(AxisEngine engine)
We don't write ourselves out, so this is a noop.
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.