You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Morycz, Felicia V" <fe...@eds.com> on 2002/10/09 16:45:18 UTC

[commons-pool] Should I use commons-pool for this?

I'm writing a service that runs continually and produces objects that I want
to put into a keyed pool.  Then there are consumers that will get and remove
the objects based on the key.  If the key is not found yet, the consumer
should wait until it is there or a timeout period is reached.  I started
looking at commons-pool and could not find any examples.  

1.  Could you point me to some examples, possibly one that uses a keyed
object pool?

2.  I'm concerned about using commons-pool because it seems to be geared
toward maintaining a pool of reusable objects.  I do not reuse the objects,
I consume them.  Is there somewhere else I should look that better matches
my needs?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [commons-pool] Should I use commons-pool for this?

Posted by Dennis Muhlestein <de...@zserve.com>.
Why not just use a queue.
Make one out of a java.util.Vector or something.  You can use wait and
notify to tell the consumer thread something has been placed in the
queue.

-Dennis

On Wed, 2002-10-09 at 08:45, Morycz, Felicia V wrote:
> I'm writing a service that runs continually and produces objects that I want
> to put into a keyed pool.  Then there are consumers that will get and remove
> the objects based on the key.  If the key is not found yet, the consumer
> should wait until it is there or a timeout period is reached.  I started
> looking at commons-pool and could not find any examples.  
> 
> 1.  Could you point me to some examples, possibly one that uses a keyed
> object pool?
> 
> 2.  I'm concerned about using commons-pool because it seems to be geared
> toward maintaining a pool of reusable objects.  I do not reuse the objects,
> I consume them.  Is there somewhere else I should look that better matches
> my needs?
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>