org.apache.tapestry
Interface IEngine

All Superinterfaces:
WebRequestServicer
All Known Implementing Classes:
AbstractEngine, BaseEngine, WMLEngine

public interface IEngine
extends WebRequestServicer

Defines the core, session-persistant object used to run a Tapestry application for a single client (each client will have its own instance of the engine).

The engine exists to provide core services to the pages and components that make up the application. The engine is a delegate to the ApplicationServletvia the #service(RequestContext)method.

Starting in release 4.0, the engine is kept around only for compatibility (with release 3.0). It's functions have been moved over into a collection of HiveMind services (or are in the process of doing so).

Author:
Howard Lewis Ship

Method Summary
 org.apache.hivemind.ClassResolver getClassResolver()
          Deprecated. To be removed in 4.1. This value can be injected (into services).
 java.lang.Object getGlobal()
          Deprecated. To be removed in 4.1. Application state objects can now be injected.
 Infrastructure getInfrastructure()
          Returns the Infrastructure object, a central registry of key HiveMind services used by Tapestry.
 java.util.Locale getLocale()
          Returns the locale for the engine.
 java.lang.String getOutputEncoding()
          Returns the encoding to be used to generate the responses and accept the requests.
 IPropertySource getPropertySource()
          Deprecated. To be removed in 4.1. This value can now be injected as "infrastructure:applicationPropertySource".
 IScriptSource getScriptSource()
          Deprecated. To be removed in 4.1. This value can now be injected as "infrastructure:scriptSource".
 IEngineService getService(java.lang.String name)
          Deprecated. To be removed in 4.1. Engine services can now be injected.
 IApplicationSpecification getSpecification()
          Deprecated. To be removed in 4.1. This value can be injected as "infrastructure:applicationSpecification".
 ISpecificationSource getSpecificationSource()
          Deprecated. To be removed in 4.1. This value can be injected as "infrastructure:specificationSource".
 java.lang.Object getVisit()
          Deprecated. To be removed in 4.1. Application state objects can now be injected.
 java.lang.Object getVisit(IRequestCycle cycle)
          Deprecated. To be removed in 4.1. Application state objects can now be injected.
 void setLocale(java.util.Locale value)
          Changes the engine's locale.
 void setVisit(java.lang.Object value)
          Deprecated. To be removed in 4.1. Application state objects can now be injected.
 
Methods inherited from interface org.apache.tapestry.services.WebRequestServicer
service
 

Method Detail

getLocale

java.util.Locale getLocale()
Returns the locale for the engine. This locale is used when selecting templates and assets.


setLocale

void setLocale(java.util.Locale value)
Changes the engine's locale. Any subsequently loaded pages will be in the new locale (though pages already loaded stay in the old locale). Generally, you should render a new page after changing the locale, to show that the locale has changed.


getService

IEngineService getService(java.lang.String name)
Deprecated. To be removed in 4.1. Engine services can now be injected.

Gets the named service, or throws an org.apache.tapestry.ApplicationRuntimeException if the engine can't provide the named service.


getSpecification

IApplicationSpecification getSpecification()
Deprecated. To be removed in 4.1. This value can be injected as "infrastructure:applicationSpecification".

Returns the application specification that defines the application and its pages.


getSpecificationSource

ISpecificationSource getSpecificationSource()
Deprecated. To be removed in 4.1. This value can be injected as "infrastructure:specificationSource".

Returns the source of all component specifications for the application. The source is shared between sessions.

See Also:
org.apache.tapestry.engine.AbstractEngine#createSpecificationSource(RequestContext)

getClassResolver

org.apache.hivemind.ClassResolver getClassResolver()
Deprecated. To be removed in 4.1. This value can be injected (into services).

Returns an object that can resolve resources and classes.


getVisit

java.lang.Object getVisit()
Deprecated. To be removed in 4.1. Application state objects can now be injected.

Returns the visit object, an object that represents the client's visit to the application. This is where most server-side state is stored (with the exception of persistent page properties).

Returns the visit, if it exists, or null if it has not been created.


getVisit

java.lang.Object getVisit(IRequestCycle cycle)
Deprecated. To be removed in 4.1. Application state objects can now be injected.

Returns the visit object, creating it if necessary.


setVisit

void setVisit(java.lang.Object value)
Deprecated. To be removed in 4.1. Application state objects can now be injected.

Allows the visit object to be removed; typically done when "shutting down" a user's session (by setting the visit to null).


getGlobal

java.lang.Object getGlobal()
Deprecated. To be removed in 4.1. Application state objects can now be injected.

Returns the globally shared application object. The global object is stored in the servlet context and shared by all instances of the engine for the same application (within the same JVM; the global is not shared between nodes in a cluster).

Returns the global object, if it exists, or null if not defined.

Since:
2.3

getScriptSource

IScriptSource getScriptSource()
Deprecated. To be removed in 4.1. This value can now be injected as "infrastructure:scriptSource".

Returns a source for parsed IScripts. The source is shared between all sessions.

Since:
1.0.2

getPropertySource

IPropertySource getPropertySource()
Deprecated. To be removed in 4.1. This value can now be injected as "infrastructure:applicationPropertySource".

Returns a IPropertySourcethat should be used to obtain configuration data. The returned source represents a search path that includes (at a minimum):

Since:
2.3
See Also:
org.apache.tapestry.engine.AbstractEngine#createPropertySource(RequestContext)

getOutputEncoding

java.lang.String getOutputEncoding()
Returns the encoding to be used to generate the responses and accept the requests.

Since:
3.0

getInfrastructure

Infrastructure getInfrastructure()
Returns the Infrastructure object, a central registry of key HiveMind services used by Tapestry.

Since:
4.0