commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsoftware.com>
Subject RE: [pool] BaseObjectPool.isClosed() visibility [was: Announcing Release Candidate 2 for Pool 1.3]
Date Fri, 24 Mar 2006 15:20:08 GMT
Sandy:

I see this comment in the unit test:

// The following should not throw exceptions just because the pool is
closed.

Then later, a second call to close() without a catch block, which is
like what I need. 

>From a quick glance through View-SVN, it looks like the close() method
no longer throws an exception if the receiver is already closed. Check?

Thanks,
Gary

> -----Original Message-----
> From: sandymac@gmail.com [mailto:sandymac@gmail.com] On Behalf Of
Sandy
> McArthur
> Sent: Thursday, March 23, 2006 8:49 PM
> To: Jakarta Commons Developers List
> Subject: Re: [pool] BaseObjectPool.isClosed() visibility [was:
Announcing
> Release Candidate 2 for Pool 1.3]
> 
> I think the pool 2 behavior will meet your needs but I'll let the code
> speak for itself as it should be unambigous.
> 
> Take a look at the TestObjectPool.testClosedPoolBehavior() test (about
> 45% down the file) and let me know if a pool that passes that test
> meets your needs. Here's a link to the trunk version of that file:
>
http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/pool/trunk/src/
te
> st/org/apache/commons/pool/TestObjectPool.java?view=markup
> 
> On 3/23/06, Gary Gregory <ggregory@seagullsoftware.com> wrote:
> > Sandy:
> >
> > I am looking for a way to query the pool for its open/close state.
> >
> > Background: for those who care ;)
> >
> > When our app server shuts down, we have a couple of threads that
need to
> > shutdown and clean up their resources. It so happens (don't ask)
that
> > more than one thread may want to close() the pool.
> >
> > When you call close() a second time (or more), you get an exception.
> > Alternatively, close() could be quiet, a no-op, if the pool is
already
> > closed.
> >
> > Right now, I have a subclass (hack) which implements an isOpen()
method
> > which calls super.isClosed(). This is not what I want to do.
Ideally,
> > I'd like to wrap the GenericObjectPool instance and not subclass it,
but
> > that's another topic for our app.
> >
> > Thanks,
> > Gary
> >
> >
> > > -----Original Message-----
> > > From: sandymac@gmail.com [mailto:sandymac@gmail.com] On Behalf Of
> > Sandy
> > > McArthur
> > > Sent: Thursday, March 23, 2006 8:10 PM
> > > To: Jakarta Commons Developers List
> > > Subject: Re: [pool] BaseObjectPool.isClosed() visibility [was:
> > Announcing
> > > Release Candidate 2 for Pool 1.3]
> > >
> > > On 3/23/06, Gary Gregory <ggregory@seagullsoftware.com> wrote:
> > > > This build works fine with our application.
> > > >
> > > > My only wish would be to make BaseObjectPool.isClosed() public.
> > >
> > > Gary, are you really wanting a way to test if the pool is closed
or do
> > > you want the returnObject and invalidateObject methods to be more
> > > graceful and accept objects borrowed from before the pool was
closed?
> > >
> > > The code in the trunk for pool 2 only throws
IllegalStateExceptions
> > > for the addObject and the borrowObject methods after close has
been
> > > called. The other methods will still seem to function normally but
> > > really they are in a shutdown mode and just dispose of returned
> > > objects.
> 
> --
> Sandy McArthur
> 
> "He who dares not offend cannot be honest."
> - Thomas Paine
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message