org.apache.axis

Class AxisEngine

Implemented Interfaces:
Handler, Serializable
Known Direct Subclasses:
AxisClient, AxisServer

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.
Authors:
Glen Daniels (gdaniels@apache.org)
Glyn Normington (glyn@apache.org)

Field Summary

static String
DEFAULT_ATTACHMENT_IMPL
static String
ENV_ATTACHMENT_DIR
static String
ENV_SERVLET_CONTEXT
static String
ENV_SERVLET_REALPATH
static String
PROP_ATTACHMENT_CLEANUP
static String
PROP_ATTACHMENT_DIR
static String
PROP_ATTACHMENT_IMPLEMENTATION
static String
PROP_BP10_COMPLIANCE
Compliance with WS-I Basic Profile.
static String
PROP_BYTE_BUFFER_BACKING
static String
PROP_BYTE_BUFFER_CACHE_INCREMENT
static String
PROP_BYTE_BUFFER_RESIDENT_MAX_SIZE
static String
PROP_BYTE_BUFFER_WORK_BUFFER_SIZE
static String
PROP_DEBUG_FILE
static String
PROP_DEBUG_LEVEL
static String
PROP_DEFAULT_CONFIG_CLASS
static String
PROP_DISABLE_PRETTY_XML
static String
PROP_DOMULTIREFS
static 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.
static String
PROP_EMIT_ALL_TYPES
static String
PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION
static String
PROP_PASSWORD
static String
PROP_SEND_XSI
static String
PROP_SOAP_ALLOWED_VERSION
static String
PROP_SOAP_VERSION
static String
PROP_SYNC_CONFIG
static String
PROP_TWOD_ARRAY_ENCODING
static String
PROP_XML_DECL
static String
PROP_XML_ENCODING
static String
PROP_XML_REUSE_SAX_PARSERS
protected boolean
_hasSafePassword
Has the user changed the password yet? True if they have.
protected ClassCache
classCache
Java class cache.
protected EngineConfiguration
config
Our go-to guy for configuration...
protected static Log
log
The Log for all message logging.
protected boolean
shouldSaveConfig
Should we save the engine config each time we modify it? True if we should.

Fields inherited from class org.apache.axis.handlers.BasicHandler

makeLockable, name, options

Constructor Summary

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

Method Summary

void
addActorURI(String uri)
Add an actor by uri that will hold for the entire engine.
void
cleanup()
Cleanup routine removes application scoped objects.
ArrayList
getActorURIs()
Get a list of actor URIs that hold for the entire engine.
Session
getApplicationSession()
Get the Session object associated with the application session.
ClassCache
getClassCache()
Get the ClassCache associated with this engine.
abstract AxisEngine
getClientEngine()
Client engine access.
EngineConfiguration
getConfig()
Get the EngineConfiguration used throughout this AxisEngine instance.
static MessageContext
getCurrentMessageContext()
Get the active message context.
Handler
getGlobalRequest()
Get the global request Handler.
Handler
getGlobalResponse()
Get the global respones Handler.
Handler
getHandler(String name)
Get the Handler for a particular local name.
SOAPService
getService(String name)
Get the SOAPService for a particular local name.
Handler
getTransport(String name)
Get the Handler that implements the transport for a local name.
TypeMappingRegistry
getTypeMappingRegistry()
Get the TypeMappingRegistry for this axis engine.
boolean
hasSafePassword()
Discover if this AxisEngine has a safe password.
void
init()
Initialize the engine.
static void
normaliseOptions(Handler handler)
Normalise the engine's options.
void
refreshGlobalOptions()
(Re-)load the global options from the registry.
void
removeActorURI(String uri)
Remove an actor by uri that will hold for the entire engine.
void
saveConfiguration()
Write out our engine configuration.
void
setAdminPassword(String pw)
Set the administration password.
protected static void
setCurrentMessageContext(MessageContext mc)
Set the active message context.
void
setShouldSaveConfig(boolean shouldSaveConfig)
Set the flag that controls if the configuration should be saved.

Methods inherited from class org.apache.axis.handlers.BasicHandler

canHandleBlock, cleanup, generateWSDL, getDeploymentData, getName, getOption, getOptions, getUnderstoodHeaders, init, initHashtable, onFault, setName, setOption, setOptionDefault, setOptions, setOptionsLockable

Field Details

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

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

_hasSafePassword

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

classCache

protected ClassCache classCache
Java class cache.

config

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

log

protected static Log log
The Log for all message logging.

shouldSaveConfig

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

Constructor Details

AxisEngine

public AxisEngine(EngineConfiguration config)
Construct an AxisEngine using the specified engine configuration.
Parameters:
config - the EngineConfiguration for this engine

Method Details

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.
Specified by:
cleanup in interface Handler
Overrides:
cleanup in interface BasicHandler

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()
            throws ConfigurationException
Get the global request Handler.
Returns:
the Handler used for global requests

getGlobalResponse

public Handler getGlobalResponse()
            throws ConfigurationException
Get the global respones Handler.
Returns:
the Handler used for global responses

getHandler

public Handler getHandler(String name)
            throws AxisFault
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)
            throws AxisFault
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)
            throws AxisFault
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.
Specified by:
init in interface Handler
Overrides:
init in interface BasicHandler

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()
            throws ConfigurationException
(Re-)load the global options from the registry.

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.