avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system ContainerManager.java
Date Wed, 13 Feb 2002 22:19:11 GMT
bloritsch    02/02/13 14:19:11

  Modified:    src/scratchpad/org/apache/avalon/excalibur/system
                        ContainerManager.java
  Log:
  begin to incorporate SourceResolver
  
  Revision  Changes    Path
  1.23      +15 -8     jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/ContainerManager.java
  
  Index: ContainerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/ContainerManager.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ContainerManager.java	12 Feb 2002 21:30:43 -0000	1.22
  +++ ContainerManager.java	13 Feb 2002 22:19:11 -0000	1.23
  @@ -109,7 +109,7 @@
    * </table>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.22 $ $Date: 2002/02/12 21:30:43 $
  + * @version CVS $Revision: 1.23 $ $Date: 2002/02/13 22:19:11 $
    */
   public class ContainerManager implements Disposable
   {
  @@ -391,10 +391,6 @@
                       m_initialParameters.getParameter(LOG_CATEGORY, null)
               );
               context.put( Container.CONTEXT_CLASSLOADER, m_contextClassLoader );
  -            context.put( Container.ROLE_MANAGER, getRoleManager() );
  -
  -            context.put( Container.COMMAND_QUEUE, m_commandManager.getCommandQueue() );
  -            context.put( Container.POOL_MANAGER, m_poolManager );
   
               context.makeReadOnly();
               m_rootContext = context;
  @@ -413,6 +409,9 @@
           {
               DefaultContext context = new DefaultContext( getRootContext() );
               context.put( Container.LOGGER_MANAGER, getLoggerManager() );
  +            context.put( Container.ROLE_MANAGER, getRoleManager() );
  +            context.put( Container.COMMAND_QUEUE, m_commandManager.getCommandQueue() );
  +            context.put( Container.POOL_MANAGER, m_poolManager );
   
               context.makeReadOnly();
               m_containerContext = context;
  @@ -544,11 +543,15 @@
               }
               else
               {
  +                SourceResolver resolver = null;
                   try
                   {
  -                    m_roleConfig = m_configBuilder.buildFromFile(
  -                            new File( m_contextDirectory, configFile )
  -                    );
  +                    resolver = (SourceResolver) getComponentManager().lookup(SourceResolver.ROLE);
  +                    Source src = resolver.resolve( configFile );
  +
  +                    m_roleConfig = m_configBuilder.build( src.getInputStream() );
  +
  +                    resolver.release( src );
                   }
                   catch (Exception e)
                   {
  @@ -558,6 +561,10 @@
                       {
                           getLogger().warn("Could not read configuration file: " + configFile,
e);
                       }
  +                }
  +                finally
  +                {
  +                    getComponentManager().release(resolver);
                   }
               }
           }
  
  
  

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