I have been running a java based process that uses the ScheduLerThread to 
execute timers.

new SchedulerThread().start()

When the process completed, the SchedulerThread would continue running 
indefinitely, until I read a couple of posts and came up with this solution.

I think it gets around an existing issue that prevents the SchedulerThread from 
being stopped by the outside application.

CODE TO START THE SchedulerThread:

  |     StoppableSchedulerThread  schedulerThread = new 
StoppableSchedulerThread();
  |     schedulerThread.start();
  | 

CODE TO STOP THE SchedulerThread:

  |       // Stop the scheduler thread
  |       // the SchedulerThread will stop after a few seconds
  |       schedulerThread.stopRunning();
  | 

CODE FOR StoppableSchedulerThread.java:

  | package org.jbpm.scheduler.impl;
  | 
  | public class StoppableSchedulerThread extends SchedulerThread
  | {
  |   public void stopRunning()
  |   {
  |     super.keepRunning = false;
  |   }
  | }
  | 




View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978679#3978679

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978679
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to