This content has been marked as final.
Show 4 replies
-
1. Re: Controlling the quartz scheduler from EJB with the quart
vickyk Jul 7, 2008 3:34 AM (in response to henk53)"henk53" wrote:
If I needed such kinds of interactions from my code to quartz from within an EJB bean, how would I go about doing that using the quartz RA?
Have you tried using the JobExecutionContext to get the Schedule etc ... , I can see that it would be possible from the API
http://quartz.sourceforge.net/javadoc/org/quartz/JobExecutionContext.html#method_summary -
2. Re: Controlling the quartz scheduler from EJB with the quart
henk53 Jul 11, 2008 5:39 PM (in response to henk53)"vickyk" wrote:
"henk53" wrote:
If I needed such kinds of interactions from my code to quartz from within an EJB bean, how would I go about doing that using the quartz RA?
Have you tried using the JobExecutionContext to get the Schedule etc ... , I can see that it would be possible from the API
http://quartz.sourceforge.net/javadoc/org/quartz/JobExecutionContext.html#method_summary
That would indeed perhaps be an option if the job that was triggered by Quartz needed to programmatically schedule a new job. In my case however I need access to the scheduler to programmatically create a trigger and a job before any job has actually executed yet.
My scenario is basically that a message arrives in a MDB and based on the content of that message a decision is made to schedule a job to run at e.g. a specific time. Therefor neither static annotations nor the context given to a job when it starts executing is really helpful.
Some other option I thought about was letting quartz run in it's own web app within the same AS and letting it put a reference to the scheduler in JNDI when it starts up. That wise jobs will be triggered in the web app context and invoke EJB3 code in the EJB3 container. EJB3 code on its turn picks up the reference to the scheduler via JNDI and would use it to schedule new jobs dynamically.
I wonder however whether there is some mechanism being provided by the quartz resource adapter for this. -
3. Re: Controlling the quartz scheduler from EJB with the quart
henk53 Jul 18, 2008 8:53 AM (in response to henk53)Nobody has any more ideas?
-
4. Re: Controlling the quartz scheduler from EJB with the quart
atijms Jul 29, 2008 12:34 PM (in response to henk53)I'm wondering about this too, but don't know the solution either.
Maybe I'll have to look into the JCA specs and (if available) the current Quartz RA source code to see how challenging it is to add outflow capabilities to it. I'm afraid though that it probably won't be the easiest or fastest solution, so if anyone knows of something I would like to hear it too ;)