Having a clustered environment complicates things :-)

One solution I am looking at is to leverage existing log4j calls in our code to send messages via a socket appender to a common console gui app.

One advantage is that the main servlet code doesn't have to change to support the console which can therefore be developed and enhanced as a independent side project.

Note also that as of v2.3 there is a new HttpSessionListener interface with methods sessionCreated() and sessionDestroyed() which gives a more direct indication than the bound/unbound methods of the HttpSessionBindingListener interface.

Michael Rutherfurd

"A mailing list for discussion about Sun Microsystem's Java               Servlet API Technology." <[EMAIL PROTECTED]> wrote on 17/06/2004 04:19:15 AM:

> Thanks a lot Chris...But will it work in clustered environment where we
> can have 2 or more number of web containers. Is it possible to get the
> count in Clustered Environment?
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED] On Behalf Of
> Chris Pratt
> Sent: Wednesday, June 16, 2004 9:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Concurrent Users
>
> Two things to note.  Since there is no way to positively no when a user
> has left your site, there's no accurate way of knowing how many users
> are currently viewing your site.  With that said, if you want to count
> the number of outstanding users whose sessions have not timed out, make
> a User object that you store in the Session (or use your existing one)
> and have it implement the HttpSessionBindingListener interface.  Create
> a Class level variable (i.e. static) to hold the count which gets
> incremented on each call to valueBound() and decremented on each call to
> valueUnbound().
>   (*Chris*)
>
> Original Message -----------------------
> You can keep a class level variable. Increment that when the user joins
> in
> the session and decrement that when the session times out or when you
> invalidate the session.
>
>
> >From: Khalid Umar <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> >         Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Concurrent Users
> >Date: Wed, 16 Jun 2004 16:45:52 +0530
> >
> >Is there a way to find out the number of concurrent users logged into a
> >web application?
> >
> >_______________________________________________________________________
> ____
> >To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> >of the message "signoff SERVLET-INTEREST".
> >
> >Archives: http://archives.java.sun.com/archives/servlet-interest.html
> >Resources: http://java.sun.com/products/servlet/external-resources.html
> >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> _________________________________________________________________
> Getting married? Find great tips, tools and the latest trends at MSN
> Life
> Events. http://lifeevents.msn.com/category.aspx?cid=married
>
> ________________________________________________________________________
> ___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ________________________________________________________________________
> ___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email.

Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems,
you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac,
please contact us immediately.

It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments.

Westpac Banking Corporation ABN is 33 007 457 141.
___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to