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.InstrumentDescriptor; 29 import org.apache.excalibur.instrument.manager.NoSuchInstrumentException; 30 31 37 public class XMLInstrumentHandler 38 extends AbstractXMLHandler 39 { 40 43 49 public XMLInstrumentHandler( DefaultInstrumentManager manager, 50 InstrumentManagerHTTPConnector connector ) 51 { 52 super( "/instrument.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 InstrumentDescriptor desc; 73 try 74 { 75 desc = getInstrumentManager().locateInstrumentDescriptor( name ); 76 } 77 catch ( NoSuchInstrumentException e ) 78 { 79 throw new FileNotFoundException ( 80 "The specified instrument does not exist: " + name ); 81 } 82 83 out.println( InstrumentManagerHTTPConnector.XML_BANNER ); 84 outputInstrument( out, desc, "", recurse, packed ); 85 } 86 87 90 } 91 92 | Popular Tags |