avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/impl DefaultBlock.java
Date Mon, 17 Feb 2003 12:11:57 GMT
mcconnell    2003/02/17 04:11:57

  Modified:    merlin/src/java/org/apache/avalon/merlin/block/impl
                        DefaultBlock.java
  Log:
  Updated to better leverage the appliance manager in url establishment.
  
  Revision  Changes    Path
  1.7       +19 -11    avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/impl/DefaultBlock.java
  
  Index: DefaultBlock.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/src/java/org/apache/avalon/merlin/block/impl/DefaultBlock.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultBlock.java	12 Feb 2003 16:28:20 -0000	1.6
  +++ DefaultBlock.java	17 Feb 2003 12:11:56 -0000	1.7
  @@ -17,6 +17,7 @@
   import org.apache.avalon.assembly.appliance.Appliance;
   import org.apache.avalon.assembly.appliance.DefaultAppliance;
   import org.apache.avalon.assembly.appliance.ApplianceContext;
  +import org.apache.avalon.assembly.appliance.ApplianceRepository;
   import org.apache.avalon.assembly.appliance.ApplianceException;
   import org.apache.avalon.assembly.appliance.DependencyGraph;
   import org.apache.avalon.assembly.engine.EngineClassLoader;
  @@ -51,7 +52,6 @@
   import org.apache.avalon.meta.info.DependencyDescriptor;
   import org.apache.avalon.meta.model.builder.XMLProfileCreator;
   import org.apache.avalon.meta.model.Profile;
  -//import org.apache.avalon.merlin.service.Registry;
   import org.apache.avalon.merlin.kernel.impl.DefaultKernel;
   import org.apache.avalon.assembly.appliance.DefaultApplianceContext;
   import org.apache.excalibur.configuration.ConfigurationUtil;
  @@ -168,9 +168,9 @@
       private Library m_library;
   
      /**
  -    * The service registry assigned to the block.
  -    */
  -    //private Registry m_registry;
  +    * The appliance manager.
  +    */ 
  +    private ApplianceRepository m_repository;
   
      /**
       * List of the appliance instances that the block is 
  @@ -236,9 +236,9 @@
           m_engine = (EngineClassLoader) context.get( "urn:assembly:engine" );
           m_applianceContext = (ApplianceContext) context.get( "urn:assembly:appliance.context"
);
           m_descriptor = (ContainerDescriptor) context.get( "urn:merlin:container.descriptor"
);
  -        //m_registry = (Registry) context.get( "urn:merlin:container.registry" );
           m_library = (Library) context.get( "urn:merlin:container.library" );
           m_blocks = (List) context.get( "urn:merlin:container.containers" );
  +        m_repository = (ApplianceRepository) context.get( "urn:assembly:appliance.repository"
);
       }
   
       //=====================================================================
  @@ -273,12 +273,12 @@
                   getLogger().debug( message );
               }
   
  -            Configuration config = m_library.getConfiguration( getPath() + "/" + profile.getName()
);
  -            //Configuration config = 
  -            //   getNamedConfiguration( m_config, profile.getName() );
  +            Configuration config = 
  +              m_library.getConfiguration( getPath() + "/" + profile.getName() );
   
               DefaultApplianceContext context = 
                  new DefaultApplianceContext( profile );
  +
               context.setPartitionName( getPath() );
               context.setConfiguration( config );
               context.setStartupPolicy( false );
  @@ -286,15 +286,23 @@
   
               Appliance appliance = m_engine.createAppliance( context, true );
               m_appliances.add( appliance );
  -            //m_registry.bind( appliance );
           }
  -   }
  +    }
   
       //-------------------------------------------------------------------------------
       // Appliance
       //-------------------------------------------------------------------------------
   
      /**
  +    * Get the appliance URL.
  +    * @return the appliance URL
  +    */
  +    public URL getURL()
  +    {
  +        return m_repository.getURL();
  +    }
  +
  +   /**
       * Assemble the appliance.  The implementation extends the default 
       * appliance behavior by instantiating the container it is managing, 
       * and applying assembly to the container instance. This results in 
  @@ -378,7 +386,7 @@
           {
               Appliance[] startup = graph.getStartupGraph( );
               StringBuffer buffer = new StringBuffer( 
  -              "statup sequence for for " + this + " (" + startup.length + ") " );
  +              "startup sequence for " + this + " (" + startup.length + ") " );
               for( int p=0; p<startup.length; p++ )
               {
                   if( p == 0 )
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message