We're using a combination of the latest Fulcrum scheduler (CVS HEAD) and *nix crond. Though we do use it, we found the scheduler service poorly documented and difficult to work with. In this case, I would rather see the existing scheduler replaced entirely, preferably with something which better emulates the functionality of Vixie cron, but is easier to setup configuration for. Perhaps the some of the existing service code could be salvaged with a non-backwards compatible overhaul, which I'd be +1 on.
- Dan "Eric Pugh" <[EMAIL PROTECTED]> writes: > I am looking forward to seeing these changes.. I am going to be using > Turbine primarily for running a series of scheduled jobs that do various > tasks.. Being able to stop and start them will be very useful to me. I > would love to see this code, and help as I dig into this aspect. > > What code base are people using for scheduled jobs? T2.1 or T2.2? Or T3? > > -----Original Message----- > From: David Wynter [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 24, 2002 11:58 AM > To: Turbine Users List > Subject: RE: How do you stop long running scheduled jobs? > > > I have researched this problem further. Basically the > TurbineSchedulerService is not really suited to being able to intervene in > currently running jobs. Since my application can have jobs that run for a > couple of hours it is very useful to be able to kill them off without having > to stop Tomcat to do it. > > It looks like I am going to have to extend (replace) TurbineSchedulerService > to achieve my end. This would involve caching all threads started by > MainLoop in TurbineSchedulerService. The cache would be keyed on > je.toString() and hold a reference to the Thread object. An additional > method in TurbineSchedulerService ( public Thread > getJobEntryThread(je.toString()) ) would allow the user to pass in a > je.toString() argument and have the Thread returned. Then the caller could > use the method interrupt() which would interrupt the WorkerThread which in > turn used ScheduledJobLoader to get an instance of and run the ScheduledJob > object. I assume this means the ScheduledJob is running in that Thread and > will respond to the Thread.isInterrupted() call so we can then go about > shutting the job down gracefully. > > Comments, ideas, alternatives? > > David > -----Original Message----- > From: David Wynter [mailto:[EMAIL PROTECTED]] > Sent: 24 April 2002 14:07 > To: Turbine-User > Subject: How do you stop long running scheduled jobs? > > > I have a screen that shows an active jobs running as a result of the > TurbineScheduledJob service running them. I have an action as a result of > that screen that returns a list of active jobs I want to terminate. It seems > the best way to do this in Java is Thread.interrupt() them. > > So in my action class I have the following code: > > if(je.isActive()) { > > if(aData.getParameters().getString(aSchedule.getScheduleName()) != null) { > ScheduledJob > runningjob=ScheduledJobLoader.getInstance().getInstance(je.getTask()); > // How do I get the Thread that this job is > running in so I can call interrupt()? > } > } > > The job itself has been modified so that the main loop where it does it's > work has: > > try > { while( !Thread.interrupted() ) > { > // Do your work > } > } > catch( InterruptedException e ){/*terminate thread by returning*/} > > Any ideas on this or a different way of doing it? -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
