This content has been marked as final.
Show 1 reply
-
1. Re: Scheduled Tasks in JBOSS ?
heismann Jan 13, 2004 4:50 PM (in response to ratheeshramachandran)Look into using a TimerMBean
Here's an incomplete example:ArrayList al = MBeanServerFactory.findMBeanServer(null); server = (MBeanServer) al.get(0); Timer timer = new Timer(); timerName = new ObjectName("ex.Timer:type=TimerService,name=ex.Cache"); DataRefresher dataRefresher = new DataRefresher(); timer.addNotificationListener(dataRefresher,null,null); timer.addNotification("ex.Timer:type=TimerService,name=ex.Cache", "ex.Timer:type=TimerService,name=ex.Cache", null, startDate, period); server.registerMBean(timer, timerName); server.invoke(timerName,"start",new Object[0],new String[0]);