Class AxisEngine

All Implemented Interfaces:
Serializable, Handler
Direct Known 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.
Author:
Glen Daniels (gdaniels@apache.org), Glyn Normington (glyn@apache.org)
See Also:
  • Field Details

  • Constructor Details

    • AxisEngine

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

    • setCurrentMessageContext

      protected static void setCurrentMessageContext(MessageContext mc)
      Set the active message context.
      Parameters:
      mc - - the new active message context.
    • getCurrentMessageContext

      public static MessageContext getCurrentMessageContext()
      Get the active message context.
      Returns:
      the current active message context
    • 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 class BasicHandler
    • 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 class BasicHandler
    • saveConfiguration

      public void saveConfiguration()
      Write out our engine configuration.
    • getConfig

      public EngineConfiguration getConfig()
      Get the EngineConfiguration used throughout this AxisEngine instance.
      Returns:
      the engine configuration instance
    • hasSafePassword

      public boolean hasSafePassword()
      Discover if this AxisEngine has a safe password.
      Returns:
      true if it is safe, false otherwise
    • setAdminPassword

      public void setAdminPassword(String pw)
      Set the administration password.
      Parameters:
      pw - the literal value of the password as a String
    • 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
    • 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
    • getGlobalRequest

      public Handler getGlobalRequest() throws ConfigurationException
      Get the global request Handler.
      Returns:
      the Handler used for global requests
      Throws:
      ConfigurationException
    • getGlobalResponse

      public Handler getGlobalResponse() throws ConfigurationException
      Get the global respones Handler.
      Returns:
      the Handler used for global responses
      Throws:
      ConfigurationException
    • 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
    • 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
    • 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
    • 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
    • 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.
      Throws:
      ConfigurationException
    • 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