David,

I am trying to dig farther into some of the ideas that you have brought up..
After looking at my code, I realized an issue...  I want to have a Task be
run at a scheduled time.  But I also want to run that same task on demand.
I looked, and it seems that I ought to be able to add an action that adds it
to the ScheduleService...  However, I am worreid that if my job that is
scheduled is called SimpleSheduledTask, and them I manually add another one
called SimpleSheduledTask, the new one will wipe the old one out...  So, is
it to get around this issue that you created the parallel class for?  

Also, I am not quite sure how to destroy the JobEntry  after it has run..

If you have some sample code that is not proprietary, I would love to see
it.

I see what you mean about the non running jobs starting to accumulate, at
least though my jobs are loaded from TR.props, not the database, so they
will get cleaned up eventually.

Eric

-----Original Message-----
From: David Wynter [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 28, 2001 12:30 PM
To: Turbine Users List
Subject: RE: One Time run of Scheduler Job?


I have had to grapple with this and ended up adding a parallel class that
destroys the JobEntry after it has run the once. It does this when the
SchedulerJob subclass associated with the JobEntry runs and tells it to do
it. The user still has a record of the CRON details so can run again by
putting in a new time (in the future) to run and the parallel class
re-creates the Job Entry object.

But this is pretty ugly as keeping a track of whether the related JobEntry
exists or not is a pain.

I think I noticed that you can set some illegal values for some of the CRON
attributes, like day of month is set to 32 and it remains in the database
but does not run, some other time values however cannot be used for this
because the SchedulerService complains. So then you just need the
ScheduledJob subclass to change the oneshot JobEntry CRON attribute value
after running the job to makes sure it does not run again. The only problem
is cleaning up these non running jobs at some point.

Hope this helps

David

-----Original Message-----
From: Pugh, Eric [mailto:[EMAIL PROTECTED]]
Sent: 27 December 2001 22:54
To: 'Turbine Users List'
Subject: One Time run of Scheduler Job?


Hi,

I want to be able to queue up a job to run exactly once, sometime in the
future...  I would like to use the Scheduler framework that comes in TDK
2.1...

I can see how I would create a jobentry that maybe was set to sometime in
the next month based on putting in a day_mo value, and populating the min
and hour values.  However, that would cause it to run every month...  I am
using the TurbineNonPersitentSchedulerService, so as long as the server gets
bounced in the next 31 days, I would be in the clear, but is there any other
more elegent way?

Eric

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


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

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

Reply via email to