1 22 package org.jboss.ha.singleton.examples; 23 24 import org.jboss.logging.Logger; 25 26 35 public class HASingletonMBeanExample 36 implements HASingletonMBeanExampleMBean 37 { 38 private static Logger log = Logger.getLogger(HASingletonMBeanExample.class); 39 private boolean isMasterNode = false; 40 41 public void startSingleton() 42 { 43 isMasterNode = true; 44 log.info("Notified to start as singleton"); 45 } 46 47 public boolean isMasterNode() 48 { 49 return isMasterNode; 50 } 51 52 public void stopSingleton( String gracefulShutdown ) 53 { 54 isMasterNode = false; 55 log.info("Notified to stop as singleton with argument: " + gracefulShutdown); 56 } 57 58 } 59 | Popular Tags |