1 22 package org.jboss.ejb3.timerservice.quartz.jmx; 23 24 import java.util.Properties ; 25 26 import javax.management.ObjectName ; 27 28 import org.jboss.ejb3.timerservice.quartz.QuartzTimerServiceFactory; 29 import org.jboss.system.ServiceMBeanSupport; 30 31 37 public class EJB3TimerService extends ServiceMBeanSupport 38 implements EJB3TimerServiceMBean 39 { 40 private QuartzTimerServiceFactory delegate; 41 private ObjectName dataSource; 42 43 public EJB3TimerService() 44 { 45 delegate = new QuartzTimerServiceFactory(); 46 } 47 48 @Override 49 protected void createService() throws Exception 50 { 51 super.createService(); 52 } 53 54 @Override 55 protected void destroyService() throws Exception 56 { 57 super.destroyService(); 59 } 60 61 66 public ObjectName getDataSource() 67 { 68 return dataSource; 69 } 70 71 74 public void setDataSource(ObjectName dataSource) 75 { 76 this.dataSource = dataSource; 77 } 78 79 84 public void setProperties(final Properties props) 85 { 86 delegate.setProperties(props); 87 } 88 89 94 public void setSqlProperties(Properties props) 95 { 96 delegate.setSqlProperties(props); 97 } 98 99 @Override 100 protected void startService() throws Exception 101 { 102 super.startService(); 103 String jndiName = (String ) server.getAttribute(dataSource, "BindName"); 104 delegate.setDataSource(jndiName); 105 delegate.start(); 106 } 107 108 @Override 109 protected void stopService() throws Exception 110 { 111 delegate.stop(); 112 super.stopService(); 113 } 114 } 115 | Popular Tags |