bloritsch    02/02/05 11:58:09

  Modified:    src/scratchpad/org/apache/avalon/excalibur/system
                        ContainerManager.java
  Log:
  separate Context initialization into root context and container context (so 
that LoggerManager can use it as well as have a version to pass on)
  
  Revision  Changes    Path
  1.17      +23 -4     
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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ContainerManager.java     5 Feb 2002 19:40:28 -0000       1.16
  +++ ContainerManager.java     5 Feb 2002 19:58:09 -0000       1.17
  @@ -116,7 +116,7 @@
    * </table>
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Berin Loritsch</a>
  - * @version CVS $Revision: 1.16 $ $Date: 2002/02/05 19:40:28 $
  + * @version CVS $Revision: 1.17 $ $Date: 2002/02/05 19:58:09 $
    */
   public class ContainerManager
   {
  @@ -156,6 +156,7 @@
       private       Configuration           m_containerConfig;
       private       Configuration           m_logKitConfig;
       private       Configuration           m_roleConfig;
  +    private       Context                 m_rootContext;
       private       Context                 m_containerContext;
       private       Container               m_containerInstance;
       private       ComponentStateValidator m_validator;
  @@ -358,9 +359,9 @@
        * Override this if you have any special needs for the Container's 
Context.
        * Typically, this will f
        */
  -    protected Context getContext()
  +    protected Context getRootContext()
       {
  -        if ( null == m_containerContext )
  +        if ( null == m_rootContext )
           {
               DefaultContext context = new DefaultContext();
               context.put( CONTEXT_DIRECTORY, m_contextDirectory );
  @@ -378,6 +379,24 @@
               context.put( Container.POOL_MANAGER, m_poolManager );
   
               context.makeReadOnly();
  +            m_rootContext = context;
  +        }
  +
  +        return m_rootContext;
  +    }
  +
  +    /**
  +     * Override this if you have any special needs for the Container's 
Context.
  +     * Typically, this will f
  +     */
  +    protected Context getContext()
  +    {
  +        if ( null == m_containerContext )
  +        {
  +            DefaultContext context = new DefaultContext( getRootContext() );
  +            context.put( Container.LOGGER_MANAGER, getLoggerManager() );
  +
  +            context.makeReadOnly();
               m_containerContext = context;
           }
   
  @@ -398,7 +417,7 @@
   
               try
               {
  -                logManager.contextualize( getContext() );
  +                logManager.contextualize( getRootContext() );
                   logManager.configure( getLogKitConfig() );
               }
               catch (Exception e)
  
  
  

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

Reply via email to