[jboss-user] [EJB/JBoss] - Accessing Scheduler throgh JNDI

Nikolajs1968 do-not-reply at jboss.com
Fri Apr 27 11:36:28 EDT 2007


Hello,

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"
  |            name=":service=Scheduler,schedule=WSAsyncEJBClient">
  |        <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.

Thanks,
Nik



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

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



More information about the jboss-user mailing list