Author: | Unspecified |
Home Page: | |
Version: | Unspecified |
Release Tag: | Unknown |
Release Date: | Unknown |
JVM Required: | Unspecified |
License: | GNU Library General Public License |
Categories: | None |
Requirements: | |
Dependencies: | No dependencies |
Externals: | None |
This defines a queue named "q1" with 10 work threads, a queue named "q2" with 5 work threads, and another queue named "q3" with 10 work threads. To use the queues, do something like this:pas.startupClass.WorkQueue =\ com.protomatter.pas.serviceimpl.PASWorkServiceImpl pas.startupArgs.WorkQueue = q1=10,q2=5,q3=10
After connecting to the PASWorkService, you can add work (in the form of any object that implements the java.lang.Runnable interface) to any of the configured work queues or to the default queue (see the javadoc for PASWorkService for available methods). You can also interrogate each of the queues and find out the queue length, the number of threads currently working and currently waiting, and the number of threads in general.import javax.naming.*; // JNDI stuff import com.protomatter.pas.service.*; // PASWorkService ... Context context = get_A_JNDI_Context(); PASWorkService ws = (PASWorkService)context.lookup(PASWorkService.JNDI_NAME); ws.addWork(myRunnable); // add work to the default queue. ws.addWork("q1", myRunnable); // add work to the "q1" queue.