Package org.zkoss.zk.ui.sys

## Interface WebAppCtrl

- All Known Implementing Classes:
    `AbstractWebApp`, `SimpleWebApp`

      public interface WebAppCtrl

  Additional interface of `WebApp` for implementation.

  Note: applications shall never access this interface.

  Author:
    tomyeh

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `destroy()` | Destroys this Web application.
    `AuDecoder` | `getAuDecoder()` | Returns the AU decoder for this Web application, or null if not assigned.
    `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).
    `UiEngine` | `getUiEngine()` | Returns the UI engine for this Web application (never null).
    `UiFactory` | `getUiFactory()` | Returns the UI factory for this Web application (never null).
    `void` | `init​(java.lang.Object context, Configuration config)` | Initializes this Web application.
    `void` | `sessionDestroyed​(Session sess)` | Called when the native session of the specified session has been destroyed
    `void` | `sessionDidActivate​(Session sess)` | Notification that the session has just been activated (a.k.a., deserialized).
    `void` | `sessionWillPassivate​(Session sess)` | Notification that the session is about to be passivated (a.k.a., serialized).
    `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 manager)` | Sets the failover manager for this Web application.
    `void` | `setIdGenerator​(IdGenerator generator)` | 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.

- - ### Method Detail

    - #### init

          void init​(java.lang.Object context,
                    Configuration config)

      Initializes this Web application.
      Parameters:
        `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)

    - #### destroy

          void destroy()

      Destroys this Web application.

      Note; once destroyed, this instance cannot be used anymore.

    - #### getUiEngine

          UiEngine getUiEngine()

      Returns the UI engine for this Web application (never null).

    - #### setUiEngine

          void setUiEngine​(UiEngine engine)

      Sets the UI engine for this Web application. The UI engine is stateful so it is not safe to change it if there are active sessions.
      Parameters:
        `engine` - the UI engine
      Throws:
        `java.lang.IllegalArgumentException` - if engine is null.
      Since:
        3.6.0

    - #### getDesktopCache

          DesktopCache getDesktopCache​(Session sess)

      Returns the desktop cache. A shortcut of `getDesktopCacheProvider()`'s `DesktopCacheProvider.getDesktopCache(org.zkoss.zk.ui.Session)`.

    - #### getDesktopCacheProvider

          DesktopCacheProvider getDesktopCacheProvider()

      Returns the desktop cache provider.

    - #### setDesktopCacheProvider

          void setDesktopCacheProvider​(DesktopCacheProvider provider)

      Sets the desktop provider for this Web application.
      Parameters:
        `provider` - the desktop cache provider
      Throws:
        `java.lang.IllegalArgumentException` - if provider is null.
      Since:
        3.6.0

    - #### getUiFactory

          UiFactory getUiFactory()

      Returns the UI factory for this Web application (never null).

    - #### setUiFactory

          void setUiFactory​(UiFactory factory)

      Sets the UI factory for this Web application.
      Parameters:
        `factory` - the UI factory
      Throws:
        `java.lang.IllegalArgumentException` - if factory is null.
      Since:
        3.6.0

    - #### getFailoverManager

          FailoverManager getFailoverManager()

      Returns the failover manager, or null if not available.

    - #### setFailoverManager

          void setFailoverManager​(FailoverManager manager)

      Sets the failover manager for this Web application.
      Parameters:
        `manager` - the failover manager. If null, it means no failover manager at all.
      Since:
        3.6.0

    - #### getIdGenerator

          IdGenerator getIdGenerator()

      Returns the ID generator, or null if not available.
      Since:
        2.4.1

    - #### setIdGenerator

          void setIdGenerator​(IdGenerator generator)

      Sets the ID generator for this Web application.
      Parameters:
        `generator` - the ID generator. If null, it means no (custom) ID generator at all.
      Since:
        3.6.0

    - #### getSessionCache

          SessionCache getSessionCache()

      Returns the session cache (never null). The session cache is used to store ZK sessions.
      Since:
        3.0.5

    - #### setSessionCache

          void setSessionCache​(SessionCache cache)

      Sets the session cache for this Web application.
      Parameters:
        `cache` - the session cache
      Throws:
        `java.lang.IllegalArgumentException` - if cache is null.
      Since:
        3.6.0

    - #### getAuDecoder

          AuDecoder getAuDecoder()

      Returns the AU decoder for this Web application, or null if not assigned.
      Since:
        5.0.4

    - #### setAuDecoder

          void setAuDecoder​(AuDecoder audec)

      Sets the AU decoder for this Web application.

      Default: null (using the system default).

      Since:
        5.0.4

    - #### sessionWillPassivate

          void sessionWillPassivate​(Session sess)

      Notification that the session is about to be passivated (a.k.a., serialized).

    - #### sessionDidActivate

          void sessionDidActivate​(Session sess)

      Notification that the session has just been activated (a.k.a., deserialized).

    - #### sessionDestroyed

          void sessionDestroyed​(Session sess)

      Called when the native session of the specified session has been destroyed
      Since:
        3.5.1