View Javadoc

1   /*
2    * $Id: LoggingInterceptor.java 7976 2007-08-21 14:26:13Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.interceptors;
12  
13  import org.mule.umo.Invocation;
14  
15  import org.apache.commons.logging.Log;
16  import org.apache.commons.logging.LogFactory;
17  
18  /**
19   * <code>LoggingInterceptor</code> is a simple interceptor that logs a message
20   * before and after the event processing.
21   * 
22   * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
23   * @version $Revision: 7976 $
24   */
25  public class LoggingInterceptor extends EnvelopeInterceptor
26  {
27      /**
28       * logger used by this class
29       */
30      private static Log logger = LogFactory.getLog(LoggingInterceptor.class);
31  
32      /*
33       * (non-Javadoc)
34       * 
35       * @see org.mule.interceptors.EnvelopeInterceptor#before(org.mule.umo.Invocation)
36       */
37      public void before(Invocation event)
38      {
39          logger.info("About to process event for " + event.getDescriptor().getName());
40  
41      }
42  
43      /*
44       * (non-Javadoc)
45       * 
46       * @see org.mule.interceptors.EnvelopeInterceptor#after(org.mule.umo.Invocation)
47       */
48      public void after(Invocation event)
49      {
50          logger.info("Processed event for " + event.getDescriptor().getName());
51      }
52  
53  }