1 16 package org.mortbay.util.jmx; 17 18 import javax.management.MBeanServer ; 19 import javax.management.ObjectName ; 20 21 import mx4j.tools.adaptor.http.HttpAdaptor; 22 23 import org.apache.commons.logging.Log; 24 import org.mortbay.log.LogFactory; 25 26 public class MX4JHttpAdaptor extends HttpAdaptor 27 { 28 private static Log log = LogFactory.getLog(MX4JHttpAdaptor.class); 29 30 public MX4JHttpAdaptor() 31 { 32 super(); 33 } 34 35 public MX4JHttpAdaptor(int port) 36 { 37 super(port); 38 } 39 40 public MX4JHttpAdaptor(int port, String host) 41 { 42 super(port,host); 43 } 44 45 public ObjectName preRegister(MBeanServer server, 46 ObjectName name) 47 throws Exception 48 { 49 name=super.preRegister(server,name); 50 ObjectName processorName = new ObjectName (name+",processor=XSLT"); 51 server.createMBean("mx4j.tools.adaptor.http.XSLTProcessor", processorName, null); 52 setProcessorName(processorName); 53 return name; 54 } 55 56 public void postRegister(Boolean done) 57 { 58 super.postRegister(done); 59 if (done.booleanValue()) 60 { 61 try{start();} catch(Exception e){e.printStackTrace();} 62 log.info("Started MX4J HTTP Adaptor on : "+this.getPort()); 63 } 64 } 65 } 66 67 68 | Popular Tags |