org.apache.axis

Class AxisEngine

public abstract class AxisEngine extends BasicHandler

An AxisEngine is the base class for AxisClient and AxisServer. Handles common functionality like dealing with the handler/service registries and loading properties.

Author: Glen Daniels (gdaniels@apache.org) Glyn Normington (glyn@apache.org)

Field Summary
protected ClassCacheclassCache
Java class cache.
protected EngineConfigurationconfig
Our go-to guy for configuration...
static StringDEFAULT_ATTACHMENT_IMPL
static StringENV_ATTACHMENT_DIR
static StringENV_SERVLET_CONTEXT
static StringENV_SERVLET_REALPATH
protected static Loglog
The Log for all message logging.
static StringPROP_ATTACHMENT_CLEANUP
static StringPROP_ATTACHMENT_DIR
static StringPROP_ATTACHMENT_IMPLEMENTATION
static StringPROP_BP10_COMPLIANCE
Compliance with WS-I Basic Profile.
static StringPROP_BYTE_BUFFER_BACKING
static StringPROP_BYTE_BUFFER_CACHE_INCREMENT
static StringPROP_BYTE_BUFFER_RESIDENT_MAX_SIZE
static StringPROP_BYTE_BUFFER_WORK_BUFFER_SIZE
static StringPROP_DEBUG_FILE
static StringPROP_DEBUG_LEVEL
static StringPROP_DEFAULT_CONFIG_CLASS
static StringPROP_DISABLE_PRETTY_XML
static StringPROP_DOMULTIREFS
static StringPROP_DOTNET_SOAPENC_FIX
Set this property to 'true' when you want Axis to avoid soap encoded types to work around a .NET problem where it wont accept soap encoded types for a (soap encoded!)
static StringPROP_EMIT_ALL_TYPES
static StringPROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION
static StringPROP_PASSWORD
static StringPROP_SEND_XSI
static StringPROP_SOAP_ALLOWED_VERSION
static StringPROP_SOAP_VERSION
static StringPROP_SYNC_CONFIG
static StringPROP_TWOD_ARRAY_ENCODING
static StringPROP_XML_DECL
static StringPROP_XML_ENCODING
static StringPROP_XML_REUSE_SAX_PARSERS
protected booleanshouldSaveConfig
Should we save the engine config each time we modify it?
protected boolean_hasSafePassword
Has the user changed the password yet?
Constructor Summary
AxisEngine(EngineConfiguration config)
Construct an AxisEngine using the specified engine configuration.
Method Summary
voidaddActorURI(String uri)
Add an actor by uri that will hold for the entire engine.
voidcleanup()
Cleanup routine removes application scoped objects.
ArrayListgetActorURIs()
Get a list of actor URIs that hold for the entire engine.
SessiongetApplicationSession()
Get the Session object associated with the application session.
ClassCachegetClassCache()
Get the ClassCache associated with this engine.
abstract AxisEnginegetClientEngine()
Client engine access.
EngineConfigurationgetConfig()
Get the EngineConfiguration used throughout this AxisEngine instance.
static MessageContextgetCurrentMessageContext()
Get the active message context.
HandlergetGlobalRequest()
Get the global request Handler.
HandlergetGlobalResponse()
Get the global respones Handler.
HandlergetHandler(String name)
Get the Handler for a particular local name.
SOAPServicegetService(String name)
Get the SOAPService for a particular local name.
HandlergetTransport(String name)
Get the Handler that implements the transport for a local name.
TypeMappingRegistrygetTypeMappingRegistry()
Get the TypeMappingRegistry for this axis engine.
booleanhasSafePassword()
Discover if this AxisEngine has a safe password.
voidinit()
Initialize the engine.
static voidnormaliseOptions(Handler handler)
Normalise the engine's options.
voidrefreshGlobalOptions()
(Re-)load the global options from the registry.
voidremoveActorURI(String uri)
Remove an actor by uri that will hold for the entire engine.
voidsaveConfiguration()
Write out our engine configuration.
voidsetAdminPassword(String pw)
Set the administration password.
protected static voidsetCurrentMessageContext(MessageContext mc)
Set the active message context.
voidsetShouldSaveConfig(boolean shouldSaveConfig)
Set the flag that controls if the configuration should be saved.

Field Detail

classCache

protected transient ClassCache classCache
Java class cache.

config

protected EngineConfiguration config
Our go-to guy for configuration...

DEFAULT_ATTACHMENT_IMPL

public static final String DEFAULT_ATTACHMENT_IMPL

ENV_ATTACHMENT_DIR

public static final String ENV_ATTACHMENT_DIR

ENV_SERVLET_CONTEXT

public static final String ENV_SERVLET_CONTEXT

ENV_SERVLET_REALPATH

public static final String ENV_SERVLET_REALPATH

log

protected static Log log
The Log for all message logging.

PROP_ATTACHMENT_CLEANUP

public static final String PROP_ATTACHMENT_CLEANUP

PROP_ATTACHMENT_DIR

public static final String PROP_ATTACHMENT_DIR

PROP_ATTACHMENT_IMPLEMENTATION

public static final String PROP_ATTACHMENT_IMPLEMENTATION

PROP_BP10_COMPLIANCE

public static final String PROP_BP10_COMPLIANCE
Compliance with WS-I Basic Profile.

PROP_BYTE_BUFFER_BACKING

public static final String PROP_BYTE_BUFFER_BACKING

PROP_BYTE_BUFFER_CACHE_INCREMENT

public static final String PROP_BYTE_BUFFER_CACHE_INCREMENT

PROP_BYTE_BUFFER_RESIDENT_MAX_SIZE

public static final String PROP_BYTE_BUFFER_RESIDENT_MAX_SIZE

PROP_BYTE_BUFFER_WORK_BUFFER_SIZE

public static final String PROP_BYTE_BUFFER_WORK_BUFFER_SIZE

PROP_DEBUG_FILE

public static final String PROP_DEBUG_FILE

PROP_DEBUG_LEVEL

public static final String PROP_DEBUG_LEVEL

PROP_DEFAULT_CONFIG_CLASS

public static final String PROP_DEFAULT_CONFIG_CLASS

PROP_DISABLE_PRETTY_XML

public static final String PROP_DISABLE_PRETTY_XML

PROP_DOMULTIREFS

public static final String PROP_DOMULTIREFS

PROP_DOTNET_SOAPENC_FIX

public static final String PROP_DOTNET_SOAPENC_FIX
Set this property to 'true' when you want Axis to avoid soap encoded types to work around a .NET problem where it wont accept soap encoded types for a (soap encoded!) array.

PROP_EMIT_ALL_TYPES

public static final String PROP_EMIT_ALL_TYPES

PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION

public static final String PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION

PROP_PASSWORD

public static final String PROP_PASSWORD

PROP_SEND_XSI

public static final String PROP_SEND_XSI

PROP_SOAP_ALLOWED_VERSION

public static final String PROP_SOAP_ALLOWED_VERSION

PROP_SOAP_VERSION

public static final String PROP_SOAP_VERSION

PROP_SYNC_CONFIG

public static final String PROP_SYNC_CONFIG

PROP_TWOD_ARRAY_ENCODING

public static final String PROP_TWOD_ARRAY_ENCODING

PROP_XML_DECL

public static final String PROP_XML_DECL

PROP_XML_ENCODING

public static final String PROP_XML_ENCODING

PROP_XML_REUSE_SAX_PARSERS

public static final String PROP_XML_REUSE_SAX_PARSERS

shouldSaveConfig

protected boolean shouldSaveConfig
Should we save the engine config each time we modify it? True if we should.

_hasSafePassword

protected boolean _hasSafePassword
Has the user changed the password yet? True if they have.

Constructor Detail

AxisEngine

public AxisEngine(EngineConfiguration config)
Construct an AxisEngine using the specified engine configuration.

Parameters: config the EngineConfiguration for this engine

Method Detail

addActorURI

public void addActorURI(String uri)
Add an actor by uri that will hold for the entire engine.

Parameters: uri a String giving the uri of the actor to add

cleanup

public void cleanup()
Cleanup routine removes application scoped objects. There is a small risk of this being called more than once so the cleanup should be designed to resist that event.

getActorURIs

public ArrayList getActorURIs()
Get a list of actor URIs that hold for the entire engine.

Returns: an ArrayList of all actor URIs as Strings

getApplicationSession

public Session getApplicationSession()
Get the Session object associated with the application session.

Returns: a Session scoped to the application

getClassCache

public ClassCache getClassCache()
Get the ClassCache associated with this engine.

Returns: the class cache

getClientEngine

public abstract AxisEngine getClientEngine()
Client engine access.

An AxisEngine may define another specific AxisEngine to be used by newly created Clients. For instance, a server may create an AxisClient and allow deployment to it. Then the server's services may access the AxisClient's deployed handlers and transports.

Returns: an AxisEngine that is the client engine

getConfig

public EngineConfiguration getConfig()
Get the EngineConfiguration used throughout this AxisEngine instance.

Returns: the engine configuration instance

getCurrentMessageContext

public static MessageContext getCurrentMessageContext()
Get the active message context.

Returns: the current active message context

getGlobalRequest

public Handler getGlobalRequest()
Get the global request Handler.

Returns: the Handler used for global requests

Throws: ConfigurationException

getGlobalResponse

public Handler getGlobalResponse()
Get the global respones Handler.

Returns: the Handler used for global responses

Throws: ConfigurationException

getHandler

public Handler getHandler(String name)
Get the Handler for a particular local name.

Parameters: name the local name of the request type

Returns: the Handler for this request type

Throws: AxisFault

getService

public SOAPService getService(String name)
Get the SOAPService for a particular local name.

Parameters: name the local name of the request type

Returns: the SOAPService for this request type

Throws: AxisFault

getTransport

public Handler getTransport(String name)
Get the Handler that implements the transport for a local name.

Parameters: name the local name to fetch the transport for

Returns: a Handler for this local name

Throws: AxisFault

getTypeMappingRegistry

public TypeMappingRegistry getTypeMappingRegistry()
Get the TypeMappingRegistry for this axis engine.

Returns: the TypeMappingRegistry if possible, or null if there is any error resolving it

hasSafePassword

public boolean hasSafePassword()
Discover if this AxisEngine has a safe password.

Returns: true if it is safe, false otherwise

init

public void init()
Initialize the engine. Multiple calls will (may?) return the engine to the intialized state.

normaliseOptions

public static void normaliseOptions(Handler handler)
Normalise the engine's options.

Convert boolean options from String to Boolean and default any ommitted boolean options to TRUE. Default the admin. password.

Parameters: handler the Handler to normalise; instances of AxisEngine get extra data normalised

refreshGlobalOptions

public void refreshGlobalOptions()
(Re-)load the global options from the registry.

Throws: ConfigurationException

removeActorURI

public void removeActorURI(String uri)
Remove an actor by uri that will hold for the entire engine.

Parameters: uri a String giving the uri of the actor to remove

saveConfiguration

public void saveConfiguration()
Write out our engine configuration.

setAdminPassword

public void setAdminPassword(String pw)
Set the administration password.

Parameters: pw the literal value of the password as a String

setCurrentMessageContext

protected static void setCurrentMessageContext(MessageContext mc)
Set the active message context.

Parameters: mc - the new active message context.

setShouldSaveConfig

public void setShouldSaveConfig(boolean shouldSaveConfig)
Set the flag that controls if the configuration should be saved.

Parameters: shouldSaveConfig true if the configuration should be changed, false otherwise

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.