|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.orderlysoftware.orderlycalls.base.Service com.orderlysoftware.orderlycalls.asterisk.agi.AGIServer
public class AGIServer
AGIServer responds to calls coming from the FastAGI source by opening a socket, and attaching it to a new AGICall object with its own thread.
The AGIConnection object reads the context information sent by the FastAGI source.
The server also instantiates a new instance of a class implementing the AGIProcessor interface (passed in the command line when running stand-alone).
To develop your own applications, simply create a class that implements the AGIProcessor interface (see documentation for that interface).
Field Summary |
---|
Fields inherited from class com.orderlysoftware.orderlycalls.base.Service |
---|
log |
Constructor Summary | |
---|---|
AGIServer(AGISettings settings)
|
Method Summary | |
---|---|
void |
clean()
Closes all listening sockets for this AGIServer. |
void |
freeAGIProcessor(AGIReusableProcessor processor)
Returns an AGIProcessor to the ObjectPool. |
AGIProcessor |
getAGIProcessor(java.lang.Class processorClass)
Gets an AGIProcessor instance. |
static AGIServer |
getInstance(AGISettings settings)
Calls getInstance(settings, true). |
static AGIServer |
getInstance(AGISettings settings,
boolean reuse)
Calls the Service
superclass. |
static AGIServer |
getInstance(java.lang.String name)
Gets a named AGIServer |
void |
init()
Start serving requests. |
boolean |
isRunning()
Determines whether this service is active. |
static void |
main(java.lang.String[] args)
Main method for running stand-alone AGIServers. |
void |
run()
Listens for incoming connections, creates a new AGICall object and runs it with the given AGIProcessor in a new thread. |
void |
shutdown()
Graceful exit. |
Methods inherited from class com.orderlysoftware.orderlycalls.base.Service |
---|
getExecutorService, getInstance, getInstance, getInstance, getInstanceByName, getLogName, getName, getSettings, setExecutorService, shutdownAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AGIServer(AGISettings settings)
Method Detail |
---|
public static AGIServer getInstance(AGISettings settings)
settings
- The AGISettings object used to initialise the new server.
public static AGIServer getInstance(AGISettings settings, boolean reuse)
Service
superclass.
settings
- The AGISettings object used to initialise the new server.reuse
- Whether or not to reuse an existing AGIServer, if one can be
found.
public boolean isRunning()
Service
isRunning
in class Service
public static AGIServer getInstance(java.lang.String name)
name
- the name of the AGIServer to get.
null
if none can be found.public void shutdown()
All listening sockets are closed.
shutdown
in class Service
public void freeAGIProcessor(AGIReusableProcessor processor)
The processor must implement AGIReusableProcessor.
processor
- The processor to free.public AGIProcessor getAGIProcessor(java.lang.Class processorClass)
Recycles processors from the ObjectPool when possible. AGIProcessors must have a zero-argument constructor.
processorClass
- The class of processor to use.
public void init()
init
in class Service
public void clean()
public void run()
Call shutdown() to stop serving. Sockets are closed on exit automatically.
run
in interface java.lang.Runnable
public static void main(java.lang.String[] args) throws java.lang.ClassNotFoundException
args
- processorClassName port java.lang.ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |