|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asterisk.fastagi.DefaultAGIServer
public class DefaultAGIServer
Constructor Summary | |
---|---|
DefaultAGIServer()
Creates a new DefaultAGIServer. |
Method Summary | |
---|---|
protected ServerSocketFacade |
createServerSocket()
|
void |
die()
|
static void |
main(java.lang.String[] args)
|
void |
run()
|
void |
setBindPort(int bindPort)
Deprecated. use setPort(int) instead |
void |
setMappingStrategy(MappingStrategy mappingStrategy)
Sets the strategy to use for mapping AGIRequests to AGIScripts that serve them. The default mapping strategy is a ResourceBundleMappingStrategy. |
void |
setPoolSize(int poolSize)
Sets the number of worker threads in the thread pool. This equals the maximum number of concurrent requests this AGIServer can serve. The default pool size is 10. |
void |
setPort(int port)
Sets the TCP port to listen on for new connections. The default port is 4573. |
void |
shutdown()
Shuts this AGIServer down. The server socket is closed and all resources are freed. |
void |
startup()
Starts this AGIServer. After calling startup() this AGIServer is ready to receive requests from Asterisk servers and process them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultAGIServer()
Method Detail |
---|
public void setPoolSize(int poolSize)
poolSize
- the size of the worker thread pool.public void setBindPort(int bindPort)
setPort(int)
instead
bindPort
- the port to bind to.public void setPort(int port)
port
- the port to bind to.public void setMappingStrategy(MappingStrategy mappingStrategy)
mappingStrategy
- the mapping strategy to use.ResourceBundleMappingStrategy
protected ServerSocketFacade createServerSocket() throws java.io.IOException
java.io.IOException
public void startup() throws java.io.IOException, java.lang.IllegalStateException
AGIServer
startup
in interface AGIServer
java.io.IOException
- if the server socket cannot be bound.
java.lang.IllegalStateException
- if this AGIServer is already running.public void run()
public void die() throws java.io.IOException
java.io.IOException
public void shutdown() throws java.io.IOException, java.lang.IllegalStateException
AGIServer
shutdown
in interface AGIServer
java.io.IOException
- if the connection cannot be shut down.
java.lang.IllegalStateException
- if this AGIServer is already shut down or
has not yet been started.public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |