You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Jason van Zyl <jv...@apache.org> on 2001/06/27 21:08:50 UTC

Decoupling the Scheduler service

Hi,

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.

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Decoupling the Scheduler service

Posted by Jason van Zyl <jv...@apache.org>.
On 6/27/01 3:35 PM, "Rafal Krzewski" <Ra...@e-point.pl> wrote:

> 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.

Lots of things are similar to modules, but I think our standard
nomenclature uses modules to refer to the view pipeline. There
is a simple scheduler service that uses properties, and the peers
are even ok for now. I just want to get of the module part.
 
> 
> As for the interface:
> 
> public interface Job
> {
> public void run();
> public void terminate(Thread thread);
> }

Yup, simple enough.
 
> 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)

Yup.
 
> 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.

I don't actually _want_ to do it myself :-) There's a PoolService
in Turbine already, I'll take a peek at using it if no one
else wants to give it a whirl.

Thanks,

 
> Rafal
> 
> --
> mgr inz. Rafal Krzewski
> Senior Internet Developer
> mailto:Rafal.Krzewski@e-point.pl
> +48 22 8534830 http://e-point.pl
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: Decoupling the Scheduler service

Posted by Rafal Krzewski <Ra...@e-point.pl>.
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:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org