1 22 package org.objectweb.petals.kernel.jmx; 23 24 import javax.management.remote.JMXConnectorServer ; 25 26 import org.objectweb.petals.util.LoggingUtil; 27 28 38 public class StopJMXServerThread extends Thread { 39 40 43 protected JMXConnectorServer cs; 44 45 48 protected LoggingUtil log; 49 50 public StopJMXServerThread(JMXConnectorServer cs, LoggingUtil log) { 51 super(); 52 this.cs = cs; 53 } 54 55 public void run() { 56 try { 57 Thread.sleep(1000); 58 if (cs != null) { 59 cs.stop(); 60 if (log != null) { 61 log.debug("JMX server at " + cs.getAddress() + " stopped"); 62 } 63 } 64 } catch (Exception e) { 65 if (log != null) { 66 log.error("Problem while stopping the JMX server", e); 67 } 68 } 69 } 70 71 } 72 | Popular Tags |