On Tuesday 11 June 2002 08:45 am, Berin Loritsch wrote:
> But, you could always discourage the use of pooled *components*,
> and have individual components manage the scarce resources.

I believe that is the crux of pete d's position. lookup() should always 
return something threadsafe.

Perhaps for pooled components we just need a generic PooledComponentManager. 
Something ala

class Blah 
{
  PooledComponentManager pooled;

  void compose( ComponentManager manager )
  {
    pooled = manager.lookup( ROLE );
  }

  void blah()
  {
    Component c = null;

    try 
    {
      c = pooled.get(); 
      c.blahblah();
    }
    finally
    {
      pooled.release( c );
    }
  }
}

-pete

-- 
peter royal -> [EMAIL PROTECTED]

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to