0 Replies Latest reply on Feb 11, 2008 9:08 AM by yanfengzhang816

    Use JNDI to implement a singleton timer?

    yanfengzhang816

      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!