org.zkoss.zk.ui.impl
Class SimpleDesktopCache

java.lang.Object
  extended by org.zkoss.zk.ui.impl.SimpleDesktopCache
All Implemented Interfaces:
java.io.Serializable, DesktopCache

public class SimpleDesktopCache
extends java.lang.Object
implements DesktopCache, java.io.Serializable

A simple implementation of DesktopCache. It manages all desktop in a CacheMap instance.

Author:
tomyeh
See Also:
Serialized Form

Constructor Summary
SimpleDesktopCache(Configuration config)
           
 
Method Summary
 void addDesktop(Desktop desktop)
          Adds a desktop to this session.
 Desktop getDesktop(java.lang.String desktopId)
          Returns the desktop for the specified desktop ID.
 Desktop getDesktopIfAny(java.lang.String desktopId)
          Returns the desktop for the specified desktop ID, or null if not found.
 int getNextKey()
          Returns the next available key which is unique in the whole cache.
 void removeDesktop(Desktop desktop)
          Removes a desktop from this session.
 void sessionDidActivate(Session sess)
          Invokes DesktopCtrl.sessionDidActivate(org.zkoss.zk.ui.Session) for each desktops it cached.
 void sessionWillPassivate(Session sess)
          Invokes DesktopCtrl.sessionWillPassivate(org.zkoss.zk.ui.Session) for each desktops it cached.
 void stop()
          Called when to stop and cleanup this cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDesktopCache

public SimpleDesktopCache(Configuration config)
Method Detail

getNextKey

public int getNextKey()
Description copied from interface: DesktopCache
Returns the next available key which is unique in the whole cache.

Desktop uses this method to generate ID automatically.

Specified by:
getNextKey in interface DesktopCache

getDesktopIfAny

public Desktop getDesktopIfAny(java.lang.String desktopId)
Description copied from interface: DesktopCache
Returns the desktop for the specified desktop ID, or null if not found.

Specified by:
getDesktopIfAny in interface DesktopCache

getDesktop

public Desktop getDesktop(java.lang.String desktopId)
Description copied from interface: DesktopCache
Returns the desktop for the specified desktop ID.

Specified by:
getDesktop in interface DesktopCache

addDesktop

public void addDesktop(Desktop desktop)
Description copied from interface: DesktopCache
Adds a desktop to this session. It must be called when a desktop is created.

Application shall never access this method.

Specified by:
addDesktop in interface DesktopCache

removeDesktop

public void removeDesktop(Desktop desktop)
Description copied from interface: DesktopCache
Removes a desktop from this session. It must be called when a desktop is remove.

Application shall never access this method.

Specified by:
removeDesktop in interface DesktopCache

sessionWillPassivate

public void sessionWillPassivate(Session sess)
Invokes DesktopCtrl.sessionWillPassivate(org.zkoss.zk.ui.Session) for each desktops it cached.

Specified by:
sessionWillPassivate in interface DesktopCache

sessionDidActivate

public void sessionDidActivate(Session sess)
Invokes DesktopCtrl.sessionDidActivate(org.zkoss.zk.ui.Session) for each desktops it cached.

Specified by:
sessionDidActivate in interface DesktopCache

stop

public void stop()
Description copied from interface: DesktopCache
Called when to stop and cleanup this cache. Once stopped, the caller shall not access it any more. It cannot be called other than the implementation of DesktopCacheProvider.

Specified by:
stop in interface DesktopCache


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo