KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > interceptors > LoggingInterceptor


1 /*
2  * $Id: LoggingInterceptor.java 3798 2006-11-04 04:07:14Z aperepel $
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 MuleSource MPL
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.apache.commons.logging.Log;
14 import org.apache.commons.logging.LogFactory;
15 import org.mule.umo.Invocation;
16
17 /**
18  * <code>LoggingInterceptor</code> is a simple interceptor that logs a message
19  * before and after the event processing.
20  *
21  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
22  * @version $Revision: 3798 $
23  */

24 public class LoggingInterceptor extends EnvelopeInterceptor
25 {
26     /**
27      * logger used by this class
28      */

29     private static Log logger = LogFactory.getLog(LoggingInterceptor.class);
30
31     /*
32      * (non-Javadoc)
33      *
34      * @see org.mule.interceptors.EnvelopeInterceptor#before(org.mule.umo.Invocation)
35      */

36     public void before(Invocation event)
37     {
38         logger.info("About to process event for " + event.getDescriptor().getName());
39
40     }
41
42     /*
43      * (non-Javadoc)
44      *
45      * @see org.mule.interceptors.EnvelopeInterceptor#after(org.mule.umo.Invocation)
46      */

47     public void after(Invocation event)
48     {
49         logger.info("Processed event for " + event.getDescriptor().getName());
50     }
51
52 }
53
Popular Tags