This class is made to handle all the ThreadPools used in L2j.
Scheduled Tasks can either be sent to a {@link #_generalScheduledThreadPool "general"} or {@link #_effectsScheduledThreadPool "effects"} {@link ScheduledThreadPoolExecutor ScheduledThreadPool}: The "effects" one is used for every effects (skills, hp/mp regen ...) while the "general" one is used for everything else that needs to be scheduled.
There also is an {@link #_aiScheduledThreadPool "ai"} {@link ScheduledThreadPoolExecutor ScheduledThreadPool} used for AI Tasks.
Tasks can be sent to {@link ScheduledThreadPoolExecutor ScheduledThreadPool} either with:
For all Tasks that should be executed with no delay asynchronously in a ThreadPool there also are usual {@link ThreadPoolExecutor ThreadPools}that can grow/shrink according to their load.:
This class is made to handle all the ThreadPools used in L2j.
Scheduled Tasks can either be sent to a {@link #_generalScheduledThreadPool "general"} or {@link #_effectsScheduledThreadPool "effects"} {@link ScheduledThreadPoolExecutor ScheduledThreadPool}: The "effects" one is used for every effects (skills, hp/mp regen ...) while the "general" one is used for everything else that needs to be scheduled.
There also is an {@link #_aiScheduledThreadPool "ai"} {@link ScheduledThreadPoolExecutor ScheduledThreadPool} used for AI Tasks.
Tasks can be sent to {@link ScheduledThreadPoolExecutor ScheduledThreadPool} either with:
For all Tasks that should be executed with no delay asynchronously in a ThreadPool there also are usual {@link ThreadPoolExecutor ThreadPools}that can grow/shrink according to their load.:
It is a singleton since threads need to be managed vm wide.
This manager forces you to use a bounded queue. By default it uses the current thread for execuion when the buffer is full and no free threads can be created.
You can specify the props file to use or pass in a properties object prior to configuration. By default it looks for configuration information in thread_pool.properties.
If set, the Properties object will take precedence.
If a value is not set for a particular pool, the hard coded defaults will be used.
int boundarySize_DEFAULT = 2000; int maximumPoolSize_DEFAULT = 150; int minimumPoolSize_DEFAULT = 4; int keepAliveTime_DEFAULT = 1000 * 60 * 5; boolean abortWhenBlocked = false; String whenBlockedPolicy_DEFAULT = IPoolConfiguration.POLICY_RUN; int startUpSize_DEFAULT = 4;You can configure default settings by specifying a default pool in the properties, ie "cache.ccf"
@author Aaron Smuts
ThreadPoolManager
manages thread pools.
|
|
|
|
|
|
|
|
|
|
|
|