org.zkoss.zk.ui.sys
Interface SessionCtrl

All Known Implementing Classes:
SerializableSession, SimpleSession

public interface SessionCtrl

Additional interface of Session for implementation.

Note: applications shall never access this interface.

Author:
tomyeh

Method Summary
 DesktopCache getDesktopCache()
          Returns the desktop cache, or null if not available.
 int getNextUuidGroup(int groupSize)
          Returns a sequence of UUID for DesktopCtrl.getNextUuid() to generate component UUID.
 void invalidateNow()
          Really invalidates the session.
 boolean isInvalidated()
          Returns whether this session is invalidated (i.e., Session.invalidate() was called).
 void notifyClientRequest(boolean keepAlive)
          Notifies the session that a client request is received.
 void onDestroyed()
          Called when the session is destroyed.
 void recover(java.lang.Object nativeSession)
          Called when ZK detects Session.getNativeSession() is not initialized properly.
 void setDesktopCache(DesktopCache cache)
          Sets the desktop cache.
 void setDeviceType(java.lang.String deviceType)
          Sets the device type that this session belongs to.
 

Method Detail

setDeviceType

void setDeviceType(java.lang.String deviceType)
Sets the device type that this session belongs to.

It is called by the desktop when Desktop.setDeviceType(java.lang.String) is called. Don't call this method directly. Otherwise, the result is inpredictable.

Since:
2.4.1

getDesktopCache

DesktopCache getDesktopCache()
Returns the desktop cache, or null if not available.

Note: this is an utility to implement DesktopCacheProvider, which might or might not use this method. Other part of ZK shall not access this method.


setDesktopCache

void setDesktopCache(DesktopCache cache)
Sets the desktop cache.

Note: this is an utility to implement DesktopCacheProvider, which might or might not use this method. Other part of ZK shall not access this method.

Parameters:
cache - the desktop cache; null to denote no cache available.

onDestroyed

void onDestroyed()
Called when the session is destroyed.

Application shall never access this method.


recover

void recover(java.lang.Object nativeSession)
Called when ZK detects Session.getNativeSession() is not initialized properly.

It is actually a workaround to solve the issue that some Web contrainer fails to call HttpSessionActivationListener.sessionDidActivate() unpon failover.


isInvalidated

boolean isInvalidated()
Returns whether this session is invalidated (i.e., Session.invalidate() was called).


invalidateNow

void invalidateNow()
Really invalidates the session.

Application shall never access this method.


getNextUuidGroup

int getNextUuidGroup(int groupSize)
Returns a sequence of UUID for DesktopCtrl.getNextUuid() to generate component UUID.

Parameters:
groupSize - how many number of UUID the caller wants.

notifyClientRequest

void notifyClientRequest(boolean keepAlive)
Notifies the session that a client request is received.

Parameters:
keepAlive - if the request will keep the session alive, or the request shall be ignored. If the request shall be ignored and the session is timeout, it will cause the session to expire (i.e., be invalidated).
Since:
3.0.0


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.