[jboss-user] [EJB/JBoss] - Use JNDI to implement a singleton timer?

yanfengzhang do-not-reply at jboss.com
Mon Feb 11 09:08:38 EST 2008


Hi there,
I'm trying to implement a global singleton timer in my EJB application. 
The timer is created by calling the following function:

Timer timer = timerService.createTimer(initialDuration, intervalDuration, description);
  | 

We plan to deploy our application in a clustered environment, and the timer should be created once and only once ( a singleton actually). 

Can I use JNDI to hold the timer instance (or timer handle instance) and then check whether there is already a timer instance by JNDI lookup? will this idea work in a clustered environment? How can I manipulate JNDI context in EJB code?

Thanks in advance! 


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128368#4128368

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128368



More information about the jboss-user mailing list