RE: scheduler service
Nathan Kontny <Nathan.Kontny-UgwZ4owrJFB8UrSeD/[email protected]> Tue, 10 Aug 2004 19:09:38 -0700
| Newsgroups | gmane.comp.java.keel.user |
|---|---|
| Message-ID | <[email protected]> |
Lou,
Here is also what I had to do to schedule a job. I do this in my model's
execute method(ModelRequest req). Then to schedule this, I call this model
from a browser. I hope this helps and sorry if I restate what you already
knew. :
Model scheduler = (Model) request
.getService(Model.ROLE, "quartzjobschedulemodel");
ModelRequest req = (ModelRequest) request
.getService(ModelRequest.ROLE, "default");
req.setParameter("role", Model.ROLE);
req.setParameter("hint", "iron.close-auctions");
//This job will run every 30 seconds
req.setParameter("seconds", "30");
req.setParameter("minutes", "*");
ModelResponse scheduleResponse = scheduler.execute(req);
Quoting Louis Moore <[email protected]>:
> Still no luck with this...So, is the layout of my schedulable model
> correct below? (Implement schedulable, and then call execute() from
> within execute(ModelRequest req))
>
> The log entries I'm expecting to see would show up in the keel logs,
> correct? Or do I need to set up quartz to log to a file as well? I
> haven't had any luck doing that by modifying the log4j.properties file
> that's in the quartz service conf.
>
> Thanks,
> Lou
>
>
> -----Original Message-----
> From: user-keelframework.org-admin-rI8AND0JKYOgdSakss0wQjfEH8FBEnyy@public.gmane.org
> [mailto:user-keelframework.org-admin-rI8AND0JKYOgdSakss0wQjfEH8FBEnyy@public.gmane.org] On Behalf
> Of Michael Nash
> Sent: Sunday, August 08, 2004 3:22 PM
> To: user-6VIttnCrOeJXNEnpj1eHPNi2O/[email protected]
> Subject: Re: [Keel User] scheduler service
>
> Lou:
>
> >From the below, it certainly looks like you're calling the Scheduler
> correctly....
>
> I'm using Scheduler on a project right now, so I've just recently run
> it's unit test suite, and it passed - but let me do a couple of
> practical tests and see what I'm getting here.
>
> Mike
>
> On Fri, 2004-08-06 at 17:14, Louis Moore wrote:
> > I'm trying to use the quartz scheduler service to schedule a model. It
> > seems from the documentation to be pretty straightforward, but I
> haven't
> > been able to get it to work. The logs show that the job has been
> > scheduled correctly and the next run time is correct:
> >
> > INFO 2004-08-06 14:05:51.051 [svc-schedule-quartz]
> >
> (/org.keel.services.schedule.quartz.QuartzScheduler.scheduleCronJob(Quar
> > tzScheduler.java:214)): Scheduling Quartz job job-1 in group DEFAULT
> > INFO 2004-08-06 14:05:51.051 [svc-schedule-quartz]
> >
> (/org.keel.services.schedule.quartz.QuartzScheduler.scheduleCronJob(Quar
> > tzScheduler.java:249)): Scheduled Quartz job job-1, next:Fri Aug 06
> > 14:06:00 PDT 2004, model:scheduler.refreshremedy-job, cron: 0 0/3 * *
> *
> > ? *
> >
> > But when that time comes, nothing happens at all. No error messages,
> > nothing in the logs, no execution of the job. I'm hoping I'm missing
> > something obvious that somebody can point out. Here's the model I'm
> > trying to execute, which is basically just taken from one of the
> quartz
> > service test classes. Is something wrong here?:
> >
> > /**
> > * @avalon.component
> > * @avalon.service type=org.keel.services.model.Model
> > * @x-avalon.info name=scheduler.refreshremedy-job
> > * @x-avalon.lifestyle type=singleton
> > */
> > public class RefreshRemedyJob extends StandardLogEnabledModel
> > implements Schedulable{
> >
> > public ModelResponse execute(ModelRequest req) throws
> > ModelException {
> >
> > ModelResponse res = req.createResponse();
> > log.info("Calling execute() method for Schedulable
> > interface");
> > this.execute();
> > return res;
> > }
> >
> > public void execute(){
> >
> > log.info("Begin execution of model batch job");
> > //Business logic goes here....
> > log.info("Finished running model batch job");
> > }
> > }
> >
> > Thanks,
> > Lou
> >
> > _______________________________________________
> > User mailing list
> > [email protected]
> > http://lists.keelframework.org/listinfo.cgi/user-keelframework.org
>
> _______________________________________________
> User mailing list
> [email protected]
> http://lists.keelframework.org/listinfo.cgi/user-keelframework.org
>
> _______________________________________________
> User mailing list
> [email protected]
> http://lists.keelframework.org/listinfo.cgi/user-keelframework.org
>