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>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 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
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlCAEgwACgkQ9CaO5/Lv0PARBACfZ+EG7KJWXt+49sbB1kVsLunF
> A4MAoKv1hM4KBlaAS4a1UaP0ePqfRr3W
> =n3WU
> -----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