views:

33

answers:

1

Say I want to add a note to a specific future firing of a CronTrigger in Quartz.

Is it possible to identify a specific future firing in such a way that I can give other objects a reference to it?

+1  A: 

You can add "notes" to a trigger's JobDataMap. When the trigger fires, those notes can guide that particular occurrence of the job to do something special.

What do you mean by "identify a specific future firing in such a way that I can give other objects a reference to it?" Are you trying to give the job a reference to some object that was available at when the trigger was added? If its not an object that can be persisted in the JobDataMap, you can store its name instead, and use a name service (JNDI, a getBean call into Spring, or whatever is appropriate for your environment) to get the object.

erickson
Looping over getFireTimeafter(Date) I can figure out that a CronTrigger will fire at a given point in time in the future, several 'firings' ahead. The question is whether there's any way to refer to that future firing right now, I guess. Still figuring the semantics out on this tbh, not sure the Quartz API supports what I'm trying to do.
Brabster