Managing channel sessions for any communication protocol

To enable the application server to accept operation requests from devices that use any communication protocol, complete the following steps:
  1. Create an instance of a ChannelSessionHandler.
  2. Create an event class that will be used to notify registered listeners that the session has expired.
  3. Implement the event listener for the event class created in the previous step.

Creating an instance of a ChannelSessionHandler

Create a new ChannelSessionHandler class for each channel that needs to be notified of events coming from the channel session manager. For example, a specialized ChannelSessionHandler for an HttpSession would implement the HttpSessionBindingListener interface, which would allow the handler to be notified when the HttpSession is added or removed from the servlet engine session manager (that is, WebSphere®).

Creating an event class

Create an instance of the ChannelSessionStateChangedEvent with the session ID of the session that has expired. When the ChannelSessionHandler is notified of a change in the session, this event is fired to all registered listeners.

Implementing an event listener for the event class

Implement the ChannelSessionStateChangedListener interface, and add the new class to the ChannelSessionHandler as a listener of the ChannelSessionStateChangedEvent. For example, for devices that support the HTTP communication protocol and use cookies to manage the session, the instance of the CSServer would be a registered listener of events from the ChannelSessionHandler. The CSServer would then propagate the event, which would be handled by the application to remove the session from the application session table and perform any other cleanup required for the session.