User (in)activity detection and auto-logout [message #1060215] |
Thu, 23 May 2013 10:40  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
(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 ) 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 !
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02903 seconds