001 // Copyright 2004, 2005 The Apache Software Foundation
002 //
003 // Licensed under the Apache License, Version 2.0 (the "License");
004 // you may not use this file except in compliance with the License.
005 // You may obtain a copy of the License at
006 //
007 // http://www.apache.org/licenses/LICENSE-2.0
008 //
009 // Unless required by applicable law or agreed to in writing, software
010 // distributed under the License is distributed on an "AS IS" BASIS,
011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012 // See the License for the specific language governing permissions and
013 // limitations under the License.
014
015 package org.apache.tapestry;
016
017 import java.util.Locale;
018
019 import org.apache.tapestry.services.Infrastructure;
020 import org.apache.tapestry.services.WebRequestServicer;
021
022 /**
023 * Defines the core, session-persistant object used to run a Tapestry application for a single
024 * client (each client will have its own instance of the engine).
025 * <p>
026 * The engine exists to provide core services to the pages and components that make up the
027 * application. The engine is a delegate to the {@link ApplicationServlet}.
028 * <p>
029 * Starting in release 4.0, the engine is kept around only for compatibility (with release 3.0).
030 * It's functions have been moved over into a collection of HiveMind services (or are in the process
031 * of doing so).
032 *
033 * @author Howard Lewis Ship
034 */
035
036 public interface IEngine extends WebRequestServicer
037 {
038 /**
039 * Returns the locale for the engine. This locale is used when selecting templates and assets.
040 */
041
042 Locale getLocale();
043
044 /**
045 * Changes the engine's locale. Any subsequently loaded pages will be in the new locale (though
046 * pages already loaded stay in the old locale). Generally, you should render a new page after
047 * changing the locale, to show that the locale has changed.
048 */
049
050 void setLocale(Locale value);
051
052 /**
053 * Returns the encoding to be used to generate the responses and accept the requests.
054 *
055 * @since 3.0
056 */
057
058 String getOutputEncoding();
059
060 /**
061 * Returns the {@link org.apache.tapestry.services.Infrastructure} object, a central
062 * registry of key HiveMind services used by Tapestry.
063 *
064 * @since 4.0
065 */
066
067 Infrastructure getInfrastructure();
068 }