avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject RE: FW: ContainerManager and Sub-containers
Date Thu, 06 Jun 2002 00:51:07 GMT
At 09:35 AM 6/5/2002 -0400, you wrote:
> > I think that no matter how far you go down this path it is
> > never going to be
> > fast enough. IMHO the only way to do this is to lookup
> > resources during
> > initialization phase rather than at runtime and with a good
> > assembly system
> > you get all the bang of runtime lookup with little cost.
>
>Explain?  Keep in mind I am thinking of a very dynamic system like
>Cocoon where component resolution depends on the URI and any runtime
>variables.

So pre-bake the components. Then when you need to lookup a Generator then do

class MyClass
{
   public void service( final ServiceManager sm ) throws SE
   {
     myGeneratorManager = (GeneratorManager)sm.lookup( GeneratorManager.ROLE );
   }

   void doRequest( ....params ...)
   {
     g = myGeneratorManager.lookup( someOptimizedKey );
     g.generate();
     myGeneratorManager.release( g );
   }
}

If you notice I used the same API as current SM with an optimized key. You 
could replace it with something more particular to generators though. The 
above demonstrates an effective way IMHO to create and manage generators 
that as performance sensitive as you need. It also follows suit with other 
established scalable frameworkss (ie J2EE, CORBA) and best of all it does 
not inflict the rest of us with complexity.



--
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