Depending on your applications needs you may want to change the configuarion parameters of a work manager's thread pool. When you define the JNDI Resource (WorkManagerFactory) you can pass configuration values: This example (for Tomcat) defines a WorkManager named MyWorkManager that uses between 5 and 15 concurrent threads:
<Context ...> ... <Resource name="wm/MyWorkManager" auth="Container" type="commonj.work.WorkManager" factory="de.myfoo.commonj.work.FooWorkManagerFactory" minThreads="5" /> maxThreads="15" /> ... </Context>
The valid attirbutes for the FooWorkManagerFactory are
as follows:
| Attribute | Description |
|---|---|
| minThreads | The mininum number of threads in the thread pool. Default: 2 |
| maxThreads | The maximum number of threads in the thread pool. Default: 10 |
| queueLenght | The number of work items that can be queued - 0 means no queuing. Default: 10 |
| maxDaemons | The maximum number of daemon threads to allow for this work manager. Default: 10 |