开发者

Triggering Quartz job from JSF (Any front end)- How to wait for the job execution to be over

I am developing a front end to trigger a quartz job on the fly. I have a form in the JSF page whose click action will dynamically trigger a quart开发者_开发问答z job.

The job is invoked by the following statement, the job is triggered and everything works fine.

scheduler.triggerJob("Job1",Scheduler.DEFAULT_GROUP,jobDataMap);

From what I understand the job seems to run in a separate thread and the execution of the calling function does not wait for the job to be over.

Since I am invoking the job from front end, I would like to wait till the job is over before I navigate to a different JSF page. So I can display an error message if the job fails. I would also like to display a message to the user, "Processing job, please wait.." until the job is actually over.

Any ideas on how to accomplish this will be appreciated.

Thanks !


You can register a Trigger/Job Listener to be notified when a Quartz job has completed.

How you would get that asynchronous update back to the user in JSF, I'm not so sure. I would expect a good solution to depend on your application architecture, the version of JSF, and maybe even the library support you have available. It does sound like the kind of thing you'd expose as a pollable service and use an AJAX-updated component to me, though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜