-
July 12th, 2007, 09:37 AM
#2
Hi Martin,
There exist cases where you could decide to disconnect a user from Lightstreamer Server (for example if they log into a second session on a different Server and you don't want to support multiple push session for the same account; if you have one Server only, ConflictingSessionException will do the trick). There are three ways to terminate an existing Lightstreamer session (one of which has been deprecated):
Option 1) Implement the getUserSession() method of the MetadataProvider together with the KILL command on the HTTP interface (see section 4.4 of “Network Protocol Tutorial.pdf”). But the getUserSession() method has been deprecated (i.e. we could decide in future releases of Lightstreamer Server to discontinue it), mainly for security reasons.
Option 2) Use JMX (which is only available in the Vivace Edition of Lightstreamer). JMX (Java Management eXtensions) is a standard specification that allows an application to be controlled both internally and externally and both manually and automatically (i.e. from code). Lightstreamer Server exposes a set of MBeans that give full control over the engine and the sessions. To terminate a session through JMX, you just need to call the destroySession() method on the appropriate SessionMBean object. The powerful aspect is that you can access MBean objects both from inside your Adapter and from your J2EE application server, because JMX already implements several transport protocols for remote invocation, besides in-process invocation.
Option 3) Handle the termination on the client side. Your clients will subscribe to some "service item" through which your Data Adapter will deliver termination notifications to the clients. When a client receives such message, it will terminate its Lightstreamer session, disconnecting from Lightstreamer Server.
Similar Threads
-
By Alessandro in forum General
Replies: 6
Last Post: February 7th, 2020, 02:03 PM
-
By magnum_rg in forum Client SDKs
Replies: 5
Last Post: August 12th, 2011, 09:43 AM
-
By vaduganathan in forum Client SDKs
Replies: 1
Last Post: May 12th, 2010, 09:26 AM
-
By gjoseph in forum Client SDKs
Replies: 3
Last Post: August 20th, 2009, 10:14 AM
-
By Mone in forum Client SDKs
Replies: 0
Last Post: July 30th, 2009, 09:09 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 10:15 AM.
Bookmarks