KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > catalina > Host


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 implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18
19 package org.apache.catalina;
20
21
22
23 /**
24  * A <b>Host</b> is a Container that represents a virtual host in the
25  * Catalina servlet engine. It is useful in the following types of scenarios:
26  * <ul>
27  * <li>You wish to use Interceptors that see every single request processed
28  * by this particular virtual host.
29  * <li>You wish to run Catalina in with a standalone HTTP connector, but still
30  * want support for multiple virtual hosts.
31  * </ul>
32  * In general, you would not use a Host when deploying Catalina connected
33  * to a web server (such as Apache), because the Connector will have
34  * utilized the web server's facilities to determine which Context (or
35  * perhaps even which Wrapper) should be utilized to process this request.
36  * <p>
37  * The parent Container attached to a Host is generally an Engine, but may
38  * be some other implementation, or may be omitted if it is not necessary.
39  * <p>
40  * The child containers attached to a Host are generally implementations
41  * of Context (representing an individual servlet context).
42  *
43  * @author Craig R. McClanahan
44  * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
45  */

46
47 public interface Host extends Container {
48
49
50     // ----------------------------------------------------- Manifest Constants
51

52
53     /**
54      * The ContainerEvent event type sent when a new alias is added
55      * by <code>addAlias()</code>.
56      */

57     public static final String JavaDoc ADD_ALIAS_EVENT = "addAlias";
58
59
60     /**
61      * The ContainerEvent event type sent when an old alias is removed
62      * by <code>removeAlias()</code>.
63      */

64     public static final String JavaDoc REMOVE_ALIAS_EVENT = "removeAlias";
65
66
67     // ------------------------------------------------------------- Properties
68

69
70     /**
71      * Return the application root for this Host. This can be an absolute
72      * pathname, a relative pathname, or a URL.
73      */

74     public String JavaDoc getAppBase();
75
76
77     /**
78      * Set the application root for this Host. This can be an absolute
79      * pathname, a relative pathname, or a URL.
80      *
81      * @param appBase The new application root
82      */

83     public void setAppBase(String JavaDoc appBase);
84
85
86     /**
87      * Return the value of the auto deploy flag. If true, it indicates that
88      * this host's child webapps should be discovred and automatically
89      * deployed dynamically.
90      */

91     public boolean getAutoDeploy();
92
93
94     /**
95      * Set the auto deploy flag value for this host.
96      *
97      * @param autoDeploy The new auto deploy flag
98      */

99     public void setAutoDeploy(boolean autoDeploy);
100
101
102     /**
103      * Return the Java class name of the context configuration class
104      * for new web applications.
105      */

106     public String JavaDoc getConfigClass();
107
108     
109     /**
110      * Set the Java class name of the context configuration class
111      * for new web applications.
112      *
113      * @param configClass The new context configuration class
114      */

115     public void setConfigClass(String JavaDoc configClass);
116
117         
118     /**
119      * Return the value of the deploy on startup flag. If true, it indicates
120      * that this host's child webapps should be discovred and automatically
121      * deployed.
122      */

123     public boolean getDeployOnStartup();
124
125
126     /**
127      * Set the deploy on startup flag value for this host.
128      *
129      * @param deployOnStartup The new deploy on startup flag
130      */

131     public void setDeployOnStartup(boolean deployOnStartup);
132
133
134     /**
135      * Return the canonical, fully qualified, name of the virtual host
136      * this Container represents.
137      */

138     public String JavaDoc getName();
139
140
141     /**
142      * Set the canonical, fully qualified, name of the virtual host
143      * this Container represents.
144      *
145      * @param name Virtual host name
146      *
147      * @exception IllegalArgumentException if name is null
148      */

149     public void setName(String JavaDoc name);
150
151
152     /**
153      * Get the server.xml <host> attribute's xmlNamespaceAware.
154      * @return true if namespace awarenes is enabled.
155      *
156      */

157     public boolean getXmlNamespaceAware();
158
159
160     /**
161      * Get the server.xml <host> attribute's xmlValidation.
162      * @return true if validation is enabled.
163      *
164      */

165     public boolean getXmlValidation();
166
167
168     /**
169      * Set the validation feature of the XML parser used when
170      * parsing xml instances.
171      * @param xmlValidation true to enable xml instance validation
172      */

173     public void setXmlValidation(boolean xmlValidation);
174
175
176    /**
177      * Set the namespace aware feature of the XML parser used when
178      * parsing xml instances.
179      * @param xmlNamespaceAware true to enable namespace awareness
180      */

181     public void setXmlNamespaceAware(boolean xmlNamespaceAware);
182
183
184     // --------------------------------------------------------- Public Methods
185

186
187     /**
188      * Add an alias name that should be mapped to this same Host.
189      *
190      * @param alias The alias to be added
191      */

192     public void addAlias(String JavaDoc alias);
193
194
195     /**
196      * Return the set of alias names for this Host. If none are defined,
197      * a zero length array is returned.
198      */

199     public String JavaDoc[] findAliases();
200
201
202     /**
203      * Return the Context that would be used to process the specified
204      * host-relative request URI, if any; otherwise return <code>null</code>.
205      *
206      * @param uri Request URI to be mapped
207      */

208     public Context map(String JavaDoc uri);
209
210
211     /**
212      * Remove the specified alias name from the aliases for this Host.
213      *
214      * @param alias Alias name to be removed
215      */

216     public void removeAlias(String JavaDoc alias);
217
218
219 }
220
Popular Tags