Runtime components : Channels components : Key features : Concepts : Channel and application sessions : Session management : Session status callback
  
Session status callback
In V8.2.0.2 or later, the ISessionCallBack interface is provided to help you monitor the session status. You can implement the callback APIs of the ISessionCallBack interface according to your business requirements to improve the system performance.
The ISessionCallBack interface is provided to monitor the session status changes when the session is created, removed, updated, retrieved, and timeout. You can implement the callback APIs in the ISessionCallBack interface to deliver distributed cache management. You can capture the session status changes and manage the sessions in the cache by taking the actions that you implemented for different session statuses. In this way, the data granularity for session management is improved. By implementing the ISessionCallBack interface, the following advantages are supported to improve your system performance.
Monitor the session status and distribute the cache according to business functions.
Capture the session status changes and manage the session data in the cache according to real-time performance and business requirements.
Design and configure your failover mechanism with the support of the fine-grained callback APIs.
The ISessionCallBack interface contains the following callback APIs:
onNewSession(String sessionId)
Use this interface to monitor the session status change when a session is created, and implement your response actions.
onRemove(String sessionId)
Use this interface to monitor the session status change when a session is removed, and implement your response actions.
Note Because the session context is removed before the session is removed, you cannot get the session context in this interface.
onIdle(String sessionId)
Use this interface to monitor when the session idle threshold is reached, and implement your response actions.
Two levels of session timeout is defined in the ISessionCallBack interface. The first level with the lower timeout threshold value is defined to monitor when the session is idle for a specified duration. You can use this interface to monitor the idle level of the session timeout. When this interface is called, The idle status of the session entry is true.
After this interface is called, monitoring of processor timeout is paused until the session becomes active.
onTimeout(String sessionId)
Use this interface to monitor when the session timeout threshold is reached, and implement your response actions.
Two levels of session timeout is defined in the ISessionCallBack interface. The second level with the higher timeout threshold value is defined to monitor when the session is timeout. You can use this interface to monitor when the application is timeout.
onRetrieveIdleContext(String sessionId)
Use this interface to monitor when the context of an idle session is retrieved, and implement your response actions.
After the onIdle interface is called, the idle status of the session entry is true. The system users can still change or swap out the context. To ensure that the context exists and is usable, the onRetrieveIdleContext interface is called when the context of an idle session is retrieved.
Note This interface is called only when the idle status of the session context is true.
onChange(String sessionId)
Use this interface to monitor when the session data is changed, and implement your response actions.
onGenerateSessionId(String orginal)
Use this interface to generate the session ID, and implement your response actions.
The old default session ID is replaced with the new session ID that is generated by the onGenerateSessionId interface.
onRetrieveSessionById(String sessionId)
Use this interface to monitor when the session is retrieved by using the session ID before failover, and implement your response actions.
onTimeStampChange(String sessionId)
Use this interface to monitor when the sessionEntry timestamp is changed, and implement your response actions.
For details about implementation of the callback APIs of the ISessionCallBack interface, see Implementing the callback APIs of the ISessionCallBack interface.
Go up to
Session management