Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/prolifics/servlet/App.java


1   /*************************************************/
2   /*  Copyright (c) 1999         */
3   /*      by         */
4   /*  JYACC, Inc., New York NY USA     */
5   /*  and contributors.         */
6   /*  Use of this program is governed by the   */
7   /*  JYACC Public License Version 1.0, a copy of   */
8   /*  which can be obtained at       */
9   /*  http://www.possl.org/jyacc-license.html   */
10  /*************************************************/
11  
12  /* @(#)App.java  77.1 99/04/22 15:03:03 */
13  
14  
15  package com.prolifics.servlet;
16  import java.io.*;
17  import java.util.*;
18  
19  
20  /**
21   * test servlet. This servlet simply echos back the request line and
22   * headers that were sent by the client, plus any HTTPS information
23   * which is accessible.
24   *
25   * @version    @(#)App.java  77.1 99/04/22 15:03:03
26   * @author    Prolifics
27   */
28  class App
29  {
30    private static String sccsid = "@(#)App.java  77.1 99/04/22 15:03:03";
31    private static Hashtable AppTable = new Hashtable();
32    private String name;
33  
34    private App(String name)
35    {
36      this.name = name;
37    }
38  
39    public static synchronized App getApp (String name)
40    {
41      App retApp = (App) AppTable.get(name);
42  
43      if (retApp == null)
44      {
45        retApp = new App(name);
46        AppTable.put(retApp.name, retApp);
47      }
48  
49      return retApp;
50    }
51  
52    public String getName()
53    {
54      return name;
55    }
56  }