|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.asteriskjava.fastagi.DefaultAgiServer
public class DefaultAgiServer
Default implementation of the AgiServer interface.
| Constructor Summary | |
|---|---|
DefaultAgiServer()
Creates a new DefaultAgiServer. |
|
| Method Summary | |
|---|---|
protected ServerSocketFacade |
createServerSocket()
|
void |
die()
|
protected void |
finalize()
|
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. |
void |
setMaximumPoolSize(int maximumPoolSize)
Sets the maximum number of worker threads in the thread pool. |
void |
setPoolSize(int poolSize)
Sets the number of worker threads in the thread pool. |
void |
setPort(int port)
Sets the TCP port to listen on for new connections. |
void |
shutdown()
Stops this AgiServer. |
void |
startup()
Starts this AgiServer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultAgiServer()
| Method Detail |
|---|
public void setPoolSize(int poolSize)
This is the number of threads that are available even if they are idle.
The default pool size is 10.
poolSize - the size of the worker thread pool.public void setMaximumPoolSize(int maximumPoolSize)
This equals the maximum number of concurrent requests this AgiServer can serve.
The default maximum pool size is 100.
maximumPoolSize - the maximum size of the worker thread pool.public void setBindPort(int bindPort)
setPort(int) instead
The default port is 4573.
bindPort - the port to bind to.public void setPort(int port)
The default port is 4573.
port - the port to bind to.public void setMappingStrategy(MappingStrategy mappingStrategy)
The default mapping strategy is a ResourceBundleMappingStrategy.
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
AgiServerAfter calling startup() this AgiServer is ready to receive requests from Asterisk servers and process them.
Note that this method will not return until the AgiServer has been shut down.
If you want to run the AgiServer in the background use wrap it with an
AgiServerThread.
startup in interface AgiServerjava.io.IOException - if the server socket cannot be bound.
java.lang.IllegalStateException - if this AgiServer is already running.public void run()
public void die()
public void shutdown()
throws java.lang.IllegalStateException
AgiServer
The server socket is closed, new connections are refused and resources
are freed. Any running AgiScripts are finish before shutdown
completes.
shutdown in interface AgiServerjava.lang.IllegalStateException - if this AgiServer is already shut down or
has not yet been started.
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||