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/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging DefaultLoggingService.java LoggingService.java
Date Sun, 20 Apr 2003 12:08:44 GMT
mcconnell    2003/04/20 05:08:44

  Modified:    merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle
                        DefaultDeploymentService.java
                        DeploymentService.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/configuration
                        ConfigurationService.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/context
                        ContextualizationService.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/disposal
                        DisposalService.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/initialization
                        InitializationService.java
               merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging
                        DefaultLoggingService.java LoggingService.java
  Log:
  Moving to <interface-class>.KEY for context lookup.
  
  Revision  Changes    Path
  1.4       +23 -23    avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/DefaultDeploymentService.java
  
  Index: DefaultDeploymentService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/DefaultDeploymentService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultDeploymentService.java	11 Apr 2003 19:52:11 -0000	1.3
  +++ DefaultDeploymentService.java	20 Apr 2003 12:08:43 -0000	1.4
  @@ -124,46 +124,45 @@
               throw new IllegalStateException( "context" );
           }
   
  -        String key = "urn:assembly:lifecycle.logging";
  -        if( m_context.hasEntry( key ) )
  +        if( m_context.hasEntry( LoggingService.KEY ) )
           {
  -            m_logging = (LoggingService) m_context.get( key );
  +            m_logging = (LoggingService) m_context.get( LoggingService.KEY );
           } else
           {
               m_logging = makeLoggingService();
           }
   
  -        key = "urn:assembly:lifecycle.context";
  -        if( m_context.hasEntry( key ) )
  +        if( m_context.hasEntry( ContextualizationService.KEY ) )
           {
  -            m_contextualization = (ContextualizationService) m_context.get( key );
  +            m_contextualization = 
  +             (ContextualizationService) m_context.get( ContextualizationService.KEY );
           } else
           {
               m_contextualization = makeContextualizationService();
           }
   
  -        key = "urn:assembly:lifecycle.configuration";
  -        if( m_context.hasEntry( key ) )
  +        if( m_context.hasEntry( ConfigurationService.KEY ) )
           {
  -            m_configuration = (ConfigurationService) m_context.get( key );
  +            m_configuration = 
  +              (ConfigurationService) m_context.get( ConfigurationService.KEY );
           } else
           {
               m_configuration = makeConfigurationService();
           }
   
  -        key = "urn:assembly:lifecycle.initialization";
  -        if( m_context.hasEntry( key ) )
  +        if( m_context.hasEntry( InitializationService.KEY ) )
           {
  -            m_initialization = (InitializationService) m_context.get( key );
  +            m_initialization = 
  +              (InitializationService) m_context.get( InitializationService.KEY );
           } else
           {
               m_initialization = makeInitializationService();
           }
   
  -        key = "urn:assembly:lifecycle.disposal";
  -        if( m_context.hasEntry( key ) )
  +        if( m_context.hasEntry( DisposalService.KEY ) )
           {
  -            m_disposal = (DisposalService) m_context.get( key );
  +            m_disposal = 
  +              (DisposalService) m_context.get( DisposalService.KEY );
           } else
           {
               m_disposal = makeDisposalService();
  @@ -214,8 +213,8 @@
           } catch( Throwable e )
           {
               final String error =
  -                    "Component implementation establishment error in appliance: "
  -                    + appliance;
  +              "Component implementation establishment error in appliance: "
  +              + appliance;
               throw new DeploymentException( error, e );
           }
   
  @@ -231,8 +230,8 @@
           } catch( Throwable e )
           {
               final String error =
  -                    "Component deployment failure in appliance: "
  -                    + appliance;
  +              "Component deployment failure in appliance: "
  +              + appliance;
               throw new DeploymentException( error, e );
           }
       }
  @@ -270,7 +269,7 @@
           } catch( Throwable e )
           {
               final String warning =
  -                    "Ignoring shutdown error raised by component: " + appliance;
  +              "Ignoring shutdown error raised by component: " + appliance;
               getLogger().warn( warning, e );
           }
   
  @@ -288,9 +287,10 @@
               DefaultLoggingService service = new DefaultLoggingService();
               service.enableLogging( getLogger().getChildLogger( "logging" ) );
               LoggingManager logging =
  -                    (LoggingManager) m_context.get( "urn:assembly:logging.manager" );
  +             (LoggingManager) m_context.get( LoggingManager.KEY );
  +
               DefaultLocator locator = new DefaultLocator();
  -            locator.put( "urn:assembly:logging.manager", logging );
  +            locator.put( LoggingManager.KEY, logging );
               service.contextualize( locator );
               service.initialize();
               return service;
  
  
  
  1.3       +2 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/DeploymentService.java
  
  Index: DeploymentService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/DeploymentService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeploymentService.java	11 Apr 2003 19:52:11 -0000	1.2
  +++ DeploymentService.java	20 Apr 2003 12:08:43 -0000	1.3
  @@ -61,6 +61,7 @@
    */
   public interface DeploymentService
   {
  +     static final String KEY = "urn:assembly:lifecycle.deployment";
   
       /**
        * Deploy an appliance based on a supplied classloader, logging channel and
  
  
  
  1.3       +3 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/configuration/ConfigurationService.java
  
  Index: ConfigurationService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/configuration/ConfigurationService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConfigurationService.java	11 Apr 2003 19:52:11 -0000	1.2
  +++ ConfigurationService.java	20 Apr 2003 12:08:43 -0000	1.3
  @@ -62,6 +62,8 @@
    */
   public interface ConfigurationService
   {
  +     static final String KEY = "urn:assembly:lifecycle.configuration";
  +
       /**
        * Configure a supplied object in accordance with the profile
        * directives assiacted with the supplied appliance.
  
  
  
  1.3       +3 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/context/ContextualizationService.java
  
  Index: ContextualizationService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/context/ContextualizationService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContextualizationService.java	11 Apr 2003 19:52:12 -0000	1.2
  +++ ContextualizationService.java	20 Apr 2003 12:08:43 -0000	1.3
  @@ -62,6 +62,8 @@
    */
   public interface ContextualizationService
   {
  +     static final String KEY = "urn:assembly:lifecycle.context";
  +
       /**
        * Contextualize the supplied object.
        * @param appliance the object to contextualize
  
  
  
  1.3       +3 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/disposal/DisposalService.java
  
  Index: DisposalService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/disposal/DisposalService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DisposalService.java	11 Apr 2003 19:52:13 -0000	1.2
  +++ DisposalService.java	20 Apr 2003 12:08:43 -0000	1.3
  @@ -62,6 +62,8 @@
    */
   public interface DisposalService
   {
  +     static final String KEY = "urn:assembly:lifecycle.disposal";
  +
       /**
        * Dispose of the supplied object.
        * @param appliance the appliance
  
  
  
  1.3       +3 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/initialization/InitializationService.java
  
  Index: InitializationService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/initialization/InitializationService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- InitializationService.java	11 Apr 2003 19:52:13 -0000	1.2
  +++ InitializationService.java	20 Apr 2003 12:08:43 -0000	1.3
  @@ -62,6 +62,8 @@
    */
   public interface InitializationService
   {
  +     static final String KEY = "urn:assembly:lifecycle.initialization";
  +
       /**
        * Initialize a supplied object in accordance with the parameters
        * associated with the supplied appliance.
  
  
  
  1.4       +6 -16     avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/DefaultLoggingService.java
  
  Index: DefaultLoggingService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/DefaultLoggingService.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultLoggingService.java	15 Apr 2003 02:53:08 -0000	1.3
  +++ DefaultLoggingService.java	20 Apr 2003 12:08:43 -0000	1.4
  @@ -88,7 +88,7 @@
        */
       public void contextualize( Locator context ) throws ContextException
       {
  -        m_manager = (LoggingManager) context.get( "urn:assembly:logging.manager" );
  +        m_manager = (LoggingManager) context.get( LoggingManager.KEY );
       }
   
       //==============================================================
  @@ -147,20 +147,10 @@
   
               String path = appliance.getPath();
   
  -            if( appliance instanceof Appliance )
  -            {
  -                LoggingDirective logging = appliance.getLoggingDirective();
  -                m_manager.addSystemCategories( path, logging );
  -                Logger logger = m_manager.getSystemLoggerForCategory( path );
  -                ((LogEnabled) object).enableLogging( logger );
  -            }
  -            else
  -            {
  -                LoggingDirective logging = appliance.getLoggingDirective();
  -                m_manager.addCategories( path, logging );
  -                Logger logger = m_manager.getLoggerForCategory( path );
  -                ((LogEnabled) object).enableLogging( logger );
  -            }
  +            LoggingDirective logging = appliance.getLoggingDirective();
  +            m_manager.addCategories( path, logging );
  +            Logger logger = m_manager.getLoggerForCategory( path );
  +            ((LogEnabled) object).enableLogging( logger );
           }
       }
   }
  
  
  
  1.3       +3 -1      avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/LoggingService.java
  
  Index: LoggingService.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/merlin/assembly/src/java/org/apache/avalon/assembly/lifecycle/logging/LoggingService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LoggingService.java	11 Apr 2003 19:52:13 -0000	1.2
  +++ LoggingService.java	20 Apr 2003 12:08:43 -0000	1.3
  @@ -61,6 +61,8 @@
    */
   public interface LoggingService
   {
  +     static final String KEY = "urn:assembly:lifecycle.logging";
  +
       /**
        * Applies logging channels to a supplied object in accordance with the profile
        * directives associated with the supplied appliance.
  
  
  

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


Mime
View raw message