Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-none-

-none-

2007-08-16       - By Filip Hanik - Dev Lists

 Back
Tomcat 5.5 has an all-to-all replication mechanism, hence all nodes
should be identical. you would only need to see the sessions on one node
to get a picture of what is looks like elsewhere.

there is a flag called "notifyListenersOnReplication" this is only for
attribute replication for nodes that are up in the cluster.
When a "state transfer" is performed, ie, a new node joins the cluster,
then nothing but serialization/deserialization is performed, and no
listeners are called or events fired.

Filip

Vinod Venkatraman wrote:
> Hi,
>
> I want to track all the active sessions of a tomcat 5.5 cluster.
> Particularly, I want to host a page on each cluster member which will
> display all the sessions active on its cluster.
>
> So I want to see a list of :
> session-id, user-name, jvmRoute (of member to which this session is sticky
> to).
>
> What I have tried is :
> Whenever a new session is created I create an object which implements
> HttpSessionBindingListener
> and put in the session.
>
>     public void valueBound(HttpSessionBindingEvent event) {
>         synchronized(ActiveSessions.ACTIVE_SESSIONS) {
>             HttpSession session = event.getSession();
>             ActiveSessions.ACTIVE_SESSIONS.add(this);
>             System.out.println("VV Registered Session : " + this);
>             System.out.println("VV Active Sessions count : " +
> ActiveSessions.ACTIVE_SESSIONS.size() + " :: Active Sessions : " +
> ActiveSessions.ACTIVE_SESSIONS);
>         }
>     }
>
>     public void valueUnbound(HttpSessionBindingEvent event) {
>         synchronized(ActiveSessions.ACTIVE_SESSIONS) {
>             long expiredAt = System.currentTimeMillis();
>             ActiveSessions.ACTIVE_SESSIONS.remove(this);
>
>             // TODO : bookkeeping of expired sessions, write to a separate
> log file.
>             System.out.println("VV Deregistered Session : " + this);
>
>             System.out.println("Session Expired : " + this + " Session
> lasted from : " + createdAt + "-" + expiredAt);
>
>             System.out.println("VV Active Sessions count : " +
> ActiveSessions.ACTIVE_SESSIONS.size() + " :: Active Sessions : " +
> ActiveSessions.ACTIVE_SESSIONS);
>         }
>     }
>
>
> Things work fine except for following case :
>
> Say clusterMember1 is down when a new session is created at clusterMember2.
>
> When clusterMember1 comes up it syncs it session state with clusterMember2
> but valueBound() is
> never called in clusterMember1's JVM so I am unable to register this session
> in clusterMember1's
> ACTIVE_SESSIONS list. Because of this my ACTIVE_SESSIONS list is not in sync
> across cluster members.
>
> Is this correct that valueBound will be called on only the cluster members
> which were alive when the
> object was put in the session ?
>
> Is there any other way I can track all active session of a cluster ?
>
> Thanks,
> Vinod
>  


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.