RE: [JBoss-user] User Monitoring

2002-11-08 Thread Luttrell, Peter



I solved 
the problem.
 
For New Session 
and Removals, this works (although it's jetty specific):
 
public class 
JettyAuthenticationTracker implements HttpSessionAttributeListener 
{
 
    
public void attributeAdded( HttpSessionBindingEvent event ) 
{    if ( 
"org.mortbay.jetty.Auth".equalsIgnoreCase( event.getName() ) ) 
{    
getMonitorService().registerSession( event.getValue().toString() 
);    }    
}
 
    
public void attributeRemoved( HttpSessionBindingEvent event ) 
{    if ( 
"org.mortbay.jetty.Auth".equalsIgnoreCase( event.getName() ) ) 
{    
getMonitorService().removeSession( event.getValue().toString() 
);    }    
}
 
    
public void attributeReplaced( HttpSessionBindingEvent event ) 
{    }
}
 
And I used a 
Servlet Filter for updates.
 
Thanks for the 
pointer on what direction to look.
 
.peter

  -Original Message-From: Luttrell, Peter 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, November 08, 
  2002 6:18 PMTo: 
  '[EMAIL PROTECTED]'Subject: RE: [JBoss-user] User 
  Monitoring
  Ah, a part of 
  the servlet api i haven't yet explored. I tried it and it didn't 
  quite work. I wonder if i have it correct.
   
  Based on my 
  sample code, when I first go to a page i see this:
   
  18:11:44,875 
  INFO  [STDOUT] sessionCreated Called.18:11:44,890 INFO  [STDOUT] 
  httpsessionevent=javax.servlet.http.HttpSessionEvent[source=org.mortbay.jetty.servlet.HashSessionManager$Session@965654]18:11:44,890 INFO  [STDOUT] source=org.mortbay.jetty.servlet.HashSessionManager$Session@96565418:11:44,890 INFO  [STDOUT] sessiontype=class 
  org.mortbay.jetty.servlet.HashSessionManager$Session18:11:44,890 
  INFO  [STDOUT] id=1yr4680607tip18:11:44,890 INFO  [STDOUT] 
  AttributeNames:
   
   
  But that's it. 
  When I navigate to the login page and login, i don't get any more 
  trace.
   
  Any 
  ideas?
   
   
  Here is the code 
  i'm using to investigate:
   
  import 
  javax.servlet.http.*;import java.util.Enumeration;
   
  public class 
  HttpSessionEventHandler implements HttpSessionListener, 
  HttpSessionBindingListener  {
   
      public void sessionCreated(HttpSessionEvent se) 
  {
   
      System.out.println( 
  "sessionCreated Called." );    
  System.out.println( "httpsessionevent=" + se );
   
      HttpSession session = 
  se.getSession();
   
      if (session != 
  null){    
  System.out.println("source=" + 
  se.getSource());    
  System.out.println( "sessiontype=" + session.getClass() 
  );    
  System.out.println( "id=" + session.getId());
   
      
  System.out.println( "AttributeNames:" 
  );    
  Enumeration attributes = 
  session.getAttributeNames();    
  while 
  (attributes.hasMoreElements()){    
  System.out.println( "\t" + attributes.nextElement().toString() 
  );    
  }    } else 
  {    
  System.out.println( "getSession() returned null." 
  );    }    
  }
   
      public void sessionDestroyed(HttpSessionEvent 
  se){
   
      System.out.println( 
  "sessionDestroyed Called." );    
  System.out.println( "httpsessionevent=" + se );
   
      HttpSession session = 
  se.getSession();
   
      if (session != 
  null){    
  System.out.println("source=" + 
  se.getSource());    
  System.out.println( "sessiontype=" + session.getClass() 
  );    
  System.out.println( "id=" + session.getId());
   
      
  System.out.println( "AttributeNames:" 
  );    
  Enumeration attributes = 
  session.getAttributeNames();    
  while 
  (attributes.hasMoreElements()){    
  System.out.println( "\t" + attributes.nextElement().toString() 
  );    
  }    } else 
  {    
  System.out.println( "getSession() returned null." 
  );    }    
  }
   
      public void 
  valueBound(HttpSessionBindingEvent event) {
   
      
  System.out.println( "valueBound Called." 
  );    System.out.println( "name=" 
  +  event.getName());    
  System.out.println( "value=" + event.getValue() );
   
      
  System.out.println( "HttpSessionBindingEvent=" + event );
   
      
  HttpSession session = event.getSession();
   
      if 
  (session != 
  null){    
  System.out.println("source=" + 
  event.getSource());    
  System.out.println( "sessiontype=" + session.getClass() 
  );    
  System.out.println( "id=" + session.getId());
   
      
  System.out.println( "AttributeNames:" 
  );    
  Enumeration attributes = 
  session.getAttributeNames();    
  while 
  (attribu

RE: [JBoss-user] User Monitoring

2002-11-08 Thread Luttrell, Peter



Ah, a part of the 
servlet api i haven't yet explored. I tried it and it didn't 
quite work. I wonder if i have it correct.
 
Based on my sample 
code, when I first go to a page i see this:
 
18:11:44,875 
INFO  [STDOUT] sessionCreated Called.18:11:44,890 INFO  [STDOUT] 
httpsessionevent=javax.servlet.http.HttpSessionEvent[source=org.mortbay.jetty.servlet.HashSessionManager$Session@965654]18:11:44,890 INFO  [STDOUT] source=org.mortbay.jetty.servlet.HashSessionManager$Session@96565418:11:44,890 INFO  [STDOUT] sessiontype=class 
org.mortbay.jetty.servlet.HashSessionManager$Session18:11:44,890 INFO  
[STDOUT] id=1yr4680607tip18:11:44,890 INFO  [STDOUT] 
AttributeNames:
 
 
But that's it. 
When I navigate to the login page and login, i don't get any more 
trace.
 
Any 
ideas?
 
 
Here is the code 
i'm using to investigate:
 
import 
javax.servlet.http.*;import java.util.Enumeration;
 
public class 
HttpSessionEventHandler implements HttpSessionListener, 
HttpSessionBindingListener  {
 
    
public void sessionCreated(HttpSessionEvent se) {
 
    System.out.println( 
"sessionCreated Called." );    
System.out.println( "httpsessionevent=" + se );
 
    HttpSession session = 
se.getSession();
 
    if (session != 
null){    
System.out.println("source=" + 
se.getSource());    
System.out.println( "sessiontype=" + session.getClass() 
);    
System.out.println( "id=" + session.getId());
 
    
System.out.println( "AttributeNames:" 
);    
Enumeration attributes = 
session.getAttributeNames();    
while 
(attributes.hasMoreElements()){    
System.out.println( "\t" + attributes.nextElement().toString() 
);    
}    } else 
{    
System.out.println( "getSession() returned null." 
);    }    
}
 
    
public void sessionDestroyed(HttpSessionEvent se){
 
    System.out.println( 
"sessionDestroyed Called." );    
System.out.println( "httpsessionevent=" + se );
 
    HttpSession session = 
se.getSession();
 
    if (session != 
null){    
System.out.println("source=" + 
se.getSource());    
System.out.println( "sessiontype=" + session.getClass() 
);    
System.out.println( "id=" + session.getId());
 
    
System.out.println( "AttributeNames:" 
);    
Enumeration attributes = 
session.getAttributeNames();    
while 
(attributes.hasMoreElements()){    
System.out.println( "\t" + attributes.nextElement().toString() 
);    
}    } else 
{    
System.out.println( "getSession() returned null." 
);    }    
}
 
    public void 
valueBound(HttpSessionBindingEvent event) {
 
    
System.out.println( "valueBound Called." 
);    System.out.println( "name=" 
+  event.getName());    
System.out.println( "value=" + event.getValue() );
 
    
System.out.println( "HttpSessionBindingEvent=" + event );
 
    
HttpSession session = event.getSession();
 
    if 
(session != 
null){    
System.out.println("source=" + 
event.getSource());    
System.out.println( "sessiontype=" + session.getClass() 
);    
System.out.println( "id=" + session.getId());
 
    
System.out.println( "AttributeNames:" 
);    
Enumeration attributes = 
session.getAttributeNames();    
while 
(attributes.hasMoreElements()){    
System.out.println( "\t" + attributes.nextElement().toString() 
);    
}    } else 
{    
System.out.println( "getSession() returned null." 
);    }    
}
 
    public void 
valueUnbound(HttpSessionBindingEvent event) {
 
    
System.out.println( "valueUnbound Called." 
);    System.out.println( "name=" 
+  event.getName());    
System.out.println( "value=" + event.getValue() );
 
    
System.out.println( "HttpSessionBindingEvent=" + event );
 
    
HttpSession session = event.getSession();
 
    if 
(session != 
null){    
System.out.println("source=" + 
event.getSource());    
System.out.println( "sessiontype=" + session.getClass() 
);    
System.out.println( "id=" + session.getId());
 
    
System.out.println( "AttributeNames:" 
);    
Enumeration attributes = 
session.getAttributeNames();    
while 
(attributes.hasMoreElements()){    
System.out.println( "\t" + attributes.nextElement().toString() 
);    
}    } else 
{    
System.out.println( "getSession() returned null." 
);    }    
}}

  -Original Message-From: Jason Westra 
  [mailto:[EM

RE: [JBoss-user] User Monitoring

2002-11-08 Thread Jason Westra



HttpSessionBindingListener to be 
exact.  
 
BTW: CurrentUsersMBean.java is not a Jboss or j2ee 
class either.  Hope this helps.
 
Jason

  -Original Message-From: Luttrell, Peter 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, November 08, 
  2002 4:14 PMTo: '[EMAIL PROTECTED]'; 
  '[EMAIL PROTECTED]'Subject: RE: [JBoss-user] User 
  Monitoring
  This 
  sounds interesting. Presumably I can get the UserPrincipal somehow 
  right?
   
  Where do i 
  get more info on HttpBindingListener? It doesn't appear to be a Jboss class, 
  nor a j2ee class.
   
  Did you mean 
  HttpSessionListener?
   
  thanks.
  .peter
  
-Original Message-From: Jason Westra 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 05, 2002 
12:14 AMTo: [EMAIL PROTECTED]Subject: 
    RE: [JBoss-user] User Monitoring
You make the custom solution sound way too hard!  It is quite 
easy.
 
You need 2 classes.
 
1 
Class implementing HttpBindingListener called 
MonitoredUser.java
1 
MBean called CurrentUsersMBean.java, which holds a list of MonitoredUser 
objects representing currently logged in users.
 
When the user logs in, create a session, create and bind the 
MonitoredUser instance to the session, and add it to the CurrentUsersMBean 
list.
 
To 
see a list of currently logged in users, ask the CurrentUsersMBean for its 
list.
 
When the session times out, or the user logs off, the 
MonitoredUser.unbind() method is called.  At this time, remove the 
object from the CurrentUsersMBean list.
 
Jason

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of 
  Luttrell, PeterSent: Monday, November 04, 2002 5:02 
  PMTo: [EMAIL PROTECTED]Subject: 
  [JBoss-user] User Monitoring
  My sysadmin 
  has one large grip with JBoss: There is no way to tell who is using a 
  webapp at a particular time, which he claims is possible with 
  Weblogic.
   
  I'm using 
  Jetty, if i turn on the metrics, i can ascertain how many sessions are 
  active (not timed out). Does anyone know how i can figure out what the 
  userPrincipal is for the httpsessions?
   
  Or does 
  anyone have any other ideas on how to monitor Who is using Jboss? Other 
  then the obvious one, which is write a bunch of custom code that 
  updates some custom monitor through filters or interceptors or 
  manually?
   
  thanks.
  .peter
   
   
  
  This transmission contains information solely 
  for intended recipient and may be privileged, confidential and/or 
  otherwise protect from disclosure. If you are not the intended recipient, 
  please contact the sender and delete all copies of this transmission. This 
  message and/or the materials contained herein are not an offer to sell, or 
  a solicitation of an offer to buy, any securities or other instruments. 
  The information has been obtained or derived from sources believed by us 
  to be reliable, but we do not represent that it is accurate or complete. 
  Any opinions or estimates contained in this information constitute our 
  judgment as of this date and are subject to change without notice. Any 
  information you share with us will be used in the operation of our 
  business, and we do not request and do not want any material, nonpublic 
  information. Absent an express prior written agreement, we are not 
  agreeing to treat any information confidentially and will use any and all 
  information and reserve the right to publish or disclose any information 
  you share with us.
  This transmission contains information solely for 
  intended recipient and may be privileged, confidential and/or otherwise 
  protect from disclosure. If you are not the intended recipient, please contact 
  the sender and delete all copies of this transmission. This message and/or the 
  materials contained herein are not an offer to sell, or a solicitation of an 
  offer to buy, any securities or other instruments. The information has been 
  obtained or derived from sources believed by us to be reliable, but we do not 
  represent that it is accurate or complete. Any opinions or estimates contained 
  in this information constitute our judgment as of this date and are subject to 
  change without notice. Any information you share with us will be used in the 
  operation of our business, and we do not request and do not want any material, 
  nonpublic information. Absent an express prior written agreement, we are not 
  agreeing to treat any information confidentially and will use any and all 
  information and reserve the right to publish or disclose any information you 
  share with us.


RE: [JBoss-user] User Monitoring

2002-11-08 Thread Luttrell, Peter



This sounds 
interesting. Presumably I can get the UserPrincipal somehow 
right?
 
Where do i 
get more info on HttpBindingListener? It doesn't appear to be a Jboss class, nor 
a j2ee class.
 
Did you mean 
HttpSessionListener?
 
thanks.
.peter

  -Original Message-From: Jason Westra 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 05, 2002 12:14 
  AMTo: [EMAIL PROTECTED]Subject: RE: 
  [JBoss-user] User Monitoring
  You 
  make the custom solution sound way too hard!  It is quite 
  easy.
   
  You 
  need 2 classes.
   
  1 
  Class implementing HttpBindingListener called 
  MonitoredUser.java
  1 
  MBean called CurrentUsersMBean.java, which holds a list of MonitoredUser 
  objects representing currently logged in users.
   
  When 
  the user logs in, create a session, create and bind the MonitoredUser instance 
  to the session, and add it to the CurrentUsersMBean list.
   
  To 
  see a list of currently logged in users, ask the CurrentUsersMBean for its 
  list.
   
  When 
  the session times out, or the user logs off, the MonitoredUser.unbind() method 
  is called.  At this time, remove the object from the CurrentUsersMBean 
  list.
   
  Jason
  
-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Luttrell, 
PeterSent: Monday, November 04, 2002 5:02 PMTo: 
[EMAIL PROTECTED]Subject: [JBoss-user] User 
Monitoring
My sysadmin 
has one large grip with JBoss: There is no way to tell who is using a webapp 
at a particular time, which he claims is possible with 
Weblogic.
 
I'm using 
Jetty, if i turn on the metrics, i can ascertain how many sessions are 
active (not timed out). Does anyone know how i can figure out what the 
userPrincipal is for the httpsessions?
 
Or does anyone 
have any other ideas on how to monitor Who is using Jboss? Other then the 
obvious one, which is write a bunch of custom code that updates some 
custom monitor through filters or interceptors or 
manually?
 
thanks.
.peter
 
 

This transmission contains information solely for 
intended recipient and may be privileged, confidential and/or otherwise 
protect from disclosure. If you are not the intended recipient, please 
contact the sender and delete all copies of this transmission. This message 
and/or the materials contained herein are not an offer to sell, or a 
solicitation of an offer to buy, any securities or other instruments. The 
information has been obtained or derived from sources believed by us to be 
reliable, but we do not represent that it is accurate or complete. Any 
opinions or estimates contained in this information constitute our judgment 
as of this date and are subject to change without notice. Any information 
you share with us will be used in the operation of our business, and we do 
not request and do not want any material, nonpublic information. Absent an 
express prior written agreement, we are not agreeing to treat any 
information confidentially and will use any and all information and reserve 
the right to publish or disclose any information you share with 
us.




This transmission contains information solely for intended recipient and may be privileged, confidential and/or otherwise protect from disclosure.  If you are not the intended recipient, please contact the sender and delete all copies of this transmission.  This message and/or the materials contained herein are not an offer to sell, or a solicitation of an offer to buy, any securities or other instruments.  The information has been obtained or derived from sources believed by us to be reliable, but we do not represent that it is accurate or complete.  Any opinions or estimates contained in  this information constitute our judgment as of this date and are subject to change without notice.  Any information you share with us will be used in the operation of our business, and we do not request and do not want any material, nonpublic information. Absent an express prior written agreement, we are not agreeing to treat any information confidentially and 
 will use any and all information and reserve the right to publish or disclose any information you share with us.


Re: [JBoss-user] User Monitoring

2002-11-05 Thread Emerson Cargnin - SICREDI Serviços
or take a look at http://www.opensymphony.com/clickstream/
there's others framework's worth of using too...

Greg Turner wrote:

One option is to check out the for pay software, AppSure, from JBoss 
partner www.alignmentsoftware.com.  I've seen a demo and its well worth 
consideration.

Luttrell, Peter wrote:

My sysadmin has one large grip with JBoss: There is no way to tell who 
is using a webapp at a particular time, which he claims is possible 
with Weblogic.
 
I'm using Jetty, if i turn on the metrics, i can ascertain how many 
sessions are active (not timed out). Does anyone know how i can figure 
out what the userPrincipal is for the httpsessions?
 
Or does anyone have any other ideas on how to monitor Who is using 
Jboss? Other then the obvious one, which is write a bunch of custom 
code that updates some custom monitor through filters or interceptors 
or manually?
 
thanks.
.peter
 
 




This transmission contains information solely for intended recipient 
and may be privileged, confidential and/or otherwise protect from 
disclosure. If you are not the intended recipient, please contact the 
sender and delete all copies of this transmission. This message and/or 
the materials contained herein are not an offer to sell, or a 
solicitation of an offer to buy, any securities or other instruments. 
The information has been obtained or derived from sources believed by 
us to be reliable, but we do not represent that it is accurate or 
complete. Any opinions or estimates contained in this information 
constitute our judgment as of this date and are subject to change 
without notice. Any information you share with us will be used in the 
operation of our business, and we do not request and do not want any 
material, nonpublic information. Absent an express prior written 
agreement, we are not agreeing to treat any information confidentially 
and will use any and all information and reserve the right to publish 
or disclose any information you share with us.


--
Greg Turner, JBoss Authorized Consultant

Tiburon Enterprise Systems
http://www.tiburon-e-systems.com
Box 1171
Tiburon, CA 94920
415-927-2543





--

| Emerson Cargnin  |
| Analista de Sistemas Sr. |
| Tel : (051) 3358-4959|
| SICREDI Serviços |
| Porto Alegre - Brasil|
|xx|



---
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] User Monitoring

2002-11-04 Thread Jason Westra



You 
make the custom solution sound way too hard!  It is quite 
easy.
 
You 
need 2 classes.
 
1 
Class implementing HttpBindingListener called 
MonitoredUser.java
1 
MBean called CurrentUsersMBean.java, which holds a list of MonitoredUser objects 
representing currently logged in users.
 
When 
the user logs in, create a session, create and bind the MonitoredUser instance 
to the session, and add it to the CurrentUsersMBean list.
 
To see 
a list of currently logged in users, ask the CurrentUsersMBean for its 
list.
 
When 
the session times out, or the user logs off, the MonitoredUser.unbind() method 
is called.  At this time, remove the object from the CurrentUsersMBean 
list.
 
Jason

  -Original Message-From: 
  [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Luttrell, 
  PeterSent: Monday, November 04, 2002 5:02 PMTo: 
  [EMAIL PROTECTED]Subject: [JBoss-user] User 
  Monitoring
  My sysadmin has 
  one large grip with JBoss: There is no way to tell who is using a webapp at a 
  particular time, which he claims is possible with 
Weblogic.
   
  I'm using Jetty, 
  if i turn on the metrics, i can ascertain how many sessions are active (not 
  timed out). Does anyone know how i can figure out what the userPrincipal is 
  for the httpsessions?
   
  Or does anyone 
  have any other ideas on how to monitor Who is using Jboss? Other then the 
  obvious one, which is write a bunch of custom code that updates some 
  custom monitor through filters or interceptors or 
  manually?
   
  thanks.
  .peter
   
   
  
  This transmission contains information solely for 
  intended recipient and may be privileged, confidential and/or otherwise 
  protect from disclosure. If you are not the intended recipient, please contact 
  the sender and delete all copies of this transmission. This message and/or the 
  materials contained herein are not an offer to sell, or a solicitation of an 
  offer to buy, any securities or other instruments. The information has been 
  obtained or derived from sources believed by us to be reliable, but we do not 
  represent that it is accurate or complete. Any opinions or estimates contained 
  in this information constitute our judgment as of this date and are subject to 
  change without notice. Any information you share with us will be used in the 
  operation of our business, and we do not request and do not want any material, 
  nonpublic information. Absent an express prior written agreement, we are not 
  agreeing to treat any information confidentially and will use any and all 
  information and reserve the right to publish or disclose any information you 
  share with us.


Re: [JBoss-user] User Monitoring

2002-11-04 Thread Greg Turner




One option is to check out the for pay software, AppSure, from JBoss partner
www.alignmentsoftware.com.  I've seen a demo and its well worth consideration.

Luttrell, Peter wrote:
 
 
  
   
  
 
  My
sysadmin has  one large grip with JBoss: There is no way to tell who is using
a webapp at a  particular time, which he claims is possible with Weblogic.
 
   
 
  I'm
using Jetty,  if i turn on the metrics, i can ascertain how many sessions
are active (not  timed out). Does anyone know how i can figure out what the
userPrincipal is for  the httpsessions?
 
   
 
  Or
does anyone  have any other ideas on how to monitor Who is using Jboss? Other
then the  obvious one, which is write a bunch of custom code that updates some
custom  monitor through filters or interceptors or manually?
 
   
 
  thanks.
 
  .peter
 
   
 
   
 
  
  
 
 
  
  This transmission contains information solely
for intended recipient and may be privileged, confidential and/or otherwise
protect from disclosure.  If you are not the intended recipient, please contact
the sender and delete all copies of this transmission.  This message and/or
the materials contained herein are not an offer to sell, or a solicitation
of an offer to buy, any securities or other instruments.  The information
has been obtained or derived from sources believed by us to be reliable,
but we do not represent that it is accurate or complete.  Any opinions or
estimates contained in  this information constitute our judgment as of this
date and are subject to change without notice.  Any information you share
with us will be used in the operation of our business, and we do not request
and do not want any material, nonpublic information. Absent an express prior
written agreement, we are not agreeing to treat any information confidentially
and will use any and all information and reserve the right to publish or
disclose any information you share with us.
  

-- 
Greg Turner, JBoss Authorized Consultant

Tiburon Enterprise Systems
http://www.tiburon-e-systems.com
Box 1171
Tiburon, CA 94920
415-927-2543