Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » User (in)activity detection and auto-logout
User (in)activity detection and auto-logout [message #1060215] Thu, 23 May 2013 10:40 Go to next message
Eclipse UserFriend
Hi everyone!

I'd like to know how is it possible from a detected user (in)activity automatically trigger a IClientSession#stopSession for example?

I currently experience great difficulties to combine:

UserActivityManager, UserActivityListener, UserActivityEvent, from the client-side

then

IUserActivityProvider, IUserActivityStateService, UserActivityClientNotification, UserStatusMap, from the server-side.

Thanks!
Re: User (in)activity detection and auto-logout [message #1060461 is a reply to message #1060215] Fri, 24 May 2013 15:53 Go to previous messageGo to next message
Eclipse UserFriend
(semi-)SOLVED (I suppose!)

Since the Servlet/RAP APIs provide session autoclose way and the documentation from AbstractRwtEnvironment

states for AbstractRwtEnvironment#initClientSession(UserAgent)

Quote:

As default, the IClientSession is attached to the http session. This means, the client session lives as long the http session lives. If the http session expires, the client session will be stopped.

This method creates and loads a new client session if there is no client session attached to the http session yet. If there already is one attached, the attached session will be returned.



I simply choosed to override AbstractRwtEnvironment#initClientSession(UserAgent) this way:

@Override
protected IClientSession initClientSession(final UserAgent userAgent) {

	final IClientSession clientSession = super.initClientSession(userAgent);
	// timeout is set to 60 seconds.
	RWT.getSessionStore().getHttpSession().setMaxInactiveInterval(60);
	return clientSession;
}


And all worked fine!

But I don't particulary approve this solution (my own Smile ) because the API states "AS DEFAULT", witch means that, I think, if the tigh conceptual coupling between the Scout IClientSession and the HTTP Session, is lost in a near future, this workouround will also probably be inefficient!


A solution combining, the own Scout's arifacts would be the best, but meanwhile ... this one works Wink !
Re: User (in)activity detection and auto-logout [message #1061275 is a reply to message #1060461] Thu, 30 May 2013 17:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Boy

Specifying a session timeout is the right way. If you package your app as war and deploy it on a servlet container (e.g. tomcat), you can set the timeout in the web.xml. I don't know how to do it with jetty, but setting it programmatically with setMaxInactiveInterval is definitely a possibility too.

The UserActivity stuff is not implemented for the rap ui, at least as far as I know.

Regards
Claudio
Re: User (in)activity detection and auto-logout [message #1061339 is a reply to message #1061275] Fri, 31 May 2013 05:41 Go to previous message
Eclipse UserFriend
OK,
Thank you very much! Smile
Previous Topic:scout eclipse features
Next Topic:Marketplace entries?
Goto Forum:
  


Current Time: Wed Jul 23 01:11:35 EDT 2025

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

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

Back to the top