|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.util.Configuration
public class Configuration
The ZK configuration.
To retrieve the current configuration, use
WebApp.getConfiguration()
.
Note: A Configuration
instance can be assigned to at most one
WebApp
instance.
Constructor Summary | |
---|---|
Configuration()
Constructor. |
Method Summary | |
---|---|
void |
addClientPackage(java.lang.String pkg)
Adds a client (JavaScript) pacakge that is provided by this server. |
void |
addDisabledThemeURI(java.lang.String uri)
Specifies what theme URI to be disabled. |
java.lang.String |
addErrorPage(java.lang.String deviceType,
java.lang.Class type,
java.lang.String location)
Adds an error page. |
void |
addLabelLocation(java.lang.String location)
Adds the location of a properties file for i18n labels. |
void |
addListener(java.lang.Class<?> klass)
Adds a listener class. |
java.lang.Object |
addRichlet(java.lang.String name,
java.lang.Class richletClass,
java.util.Map<java.lang.String,java.lang.String> params)
Adds the definition of a richlet. |
java.lang.Object |
addRichlet(java.lang.String name,
java.lang.String richletClassName,
java.util.Map<java.lang.String,java.lang.String> params)
Adds the definition of a richlet. |
void |
addRichletMapping(java.lang.String name,
java.lang.String path)
Adds a richlet mapping. |
void |
addThemeURI(java.lang.String uri)
Adds an CSS resource that will be generated for each ZUML desktop. |
void |
afterComponentAttached(Component comp,
Page page)
Invokes UiLifeCycle.afterComponentAttached(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page)
when a component is attached to a page. |
void |
afterComponentDetached(Component comp,
Page prevpage)
Invokes UiLifeCycle.afterComponentDetached(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page)
when a component is detached from a page. |
void |
afterComponentMoved(Component parent,
Component child,
Component prevparent)
Invokes UiLifeCycle.afterComponentMoved(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
when a component is moved (aka., page changed). |
void |
afterPageAttached(Page page,
Desktop desktop)
Invokes UiLifeCycle.afterPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Desktop)
when a compnent's parent is changed. |
void |
afterPageDetached(Page page,
Desktop prevdesktop)
Invokes UiLifeCycle.afterPageDetached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Desktop)
when a compnent's parent is changed. |
void |
afterProcessEvent(Event event)
Invokes EventInterceptor.afterProcessEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>) with a class implementing
EventInterceptor . |
Event |
beforePostEvent(Event event)
Invokes EventInterceptor.beforePostEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>) with a class implementing
EventInterceptor . |
Event |
beforeProcessEvent(Event event)
Invokes EventInterceptor.beforeProcessEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>) with a class implementing
EventInterceptor . |
Event |
beforeSendEvent(Event event)
Invokes EventInterceptor.beforeSendEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>) with a class implementing
EventInterceptor . |
void |
detroyRichlets()
Destroyes all richlets. |
void |
enableEventThread(boolean enable)
Sets whether to use the event processing thread. |
void |
enableZScript(boolean enable)
Sets whether zscript is allowed. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of an application-specific attribute, or null if not found. |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns a map of application-specific attributes. |
java.lang.Class |
getAuDecoderClass()
Returns the class used to decode AU requests, or null if the default shall be used. |
int |
getClickFilterDelay()
Deprecated. As of release 5.0.0, please use Button.setAutodisable(java.lang.String) instead. |
java.lang.String |
getClientErrorReload(java.lang.String deviceType,
int errCode,
java.lang.String connType)
Returns the URI that is associated with the specified error code, or null if no URI is associated. |
java.lang.Object[][] |
getClientErrorReloads(java.lang.String deviceType,
java.lang.String connType)
Returns an array of pairs of the error code and URI info of the specified device and connection (never null). |
java.lang.String[] |
getClientPackages()
Returns a readonly list of the names of the client pages that are provided by this server |
Composer |
getComposer(Page page)
Returns the system-level composer or null if none is registered. |
java.lang.Class |
getDesktopCacheProviderClass()
Returns the class used to provide the desktop cache, or null if default is used. |
int |
getDesktopMaxInactiveInterval()
Returns the time, in seconds, between client requests before ZK will invalidate the desktop. |
DesktopRecycle |
getDesktopRecycle()
Returns the desktop recycle for this application, or null if not set. |
java.util.Set<java.lang.String> |
getDisabledThemeURIs()
Returns a set of the theme URIs that are disabled (never null). |
java.lang.String |
getErrorPage(java.lang.String deviceType,
java.lang.Throwable error)
Returns the error page that matches the specified error, or null if not found. |
int |
getEventTimeWarning()
Returns the time, in seconds, to show a warning message if an event has been processinged longer than it. |
ExecutionMonitor |
getExecutionMonitor()
Returns the execution monitor for this application, or null if not set. |
java.lang.Class<? extends ExpressionFactory> |
getExpressionFactoryClass()
Returns the implementation of the expression factory that is used by the whole system, or null if the sytem default is used. |
java.lang.Class |
getFailoverManagerClass()
Returns the class used to handle the failover mechanism, or null if no custom failover mechanism. |
int |
getFileSizeThreshold()
Returns the threshold at which a temporary file is created as a buffer, in kilobytes, or a negative value which implies default setting. |
java.lang.Class |
getIdGeneratorClass()
Returns the class used to generate UUID/ID for desktop, page and components, or null if the default shall be used. |
Initiator[] |
getInitiators()
Returns a readonly list of the system-level initiators. |
java.lang.String[] |
getLabelLocations()
Returns an array of the locations of properties files registered by addLabelLocation(java.lang.String) . |
int |
getMaxProcessTime()
Returns the maximal allowed time to process events, in milliseconds. |
int |
getMaxSpareThreads()
Returns the maximal allowed number of the spare pool for queuing event processing threads (per Web application). |
int |
getMaxSuspendedThreads()
Returns the maximal allowed number of suspended event processing threads (per Web application). |
int |
getMaxUploadSize()
Returns the maximal allowed upload size, in kilobytes, or a negative value if no limit. |
Monitor |
getMonitor()
Returns the monitor for this application, or null if not set. |
PerformanceMeter |
getPerformanceMeter()
Returns the performance meter for this application, or null if not set. |
java.lang.String |
getPreference(java.lang.String name,
java.lang.String defaultValue)
Returns the value of the preference defined in zk.xml, or by setPreference(java.lang.String, java.lang.String) . |
java.util.Set<java.lang.String> |
getPreferenceNames()
Returns a readonly set of all preference names. |
int |
getProcessingPromptDelay()
Returns the time, in milliseconds, before ZK Client Engine shows a dialog to prompt users that the request is in processing. |
PropertiesRenderer[] |
getPropertiesRenderers()
Returns a readonly list of the system-level properties renders. |
int |
getResendDelay()
Deprecated. As of release 6.0.0, it is removed without replacement, since it is rarely applicable and over complicated. Returns the time, in milliseconds, before ZK Client Engine re-sends the request to the server. |
java.lang.String |
getResponseCharset()
Returns the charset used to generate the HTTP response or null to use the container's default. |
Richlet |
getRichlet(java.lang.String name)
Returns an instance of richlet of the specified name, or null if not found. |
Richlet |
getRichletByPath(java.lang.String path)
Returns an instance of richlet for the specified path, or null if not found. |
SEORenderer[] |
getSEORenderers()
Returns a readonly list of the system-level SEO renderer. |
java.lang.Class |
getSessionCacheClass()
Returns the class used to store ZK sessions, or null if the default shall be used. |
int |
getSessionMaxDesktops()
Returns the maximal allowed number of desktop per session. |
int |
getSessionMaxInactiveInterval()
Returns the time, in seconds, between client requests before ZK will invalidate the session. |
int |
getSessionMaxPushes()
Returns the maximal allowed number of concurrent server-pushes per session. |
int |
getSessionMaxRequests()
Returns the maximal allowed number of concurrent requests per session. |
ThemeProvider |
getThemeProvider()
Returns the theme provider for the current execution, or null if not available. |
java.lang.String[] |
getThemeURIs()
Returns a readonly list of the URI of the CSS resources that will be generated for each ZUML desktop (never null). |
java.lang.String |
getTimeoutMessage(java.lang.String deviceType)
Returns the timeout message for this device, or null if the default message is preferred. |
URIInfo |
getTimeoutURI(java.lang.String deviceType)
Returns the timeout URI for this device. |
int |
getTooltipDelay()
Returns the time, in milliseconds, before ZK Client Engine shows the tooltip when a user moves the mouse over particular UI components. |
java.lang.Class |
getUiEngineClass()
Returns the class used to handle UI loading and updates, or null if default is used. |
java.lang.Class |
getUiFactoryClass()
Returns the class used to instantiate desktops, pages and components, or null if default is used. |
java.lang.String |
getUploadCharset()
Returns the charset used to encode the uploaded text file (never null). |
CharsetFinder |
getUploadCharsetFinder()
Returns the finder that is used to decide the character set for the uploaded text file(s), or null if not available. |
WebApp |
getWebApp()
Returns the Web application that this configuration belongs to, or null if it is not associated yet. |
java.lang.Class |
getWebAppClass()
Returns the class used to represent this Web application, or null if default is used. |
java.lang.Class |
getWebAppFactoryClass()
Returns the class used to instantiate an instance representing this Web application, or null if default is used. |
void |
init(Page page)
Initializes the given page with the variable resolvers registered by addListener(java.lang.Class>) . |
void |
invokeDesktopCleanups(Desktop desktop)
Invokes DesktopCleanup.cleanup(org.zkoss.zk.ui.Desktop) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeDesktopInits(Desktop desktop,
java.lang.Object request)
Invokes DesktopInit.init(org.zkoss.zk.ui.Desktop, java.lang.Object) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeEventThreadCompletes(java.util.List<EventThreadCleanup> cleanups,
Component comp,
Event evt,
java.util.List<java.lang.Throwable> errs,
boolean silent)
Invoke EventThreadCleanup.complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for each instance returned by
newEventThreadCleanups(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List . |
boolean |
invokeEventThreadInits(java.util.List<EventThreadInit> inits,
Component comp,
Event evt)
Invokes EventThreadInit.init(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for each instance returned
by newEventThreadInits(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) . |
void |
invokeEventThreadResumeAborts(Component comp,
Event evt)
Invokes EventThreadResume.abortResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeEventThreadResumes(java.util.List<EventThreadResume> resumes,
Component comp,
Event evt)
Invokes EventThreadResume.afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for each instance returned
by newEventThreadResumes(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) . |
void |
invokeEventThreadSuspends(java.util.List<EventThreadSuspend> suspends,
Component comp,
Event evt)
Invokes EventThreadSuspend.afterSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeExecutionCleanups(Execution exec,
Execution parent,
java.util.List<java.lang.Throwable> errs)
Invokes ExecutionCleanup.cleanup(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution, java.util.List for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeExecutionInits(Execution exec,
Execution parent)
Invokes ExecutionInit.init(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeRequestInterceptors(Session sess,
java.lang.Object request,
java.lang.Object response)
Invokes RequestInterceptor.request(org.zkoss.zk.ui.Session, java.lang.Object, java.lang.Object) for each relevant listener
registered by addListener(java.lang.Class>) . |
void |
invokeSessionCleanups(Session sess)
Invokes SessionCleanup.cleanup(org.zkoss.zk.ui.Session) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeSessionInits(Session sess,
java.lang.Object request)
Invokes SessionInit.init(org.zkoss.zk.ui.Session, java.lang.Object) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeURIInterceptors(java.lang.String uri)
Invokes URIInterceptor.request(java.lang.String) for each relevant listner
registered by addListener(java.lang.Class>) . |
void |
invokeWebAppCleanups()
Invokes WebAppCleanup.cleanup(org.zkoss.zk.ui.WebApp) for each relevant
listener registered by addListener(java.lang.Class>) . |
void |
invokeWebAppInits()
Invokes WebAppInit.init(org.zkoss.zk.ui.WebApp) for each relevant
listener registered by addListener(java.lang.Class>) . |
boolean |
isAutomaticTimeout(java.lang.String deviceType)
Returns whether to automatically trigger the timeout at the client. |
boolean |
isCrawlable()
Returns whether this Web application can be crawled by search engies. |
boolean |
isDebugJS()
Returns whether to debug JavaScript files. |
boolean |
isEventThreadEnabled()
Returns whether to use the event processing thread. |
boolean |
isKeepDesktopAcrossVisits()
Returns whether to keep the desktops across visits. |
boolean |
isRepeatUuid()
Returns whether to use the same UUID sequence for desktops after rebooting. |
boolean |
isTimerKeepAlive()
Returns whether to keep the session alive, when receiving the onTimer event. |
boolean |
isZScriptEnabled()
Returns whether zscript is allowed. |
java.util.List<EventThreadCleanup> |
newEventThreadCleanups(Component comp,
Event evt,
java.util.List<java.lang.Throwable> errs,
boolean silent)
Invokes EventThreadCleanup.cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List for each relevant
listener registered by addListener(java.lang.Class>) . |
java.util.List<EventThreadInit> |
newEventThreadInits(Component comp,
Event evt)
Constructs a list of EventThreadInit instances and invokes
EventThreadInit.prepare(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for
each relevant listener registered by addListener(java.lang.Class>) . |
java.util.List<EventThreadResume> |
newEventThreadResumes(Component comp,
Event evt)
Constructs a list of EventThreadResume instances and invokes
EventThreadResume.beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event) for each relevant
listener registered by addListener(java.lang.Class>) . |
java.util.List<EventThreadSuspend> |
newEventThreadSuspends(Component comp,
Event evt,
java.lang.Object obj)
Constructs a list of EventThreadSuspend instances and invokes
EventThreadSuspend.beforeSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.lang.Object) for each relevant
listener registered by addListener(java.lang.Class>) . |
java.lang.Object |
removeAttribute(java.lang.String name)
Removes the value of an application-specific attribute. |
java.lang.String |
removeClientErrorReload(java.lang.String deviceType,
int errCode,
java.lang.String connType)
Removes the URI to redirect to, when ZK Client Engine receives an error. |
void |
removeListener(java.lang.Class<?> klass)
Removes a listener class. |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Returns the value of an application-specific attribute. |
void |
setAuDecoderClass(java.lang.Class cls)
Sets the class that is used to decode AU requests, or null to use the default. |
boolean |
setAutomaticTimeout(java.lang.String deviceType,
boolean auto)
Sets whether to automatically trigger the timeout at the client. |
void |
setClickFilterDelay(int minisecs)
Deprecated. As of release 5.0.0, please use Button.setAutodisable(java.lang.String) instead. |
java.lang.String |
setClientErrorReload(java.lang.String deviceType,
int errCode,
java.lang.String uri,
java.lang.String connType)
Sets the URI to redirect to, when ZK Client Engine receives an error. |
void |
setCrawlable(boolean crawlable)
Sets whether this Web application is crawlable. |
void |
setDebugJS(boolean debug)
Sets whether to debug JavaScript files. |
void |
setDesktopCacheProviderClass(java.lang.Class cls)
Sets the class used to provide the desktop cache, or null to use the default. |
void |
setDesktopMaxInactiveInterval(int secs)
Specifies the time, in seconds, between client requests before ZK will invalidate the desktop. |
DesktopRecycle |
setDesktopRecycle(DesktopRecycle dtRecycle)
Sets the desktop recycler for this application, or null to disable it. |
void |
setEventTimeWarning(int secs)
Set the time, in seconds, to show a warning message if an event has been processinged longer than it. |
ExecutionMonitor |
setExecutionMonitor(ExecutionMonitor monitor)
Sets the execution monitor for this application, or null to disable it. |
void |
setExpressionFactoryClass(java.lang.Class<? extends ExpressionFactory> expfcls)
Sets the implementation of the expression factory that shall be used by the whole system. |
void |
setFailoverManagerClass(java.lang.Class cls)
Sets the class used to handle the failover mechanism, or null if no custom failover mechanism. |
void |
setFileSizeThreshold(int sz)
Specifies the threshold at which a temporary file is created as a buffer, in kilobytes. |
void |
setIdGeneratorClass(java.lang.Class cls)
Sets the class that is used to generate UUID/ID of desktop, page and components, or null to use the default. |
void |
setKeepDesktopAcrossVisits(boolean keep)
Specifies whether to keep the desktops across visits. |
void |
setMaxProcessTime(int time)
Specifies the maximal allowed time to process events, in milliseconds. |
void |
setMaxSpareThreads(int max)
Specifies the maximal allowed number of the spare pool for queuing the event processing threads (per Web application). |
void |
setMaxSuspendedThreads(int max)
Specifies the maximal allowed number of suspended event processing threads (per Web application). |
void |
setMaxUploadSize(int sz)
Specifies the maximal allowed upload size, in kilobytes. |
Monitor |
setMonitor(Monitor monitor)
Sets the monitor for this application, or null to disable it. |
PerformanceMeter |
setPerformanceMeter(PerformanceMeter meter)
Sets the performance meter for this application, or null to disable it. |
void |
setPreference(java.lang.String name,
java.lang.String value)
Sets the value of the preference. |
void |
setProcessingPromptDelay(int minisecs)
Specifies the time, in milliseconds, before ZK Client Engine shows a dialog to prompt users that the request is in processing. |
void |
setRepeatUuid(boolean repeat)
Sets whether to use the same UUID sequence for desktops after rebooting. |
void |
setResendDelay(int minisecs)
Deprecated. As of release 6.0.0, it is removed without replacement, since it is rarely applicable and over complicated. Specifies the time, in milliseconds, before ZK Client Engine re-sends the request to the server. Default: -1 (i.e., disabled). However, if ZK 5.0.3 EE or prior, the default is 9000. There are many reasons an Ajax request is not received by the server. With the resending mechanism, ZK ensures the reliable connection between the client and the server. See also Bug 1839246 |
void |
setResponseCharset(java.lang.String charset)
Sets the charset used to generate HTTP response. |
void |
setSessionCacheClass(java.lang.Class cls)
Sets the class that is used to store ZK sessions, or null to use the default. |
void |
setSessionMaxDesktops(int max)
Specifies the maximal allowed number of desktop per session. |
void |
setSessionMaxInactiveInterval(int secs)
Specifies the time, in seconds, between client requests before ZK will invalidate the session. |
void |
setSessionMaxPushes(int max)
Specifies the maximal allowed number of concurrent server-pushes per session. |
void |
setSessionMaxRequests(int max)
Specifies the maximal allowed number of concurrent requests per session. |
void |
setThemeProvider(ThemeProvider provider)
Sets the theme provider for the current execution, or null if not available. |
java.lang.String |
setTimeoutMessage(java.lang.String deviceType,
java.lang.String message)
Sets the timeout message for this device, or null if the default message is preferred. |
URIInfo |
setTimeoutURI(java.lang.String deviceType,
java.lang.String timeoutURI,
int type)
Sets the timeout URI. |
void |
setTimerKeepAlive(boolean alive)
Specifies whether to keep the session alive, when receiving the onTimer event. |
void |
setTooltipDelay(int minisecs)
Specifies the time, in milliseconds, before ZK Client Engine shows the tooltip when a user moves the mouse over particular UI components. |
void |
setUiEngineClass(java.lang.Class cls)
Sets the class used to handle UI loading and updates, or null to use the default. |
void |
setUiFactoryClass(java.lang.Class cls)
Sets the class used to instantiate desktops, pages and components, or null to use the default. |
void |
setUploadCharset(java.lang.String charset)
Sets the charset used to encode the upload text file. |
void |
setUploadCharsetFinder(CharsetFinder finder)
Sets the finder that is used to decide the character set for the uploaded text file(s), or null if not available. |
void |
setWebApp(WebApp wapp)
Associates it with a web application. |
void |
setWebAppClass(java.lang.Class cls)
Sets the class used to represent this Web application, or null to use the default. |
void |
setWebAppFactoryClass(java.lang.Class cls)
Sets the class used to instantiate an instance representing this Web application, or null to use the default. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Configuration()
Method Detail |
---|
public WebApp getWebApp()
public void setWebApp(WebApp wapp)
public void addListener(java.lang.Class<?> klass) throws java.lang.Exception
Notice that there is only one listener allowed for the following classes:
Monitor
, PerformanceMeter
, and DesktopRecycle
.
On the other hand, any number listeners are allowed for other classes.
Notice that if the listener implements Composer
, it can also
implement ComposerExt
and/or FullComposer
to have
more detailed control. However, ComposerExt and FullComposer are meaningless
to richlets. In additions, an independent
composer is instantiated for each page so there is synchronization required.
By default, a listener is instantiated when required, and dropped after invoked. In other words, a new instance will be instantiated in the next invocation. It means you don't have to worry the threading,
However, for better performance, the following listeners will be instantiated
in addListener(java.lang.Class>)
, and then used repeatedly. It means it has
to be thread safe. These listeners include
URIInterceptor
, RequestInterceptor
,
EventInterceptor
, UiLifeCycle
,
and PropertiesRenderer
.
klass
- the listener class must implement at least one of
Monitor
, PerformanceMeter
, EventThreadInit
,
EventThreadCleanup
, EventThreadSuspend
,
EventThreadResume
, WebAppInit
, WebAppCleanup
,
SessionInit
, SessionCleanup
, DesktopInit
,
DesktopCleanup
, ExecutionInit
, ExecutionCleanup
,
Composer
, Initiator
(since 5.0.7), SEORenderer
(since 5.0.7),
PropertiesRenderer
(since 5.0.7),
VariableResolver
,
URIInterceptor
, RequestInterceptor
,
UiLifeCycle
, DesktopRecycle
,
and/or EventInterceptor
interfaces.
java.lang.Exception
Desktop.addListener(java.lang.Object)
public void removeListener(java.lang.Class<?> klass)
Desktop.removeListener(java.lang.Object)
public java.util.List<EventThreadInit> newEventThreadInits(Component comp, Event evt) throws UiException
EventThreadInit
instances and invokes
EventThreadInit.prepare(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for
each relevant listener registered by addListener(java.lang.Class>)
.
Used only internally (by UiEngine
before starting an event
processing thread).
EventThreadInit
instances that are
constructed in this method (and their EventThreadInit.prepare(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
are called successfully), or null.
UiException
- to prevent a thread from being processed
if EventThreadInit.prepare(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
throws an exceptionpublic boolean invokeEventThreadInits(java.util.List<EventThreadInit> inits, Component comp, Event evt) throws UiException
EventThreadInit.init(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for each instance returned
by newEventThreadInits(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
.
Used only internally.
inits
- a list of EventThreadInit
instances returned from
newEventThreadInits(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
, or null if no instance at all.comp
- the component which the event is targetingevt
- the event to process
UiException
- to prevent a thread from being processed
if EventThreadInit.init(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
throws an exceptionpublic java.util.List<EventThreadCleanup> newEventThreadCleanups(Component comp, Event evt, java.util.List<java.lang.Throwable> errs, boolean silent)
EventThreadCleanup.cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of EventThreadCleanup
is constructed first,
and then invoke EventThreadCleanup.cleanup(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List
.
It never throws an exception but logs and adds it to the errs argument, if not null.
comp
- the component which the event is targetingevt
- the event to processerrs
- a list of exceptions (java.lang.Throwable) if any exception
occurred before this method is called, or null if no exception at all.
Note: you can manipulate the list directly to add or clean up exceptions.
For example, if exceptions are fixed correctly, you can call errs.clear()
such that no error message will be displayed at the client.silent
- whether not to log the exception
EventThreadCleanup
, or nullpublic void invokeEventThreadCompletes(java.util.List<EventThreadCleanup> cleanups, Component comp, Event evt, java.util.List<java.lang.Throwable> errs, boolean silent)
EventThreadCleanup.complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for each instance returned by
newEventThreadCleanups(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List, boolean)
.
Used only internally.
It never throws an exception but logs and adds it to the errs argument, if not null.
cleanups
- a list of EventThreadCleanup
instances returned from
newEventThreadCleanups(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.util.List, boolean)
, or null if no instance at all.errs
- used to hold the exceptions that are thrown by
EventThreadCleanup.complete(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
.
If null, all exceptions are ignored (but logged).silent
- whether not to log the exceptionpublic java.util.List<EventThreadSuspend> newEventThreadSuspends(Component comp, Event evt, java.lang.Object obj)
EventThreadSuspend
instances and invokes
EventThreadSuspend.beforeSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.lang.Object)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
Note: caller shall execute in the event processing thread.
comp
- the component which the event is targetingevt
- the event to processobj
- which object that Executions.wait(java.lang.Object)
is called with.
EventThreadSuspend
, or null
UiException
- to prevent a thread from suspendingpublic void invokeEventThreadSuspends(java.util.List<EventThreadSuspend> suspends, Component comp, Event evt) throws UiException
EventThreadSuspend.afterSuspend(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Unlike invokeEventThreadSuspends(java.util.List, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
, caller shall execute in
the main thread (aka, servlet thread).
Used only internally.
Unlike invokeEventThreadSuspends(java.util.List
, exceptions are logged
and ignored.
suspends
- a list of EventThreadSuspend
instances returned
from newEventThreadSuspends(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event, java.lang.Object)
, or null if no instance at all.comp
- the component which the event is targetingevt
- the event to process
UiException
public java.util.List<EventThreadResume> newEventThreadResumes(Component comp, Event evt) throws UiException
EventThreadResume
instances and invokes
EventThreadResume.beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally (by UiEngine
when resuming a suspended event
thread).
Notice: it executes in the main thread (i.e., the servlet thread).
comp
- the component which the event is targetingevt
- the event to process
EventThreadResume
instances that are constructed
in this method (and their EventThreadResume.beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
are called successfully), or null.
UiException
- to prevent a thread from being resumed
if EventThreadResume.beforeResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
throws an exceptionpublic void invokeEventThreadResumes(java.util.List<EventThreadResume> resumes, Component comp, Event evt) throws UiException
EventThreadResume.afterResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for each instance returned
by newEventThreadResumes(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
.
Used only internally.
It never throws an exception but logs and adds it to the errs argument, if not null.
resumes
- a list of EventThreadResume
instances returned from
newEventThreadResumes(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
, or null if no instance at all.comp
- the component which the event is targetingevt
- the event to process
If null, all exceptions are ignored (but logged)
UiException
public void invokeEventThreadResumeAborts(Component comp, Event evt)
EventThreadResume.abortResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of EventThreadResume
is constructed first,
and then invoke EventThreadResume.abortResume(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.event.Event)
.
It never throws an exception but logging.
comp
- the component which the event is targetingevt
- the event to processpublic void invokeWebAppInits() throws UiException
WebAppInit.init(org.zkoss.zk.ui.WebApp)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of WebAppInit
is constructed first,
and then invoke WebAppInit.init(org.zkoss.zk.ui.WebApp)
.
Unlike invokeWebAppInits()
, it doesn't throw any exceptions.
Rather, it only logs them.
UiException
public void invokeWebAppCleanups()
WebAppCleanup.cleanup(org.zkoss.zk.ui.WebApp)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of WebAppCleanup
is constructed first,
and then invoke WebAppCleanup.cleanup(org.zkoss.zk.ui.WebApp)
.
It never throws an exception.
public void invokeSessionInits(Session sess, java.lang.Object request) throws UiException
SessionInit.init(org.zkoss.zk.ui.Session, java.lang.Object)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of SessionInit
is constructed first,
and then invoke SessionInit.init(org.zkoss.zk.ui.Session, java.lang.Object)
.
sess
- the session that is createdrequest
- the original request. If HTTP, it is
javax.servlet.http.HttlServletRequest.
UiException
- to prevent a session from being createdpublic void invokeSessionCleanups(Session sess)
SessionCleanup.cleanup(org.zkoss.zk.ui.Session)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of SessionCleanup
is constructed first,
and then invoke SessionCleanup.cleanup(org.zkoss.zk.ui.Session)
.
It never throws an exception.
sess
- the session that is being destroyedpublic void invokeDesktopInits(Desktop desktop, java.lang.Object request) throws UiException
DesktopInit.init(org.zkoss.zk.ui.Desktop, java.lang.Object)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of DesktopInit
is constructed first,
and then invoke DesktopInit.init(org.zkoss.zk.ui.Desktop, java.lang.Object)
.
desktop
- the desktop that is createdrequest
- the original request. If HTTP, it is
javax.servlet.http.HttlServletRequest.
UiException
- to prevent a desktop from being createdpublic void invokeDesktopCleanups(Desktop desktop)
DesktopCleanup.cleanup(org.zkoss.zk.ui.Desktop)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of DesktopCleanup
is constructed first,
and then invoke DesktopCleanup.cleanup(org.zkoss.zk.ui.Desktop)
.
It never throws an exception.
desktop
- the desktop that is being destroyedpublic void invokeExecutionInits(Execution exec, Execution parent) throws UiException
ExecutionInit.init(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of ExecutionInit
is constructed first,
and then invoke ExecutionInit.init(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution)
.
exec
- the execution that is createdparent
- the previous execution, or null if no previous at all
UiException
- to prevent an execution from being createdpublic void invokeExecutionCleanups(Execution exec, Execution parent, java.util.List<java.lang.Throwable> errs)
ExecutionCleanup.cleanup(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution, java.util.List)
for each relevant
listener registered by addListener(java.lang.Class>)
.
Used only internally.
An instance of ExecutionCleanup
is constructed first,
and then invoke ExecutionCleanup.cleanup(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution, java.util.List
.
It never throws an exception but logs and adds it to the errs argument, if not null.
exec
- the execution that is being destroyedparent
- the previous execution, or null if no previous at allerrs
- a list of exceptions (java.lang.Throwable) if any exception
occurred before this method is called, or null if no exception at all.
Note: you can manipulate the list directly to add or clean up exceptions.
For example, if exceptions are fixed correctly, you can call errs.clear()
such that no error message will be displayed at the client.public void invokeURIInterceptors(java.lang.String uri)
URIInterceptor.request(java.lang.String)
for each relevant listner
registered by addListener(java.lang.Class>)
.
Used only internally.
If any of them throws an exception, the exception is propagated to the caller.
UiException
- if it is rejected by the interceptor.
Use Throwable.getCause()
to retrieve the cause.public void invokeRequestInterceptors(Session sess, java.lang.Object request, java.lang.Object response)
RequestInterceptor.request(org.zkoss.zk.ui.Session, java.lang.Object, java.lang.Object)
for each relevant listener
registered by addListener(java.lang.Class>)
.
Used only internally.
If any of them throws an exception, the exception is propagated to the caller.
UiException
- if it is rejected by the interceptor.
Use Throwable.getCause()
to retrieve the cause.public void addLabelLocation(java.lang.String location)
Default: none (/WEB-INF/zk-label.properties is assumed).
Notice that this method has no effect after the web server has been started. Thus, it is suggested to use the label-location element in zk.xml instead.
public java.lang.String[] getLabelLocations()
addLabelLocation(java.lang.String)
.
public Composer getComposer(Page page) throws java.lang.Exception
addListener(java.lang.Class>)
.
Notice that any number of composers can be registered, and a single composer is returned to represent them all.
java.lang.Exception
public Initiator[] getInitiators()
addListener(java.lang.Class>)
.
public SEORenderer[] getSEORenderers()
addListener(java.lang.Class>)
.
Notice that, once registered, an instance is instantiated before
invoking SEORenderer.render(org.zkoss.zk.ui.Page, java.io.Writer)
.
public void init(Page page)
addListener(java.lang.Class>)
.
It must be called before accessing a page (actually in PageCtrl.preInit()
).
public PropertiesRenderer[] getPropertiesRenderers()
addListener(java.lang.Class>)
.
Notice that, once registered, it is instantiated immeidately, and the same instance is shared for rendering the properties of every component.
public void afterComponentAttached(Component comp, Page page)
UiLifeCycle.afterComponentAttached(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page)
when a component is attached to a page.
public void afterComponentDetached(Component comp, Page prevpage)
UiLifeCycle.afterComponentDetached(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page)
when a component is detached from a page.
public void afterComponentMoved(Component parent, Component child, Component prevparent)
UiLifeCycle.afterComponentMoved(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
when a component is moved (aka., page changed).
public void afterPageAttached(Page page, Desktop desktop)
UiLifeCycle.afterPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Desktop)
when a compnent's parent is changed.
public void afterPageDetached(Page page, Desktop prevdesktop)
UiLifeCycle.afterPageDetached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Desktop)
when a compnent's parent is changed.
public void addThemeURI(java.lang.String uri)
Note: if ThemeProvider
is specified (setThemeProvider(org.zkoss.zk.ui.util.ThemeProvider)
),
the final theme URIs generated depend on ThemeProvider.getThemeURIs(org.zkoss.zk.ui.Execution, java.util.List
.
public java.lang.String[] getThemeURIs()
Default: an array with zero length.
public void addDisabledThemeURI(java.lang.String uri)
Note: if ThemeProvider
is used (setThemeProvider(org.zkoss.zk.ui.util.ThemeProvider)
),
the URIs of the theme depend on ThemeProvider.getThemeURIs(org.zkoss.zk.ui.Execution, java.util.List
.
uri
- the theme URI to disablepublic java.util.Set<java.lang.String> getDisabledThemeURIs()
addDisabledThemeURI(java.lang.String)
public ThemeProvider getThemeProvider()
Default: null.
Note: if specified, the final theme URIs is decided by
the provider. The URIs specified in getThemeURIs()
are
passed to provider, and it has no effect if the provider decides
to ignore them.
getThemeURIs()
,
getDisabledThemeURIs()
public void setThemeProvider(ThemeProvider provider)
provider
- the theme provide. If null, the default theme URIs
will be used.getThemeProvider()
public void setUiEngineClass(java.lang.Class cls)
UiEngine
.
public java.lang.Class getUiEngineClass()
UiEngine
.
public void setWebAppClass(java.lang.Class cls)
WebApp
and WebAppCtrl
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getWebAppClass()
WebApp
and WebAppCtrl
public void setWebAppFactoryClass(java.lang.Class cls)
Note: setWebAppClass(java.lang.Class)
has the higher priority if not null.
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
cls
- the class that implements WebAppFactory
.public java.lang.Class getWebAppFactoryClass()
WebAppFactory
.
Note: getWebAppClass()
has the higher priority if not null.
public void setDesktopCacheProviderClass(java.lang.Class cls)
DesktopCacheProvider
.
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getDesktopCacheProviderClass()
DesktopCacheProvider
.
public void setUiFactoryClass(java.lang.Class cls)
UiFactory
,
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getUiFactoryClass()
UiFactory
,
public void setFailoverManagerClass(java.lang.Class cls)
FailoverManager
.
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getFailoverManagerClass()
FailoverManager
.
public void setIdGeneratorClass(java.lang.Class cls)
IdGenerator
.
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getIdGeneratorClass()
IdGenerator
public void setSessionCacheClass(java.lang.Class cls)
SessionCache
.
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getSessionCacheClass()
SessionCache
.
public void setAuDecoderClass(java.lang.Class cls)
AuDecoder
.
Note: you have to set the class before WebApp
is created.
Otherwise, it won't have any effect.
public java.lang.Class getAuDecoderClass()
AuDecoder
.
public void setMaxProcessTime(int time)
Default: 3000.
Note: since 3.0.0, this setting has no effect on AU requests. It controls only the requests from the client-polling server push.
time
- the maximal allowed time to process events.
It must be positive.public int getMaxProcessTime()
public void setMaxUploadSize(int sz)
Default: 5120.
sz
- the maximal allowed upload size.
A negative value indicates there is no limit.public int getMaxUploadSize()
public void setFileSizeThreshold(int sz)
Default: 128.
sz
- the file size threshold
A negative value implies default setting.public int getFileSizeThreshold()
public java.lang.String getUploadCharset()
Default: UTF-8.
getUploadCharsetFinder()
public void setUploadCharset(java.lang.String charset)
Note: setUploadCharsetFinder(org.zkoss.zk.ui.util.CharsetFinder)
has the higher priority.
charset
- the charset to use.
If null or empty, UTF-8 is assumed.setUploadCharsetFinder(org.zkoss.zk.ui.util.CharsetFinder)
public CharsetFinder getUploadCharsetFinder()
Default: null
getUploadCharset()
public void setUploadCharsetFinder(CharsetFinder finder)
It has the higher priority than setUploadCharset(java.lang.String)
.
In other words, getUploadCharset()
is used only if
this method returns null or CharsetFinder.getCharset(java.lang.String, java.io.InputStream)
returns null.
setUploadCharset(java.lang.String)
public void setDesktopMaxInactiveInterval(int secs)
Default: 3600 (1 hour).
A negative value indicates the desktop should never timeout.
public int getDesktopMaxInactiveInterval()
Notice that this timeout is used only if JVM starts GC when the memory is running low.
A negative value indicates the desktop should never timeout.
public void setProcessingPromptDelay(int minisecs)
Default: 900
public int getProcessingPromptDelay()
public void setClickFilterDelay(int minisecs)
Button.setAutodisable(java.lang.String)
instead.
If you prefer not to filter out any of them, specify a non-positive value.
Default: 0
minisecs
- the delay to filtering the second click event
if it happens shorter than the second value.
If a non-positive value is specified, no click event is ignored.public int getClickFilterDelay()
Button.setAutodisable(java.lang.String)
instead.
public void setTooltipDelay(int minisecs)
Default: 800
public int getTooltipDelay()
public void setResendDelay(int minisecs)
Default: -1 (i.e., disabled). However, if ZK 5.0.3 EE or prior, the default is 9000.
There are many reasons an Ajax request is not received by the server. With the resending mechanism, ZK ensures the reliable connection between the client and the server.
See also Bug 1839246
minisecs
- the timeout in milliseconds.
Since 3.0.3, you can specify a nonpositive number to disable the resend.public int getResendDelay()
public boolean isCrawlable()
Default: false.
public void setCrawlable(boolean crawlable)
public URIInfo getTimeoutURI(java.lang.String deviceType)
Default: null (to shown an error message).
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.public URIInfo setTimeoutURI(java.lang.String deviceType, java.lang.String timeoutURI, int type)
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.timeoutURI
- the timeout URI. If empty, it means to reload
the same page. If null, an error message is shown instead of
redirecting to another page.type
- how to handle the timeout URI. It is one of
URIInfo.SEND_REDIRECT
or URIInfo.POPUP
.
However, it supports only URIInfo.SEND_REDIRECT
currently.
public java.lang.String getTimeoutMessage(java.lang.String deviceType)
getTimeoutURI(java.lang.String)
returns null.
setTimeoutMessage(java.lang.String, java.lang.String)
public java.lang.String setTimeoutMessage(java.lang.String deviceType, java.lang.String message)
getTimeoutURI(java.lang.String)
returns null.
To specify an I18N label, prefix the key with label:
.
To specify the JavaScript code, prefix the code with script:
.
Refer to ZK Configuration Reference
for more information.
public boolean isAutomaticTimeout(java.lang.String deviceType)
setAutomaticTimeout(java.lang.String, boolean)
for details.
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.setAutomaticTimeout(java.lang.String, boolean)
,
getTimeoutURI(java.lang.String)
public boolean setAutomaticTimeout(java.lang.String deviceType, boolean auto)
Default: false. It means this page is redirected to the timeout URI when the use takes some action after timeout. In other words, nothing happens if the user does nothing. If it is set to true, it is redirected as soon as the timeout URI, no matter the user takes any action.
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.setTimeoutURI(java.lang.String, java.lang.String, int)
public java.lang.String setClientErrorReload(java.lang.String deviceType, int errCode, java.lang.String uri, java.lang.String connType)
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.errCode
- the error code.uri
- the URI to redirect to. It cannot be null.
If empty, the client will reload the same page again.
If null, it is the same as removeClientErrorReload(java.lang.String, int, java.lang.String)
connType
- the connection type: au or server-push.
If null, "au" is assumed.
public java.lang.String removeClientErrorReload(java.lang.String deviceType, int errCode, java.lang.String connType)
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.errCode
- the error code.connType
- the connection type: au or server-push.
If null, "au" is assumed.
public java.lang.String getClientErrorReload(java.lang.String deviceType, int errCode, java.lang.String connType)
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.errCode
- the error code.connType
- the connection type: au or server-push.
If null, "au" is assumed.public java.lang.Object[][] getClientErrorReloads(java.lang.String deviceType, java.lang.String connType)
Default: none (none since 3.6.0, while older version: 302, 401 and 403 are associated with an empty URI).
deviceType
- the device type: ajax or mil.
If null, ajax is assumed.connType
- the connection type: au or server-push.
If null, "au" is assumed.
URIInfo
.
For example, [[410, new URIInfo("/login.zul")], [310, new URIInfo("/login2.zul")]].public void setSessionMaxInactiveInterval(int secs)
Default: 0 (means the system default).
setTimerKeepAlive(boolean)
,
Session.setMaxInactiveInterval(int)
public int getSessionMaxInactiveInterval()
Default: 0 (means the system default).
A negative value indicates that there is no limit. Zero means to use the system default (usually defined in web.xml).
isTimerKeepAlive()
,
Session.getMaxInactiveInterval()
public void setSessionMaxDesktops(int max)
Defafult: 15.
A negative value indicates there is no limit.
public int getSessionMaxDesktops()
A negative value indicates there is no limit.
public void setSessionMaxRequests(int max)
Defafult: 5.
A negative value indicates there is no limit, but it is not recommended due to the possibility of the DoS attacks.
public int getSessionMaxRequests()
A negative value indicates there is no limit, but it is not recommended due to the possibility of the DoS attacks.
public void setSessionMaxPushes(int max)
Default: -1 (no limitation).
max
- the maximal allowed number.
A negative value indicates there is no limit.public int getSessionMaxPushes()
public void setMaxSpareThreads(int max)
Default: 100.
A negative value indicates there is no limit.
ZK uses a thread pool to keep the idle event processing threads. It speeds up the service of an event by reusing the thread queued in this pool.
setMaxSuspendedThreads(int)
,
isEventThreadEnabled()
public int getMaxSpareThreads()
isEventThreadEnabled()
public void setMaxSuspendedThreads(int max)
Default: -1 (no limit).
A negative value indicates there is no limit.
It is ignored if the use of the event processing thread
is disable (isEventThreadEnabled()
.
public int getMaxSuspendedThreads()
It is ignored if the use of the event processing thread
is disable (isEventThreadEnabled()
.
isEventThreadEnabled()
public void enableEventThread(boolean enable)
Default: false (disabled).
java.lang.IllegalStateException
- if there is suspended thread
and use is false.public boolean isEventThreadEnabled()
Default: false (disabled).
public void enableZScript(boolean enable)
Default: true (enabled).
public boolean isZScriptEnabled()
Default: true (enabled).
public Monitor getMonitor()
public Monitor setMonitor(Monitor monitor)
Default: null.
There is at most one monitor for each Web application. The previous monitor will be replaced when this method is called.
In addition to call this method, you could specify a monitor in zk.xml
monitor
- the performance meter. If null, the meter function
is disabled.
public PerformanceMeter getPerformanceMeter()
public PerformanceMeter setPerformanceMeter(PerformanceMeter meter)
Default: null.
There is at most one performance meter for each Web application. The previous meter will be replaced when this method is called.
In addition to call this method, you could specify a performance meter in zk.xml
meter
- the performance meter. If null, the meter function
is disabled.
public ExecutionMonitor getExecutionMonitor()
public ExecutionMonitor setExecutionMonitor(ExecutionMonitor monitor)
Default: null.
There is at most one execution monitor for each Web application. The previous meter will be replaced when this method is called.
In addition to call this method, you could specify an execution monitor in zk.xml
monitor
- the execution monitor. If null, the monitor function
is disabled.
public DesktopRecycle getDesktopRecycle()
public DesktopRecycle setDesktopRecycle(DesktopRecycle dtRecycle)
Default: null.
There is at most one desktop recycle for each Web application. The previous instance will be replaced when this method is called.
In addition to call this method, you could specify a desktop recycle in zk.xml
dtRecycle
- the desktop recycle. If null, the recycle function
is disabled.
public java.lang.String getResponseCharset()
DHtmlLayoutServlet
,
Default: UTF-8.
public void setResponseCharset(java.lang.String charset)
DHtmlLayoutServlet
,
charset
- the charset to use. If null or empty, the container's default
is used.public java.lang.String getPreference(java.lang.String name, java.lang.String defaultValue)
setPreference(java.lang.String, java.lang.String)
.
Preference is application specific. You can specify whatever you want as you specifying context-param for a Web application.
defaultValue
- the default value that is used if the specified
preference is not found.public void setPreference(java.lang.String name, java.lang.String value)
public java.util.Set<java.lang.String> getPreferenceNames()
public java.lang.Object addRichlet(java.lang.String name, java.lang.Class richletClass, java.util.Map<java.lang.String,java.lang.String> params)
If there was a richlet associated with the same name, the the old richlet will be replaced.
name
- the richlet nameparams
- the initial parameters, or null if no initial parameter at all.
Once called, the caller cannot access params
any more.
public java.lang.Object addRichlet(java.lang.String name, java.lang.String richletClassName, java.util.Map<java.lang.String,java.lang.String> params)
If there was a richlet associated with the same name, the the old servlet will be replaced.
name
- the richlet namerichletClassName
- the class name. The class will be loaded
only when the richlet is loaded.params
- the initial parameters, or null if no initial parameter at all.
Once called, the caller cannot access params
any more.
public void addRichletMapping(java.lang.String name, java.lang.String path)
name
- the name of the richlet.path
- the URL pattern. It must start with '/' and may end
with '/*'.
UiException
- if the richlet is not defined yet.
See addRichlet(java.lang.String, java.lang.Class, java.util.Map)
.public Richlet getRichlet(java.lang.String name)
public Richlet getRichletByPath(java.lang.String path)
public void detroyRichlets()
public void setKeepDesktopAcrossVisits(boolean keep)
Default: false.
public boolean isKeepDesktopAcrossVisits()
public void setTimerKeepAlive(boolean alive)
Default: false.
A session is expired (and then invalidated), if it didn't receive
any client request in the specified timeout interval
(getSessionMaxInactiveInterval()
).
By setting this option to true, the session timeout will be reset
when onTimer is received (just like any other event).
Note: if true and the timer is shorter than
the session timeout (getSessionMaxInactiveInterval()
),
the session is never expired.
alive
- whether to keep the session alive when receiving
onTimerpublic boolean isTimerKeepAlive()
public boolean isDebugJS()
setDebugJS(boolean)
public void setDebugJS(boolean debug)
Default: false.
If true is specified, it will try to load the original
Java (i.e., uncompressed) file instead of the compressed one.
For example, if ClassWebResource.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
is called to load abc.js,
and isDebugJS()
, then ClassWebResource.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
will try
to load abc.org.js first. If not found, it load ab.js insted.
If isDebugJS()
is false (default),
abc.js is always loaded.
Prior to 5.0.3, the setting won't affect JavaScript files that have been loaded. That is, the reboot is required.
debug
- whether to debug JavaScript files.
If true, the original JavaScript files shall be
loaded instead of the compressed files.public boolean isRepeatUuid()
Default: false.
Note: if the custom ID generator (org.zkoss.zk.ui.util.IdGenerator) is used, this option is meaningless.
public void setRepeatUuid(boolean repeat)
public void setExpressionFactoryClass(java.lang.Class<? extends ExpressionFactory> expfcls)
Default: null -- it means the org.zkoss.xel.el.ELFactory class (it requires zcommons-el.jar).
Note: you can only specify an implementation that is compatible with JSP EL here, since ZK's builtin pages depend on it. However, you can use any factory you like in an individual page, as long as all expressions in the page follow the syntax of the evaluator you are using.
expfcls
- the implemtation class, or null to use the default.
Note: expfcls must implement ExpressionFactory
.public java.lang.Class<? extends ExpressionFactory> getExpressionFactoryClass()
setExpressionFactoryClass(java.lang.Class extends org.zkoss.xel.ExpressionFactory>)
public Event beforeSendEvent(Event event)
EventInterceptor.beforeSendEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>)
with a class implementing
EventInterceptor
.
Used only internally.
public Event beforePostEvent(Event event)
EventInterceptor.beforePostEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>)
with a class implementing
EventInterceptor
.
Used only internally.
public Event beforeProcessEvent(Event event)
EventInterceptor.beforeProcessEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>)
with a class implementing
EventInterceptor
.
Used only internally.
public void afterProcessEvent(Event event)
EventInterceptor.afterProcessEvent(org.zkoss.zk.ui.event.Event)
registered by addListener(java.lang.Class>)
with a class implementing
EventInterceptor
.
Used only internally.
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public java.lang.Object getAttribute(java.lang.String name)
public java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
value
- the value of the attribute. If null, it means removal,
i.e., removeAttribute(java.lang.String)
.
public java.lang.Object removeAttribute(java.lang.String name)
public void addClientPackage(java.lang.String pkg)
Default: none.
If no package is defined (default), ZK Client Engine assumes all packages coming from the server generating the HTML page.
However, it might not be true if you want to load some client codes from different server (such as Ajax-asService). Therefore, you have to invoke this method to add the client packages if this server is going to provide JavaScript codes for other servers.
public java.lang.String[] getClientPackages()
public int getEventTimeWarning()
Default: 600
public void setEventTimeWarning(int secs)
secs
- the number of seconds.
If a non-positive number is specified, no warning message at all.public java.lang.String addErrorPage(java.lang.String deviceType, java.lang.Class type, java.lang.String location)
deviceType
- the device type: ajax or miltype
- what type of errors the error page is associated with.location
- where is the error page.
public java.lang.String getErrorPage(java.lang.String deviceType, java.lang.Throwable error)
deviceType
- the device type: ajax or milerror
- the exception being thrown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |