1 24 package org.objectweb.jalisto.se.jmx; 25 26 import org.objectweb.jalisto.se.api.jmx.JalistoMBeanServer; 27 import org.objectweb.jalisto.se.jmx.exception.MBeanAdminException; 28 29 public class JalistoMbeanServerFactory implements JalistoMBeanServer { 30 31 public JalistoMbeanServerFactory() { 32 } 33 34 public void addSession(String s) { 35 instance.addSession(s); 36 } 37 38 public void init(String propertiesPath) { 39 try { 40 if (instance == null) { 41 String className = "org.objectweb.jalisto.se.jmx.server.mx4j.JalistoMbeanServerMx4jImpl"; 42 instance = (JalistoMBeanServer) Class.forName(className).newInstance(); 43 } 44 } catch (Exception e) { 45 throw new MBeanAdminException("could not instanciate any MBean JalistoServer implementation", e); 46 } 47 instance.init(propertiesPath); 48 } 49 50 public boolean isAlive() { 51 return instance.isAlive(); 52 } 53 54 public void run() { 55 instance.run(); 56 } 57 58 JalistoMBeanServer instance; 59 } 60 | Popular Tags |