avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application BlockResourceProvider.java
Date Thu, 07 Nov 2002 16:37:16 GMT
donaldp     2002/11/07 08:37:16

  Modified:    lib      avalon-framework-4.1.3.jar
               src/java/org/apache/avalon/phoenix/components/application
                        BlockResourceProvider.java
  Log:
  Use WrapperComponentManager to adapt ServiceManager to a ComponentManager.
  
  Revision  Changes    Path
  1.3       +125 -109  jakarta-avalon-phoenix/lib/avalon-framework-4.1.3.jar
  
  	<<Binary file>>
  
  
  1.12      +4 -26     jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockResourceProvider.java
  
  Index: BlockResourceProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/application/BlockResourceProvider.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- BlockResourceProvider.java	2 Oct 2002 11:25:55 -0000	1.11
  +++ BlockResourceProvider.java	7 Nov 2002 16:37:16 -0000	1.12
  @@ -19,6 +19,7 @@
   import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.component.ComponentManager;
   import org.apache.avalon.framework.component.DefaultComponentManager;
  +import org.apache.avalon.framework.component.WrapperComponentManager;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.framework.context.Context;
  @@ -136,31 +137,8 @@
       public ComponentManager createComponentManager( final Object entry )
           throws Exception
       {
  -        final BlockMetaData metaData = getMetaDataFor( entry );
  -        final DefaultComponentManager manager = new DefaultComponentManager();
  -
  -        final Map serviceMap = createServiceMap( entry );
  -        final Iterator iterator = serviceMap.keySet().iterator();
  -        while( iterator.hasNext() )
  -        {
  -            final String key = (String)iterator.next();
  -            final Object value = serviceMap.get( key );
  -            if( value instanceof Component )
  -            {
  -                manager.put( key, (Component)value );
  -            }
  -            else
  -            {
  -                final String message =
  -                    REZ.getString( "lifecycle.nota-component.error",
  -                                   metaData.getName(),
  -                                   key,
  -                                   metaData.getDependency( key ).getName() );
  -                throw new Exception( message );
  -            }
  -        }
  -
  -        return manager;
  +        final ServiceManager serviceManager = createServiceManager( entry );
  +        return new WrapperComponentManager( serviceManager );
       }
   
       /**
  
  
  

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


Mime
View raw message