Session Close

2000-11-08 Thread Pablo Trujillo

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

2000-11-08 Thread William Brogden



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 - [EMAIL PROTECTED]
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2



RE: Session Close

2000-11-08 Thread Robert Schulz

I assume by "close" you mean
 - session times out
 - session gets explicitly invalidated by calling .invalidate()
This can be trapped by attaching an object which is a 
javax.servlet.http.HttpSessionBindingListener to the session. 

This object gets call backs when it is bound and unbound from 
a session. When a session "closes" all associated objects get 
unbound.

R.
> -Original Message-
> From: Pablo Trujillo [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 9 November 2000 3:53
> 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/
> 
> 



Re: Session Close

2000-11-08 Thread romain



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

2000-11-08 Thread William Brogden



[EMAIL PROTECTED] 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 - [EMAIL PROTECTED]
Author of Java Developer's Guide to Servlets and JSP 
ISBN 0-7821-2809-2



RE: Session Close

2000-11-09 Thread Lacerda, Wellington (AFIS)

You can put an object that implements HttpSessionBindingListener in the
session. Whenever session.invalidate() is called, it unbinds all objects
bound, so that object receives an HttpSessionBindingEvent and can notify you
the session was closed.

Wellington Silva
UN/FAO

-Original Message-
From: Pablo Trujillo [mailto:[EMAIL PROTECTED]]
Sent: 08 November 2000 17:53
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/




RE: Session Close

2000-11-08 Thread Marc Saegesser

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:[EMAIL PROTECTED]]
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/