[jboss-user] [EJB/JBoss] - Re: Scheduler vs. EJB Timer Service

torf do-not-reply at jboss.com
Thu Dec 14 06:20:45 EST 2006


Hi,

we call a SLSB from a org.jboss.varia.scheduler.Scheduler implementation, and our deployment goes like this:

deploy/applications/MyApp/ contains:
- MyApp-all.ear
- MyApp-api.jar

deploy-hasingleton/applications/MyApp/MyApp-timer-service.xml:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <server>
  |   <classpath codebase="deploy/applications/MyApp" archives="MyApp-api.jar"/>
  |   <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler,schedule=MyApp">
  |     <depends>jboss.j2ee:service=EARDeployment,url='MyApp-all.ear'</depends>
  |     <attribute name="StartAtStartup">true</attribute>
  |     <attribute name="SchedulableClass">our.company.framework.timer.TimedObjectSchedulableRemote</attribute>
  |     <attribute name="SchedulableArguments">ejb/MySchedulerTimer</attribute>
  |     <attribute name="SchedulableArgumentTypes">java.lang.String</attribute>
  |     <attribute name="InitialStartDate">0</attribute>
  |     <attribute name="SchedulePeriod">60000</attribute>
  |     <attribute name="InitialRepetitions">-1</attribute>
  |   </mbean>
  | </server>
  | 

our.company.framework.timer.TimedObjectSchedulableRemote has a String-arg constructor which is invoked with argument "ejb/MySchedulerTimer". Its perform method looks up the remote home "ejb/MySchedulerTimer" in JNDI, reflectively invokes create(), and then  (non-reflectively) the SLSB business method.

our.company.framework.timer.TimedObjectSchedulableRemote is contained in server/$SERVER_CONF/lib/our-framework.jar.

Regards,
Christoph

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

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



More information about the jboss-user mailing list