avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craft...@apache.org
Subject cvs commit: avalon-excalibur/event/src/java/org/apache/excalibur/event/command CommandManager.java
Date Tue, 17 Jun 2003 15:52:30 GMT
crafterm    2003/06/17 08:52:30

  Modified:    event/src/java/org/apache/excalibur/event/command
                        CommandManager.java
  Log:
  Added AbstractLogEnabled as parent, and message to log exceptions thrown
  during the call to execute on command objects.
  
  Revision  Changes    Path
  1.31      +12 -2     avalon-excalibur/event/src/java/org/apache/excalibur/event/command/CommandManager.java
  
  Index: CommandManager.java
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/event/src/java/org/apache/excalibur/event/command/CommandManager.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- CommandManager.java	12 Jun 2003 22:43:36 -0000	1.30
  +++ CommandManager.java	17 Jun 2003 15:52:30 -0000	1.31
  @@ -56,6 +56,8 @@
   import java.util.Map;
   
   import org.apache.avalon.framework.activity.Disposable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
  +import org.apache.avalon.framework.logger.NullLogger;
   import org.apache.commons.collections.Buffer;
   import org.apache.commons.collections.UnboundedFifoBuffer;
   import org.apache.excalibur.event.*;
  @@ -90,12 +92,14 @@
    //
   
    CommandManager commandManager = new CommandManager();
  + commandManager.enableLogging( getLogger().getChildLogger("commandmanager") );
    threadManager.register( commandManager );
    * </pre>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    */
  -public class CommandManager implements EventPipeline, Disposable, EnqueuePredicate
  +public class CommandManager extends AbstractLogEnabled
  +    implements EventPipeline, Disposable, EnqueuePredicate
   {
       private final Queue m_queue;
       private final HashMap m_signalHandlers;
  @@ -118,6 +122,9 @@
           m_failureHandler = NullCommandFailureHandler.SHARED_INSTANCE;
           m_queue.setEnqueuePredicate(this);
           m_isAccepting = true;
  +
  +        // if no logger is set ensure a valid one is there.
  +        enableLogging( new NullLogger() );
       }
   
       /**
  @@ -294,7 +301,10 @@
                       }
                       catch( Exception e )
                       {
  -                        // ignore for now
  +                        if ( getLogger().isWarnEnabled() )
  +                        {
  +                            getLogger().warn( "Exception during Command.execute()", e );
  +                        }
                       }
   
                       command.m_numExecutions++;
  
  
  

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


Mime
View raw message