|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.asteriskjava.fastagi.AbstractAgiServer
public abstract class AbstractAgiServer
Abstract base class for FastAGI and AsyncAGI servers.
Constructor Summary | |
---|---|
AbstractAgiServer()
|
Method Summary | |
---|---|
protected java.util.concurrent.ThreadPoolExecutor |
createPool()
Creates a new ThreadPoolExecutor to serve the AGI requests. |
protected void |
execute(java.lang.Runnable command)
Execute the runnable using the configured ThreadPoolExecutor obtained from getPool() . |
protected void |
finalize()
|
protected MappingStrategy |
getMappingStrategy()
|
protected void |
handleException(java.lang.String message,
java.lang.Exception e)
|
protected boolean |
isDie()
|
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. |
protected void |
shutdown()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAgiServer()
Method Detail |
---|
public void setPoolSize(int poolSize)
poolSize
- the size of the worker thread pool.public void setMaximumPoolSize(int maximumPoolSize)
maximumPoolSize
- the maximum size of the worker thread pool.public void setMappingStrategy(MappingStrategy mappingStrategy)
mappingStrategy
- the mapping strategy to use.protected MappingStrategy getMappingStrategy()
protected boolean isDie()
protected void shutdown()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void execute(java.lang.Runnable command)
getPool()
.
command
- the command to run.protected void handleException(java.lang.String message, java.lang.Exception e)
protected java.util.concurrent.ThreadPoolExecutor createPool()
You can override this method to change this behavior. For example you can use a cached pool with
return Executors.newCachedThreadPool(new DaemonThreadFactory());
setPoolSize(int)
,
setMaximumPoolSize(int)
|
Asterisk-Java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |