RE: The semantics of close()

"Paul Andrews" <[email protected]> Wed, 4 Jun 2003 13:41:55 -0400
Newsgroups gmane.network.beep.beepcore.java.general
Message-ID <[email protected]>
Yes, that would be perfect. I was thinking that it might also be worth
adding a method to query the state, though that would obviously present
a race condition, I don't think it would matter if close() was modified
like you propose.

> -----Original Message-----
> From: Huston [mailto:[email protected]] 
> Sent: Wednesday, June 04, 2003 1:14 PM
> To: Paul Andrews
> Cc: [email protected]
> Subject: Re: [Beepcore-java-users] The semantics of close()
> 
> 
> On Wed, 2003-06-04 at 10:03, Paul Andrews wrote:
> > I've been thinking about how session.close() works and I'm 
> not really
> > comfortable with it. If I call close() on a session that is already
> > closing I get an illegal state exception from it, yet I 
> have no way of
> > finding out if a session is in the process of closing or is already
> > closed.
> > 
> > This makes it difficult to write code that cleans up when 
> it is through
> > with a session.
> 
> This is a very good point. Would it be ok with you if close() did
> nothing if the state of the session was CLOSING or CLOSED?
> 
> --Huston
> 



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.