You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Fabio Daprile <fa...@wuerth.it> on 2002/01/08 15:31:32 UTC

Sceduled jobs!

 Hi,

I've come to the point, in my application development, where i have to 
design jobs that need to run at fixed intervals (each week typically)
I know there is a Sceduling service, but have no idea how to use it.

Somebody can help me with a clear and simple example.

Thx very much!

Fabio


-- 


Würth Phoenix Srl
Via Kravogl 4, I-39100 Bolzano
Tel: +39 0471/564111
Fax: +39 0471/564122

mailto:fabio.daprile@wuerth-phoenix.com
http://www.wuerth-phoenix.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Sceduled jobs!

Posted by David Wynter <da...@btclick.com>.
Fabio,

This is pretty much straight out of the section on services in the
documentation:

                        //access the service singleton
                        ScheduleService ss =
(ScheduleService)TurbineServices
                            .getInstance()
                            .getService(ScheduleService.SERVICE_NAME);

                        //create a new JobEntry with the time constraints
from
                        //the template as the arguments
                        JobEntry je =  new JobEntry(second,
                                                    minute,
                                                    hour, dow, dom, task);

                        //set the email for notification
                        je.setEmail("");
                        taskProps.put("rwScheduleId",
                                      schedule.getPrimaryKey());
                        taskProps.put("linkedtaskdelay",
                                      parser.getString("runafter","120"));

                        //add the HashMap of arguments
                        je.setProperty(taskProps);

                        //add the job to the queue
                        ss.addJob(je);

Have fun. For the values of second, minute, hour etc. see the JavaDoc. There
is a properties file version as well of you don't want to use the database
to store the job entries.

David

-----Original Message-----
From: Fabio Daprile [mailto:fabio.daprile@wuerth.it]
Sent: 08 January 2002 14:32
To: turbine-user@jakarta.apache.org
Subject: Sceduled jobs!


 Hi,

I've come to the point, in my application development, where i have to
design jobs that need to run at fixed intervals (each week typically)
I know there is a Sceduling service, but have no idea how to use it.

Somebody can help me with a clear and simple example.

Thx very much!

Fabio


--


Würth Phoenix Srl
Via Kravogl 4, I-39100 Bolzano
Tel: +39 0471/564111
Fax: +39 0471/564122

mailto:fabio.daprile@wuerth-phoenix.com
http://www.wuerth-phoenix.com



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>