[jboss-user] [Management, JMX/JBoss] - Re: Scheduler Jboss

kresho do-not-reply at jboss.com
Tue Sep 12 05:07:32 EDT 2006


Here's an workaround - you can programatically reschedule your schedulable mbean after you finish the nightly job:
private void reschedule() {
  | 	try {
  | 		ObjectName scheduler = new ObjectName("hr.chipoteka.erp.nightly-tasks:service=Scheduler");
  | 		MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
  | 		server.invoke(scheduler, "restartSchedule", new Object[0], new String[0]);
  | 	} catch (Exception e) {
  | 		// log the failure or whatever
  | 	}
  | }
Of course, replace hr.chipoteka.erp.nightly-tasks:service=Scheduler with your schedulable mbean's name.

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

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



More information about the jboss-user mailing list