KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > opensubsystems > core > www > TestWebModule1


1 /*
2  * Copyright (c) 2006 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.
3  *
4  * Project: OpenSubsystems
5  *
6  * $Id: TestWebModule1.java,v 1.4 2007/01/07 06:14:26 bastafidli Exp $
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21
22 package org.opensubsystems.core.www;
23
24 /**
25  * Test class representing portal web module 1.
26  *
27  * @version $Id: TestWebModule1.java,v 1.4 2007/01/07 06:14:26 bastafidli Exp $
28  * @author Julian Legeny
29  * @code.reviewer Miro Halas
30  * @code.reviewed 1.2 2006/04/20 00:16:49 jlegeny
31  */

32 public class TestWebModule1 implements WebModule
33 {
34    // Configuration parameters /////////////////////////////////////////////////
35

36    /**
37     * String unique name of the module. This string will be used as identifier
38     * for the module within the html code.
39     */

40    public static final String JavaDoc TEST1_WEB_MODULE_NAME = "module1";
41
42    /**
43     * String unique tab name of the module. This string will be displayed
44     * on the tab with modules.
45     */

46    public static final String JavaDoc TEST1_WEB_MODULE_TABNAME = "Module 1";
47
48    /**
49     * String tooltip for module. This string will be displayed as tooltip
50     * on the GUI.
51     */

52    public static final String JavaDoc TEST1_WEB_MODULE_TOOLTIP = "Test module 1";
53
54    // Constants ////////////////////////////////////////////////////////////////
55

56    /**
57     * Lock used in synchronized sections.
58     */

59    private static final String JavaDoc IMPL_LOCK = "IMPL_LOCK";
60
61    // Attributes ////////////////////////////////////////////////////////////
62

63    /**
64     * Module URL that will be set from context parameter.
65     */

66    private static String JavaDoc s_moduleURL = null;
67
68    // Cached values ////////////////////////////////////////////////////////////
69

70    /**
71     * Reference to the instance actually in use.
72     */

73    private static WebModule s_defaultInstance;
74
75    // Public methods ///////////////////////////////////////////////////////////
76

77    /**
78     * Get the default instance of the security bundle.
79     *
80     * @return SecurityDefinitionBundle - default instance
81     */

82    public static WebModule getInstance()
83    {
84       if (s_defaultInstance == null)
85       {
86          synchronized (IMPL_LOCK)
87          {
88             if (s_defaultInstance == null)
89             {
90                s_defaultInstance = new TestWebModule1();
91             }
92          }
93          
94       }
95       return s_defaultInstance;
96    }
97
98    /**
99     * {@inheritDoc}
100     */

101    public String JavaDoc getName()
102    {
103       return TEST1_WEB_MODULE_NAME;
104    }
105
106    /**
107     * {@inheritDoc}
108     */

109    public String JavaDoc getTabName()
110    {
111       return TEST1_WEB_MODULE_TABNAME;
112    }
113
114    /**
115     * {@inheritDoc}
116     */

117    public String JavaDoc getTooltip()
118    {
119       return TEST1_WEB_MODULE_TOOLTIP;
120    }
121
122    /**
123     * {@inheritDoc}
124     */

125    public String JavaDoc getURL()
126    {
127       return s_moduleURL;
128    }
129
130    /**
131     * {@inheritDoc}
132     */

133    public void setURL(
134       String JavaDoc strURL
135    )
136    {
137       s_moduleURL = strURL;
138    }
139 }
140
Popular Tags