[jboss-user] [Management, JMX/JBoss] - Re: jboss sheduler issue

Pop Octavian do-not-reply at jboss.com
Fri Oct 12 03:06:29 EDT 2007


A simple way to create a sceduler is to implement Schedulable interface, you have to implement public void perform(Date data, long l) method.
This interface is found in sceduler-plugin.jar, for jboss 4.0.5.

A sample cod is:

public class MyScheduler implements Schedulable
  | {
  |        public void perform(Date data, long l)
  | 	{
  | 		execute();
  | 	}
  | }
  | 
and the deployment descriptor from jboss-service is:

<server>
  |         <mbean code="org.jboss.varia.scheduler.Scheduler"
  |                 name="acme:service=Scheduler">
  |                 <attribute name="StartAtStartup">true</attribute>
  |                 <attribute name="SchedulableClass">MyScheduler</attribute>       
  |                 <attribute name="InitialStartDate">NOW</attribute>
  |                 <attribute name="SchedulePeriod">60000</attribute>
  |                 <attribute name="InitialRepetitions">-1</attribute>     
  |         </mbean>
  | </server>

I hope it helps you.



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

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



More information about the jboss-user mailing list