KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > excalibur > instrument > manager > http > XMLInstrumentManagerHandler


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14  * implied.
15  *
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */

19
20 package org.apache.excalibur.instrument.manager.http;
21
22 import java.io.IOException JavaDoc;
23 import java.io.PrintWriter JavaDoc;
24 import java.util.Map JavaDoc;
25
26 import org.apache.excalibur.instrument.manager.DefaultInstrumentManager;
27
28 /**
29  *
30  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
31  * @version CVS $Revision: 1.6 $ $Date: 2004/03/06 14:01:28 $
32  * @since 4.1
33  */

34 public class XMLInstrumentManagerHandler
35     extends AbstractXMLHandler
36 {
37     /*---------------------------------------------------------------
38      * Constructors
39      *-------------------------------------------------------------*/

40     /**
41      * Creates a new XMLInstrumentManagerHandler.
42      *
43      * @param manager Reference to the DefaultInstrumentManager.
44      * @param connector The InstrumentManagerHTTPConnector.
45      */

46     public XMLInstrumentManagerHandler( DefaultInstrumentManager manager,
47                                         InstrumentManagerHTTPConnector connector )
48     {
49         super( "/instrument-manager.xml", manager, connector );
50     }
51     
52     /*---------------------------------------------------------------
53      * AbstractHTTPURLHandler Methods
54      *-------------------------------------------------------------*/

55     /**
56      * Handles the specified request.
57      *
58      * @param The full path being handled.
59      * @param parameters A Map of the parameters in the request.
60      * @param os The PrintWriter to write the result to.
61      */

62     public void doGet( String JavaDoc path, Map JavaDoc parameters, PrintWriter JavaDoc out )
63         throws IOException JavaDoc
64     {
65         boolean packed = getBooleanParameter( parameters, "packed", false );
66         boolean recurse = getBooleanParameter( parameters, "recurse", false );
67         
68         out.println( InstrumentManagerHTTPConnector.XML_BANNER );
69         outputInstrumentManager(
70             out, getInstrumentManager(), "", recurse, packed, getConnector().isReadOnly() );
71     }
72             
73     /*---------------------------------------------------------------
74      * Methods
75      *-------------------------------------------------------------*/

76 }
77
78
Popular Tags