How about creating a SessionListener

class SomeSessionListener implements HttpSessionListener ...

Register it in web.xml

in the sessionCreated method of your listener get a reference to the
new session from the HttpSessionEvent you can now access the
getLastAccessedTime(), maybe store the refs in some singleton
accessible from the context and so some stuff in your TimerTask ...

Just an idea if you like messing about with stuff, nothing to do with
ManagerBase though so I bet there is a better way of doing it.

Rgds
Duncan

On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> We have tomcat configured to allow users sessions to stay alive for 12
> hours. This is because this is how they like to work, login once at the
> start of the day and shutdown at the end of the day.
>
> I have a need to track their actual activity, like a concurrent license
> tool, and thought the best way of doing this would be to have a servlet
> start a timer at server startup, this servlet could then poll all the
> active sessions at a set interval and check the  getLastAccessedtime()
> method, building up a view of the actual activity.
>
> Am I going about this in the right way?
>
> If I am how do I access all the currently active sessions from a servlet?
> It looks like if I can gain access to the servers engine/context I could
> access all sessions via the ManagerBase class but I do not know how to do
> this.
>
> Thanks Gary
> _____________
> This e-mail transmission and any attachments to it are intended solely for
> the use of the individual or entity to whom it is addressed and may contain
> confidential and privileged information.  If you are not the intended
> recipient, your use, forwarding, printing, storing, disseminating,
> distribution, or copying of this communication is prohibited.  If you
> received this communication in error, please notify the sender immediately
> by replying to this message and delete it from your computer.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to