1 17 18 package org.apache.catalina.mbeans; 19 20 21 import javax.management.InstanceNotFoundException ; 22 import javax.management.MBeanException ; 23 import javax.management.MBeanServer ; 24 import javax.management.RuntimeOperationsException ; 25 import org.apache.catalina.Server; 26 import org.apache.catalina.ServerFactory; 27 import org.apache.catalina.core.StandardServer; 28 import org.apache.tomcat.util.modeler.BaseModelMBean; 29 30 31 38 39 public class StandardServerMBean extends BaseModelMBean { 40 41 42 44 45 48 private static MBeanServer mserver = MBeanUtils.createServer(); 49 50 51 53 54 63 public StandardServerMBean() 64 throws MBeanException , RuntimeOperationsException { 65 66 super(); 67 68 } 69 70 71 73 74 76 77 88 public synchronized void store() throws InstanceNotFoundException , 89 MBeanException , RuntimeOperationsException { 90 91 Server server = ServerFactory.getServer(); 92 if (server instanceof StandardServer) { 93 try { 94 ((StandardServer) server).storeConfig(); 95 } catch (Exception e) { 96 throw new MBeanException (e, "Error updating conf/server.xml"); 97 } 98 } 99 100 } 101 102 103 } 104 | Popular Tags |