This content has been marked as final.
Show 3 replies
-
1. Re: scheduler-service
arshadsa Feb 7, 2006 11:55 AM (in response to hassanm)I did the same way but for me, my class not even running!
Could you help me how to run a scheduler which has to fire an event at every hour! -
2. Re: scheduler-service
tylerblack Feb 7, 2006 1:13 PM (in response to hassanm)"hassanm" wrote:
Hi, I wrote a class to be executed as a scheduled service, and made an entry accordingly in scheduler-service.xml
...
Now one way I thought to solve the problem was to make scheduler-service start after deployment of application. Now does anyone know how to do that?
How is your application deployed?
How is the SchedulableClass that you wrote deployed?
I would suggest one of 2 solutions:- In scheduler-service.xml, after the opening element and before the elements, put a < depends > element with your application/service's name, that contains your SchedulableClass, as is appears in your jmx-console. Something like:
<depends>hassanm:service=SuperCoolApp</depends>
- Package your SchedulableClass in a .jar and deploy it in the lib directory of your jboss configuration (all/default/whatever).
Hope this helps.
-
3. Re: scheduler-service
tylerblack Feb 7, 2006 3:03 PM (in response to hassanm)"arshadsa" wrote:
I did the same way but for me, my class not even running!
Could you help me how to run a scheduler which has to fire an event at every hour!
Edit scheduler-config.xml to say<mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler"> <attribute name="StartAtStartup">true</attribute> <attribute name="SchedulableClass">your.fully.qualified.classname.GoesHere</attribute> <attribute name="SchedulableArguments">consructor param values go here</attribute> <attribute name="SchedulableArgumentTypes">constructor param types go here</attribute> <attribute name="InitialStartDate">0</attribute> <attribute name="SchedulePeriod">60000</attribute> <attribute name="InitialRepetitions">-1</attribute> </mbean>
You class must implement org.jboss.varia.scheduler.Schedulable, and have a constructor with the parameters you specified.
Hope this helps