|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.impl.AbstractWebApp
public abstract class AbstractWebApp
A skeletal implementation of WebApp
.
Constructor Summary | |
---|---|
protected |
AbstractWebApp()
Constructor. |
Method Summary | |
---|---|
void |
destroy()
Destroys this Web application. |
java.lang.String |
getAppName()
Returns the application name, never null. |
java.lang.Object |
getAttribute(java.lang.String name,
boolean recurse)
Returns the custom attribute associated with this object. |
AuDecoder |
getAuDecoder()
Returns the AU decoder for this Web application, or null if not assigned. |
java.lang.String |
getBuild()
Returns the build identifier, such as 2007121316. |
Configuration |
getConfiguration()
Returns the configuration. |
DesktopCache |
getDesktopCache(Session sess)
Returns the desktop cache. |
DesktopCacheProvider |
getDesktopCacheProvider()
Returns the desktop cache provider. |
FailoverManager |
getFailoverManager()
Returns the failover manager, or null if not available. |
IdGenerator |
getIdGenerator()
Returns the ID generator, or null if not available. |
SessionCache |
getSessionCache()
Returns the session cache (never null). |
int |
getSubversion(int portion)
Returns a portion of the version in an integer by specifying its index. |
UiEngine |
getUiEngine()
Returns the UI engine for this Web application (never null). |
UiFactory |
getUiFactory()
Returns the UI factory for this Web application (never null). |
java.lang.String |
getVersion()
Returns the ZK version, such as "1.1.0" and "2.0.0". |
boolean |
hasAttribute(java.lang.String name,
boolean recurse)
Returns if a custom attribute is associated with this object. |
void |
init(java.lang.Object context,
Configuration config)
Initializes this Web application. |
static java.lang.String |
loadBuild()
Loads the build identifier. |
java.lang.Object |
removeAttribute(java.lang.String name,
boolean recurse)
Removes the custom attribute associated with this scope. |
void |
sessionDestroyed(Session sess)
Called when the native session of the specified session has been destroyed |
void |
sessionDidActivate(Session sess)
Invokes getDesktopCacheProvider() 's
DesktopCacheProvider.sessionDidActivate(org.zkoss.zk.ui.Session) . |
void |
sessionWillPassivate(Session sess)
Invokes getDesktopCacheProvider() 's
DesktopCacheProvider.sessionWillPassivate(org.zkoss.zk.ui.Session) . |
void |
setAppName(java.lang.String name)
Sets the application name. |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value,
boolean recurse)
Sets the custom attribute associated with this scope, or the parent scope. |
void |
setAuDecoder(AuDecoder audec)
Sets the AU decoder for this Web application. |
void |
setDesktopCacheProvider(DesktopCacheProvider provider)
Sets the desktop provider for this Web application. |
void |
setFailoverManager(FailoverManager failover)
Sets the failover manager for this Web application. |
void |
setIdGenerator(IdGenerator idgen)
Sets the ID generator for this Web application. |
void |
setSessionCache(SessionCache cache)
Sets the session cache for this Web application. |
void |
setUiEngine(UiEngine engine)
Sets the UI engine for this Web application. |
void |
setUiFactory(UiFactory factory)
Sets the UI factory for this Web application. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.zkoss.zk.ui.WebApp |
---|
getAttribute, getAttributes, getInitParameter, getInitParameterNames, getMimeType, getNativeContext, getRealPath, getResource, getResourceAsStream, getResourcePaths, getServletContext, getUpdateURI, getUpdateURI, getWebApp, log, log, removeAttribute, setAttribute |
Methods inherited from interface org.zkoss.zk.ui.ext.Scope |
---|
addScopeListener, hasAttribute, removeScopeListener |
Methods inherited from interface org.zkoss.util.resource.Locator |
---|
getDirectory |
Constructor Detail |
---|
protected AbstractWebApp()
Note: after constructed, it is not initialized completely.
For example, getConfiguration()
returns null.
WebManager will initialize it later such as initializing
a Configuration
instance by loading zk.xml,
and then calling init(java.lang.Object, org.zkoss.zk.ui.util.Configuration)
.
Method Detail |
---|
public java.lang.String getAppName()
WebApp
Default: ZK
getAppName
in interface WebApp
public void setAppName(java.lang.String name)
WebApp
setAppName
in interface WebApp
public final java.lang.String getVersion()
WebApp
getVersion
in interface WebApp
WebApp.getSubversion(int)
,
Utils.parseVersion(java.lang.String)
,
Utils.compareVersion(int[], int[])
public final java.lang.String getBuild()
WebApp
Each time ZK is built, a different build identifier is assigned.
getBuild
in interface WebApp
public int getSubversion(int portion)
WebApp
getSubversion
in interface WebApp
portion
- which portion of the version; starting from 0.
If you want to retrieve the major version, specify 0.WebApp.getVersion()
public final Configuration getConfiguration()
WebApp
getConfiguration
in interface WebApp
public java.lang.Object getAttribute(java.lang.String name, boolean recurse)
Scope
getAttribute
in interface Scope
recurse
- whether to search its ancestor scope.
If true and the current scope doen't define the attribute,
it searches up its ancestor to see
any of them has defined the specified attribute.public boolean hasAttribute(java.lang.String name, boolean recurse)
Scope
Notice that null
is a valid value, so you can
tell if an attribute is associated by examining the return value
of Scope.getAttribute(java.lang.String)
.
hasAttribute
in interface Scope
recurse
- whether to search its ancestor scope.
If true and the current scope doen't define the attribute,
it searches up its ancestor to see
any of them has defined the specified attribute.public java.lang.Object setAttribute(java.lang.String name, java.lang.Object value, boolean recurse)
Scope
setAttribute
in interface Scope
recurse
- whether to look up the parent scope for the
existence of the attribute.Scope.setAttribute(String,Object)
.public java.lang.Object removeAttribute(java.lang.String name, boolean recurse)
Scope
removeAttribute
in interface Scope
recurse
- whether to look up the parent scope for the
existence of the attribute.Scope.removeAttribute(String)
.public void init(java.lang.Object context, Configuration config)
WebAppCtrl
init
in interface WebAppCtrl
context
- the servlet context, if servlets are used.
Currently, ZK supports only servlets. In the future there might be
more to support.config
- the configuration (never null)public void destroy()
WebAppCtrl
Note; once destroyed, this instance cannot be used anymore.
destroy
in interface WebAppCtrl
public final UiEngine getUiEngine()
WebAppCtrl
getUiEngine
in interface WebAppCtrl
public void setUiEngine(UiEngine engine)
WebAppCtrl
setUiEngine
in interface WebAppCtrl
engine
- the UI enginepublic DesktopCache getDesktopCache(Session sess)
WebAppCtrl
WebAppCtrl.getDesktopCacheProvider()
's
DesktopCacheProvider.getDesktopCache(org.zkoss.zk.ui.Session)
.
getDesktopCache
in interface WebAppCtrl
public DesktopCacheProvider getDesktopCacheProvider()
WebAppCtrl
getDesktopCacheProvider
in interface WebAppCtrl
public void setDesktopCacheProvider(DesktopCacheProvider provider)
WebAppCtrl
setDesktopCacheProvider
in interface WebAppCtrl
provider
- the desktop cache providerpublic UiFactory getUiFactory()
WebAppCtrl
getUiFactory
in interface WebAppCtrl
public void setUiFactory(UiFactory factory)
WebAppCtrl
setUiFactory
in interface WebAppCtrl
factory
- the UI factorypublic FailoverManager getFailoverManager()
WebAppCtrl
getFailoverManager
in interface WebAppCtrl
public void setFailoverManager(FailoverManager failover)
WebAppCtrl
setFailoverManager
in interface WebAppCtrl
failover
- the failover manager.
If null, it means no failover manager at all.public IdGenerator getIdGenerator()
WebAppCtrl
getIdGenerator
in interface WebAppCtrl
public void setIdGenerator(IdGenerator idgen)
WebAppCtrl
setIdGenerator
in interface WebAppCtrl
idgen
- the ID generator.
If null, it means no (custom) ID generator at all.public SessionCache getSessionCache()
WebAppCtrl
getSessionCache
in interface WebAppCtrl
public void setSessionCache(SessionCache cache)
WebAppCtrl
setSessionCache
in interface WebAppCtrl
cache
- the session cachepublic AuDecoder getAuDecoder()
WebAppCtrl
getAuDecoder
in interface WebAppCtrl
public void setAuDecoder(AuDecoder audec)
WebAppCtrl
Default: null (using the system default).
setAuDecoder
in interface WebAppCtrl
public void sessionWillPassivate(Session sess)
getDesktopCacheProvider()
's
DesktopCacheProvider.sessionWillPassivate(org.zkoss.zk.ui.Session)
.
sessionWillPassivate
in interface WebAppCtrl
public void sessionDidActivate(Session sess)
getDesktopCacheProvider()
's
DesktopCacheProvider.sessionDidActivate(org.zkoss.zk.ui.Session)
.
sessionDidActivate
in interface WebAppCtrl
public void sessionDestroyed(Session sess)
WebAppCtrl
sessionDestroyed
in interface WebAppCtrl
public static java.lang.String loadBuild()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |