1 19 20 package org.apache.excalibur.instrument.manager.http; 21 22 import java.io.FileNotFoundException ; 23 import java.io.IOException ; 24 import java.io.PrintWriter ; 25 import java.util.Map ; 26 27 import org.apache.excalibur.instrument.manager.DefaultInstrumentManager; 28 import org.apache.excalibur.instrument.manager.InstrumentableDescriptor; 29 import org.apache.excalibur.instrument.manager.NoSuchInstrumentableException; 30 31 37 public class XMLInstrumentableHandler 38 extends AbstractXMLHandler 39 { 40 43 49 public XMLInstrumentableHandler( DefaultInstrumentManager manager, 50 InstrumentManagerHTTPConnector connector ) 51 { 52 super( "/instrumentable.xml", manager, connector ); 53 } 54 55 58 65 public void doGet( String path, Map parameters, PrintWriter out ) 66 throws IOException 67 { 68 String name = getParameter( parameters, "name" ); 69 boolean packed = getBooleanParameter( parameters, "packed", false ); 70 boolean recurse = getBooleanParameter( parameters, "recurse", false ); 71 72 InstrumentableDescriptor desc; 73 try 74 { 75 desc = getInstrumentManager().locateInstrumentableDescriptor( name ); 76 } 77 catch ( NoSuchInstrumentableException e ) 78 { 79 throw new FileNotFoundException ( 80 "The specified instrumentable does not exist: " + name ); 81 } 82 83 out.println( InstrumentManagerHTTPConnector.XML_BANNER ); 84 outputInstrumentable( out, desc, "", recurse, packed ); 85 } 86 87 90 } 91 92 | Popular Tags |