Jason van Zyl wrote:

> Does anyone want to take a stab at decoupling the scheduler
> from Turbine. I don't think a scheduled job should be a module.
> I think that modules are responsible for the view pipeline and
> nothing else.
> 
> If someone could come up with a simple interface for a job
> possibly, or some way to get rid of Turbine references in
> the scheduler service that would be great. I will do if
> no one else steps up, but I don't really use the scheduler
> so it might burp if I make the changes.

Job is similar to module in a way - you might want to use BSF
service to have scripted jobs. I think that it is a quite
nice feature. 

As for the interface:

public interface Job
{
  public void run();
  public void terminate(Thread thread);
}

terminate is for asking the job to stop in an orderly manner
(synchronous, or 'asynchronous but ASAP') when the system
is shutting down. The thread parameter should allow access
to the thread running this instance of the Job, in case
the Job wants to use interrupt() or stop() (yes, this is 
neccessary in certain situations)

I think that commons have some stuff for thread pooling.
You can also take my implementation of PoolService (you
know where to look for it Jason). I can mail it to you
with a 'code donated to the ASF' disclaimer.

Rafal

--
mgr inz. Rafal Krzewski
Senior Internet Developer
mailto:[EMAIL PROTECTED]
+48 22 8534830 http://e-point.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to