0 Replies Latest reply on Apr 27, 2007 11:36 AM by Nikolajs Krasnikovs

    Accessing Scheduler throgh JNDI

    Nikolajs Krasnikovs Newbie


      I am choosing curently between TimerService and JBoss Schedulers for running repeated requests with given timeout...

      I tried to use JBoss Scheduler with "StartAtStartup" = true, generally haven't found any issues, worked Ok.

      The question is - can I start and stop the Scheduler programmatically ? I.e. there is a EJB which I would like to start and stop Scheduler. I assume the start() and stop() methods in org.jboss.varia.scheduler.Scheduler are doing exactly this.

      The trouble is, I cannot understand how to access the Scheduler service from my EJB . I need to pass JNDI name to InitialContext, right >

      new InitialContext(). lookup( some name here );

      the snippet from jboss-service.xml is :

      <mbean code="org.jboss.varia.scheduler.Scheduler"
       <classpath codebase="deploy/WSAsyncEJBClient" archives="WSAsyncEJBClient.jar"/>
       <attribute name="StartAtStartup">false</attribute>
      </mbean >

      I wonder if JNDI name should match mbean name, or something else.