You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pablo Trujillo <Pa...@adinet.com.uy> on 2000/11/08 17:52:50 UTC

Session Close

I need to execute a procedure when a session closes. Is this possible? How
it is made?
-----------------------------------------------------
Click here for Free Video!!
http://www.gohip.com/free_video/



Re: Session Close

Posted by William Brogden <wb...@bga.com>.

romain@zzict.nl wrote:
> 
> On Wed, 8 Nov 2000, William Brogden wrote:
> 
> >
> >
> > Pablo Trujillo wrote:
> > >
> > > I need to execute a procedure when a session closes. Is this possible? How
> > > it is made?
> >
> > Make a class that is a HttpSessionBindingListener - attach an
> > object of this class to the session. When the session is destroyed
> > your object will get a call to the valueUnbound method.
> 
> this is the clean way of doing it.
> you could also add some object to the session,
> and do whatever you want in the finalizer.....
> 
> Dirty, but works.
> 
> Sloot.

The problems there are that
1) you don't have any guarantee as to when the finalizer will run.
2) if there is another reference to that object hanging around,
   it will never run.

-- 
WBB - wbrogden@bga.com
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

Re: Session Close

Posted by ro...@zzict.nl.

On Wed, 8 Nov 2000, William Brogden wrote:

> 
> 
> Pablo Trujillo wrote:
> > 
> > I need to execute a procedure when a session closes. Is this possible? How
> > it is made?
> 
> Make a class that is a HttpSessionBindingListener - attach an
> object of this class to the session. When the session is destroyed
> your object will get a call to the valueUnbound method.

this is the clean way of doing it.
you could also add some object to the session,
and do whatever you want in the finalizer.....

Dirty, but works.

Sloot.


Re: Session Close

Posted by William Brogden <wb...@bga.com>.

Pablo Trujillo wrote:
> 
> I need to execute a procedure when a session closes. Is this possible? How
> it is made?

Make a class that is a HttpSessionBindingListener - attach an
object of this class to the session. When the session is destroyed
your object will get a call to the valueUnbound method.

-- 
WBB - wbrogden@bga.com
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2

Re: Session Close

Posted by "Kevin A. Burton" <bu...@relativity.yi.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Pablo Trujillo" <Pa...@adinet.com.uy> writes:

> I need to execute a procedure when a session closes. Is this possible? How
> it is made?
<snip>

Firstoff. :).  Java doesn't have procedures... I think you mean a method.

Second.  What type of Session?  Servlet?

Kevin
- -- 
Kevin A. Burton ( burton@apache.org, burton@openprivacy.org, burtonator@acm.org )
             Cell: 408-910-6145 URL: http://relativity.yi.org

The unconstitutional government for the corporation, by the corporation must be
overthrown!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: Get my public key at: http://relativity.yi.org/pgpkey.txt

iD8DBQE6Ck+mAwM6xb2dfE0RAsiNAJwMGTmuree6Os5HtnoI9AAvW2DLfQCgj2Xk
FoFRJOmClJXLD+MGTPl6x2s=
=BTm5
-----END PGP SIGNATURE-----



KGB SEAL Team 6 Khaddafi Ft. Meade supercomputer SDI Clinton DES AK-47 Qaddafi
Nazi bomb Treasury jihad fissionable

RE: Session Close

Posted by Marc Saegesser <ma...@apropos.com>.
Take a look at the javax.servlet.http.HttpSessionBindingListener interface
and see if that does what your looking for.


-----Original Message-----
From: Pablo Trujillo [mailto:Patrujil@adinet.com.uy]
Sent: Wednesday, November 08, 2000 10:53 AM
To: Java-Linux; Polinux; Tomcat-Linux
Subject: Session Close


I need to execute a procedure when a session closes. Is this possible? How
it is made?
-----------------------------------------------------
Click here for Free Video!!
http://www.gohip.com/free_video/