01: /*
02: * Copyright 2003 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.bootstrap;
15:
16: import javax.servlet.ServletException;
17: import javax.servlet.ServletConfig;
18: import javax.servlet.ServletContext;
19: import javax.servlet.http.HttpServlet;
20: import javax.servlet.http.HttpServletRequest;
21: import javax.servlet.http.HttpServletResponse;
22:
23: import java.io.IOException;
24: import java.util.Properties;
25:
26: /**
27: * This class is stricktly used to bootstrap
28: * bare essential resources like system properties.
29: * This servlet MUST be the
30: * specified with load-on-startup with value 0.
31: * No other servlet in the portal should have the value as 0.
32: * This class must not depend on any package, jars,
33: * listeners or servlets being loaded or initialized.
34: */
35: public class BootstrapServlet extends HttpServlet {
36:
37: public void init(ServletConfig config) throws ServletException {
38: super .init(config);
39: try {
40: //
41: // load PS system properties
42: //
43: BootstrapCore.loadSystemProperties();
44:
45: } catch (IOException ex) {
46: ex.printStackTrace();
47: throw new ServletException(
48: "Portal Bootstrap Initialization Failed: "
49: + ex.getMessage());
50: }
51: }
52:
53: public void service(HttpServletRequest req, HttpServletResponse res)
54: throws ServletException, IOException {
55: throw new ServletException("Bootstrap servlet can't be called.");
56: }
57: }
|