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: 117
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: 205
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 message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2285
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
Previous Topic:ExitConfirmation doesn't work on firefox and chrome
Next Topic:RAP - TreeViewer custom variant
Goto Forum:
  


Current Time: Fri Aug 17 15:17:37 GMT 2018

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

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

Back to the top