com.orderlysoftware.orderlycalls
Class OrderlyCallsImpl

java.lang.Object
  extended by com.orderlysoftware.orderlycalls.OrderlyCallsImpl

public class OrderlyCallsImpl
extends java.lang.Object

The OrderlyCalls class instantiates one of these and calls its methods from within its static methods.

You may instantiate this class directly, however you will no longer be able to retrieve Services statically.

Direct instantiation of this class is therefore not recommended.

Author:
Matt King, M.A. Oxon.

Constructor Summary
OrderlyCallsImpl()
          Not recommended.
 
Method Summary
 void addService(Service service)
          Adds a service (with a named Settings object) to the framework.
 java.lang.Object getService(java.lang.Class serviceClass)
          Gets services by service class.
 Service getService(java.lang.String name)
          Gets a Service by name.
 java.util.HashMap getServicesMap()
          Gets the mapping between names and services.
 Settings getSettings(java.lang.String name)
          Gets a Settings object.
 java.util.HashMap getSettingsMap()
          Gets the mapping between names and service Settings objects.
 void init(java.io.File f)
          Initialise from config file.
 void init(java.util.HashMap definitionsBySettings)
          Initialises OrderlyCalls programmatically.
 void init(java.io.InputStream is)
          Initialise from stream.
 void init(java.lang.String path)
          Initialise from config file.
 void removeService(Service service)
          Removes a service (with a named Settings object) from the framework.
 void setLogLevel(java.util.logging.Level level)
          Sets the logging level.
 void setLogLevel(java.lang.String levelStr)
          Sets the logging level.
 void shutdown()
          Shuts down all services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderlyCallsImpl

public OrderlyCallsImpl()
Not recommended.

Method Detail

init

public void init(java.lang.String path)
Initialise from config file.

Parameters:
path - The path to the configuration XML file.

init

public void init(java.io.File f)
Initialise from config file.

Parameters:
f - The file to read.

init

public void init(java.io.InputStream is)
Initialise from stream.

Parameters:
is - An InputStream containing XML.

setLogLevel

public void setLogLevel(java.util.logging.Level level)
Sets the logging level.

Parameters:
level - The level to be used by all OrderlyCalls classes.

setLogLevel

public void setLogLevel(java.lang.String levelStr)
Sets the logging level.

Parameters:
levelStr - One of "SEVERE","WARNING","INFO","FINE","FINER","ALL"

init

public void init(java.util.HashMap definitionsBySettings)
Initialises OrderlyCalls programmatically.

Parameters:
definitionsBySettings - A HashMap containing Settings objects as keys, and Definition objects as values.

addService

public void addService(Service service)
Adds a service (with a named Settings object) to the framework.

Parameters:
service - The service to add.

removeService

public void removeService(Service service)
Removes a service (with a named Settings object) from the framework.

Parameters:
service - The service to remove.

shutdown

public void shutdown()
Shuts down all services.


getServicesMap

public java.util.HashMap getServicesMap()
Gets the mapping between names and services.

Returns:
A HashMap with names as keys (Strings), and Services as values.

getSettingsMap

public java.util.HashMap getSettingsMap()
Gets the mapping between names and service Settings objects.

Returns:
A HashMap with names as keys, and Settings objects as values.

getService

public Service getService(java.lang.String name)
Gets a Service by name. The first call to this method will create and initialise the service. Subsequent calls return the created Service object.

Parameters:
name - The name of the Service.
Returns:
The named Service.

getService

public java.lang.Object getService(java.lang.Class serviceClass)
Gets services by service class.

Parameters:
serviceClass - The class of service to find.
Returns:
A Collection of services of this class, or null if none can be found, or a single Service object if only one can be found.

getSettings

public Settings getSettings(java.lang.String name)
Gets a Settings object.

Parameters:
name - The name of the corresponding Service.
Returns:
the Settings object used to configure the named Service.
See Also:
Service.getSettings()