001: /*
002: * Copyright 1999,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.apache.catalina;
018:
019: /**
020: * An <b>Engine</b> is a Container that represents the entire Catalina servlet
021: * engine. It is useful in the following types of scenarios:
022: * <ul>
023: * <li>You wish to use Interceptors that see every single request processed
024: * by the entire engine.
025: * <li>You wish to run Catalina in with a standalone HTTP connector, but still
026: * want support for multiple virtual hosts.
027: * </ul>
028: * In general, you would not use an Engine when deploying Catalina connected
029: * to a web server (such as Apache), because the Connector will have
030: * utilized the web server's facilities to determine which Context (or
031: * perhaps even which Wrapper) should be utilized to process this request.
032: * <p>
033: * The child containers attached to an Engine are generally implementations
034: * of Host (representing a virtual host) or Context (representing individual
035: * an individual servlet context), depending upon the Engine implementation.
036: * <p>
037: * If used, an Engine is always the top level Container in a Catalina
038: * hierarchy. Therefore, the implementation's <code>setParent()</code> method
039: * should throw <code>IllegalArgumentException</code>.
040: *
041: * @author Craig R. McClanahan
042: * @version $Revision: 1.3 $ $Date: 2004/02/27 14:58:38 $
043: */
044:
045: public interface Engine extends Container {
046:
047: // ------------------------------------------------------------- Properties
048:
049: /**
050: * Return the default hostname for this Engine.
051: */
052: public String getDefaultHost();
053:
054: /**
055: * Set the default hostname for this Engine.
056: *
057: * @param defaultHost The new default host
058: */
059: public void setDefaultHost(String defaultHost);
060:
061: /**
062: * Retrieve the JvmRouteId for this engine.
063: */
064: public String getJvmRoute();
065:
066: /**
067: * Set the JvmRouteId for this engine.
068: *
069: * @param jvmRouteId the (new) JVM Route ID. Each Engine within a cluster
070: * must have a unique JVM Route ID.
071: */
072: public void setJvmRoute(String jvmRouteId);
073:
074: /**
075: * Return the <code>Service</code> with which we are associated (if any).
076: */
077: public Service getService();
078:
079: /**
080: * Set the <code>Service</code> with which we are associated (if any).
081: *
082: * @param service The service that owns this Engine
083: */
084: public void setService(Service service);
085:
086: /**
087: * Set the DefaultContext
088: * for new web applications.
089: *
090: * @param defaultContext The new DefaultContext
091: */
092: public void addDefaultContext(DefaultContext defaultContext);
093:
094: /**
095: * Retrieve the DefaultContext for new web applications.
096: */
097: public DefaultContext getDefaultContext();
098:
099: // --------------------------------------------------------- Public Methods
100:
101: /**
102: * Import the DefaultContext config into a web application context.
103: *
104: * @param context web application context to import default context
105: */
106: public void importDefaultContext(Context context);
107:
108: }
|