Distributed Real-Time - how to capture Idle Time of Application in JSP or Java
Topic: IDLE Time for Java Application not SYSTEM Idle
Hi
I am Krishna , I want to calculate idle time for an application.That is , if
user1 uses the application for example called "yahoo site" for checking
mails , then after 10 mins he went to outside , from 11th min the status
of application should show (Like Yahoo messenger after certail time it
shows idle time ) in another ADMINJSP page for Admins that how
much this user1 idle say.. :
1 min idle
2 min idle
....
....
10 min idle
Now user1 comes and now clicks on application . then ADMINJSP
page should show total IDLE time (10 mins idle). And he again after 15
mins he went some where from 16th min the status of the application
should show in ADMINJSP page.If user1 left the application like that
then the application should be idle for 1 hour i.e
1 min idle
2 min idle
...
...
59 mins idle
60 mins idle
Time Up -- Session Expired
then he has to login again.
So the above is the issue
What i have done ..................issssssssssssss
I have taken time for last request by using getLastAccessedTime()
I have taken present time System.currentTimeMills()
Taking the difference we will get the idle time .
But the problem here is When user1 click on any page only this
calcuting will be done and showing to ADMINJSP because getLastAccessedTime works only when any requests comes , but we
dont want like that , we want the application without any requests from user1 the application should show idle for 1 min , 2 mins , 3 mins...so
on upto user1 uses the application then the time should be normal.
I have also tried all the EVENTS classes in HttpSessionBinding like
valueunbound()...or sessiondestroy() etc.
Can any one please help me by giving any CODE.If you need more
information plz ask me
Plz plz plz plz this is very urgent plz can any please send me the CODE ,
ihave tried this very hard but no idea how to do?
long startTime = session.getLastAccessedTime();
long stopTime = System.currentTimeMillis();
long diffTimeInSecs = (stopTime - startTime) / 1000 ;
gives idle time for every request
Regards
Krishna

