You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Joseph Shraibman <jk...@selectacast.net> on 2005/02/23 05:17:56 UTC
Getting other Sessions
I want to make an admin page in my application. I needs to be able to
get access to all the current Session objects to access their
attributes. Is this possible?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Getting other Sessions
Posted by Joseph Shraibman <jk...@selectacast.net>.
Antony Paul wrote:
> You can put all the sessions in List or Map when they login or use
> HttpSessionListener to listen to session events.
That was my fallback plan, if there wasn't an easier way.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Getting other Sessions
Posted by Antony Paul <an...@gmail.com>.
You can put all the sessions in List or Map when they login or use
HttpSessionListener to listen to session events.
rgds
Antony Paul
On Tue, 22 Feb 2005 23:17:56 -0500, Joseph Shraibman
<jk...@selectacast.net> wrote:
> I want to make an admin page in my application. I needs to be able to
> get access to all the current Session objects to access their
> attributes. Is this possible?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Getting other Sessions
Posted by Joseph Shraibman <jk...@selectacast.net>.
Michael Greer wrote:
>
> List servers = MBeanServerFactory.findMBeanServer(null);
> MBeanServer server = (MBeanServer)servers.get(0);
>
> ObjectName objName = new
> ObjectName("Catalina:type=Manager,path=/contextPath,host=localhost");
>
> String sessionIds =
> (String)server.invoke(objName,"listSessionIds",null, null);
>
> You can get the rest by each sessionId.
How do I get a refrence to the Session once I have the id?
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Getting other Sessions
Posted by Michael Greer <mi...@earthlink.net>.
List servers = MBeanServerFactory.findMBeanServer(null);
MBeanServer server = (MBeanServer)servers.get(0);
ObjectName objName = new
ObjectName("Catalina:type=Manager,path=/contextPath,host=localhost");
String sessionIds =
(String)server.invoke(objName,"listSessionIds",null, null);
You can get the rest by each sessionId. Take a look at the MBean docs
on how to make jmx calls. There is a jmxproxy in 5.5 manager app which
shows all of the mbeans by default, and lets you test your queries.
Complex, but not hard.
-Michael Greer
On Feb 22, 2005, at 11:17 PM, Joseph Shraibman wrote:
> I want to make an admin page in my application. I needs to be able to
> get access to all the current Session objects to access their
> attributes. Is this possible?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org