|
Replies:
4
-
Last Post:
Sep 8, 2006 8:47 AM
by: demiant
|
|
|
|
|
|
|
Schedule method executions
Posted:
Sep 8, 2006 7:03 AM
|
|
|
Hi,
Assuming I need some methods to be executed during specific times or per constant interval (for example a process that go through all orders within the system and make sure all of them were paid in time),
is it possible to schedule these method executions through GF? or I have to use an external scheduler such as http://www.opensymphony.com/quartz/
Thanks a lot,
Demian
|
|
|
|
|
|
|
Re: Schedule method executions
Posted:
Sep 8, 2006 8:01 AM
in response to: demiant
|
|
|
HI Demian,
You can do this portably via the EJB Timer Service, which allows you to schedule either one-time or periodic event notifications that are delivered to either a stateless session bean or message-driven bean. Chapter 22 in the Java EE 5 Tutorial that can get you started :
http://java.sun.com/javaee/5/docs/tutorial/doc/
--ken
|
|
|
|
|
|
|
|
Re: Schedule method executions
Posted:
Sep 8, 2006 8:24 AM
in response to: ksak
|
|
|
Hey,
I already have seen this chapter and read it, but my problem is that I cant find a way to create a timer automatically when the application is deployed,
I dont want any client to create the timer explicitly
thanks!
|
|
|
|
|
|
|
|
Re: Schedule method executions
Posted:
Sep 8, 2006 8:41 AM
in response to: demiant
|
|
|
The hack that I use, and seem to see in popular use, is to have a servlet that is loaded on deploy and is not bound to any URL, to prevent access. Then in the servlet's init() method, you call the init methods of each EJB that needs to be added to the Timer service.
--Scott
|
|
|
|
|
|
|
|
Re: Schedule method executions
Posted:
Sep 8, 2006 8:47 AM
in response to: sbalmos
|
|
|
heh, didnt think about this,
thanks !
|
|
|
|
|