You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by bl...@apache.org on 2002/08/06 22:42:25 UTC

cvs commit: jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/test ContainerProfile.java

bloritsch    2002/08/06 13:42:24

  Modified:    fortress/src/java/org/apache/excalibur/fortress
                        ContainerManagerConstants.java
                        DefaultContainerManager.java
               fortress/src/test/org/apache/excalibur/fortress/test
                        ContainerProfile.java
  Log:
  Fix remaining problems with the change
  
  Revision  Changes    Path
  1.9       +1 -6      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/ContainerManagerConstants.java
  
  Index: ContainerManagerConstants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/ContainerManagerConstants.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContainerManagerConstants.java	6 Aug 2002 19:41:18 -0000	1.8
  +++ ContainerManagerConstants.java	6 Aug 2002 20:42:24 -0000	1.9
  @@ -67,11 +67,6 @@
       /**
        * ComponentLocator: The component manager to give to the container.
        */
  -    String COMPONENT_MANAGER = "container.componentManager";
  -
  -    /**
  -     * ComponentLocator: The component manager to give to the container.
  -     */
       String SERVICE_MANAGER = "container.serviceManager";
   
       /**
  
  
  
  1.18      +6 -24     jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/DefaultContainerManager.java
  
  Index: DefaultContainerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/DefaultContainerManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DefaultContainerManager.java	6 Aug 2002 20:24:52 -0000	1.17
  +++ DefaultContainerManager.java	6 Aug 2002 20:42:24 -0000	1.18
  @@ -105,7 +105,7 @@
       public DefaultContainerManager( ContextManager contextManager, Logger logger )
       {
           this.contextManager = contextManager;
  -        this.logger = logger == null ? createLoggerFromContext( this.contextManager.getChildContext() ) : logger;
  +        this.logger = logger == null ? createLoggerFromContext( this.contextManager.getContainerManagerContext() ) : logger;
       }
   
       public DefaultContainerManager( Context initParameters )
  @@ -149,7 +149,7 @@
   
               try
               {
  -                instance = ( (Class)this.contextManager.getChildContext().get( CONTAINER_CLASS ) ).newInstance();
  +                instance = ( (Class)this.contextManager.getContainerManagerContext().get( CONTAINER_CLASS ) ).newInstance();
               }
               catch( Exception e )
               {
  @@ -176,7 +176,7 @@
                   }
   
                   ServiceManager smanager = getServiceManager(
  -                        this.contextManager.getChildContext() );
  +                        this.contextManager.getContainerManagerContext() );
   
                   if( instance instanceof Composable )
                   {
  @@ -194,14 +194,14 @@
                   {
                       validator.checkConfigured();
                       ( (Configurable)instance ).configure( (Configuration)
  -                        this.contextManager.getChildContext().get( CONFIGURATION ) );
  +                        this.contextManager.getContainerManagerContext().get( CONFIGURATION ) );
                   }
   
                   if( instance instanceof Parameterizable )
                   {
                       validator.checkParameterized();
                       ( (Parameterizable)instance ).parameterize( (Parameters)
  -                        this.contextManager.getChildContext().get( PARAMETERS ) );
  +                        this.contextManager.getContainerManagerContext().get( PARAMETERS ) );
                   }
   
                   if( instance instanceof Initializable )
  @@ -224,24 +224,6 @@
               }
   
               containerInstance = instance;
  -        }
  -    }
  -
  -    /**
  -     * Helper method to get the CM out of the given context, if existing
  -     *
  -     * @param context a <code>Context</code> instance
  -     * @return a <code>ComponentManager</code> instance or null if none
  -     */
  -    private ComponentManager getComponentManager( Context context )
  -    {
  -        try
  -        {
  -            return (ComponentManager) context.get( COMPONENT_MANAGER );
  -        }
  -        catch( ContextException e )
  -        {
  -            return null;
           }
       }
   
  
  
  
  1.21      +2 -5      jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/test/ContainerProfile.java
  
  Index: ContainerProfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/test/ContainerProfile.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ContainerProfile.java	6 Aug 2002 19:53:39 -0000	1.20
  +++ ContainerProfile.java	6 Aug 2002 20:42:24 -0000	1.21
  @@ -146,10 +146,7 @@
           contextBuilder.setLoggerManagerConfiguration( "resource://org/apache/excalibur/fortress/test/ContainerProfile.xlog" );
           contextBuilder.setRoleManagerConfiguration( "resource://org/apache/excalibur/fortress/test/ContainerProfile.roles" );
   
  -        ContextManager contextManager = new ContextManager( contextBuilder.getContext(), new NullLogger() );
  -        contextManager.initialize();
  -
  -        ContainerManager cm = new DefaultContainerManager( contextManager );
  +        ContainerManager cm = new DefaultContainerManager( contextBuilder.getContext(), new NullLogger() );
           cm.initialize();
           DefaultContainer container = (DefaultContainer)cm.getContainer();
           assertNotNull( container );
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>