You can easily create 5-10 schedulers programatically or just by putting them each into jboss-service.xml. If they all fire off at once, one of them executes in its own thread.
Thanks for the tip!
In my case, using separate schedulers introduces the problem of coordinating them; the threads must work on different "chunks" of data to avoid conflicts.
I'm sure the coordination can be done, but it would be easier to use just one "master" scheduler if possible.
Wait a minute... are you saying that a scheduler can start other schedulers programmatically? And they will all run in parallell?
I'm a bit unsure what the benefits will be over using threads, but i'll look into it.
I'm not sure I know what you want. But if things must execute in order, it seems like you can't use separate threads, right?
Transactions from the same origin must be processed in sequence. Transactions from different origins can be processed i parallell.
So the threads must be coordinated to avoid working on the same origin at the same time.
Anyway, I have solved this now by using one scheduler that populates a java.util.concurrent.BlockingQueue. My worker threads feed of the blockingqueue, and the swchedulerwaits for all threads to die before finishing.
Unless starting threads from my scheduler should be avoided, I believe this is a simple solution.