|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.orderlysoftware.orderlycalls.OrderlyCalls
public class OrderlyCalls
This is the primary class for the OrderlyCalls application server.
OrderlyCalls takes a named-service approach to providing telephony Services. OrderlyCalls is configured with an extensible XML file (default is "./OrderlyCalls.xml") which allows you to define your own Services, and configure them with any initial parameters necessary.
You can run multiple services of the same class by giving them each a different name.
OrderlyCalls may be run in several ways, depending on your requirements:
Example:
> java com.orderlysoftware.orderlycalls.OrderlyCalls ./OrderlyCalls.xml
Example:
boolean doneInit=false;
public void useOrderlyCalls() {
//We only want to initialize once.
OrderlyCalls.init("./OrderlyCalls.xml");
//Get a service
ManagerClient managerClient=(ManagerClient)OrderlyCalls.getService("myManagerClient");
... do something with the service ...
OrderlyCalls.shutdown();
}
You can then access OrderlyCalls services from within ANY context
simply by calling OrderlyCalls.getService(name).
Please see the accompanying documentation on configuring Tomcat for use with OrderlyCalls.
| Constructor Summary | |
|---|---|
OrderlyCalls()
|
|
| Method Summary | |
|---|---|
void |
addService(Service service)
Adds a service (with a named Settings object) to the framework. |
static OrderlyCallsImpl |
getInstance()
Gets the internal OrderlyCallsImpl object used to manage services. |
static java.lang.String[] |
getLogo()
|
static java.lang.Object |
getService(java.lang.Class serviceClass)
Gets services by service class. |
static Service |
getService(java.lang.String name)
Gets a named Service. |
static java.util.HashMap |
getServicesMap()
Gets the mapping between names and services. |
static Settings |
getSettings(java.lang.String name)
Gets a named Settings object. |
static java.util.HashMap |
getSettingsMap()
Gets the mapping between names and service Settings objects. |
static void |
init(java.io.File f)
Initialise from config file. |
static void |
init(java.util.HashMap definitionsBySettings)
Initialises OrderlyCalls programmatically. |
static void |
init(java.io.InputStream is)
Initialise from stream. |
static void |
init(java.lang.String path)
Initialise from config file. |
static boolean |
isReuse()
|
static void |
main(java.lang.String[] args)
Starts OrderlyCalls from the command line |
void |
removeService(Service service)
Removes a service (with a named Settings object) from the framework. |
static void |
setInstance(OrderlyCallsImpl newInstance)
Sets the underlying instance. |
static void |
setLogLevel(java.util.logging.Level level)
Sets the logging level. |
static void |
setLogLevel(java.lang.String levelStr)
Sets the logging level. |
static void |
setReuse(boolean reuse)
|
static 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 |
|---|
public OrderlyCalls()
| Method Detail |
|---|
public static java.lang.String[] getLogo()
public static boolean isReuse()
public static void setReuse(boolean reuse)
reuse - The reuse to set.public static OrderlyCallsImpl getInstance()
The getService() methods in OrderlyCalls are defined statically for easy coding as most uses of OrderlyCalls will only require a single instance of OrderlyCallsImpl to handle the services.
public static void init(java.lang.String path)
path - The path to the configuration XML file.public static void init(java.io.File f)
f - The file to read.public static void init(java.io.InputStream is)
is - An InputStream containing XML.public static void setLogLevel(java.util.logging.Level level)
level - The level to be used by all OrderlyCalls classes.public static void setLogLevel(java.lang.String levelStr)
levelStr - One of "SEVERE","WARNING","INFO","FINE","FINER","ALL"public static void init(java.util.HashMap definitionsBySettings)
definitionsBySettings - A HashMap containing Settings objects as keys, and Definition objects as values.public static void shutdown()
public static void main(java.lang.String[] args)
Usage: java com.orderlysoftware.orderlycalls.OrderlyCalls path/to/OrderlyCalls.xml
args - With no arguments, looks for config file in the current directory.public static java.util.HashMap getServicesMap()
public static java.util.HashMap getSettingsMap()
public static Service getService(java.lang.String name)
name - The name of the Service.
public static java.lang.Object getService(java.lang.Class serviceClass)
serviceClass - The class of service to find.
public static Settings getSettings(java.lang.String name)
name - The name of the Service
public static void setInstance(OrderlyCallsImpl newInstance)
newInstance - the instance to set.public void addService(Service service)
service - The service to add.public void removeService(Service service)
service - The service to remove.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||