-
1. Re: Working with Timer service
adrian.brock Nov 8, 2002 1:53 PM (in response to pazu)You might want to look at scheduler-service.xml,
it is more user friendly than the plain jmx timer.
You don't need to worry about creating/starting
the timer or registering the notification listener.
You can also add so the scheduled task
won't start until the ejb(s) are deployed.
Regards,
Adrian -
2. Re: Working with Timer service
jdeng Nov 11, 2002 10:26 PM (in response to pazu)Adrian,
I understand what you are saying. But I have similar problem because I am trying the build an application that will run across most application servers (JBoss being one of them). Even though J2EE does not specify what timer service to use. But the most prevelent one seems to be the javax.management.timer.Timer, which works for other application server such as WebLogic. But it seems to have problem inside jboss receiving timer notification (hanndleNotification not called). I am registering with the Timer using following code snippet:
timer = new Timer();
if (!timer.isActive()) {
timer.start();
}
timer.addNotificationListener(this, this, null);
My question to you is what is the limitation of using Timer inside jboss?
Jie -
3. Re: Working with Timer service
adrian.brock Nov 12, 2002 11:00 AM (in response to pazu)You have to register the timer in the MBeanServer.
You have to get add a notifiction id
where you configure the repeats, start time, etc.
The jmx timer is pretty simple and requires a lot
of booking keeping. If it fits your purpose there
are no limitations.
Regards,
Adrian -
4. Re: Working with Timer service
jdeng Nov 15, 2002 7:48 PM (in response to pazu)Thanks Adrian. Your suggestion is on the point. Besides what you suggested I also have to create a little wrapper on top of timer MBean. You can not direcly use javax.management.timer.Timer directly. But the wrapping is really simple. This way you can basically write a universal scheduler that works across all application server.
Jie