KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > appserver > debugger > Debugger


1 /*-----------------------------------------------------------------------------
2  * Enhydra Java Application Server
3  * Copyright 1997-2000 Lutris Technologies, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the distribution.
14  * 3. All advertising materials mentioning features or use of this software
15  * must display the following acknowledgement:
16  * This product includes Enhydra software developed by Lutris
17  * Technologies, Inc. and its contributors.
18  * 4. Neither the name of Lutris Technologies nor the names of its contributors
19  * may be used to endorse or promote products derived from this software
20  * without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY LUTRIS TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL LUTRIS TECHNOLOGIES OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *-----------------------------------------------------------------------------
34  * $Id: Debugger.java,v 1.1 2004/04/06 15:24:32 rale Exp $
35  *-----------------------------------------------------------------------------
36  */

37
38
39
40
41
42 package com.lutris.appserver.debugger;
43
44
45 import com.lutris.util.*;
46
47 import com.lutris.util.Config;
48 import com.lutris.appserver.server.*;
49 import com.lutris.appserver.server.httpPresentation.*;
50
51
52 import com.lutris.appserver.debugger.spec.*;
53 import java.io.IOException JavaDoc;
54
55
56
57
58 public class Debugger extends StandardApplication {
59
60     /**
61      * Start the application.
62      *
63      * @@param appConfig
64      * Configuration object for this application.
65      * @@exception ApplicationException
66      * If an error occurs starting the application.
67      */

68     public void startup(Config appConfig)
69     throws ApplicationException {
70
71     /*
72          * Mandatory config settings.
73          */

74         int debugQueueSize = 64;
75         try {
76             debugQueueSize = appConfig.getInt("Debugger.DebugQueueSize");
77     } catch (ConfigException except) {
78         throw new ApplicationException("No parameter " +
79                                           "Debugger.DebugQueueSize specified");
80     }
81         if (debugQueueSize < 1)
82             throw new ApplicationException("Debugger.DebugQueueSize must " +
83                                            "be at least 1.");
84         /*
85          * Optional config settings.
86          */

87         boolean saveResponseData = false;
88         try {
89             saveResponseData = appConfig.getBoolean("Debugger.SaveResponseData");
90     } catch (ConfigException except) {
91             // It's ok.
92
}
93         try{
94        ServletMonitor sm=ServletMonitorFactory.getServletMonitor("com.lutris.appserver.debugger.business.ServletMonitorImpl");
95         sm.initialize(debugQueueSize, saveResponseData, this.getName());
96         
97 }catch(Exception JavaDoc e){}
98 super.startup(appConfig);
99
100     }
101
102
103   public synchronized void shutdown() {
104      ServletMonitor sm=ServletMonitorFactory.getServletMonitor("com.lutris.appserver.debugger.business.ServletMonitorImpl");
105         sm.shutdown();
106  
107   super.shutdown();
108 }
109
110
111    
112     public boolean requestPreprocessor(HttpPresentationComms comms)
113             throws Exception JavaDoc {
114         super.requestPreprocessor(comms);
115     /*
116          * Proceed normally.
117      */

118         return false;
119     }
120
121
122
123
124
125
126
127 }
128
Popular Tags