avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Royal <pro...@apache.org>
Subject Re: [proposal] avalon 5 ComponentManager interface
Date Tue, 11 Jun 2002 14:11:02 GMT
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 -> proyal@apache.org

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message