|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEngine
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
ApplicationServlet
via the service(RequestContext)
method.
Engine instances are persisted in the HttpSession
and are serializable.
Field Summary | |
---|---|
static String |
EXCEPTION_PAGE
The name ("Exception") of the page used for reporting exceptions. |
static String |
HOME_PAGE
The name ("Home") of the default page presented when a user first accesses the application. |
static String |
STALE_LINK_PAGE
The name ("StaleLink") of the page used for reporting stale links. |
static String |
STALE_SESSION_PAGE
The name ("StaleSession") of the page used for reporting state sessions. |
Method Summary | |
---|---|
IPageRecorder |
createPageRecorder(String pageName,
IRequestCycle cycle)
Creates a new page recorder for the named page. |
void |
forgetPage(String name)
Forgets changes to the named page by discarding the page recorder for the page. |
IComponentClassEnhancer |
getComponentClassEnhancer()
Returns an object that can create enhanced versions of component classes. |
IComponentMessagesSource |
getComponentMessagesSource()
Returns a shared object that allows components to find their set of localized strings. |
String |
getContextPath()
Returns the context path, a string which is prepended to the names of any assets or servlets. |
DataSqueezer |
getDataSqueezer()
Returns a shared instance of DataSqueezer . |
Object |
getGlobal()
Returns the globally shared application object. |
Locale |
getLocale()
Returns the locale for the engine. |
String |
getOutputEncoding()
Returns the encoding to be used to generate the servlet responses and accept the servlet requests. |
IPageRecorder |
getPageRecorder(String pageName,
IRequestCycle cycle)
Returns a recorder for a page. |
IPageSource |
getPageSource()
Returns the object used to load a page from its specification. |
Pool |
getPool()
Returns a Pool that is used
to store all manner of objects that are needed throughout the system. |
IPropertySource |
getPropertySource()
Returns a IPropertySource that should be
used to obtain configuration data. |
ResourceChecksumSource |
getResourceChecksumSource()
Returns an object that can compute the checksum of a resource. |
IResourceResolver |
getResourceResolver()
Returns an object that can resolve resources and classes. |
IScriptSource |
getScriptSource()
Returns a source for parsed IScript s. |
IEngineService |
getService(String name)
Gets the named service, or throws an ApplicationRuntimeException
if the application can't provide
the named server. |
String |
getServletPath()
Returns the URL path that corresponds to the servlet for the application. |
IApplicationSpecification |
getSpecification()
Returns the application specification that defines the application and its pages. |
ISpecificationSource |
getSpecificationSource()
Returns the source of all component specifications for the application. |
ITemplateSource |
getTemplateSource()
Returns the source for HTML templates. |
Object |
getVisit()
Returns the visit object, an object that represents the client's visit to the application. |
Object |
getVisit(IRequestCycle cycle)
Returns the visit object, creating it if necessary. |
boolean |
isResetServiceEnabled()
Returns true if the application allows the reset service. |
boolean |
isStateful()
Returns true if the engine has state and, therefore, should be stored in the HttpSession. |
boolean |
service(RequestContext context)
Method invoked from the ApplicationServlet
to perform processing of the
request. |
void |
setLocale(Locale value)
Changes the engine's locale. |
void |
setVisit(Object value)
Allows the visit object to be removed; typically done when "shutting down" a user's session (by setting the visit to null). |
Field Detail |
---|
static final String HOME_PAGE
HomeService
,
Constant Field Valuesstatic final String EXCEPTION_PAGE
Such a page must have
a writable JavaBeans property named 'exception' of type
java.lang.Throwable
.
static final String STALE_LINK_PAGE
The page must implement a writeable JavaBeans proeprty named
'message' of type String
.
static final String STALE_SESSION_PAGE
Method Detail |
---|
IPageRecorder getPageRecorder(String pageName, IRequestCycle cycle)
createPageRecorder(String, IRequestCycle)
void forgetPage(String name)
This should be done if the page is no longer needed or relevant, otherwise the properties for the page will continue to be recorded by the engine, which is wasteful (especially if clustering or failover is employed on the application).
Throws an ApplicationRuntimeException
if there are uncommitted changes
for the recorder (in the current request cycle).
Locale getLocale()
void setLocale(Locale value)
IPageRecorder createPageRecorder(String pageName, IRequestCycle cycle)
IPageSource getPageSource()
IEngineService getService(String name)
ApplicationRuntimeException
if the application can't provide
the named server.
The object returned has a short lifecycle (it isn't serialized with the engine). Repeated calls with the same name are not guarenteed to return the same object, especially in different request cycles.
String getServletPath()
IEngineService
that need
to construct URLs for the application. This value will include
the context path.
String getContextPath()
This value is obtained from
HttpServletRequest.getContextPath()
.
IApplicationSpecification getSpecification()
ISpecificationSource getSpecificationSource()
AbstractEngine.createSpecificationSource(RequestContext)
ITemplateSource getTemplateSource()
AbstractEngine.createTemplateSource(RequestContext)
boolean service(RequestContext context) throws ServletException, IOException
ApplicationServlet
to perform processing of the
request. In release 3.0, this has become more of a dirty flag, indicating
if any state stored by the engine instance itself has changed.
ServletException
IOException
IResourceResolver getResourceResolver()
Object getVisit()
Returns the visit, if it exists, or null if it has not been created.
Object getVisit(IRequestCycle cycle)
void setVisit(Object value)
Object getGlobal()
Returns the global object, if it exists, or null if not defined.
boolean isResetServiceEnabled()
IScriptSource getScriptSource()
IScript
s. The source is
shared between all sessions.
boolean isStateful()
IComponentMessagesSource getComponentMessagesSource()
AbstractEngine.createComponentStringsSource(RequestContext)
DataSqueezer getDataSqueezer()
DataSqueezer
.
AbstractEngine.createDataSqueezer()
IPropertySource getPropertySource()
IPropertySource
that should be
used to obtain configuration data. The returned source represents
a search path that includes (at a minimum):
ApplicationSpecification
web.xml
deployment descriptor)
web.xml
)
-D
JVM command line parameter)
AbstractEngine.createPropertySource(RequestContext)
Pool getPool()
Pool
that is used
to store all manner of objects that are needed throughout the system.
This is the best way to deal with objects that are both expensive to
create and not threadsafe. The reset service
will clear out this Pool.
AbstractEngine.createPool(RequestContext)
IComponentClassEnhancer getComponentClassEnhancer()
AbstractEngine.createComponentClassEnhancer(RequestContext)
String getOutputEncoding()
ResourceChecksumSource getResourceChecksumSource()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |