You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Angelo C." <an...@gmail.com> on 2012/07/30 03:28:48 UTC

PeriodicExecutor

Hi,

I put following code to start a job, it runs every min,  I'd like it to run
once it is loaded, then every min, possible? thanks.

@Startup
   public static void scheduleJobs(
           PeriodicExecutor executor,
           final Jobs jobs) {

       executor.addJob(
               new IntervalSchedule(1000L*60*60),
               "Job",
               new Runnable() {
                   public void run() {
                       jobs.hourlyrun();
                   }
               });
   }



--
View this message in context: http://tapestry.1045711.n5.nabble.com/PeriodicExecutor-tp5714867.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: PeriodicExecutor

Posted by Howard Lewis Ship <hl...@gmail.com>.
How about a @PostInjection method on the service implementation to
perform the addJob() call?

On Sun, Jul 29, 2012 at 6:28 PM, Angelo C. <an...@gmail.com> wrote:
> Hi,
>
> I put following code to start a job, it runs every min,  I'd like it to run
> once it is loaded, then every min, possible? thanks.
>
> @Startup
>    public static void scheduleJobs(
>            PeriodicExecutor executor,
>            final Jobs jobs) {
>
>        executor.addJob(
>                new IntervalSchedule(1000L*60*60),
>                "Job",
>                new Runnable() {
>                    public void run() {
>                        jobs.hourlyrun();
>                    }
>                });
>    }
>
>
>
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/PeriodicExecutor-tp5714867.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org