Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How get number of sessions?
How get number of sessions? [message #1774452] Sat, 14 October 2017 23:04 Go to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 134
Registered: February 2013
Senior Member
short question
How get number of active sessions?
Dmitry
Re: How get number of sessions? [message #1774467 is a reply to message #1774452] Mon, 16 October 2017 00:22 Go to previous messageGo to next message
Chris Fairhall is currently offline Chris FairhallFriend
Messages: 221
Registered: February 2011
Senior Member
You'd probably have to write an HttpSessionListener to track HttpSession's. To count the number of RAP sessions, you'd need to iterate all the values of all the HttpSessions, and count the ones that are of type UISession

Doesn't sound like a very efficient way of doing things though. What's the use case? Simply for runtime stats?

You could put code in your entrypoint to track the sessions. If you run in SWT Compat mode, the start and end of your createUI method is one place to put it.
For JEE mode, I guess you could increment your count in createUI and add a listener to the UISession to decrement it when it's destroyed.


edit: Or use a HttpSessionBindingListener or HttpAttributeListener, that way you can tract UISession instances directly

[Updated on: Mon, 16 October 2017 00:29]

Report message to a moderator

Re: How get number of sessions? [message #1774979 is a reply to message #1774452] Mon, 23 October 2017 07:14 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2349
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
every UI session has a display object associated. You can use RAP internals to get a array with all display objects like in private method Display#getDisplays:
---
ContextProvider.getApplicationContext().getDisplaysHolder().getDisplays();
---
HTH,
Ivan
Re: How get number of sessions? [message #1832693 is a reply to message #1774979] Wed, 23 September 2020 11:50 Go to previous message
Abdalla Bushnaq is currently offline Abdalla BushnaqFriend
Messages: 3
Registered: September 2020
Junior Member
Thanks Ivan, will try that and report back.
Previous Topic:Unable to load resource platform:/plugin/HelloWorld/Application.e4xmi
Next Topic:About the use of Table Shortcuts in Mac.
Goto Forum:
  


Current Time: Fri Sep 25 20:12:35 GMT 2020

Powered by FUDForum. Page generated in 0.01653 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top