-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 19/10/2012 19:17, Felipe Jaekel wrote:
> Anyone?

Again, look at the source code to see how the Tomcat Manager servlet
does it.

Mark

> 
> 2012/10/18 Felipe Jaekel <fkjae...@gmail.com>
> 
>> Found the following:
>> 
>> context = (Context) wrapper.getParent();
>>> host = (Host) context.getParent();
>>> 
>> 
>> 
>>> Context ctx = (Context) host.findChild(name); Manager manager =
>>> ctx.getManager(); Session [] sessions =
>>> manager.findSessions();
>> 
>> 
>> Had the same doubt I had when I looked at the PSI Probe code some
>> days ago: how to handle the wrapper property?
>> 
>> 
>> As a alternative I tried to implement
>> *HttpSessionActivationListener*, but the methods aren't called
>> when I restart the server.
>> 
>> Thanks again for the help, Phillip
>> 
>> 
>> 2012/10/18 Christopher Schultz <ch...@christopherschultz.net>
>> 
> Felipe,
> 
> On 10/18/12 9:34 AM, Felipe Jaekel wrote:
>>>>> I need to get the active session list. Searching about I
>>>>> saw a lot of people with the same question, but no answer.
>>>>> 
>>>>> I don't want to write a list inside a HttpSessionListener
>>>>> and keep the session list there, because I use session
>>>>> serialization and the list inside the listener would be
>>>>> destroyed in case the server is restarted.
> 
> You *can* get notification of sessions being de-serialized from
> the disk to maintain your list. Look at the other session-related 
> listeners in the servlet API.
> 
> You could also use JMX to get a list of sessions. Use JConsole to 
> poke-around in Tomcat's JMX beans and find the one(s) that expose 
> sessions. You may have to make your webapp "privileged" in order
> to make JMX calls.
> 
> -chris
>>> 
>>> ---------------------------------------------------------------------
>>>
>>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>>> 
>> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQIcBAEBAgAGBQJQgaamAAoJEBDAHFovYFnnXC8P/2YMIuVEYDOs2xWtzA8brB2X
WAMoqu8eP3qVCxRxmilImnnmCSum7jV0yXEhwDaYfC71hPni7LLDNU69oEnfg19d
gR43m84v1VENIpZimlij6ZPZBpV5P+0VlyVgfoOm5sVppsERXKvn/B1XUCzyD7YR
mAbbrwbRa+c1NiMfFf0XMHrb9+BoYfQ1aUDJ3BaK/vzplCrzBgDSygBYPOozwva+
GlHn76MkAE86ojeYvmJN0yIF9ahuwfNXm/NK5wdOKf78BD23NrRW23j+Y80xz15N
mHI/8F1kX6A8bVdaUeJzEsvpZodKP3AhkqX5bhKh1E4HmKuoYU0s5dqDqTnbyuJA
eN/BFQDBPYK7R4p4VJkADu3yCORRkkpp8l//TwYZO9ylddNZpd7eSDkmX7qlC8DJ
Usa77xCV5g1nZvrAuJYWYtfFWqMtXtTBfQMw809170Ugh821ruPvTi23YFZSYYFL
LkZBBbKkatnjeU/jE7QXmWwQrEop6ZF8rGZjlSMFYAsLRR75+qdf9A5+wl/HKfKh
3eLZT5frkOmqhWrmb35aMA4sxUlJAhc+UhudbHjp3twUX2U1ki59QW/EMOJAtsvr
G3FFY0/Ui1dxmuzeA+tzB1Eiypq6RU+34ZTjZ9XjHqKfV/ydNwczhc3fSYk4l4N7
FH5cLf3tldLqP35Wj7mg
=h6w0
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to