mcconnell    2003/05/29 14:01:38

  Modified:    merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl
                        StandardBlock.java
  Log:
  Make the engine available explicity in context for a compoinent acting as a 
container (equivalent to getting the context classloader but allows us to move away 
from the classloader in the future).
  
  Revision  Changes    Path
  1.8       +11 -4     
avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/StandardBlock.java
  
  Index: StandardBlock.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-sandbox/merlin/merlin-core/src/java/org/apache/avalon/merlin/block/impl/StandardBlock.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- StandardBlock.java        9 May 2003 05:40:57 -0000       1.7
  +++ StandardBlock.java        29 May 2003 21:01:38 -0000      1.8
  @@ -67,6 +67,7 @@
   import org.apache.avalon.assembly.appliance.impl.DefaultAppliance;
   import org.apache.avalon.assembly.appliance.impl.DefaultApplianceContext;
   import org.apache.avalon.assembly.appliance.DependencyGraph;
  +import org.apache.avalon.assembly.engine.Engine;
   import org.apache.avalon.assembly.engine.impl.EngineClassLoader;
   import org.apache.avalon.assembly.locator.Locator;
   import org.apache.avalon.assembly.locator.LocatorException;
  @@ -248,6 +249,7 @@
           }
   
           m_threads = new ThreadGroup( super.getPath() );
  +        m_applianceContext.getDeploymentMap().put( Engine.KEY, m_engine );
       }
   
       
//-------------------------------------------------------------------------------
  @@ -466,7 +468,8 @@
           {
               if( appliances.length > 0 )
               {
  -                StringBuffer buffer = new StringBuffer( this.toString() + " 
termination: " );
  +                StringBuffer buffer = 
  +                  new StringBuffer( this.toString() + " termination: " );
                   for( int p=0; p<appliances.length; p++ )
                   {
                       if( p == 0 )
  @@ -642,7 +645,8 @@
           {
               if( appliances.length > 0 )
               {
  -                StringBuffer buffer = new StringBuffer( this.toString() + " 
shutdown: " );
  +                StringBuffer buffer = 
  +                  new StringBuffer( this.toString() + " shutdown: " );
                   for( int p=0; p<appliances.length; p++ )
                   {
                       if( p == 0 )
  @@ -736,7 +740,8 @@
       public VirtualService getVirtualService( Class clazz )
       {
           String classname = clazz.getName();
  -        ContainmentProfile profile = (ContainmentProfile) 
m_applianceContext.getProfile();
  +        ContainmentProfile profile = 
  +          (ContainmentProfile) m_applianceContext.getProfile();
           return profile.getVirtualService( clazz );
       }
   
  @@ -750,7 +755,9 @@
           getLogger().debug( "building virtual service proxy (VSP)" );
           Object instance = super.resolve( source, ref );
           Object proxy = Proxy.newProxyInstance( 
  -          m_engine, getInterfaceClasses(), new BlockInvocationHandler( this, 
instance ) );
  +          m_engine, 
  +          getInterfaceClasses(), 
  +          new BlockInvocationHandler( this, instance ) );
           return proxy;
       }
   
  
  
  

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

Reply via email to