/*
 * Copyright 2002-2004 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */ 

package org.springframework.aop.interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 *Simple AOP Alliance MethodInterceptor that can be introduced in a chain to display
 * verbose trace information about intercepted method invocations with method entry and method exit info
 * using Commons Logging at DEBUG level.
 * @author Dmitriy Kopylenko
 * @version $Id: TraceInterceptor.java,v 1.1 2004-05-02 21:05:53 dkopylenko Exp $
 */
public class TraceInterceptor implements MethodInterceptor {
	
	protected final Log logger = LogFactory.getLog(getClass());
	
	/**
	 * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation)
	 */
	public Object invoke(MethodInvocation invocation) throws Throwable {
		logger.debug("Entering method ["+ invocation.getMethod().getName() +"] in class ["+ invocation.getThis().getClass().getName() + "]" );
		Object rval = invocation.proceed();
		logger.debug("Exiting method ["+ invocation.getMethod().getName() +"] in class ["+ invocation.getThis().getClass().getName() + "]" );
		return rval;
	}
}

@@ -50,23 +50,16 @@
 authors.
-%0A * %0A *
  License
@@ -182,19 +182,16 @@
 License.
-%0A *
  You may
@@ -230,17 +230,8 @@
 %0A * 
-%0A *      
 http
@@ -272,15 +272,8 @@
 -2.0
-%0A * %0A *
  Unl
@@ -405,19 +405,16 @@
 %22 BASIS,
-%0A *
  WITHOUT
@@ -451,16 +451,19 @@
 NY KIND,
+%0A *
  either 
@@ -481,19 +481,16 @@
 implied.
-%0A *
  See the
@@ -549,19 +549,16 @@
 ions and
-%0A *
  limitat
@@ -563,32 +563,35 @@
 ations under the
+%0A *
  License.%0A */ %0A%0A
@@ -587,17 +587,16 @@
 nse.%0A */
- 
 %0A%0Apackag
@@ -830,16 +830,17 @@
 %0A%0A/**%0A *
+ 
 Simple A
@@ -913,19 +913,16 @@
  display
-%0A *
  verbose
@@ -945,16 +945,19 @@
 on about
+%0A *
  interce
@@ -1018,19 +1018,16 @@
 xit info
-%0A *
  using C
@@ -1057,16 +1057,20 @@
  level.%0A
+ * %0A
  * @auth
@@ -1137,29 +1137,29 @@
 v 1.
-1
+2
  2004-0
-5-02 21:05:53
+7-12 15:21:18
  dko
@@ -1237,19 +1237,21 @@
 eptor %7B%0A
-%09%0A%09
+%0A    
 protecte
@@ -1306,16 +1306,21 @@
 ));%0A
-%09%0A%09/**%0A%09
+%0A    /**%0A    
  * @
@@ -1396,14 +1396,20 @@
 on)%0A
-%09 */%0A%09
+     */%0A    
 publ
@@ -1473,18 +1473,24 @@
 wable %7B%0A
-%09%09
+        
 logger.d
@@ -1505,32 +1505,33 @@
 tering method %5B%22
+ 
 + invocation.get
@@ -1542,32 +1542,33 @@
 od().getName() +
+ 
 %22%5D in class %5B%22+ 
@@ -1557,32 +1557,33 @@
 + %22%5D in class %5B%22
+ 
 + invocation.get
@@ -1615,22 +1615,27 @@
 () + %22%5D%22
- 
 );%0A
-%09%09
+        
 Object r
@@ -1662,18 +1662,24 @@
 ceed();%0A
-%09%09
+        
 logger.d
@@ -1701,16 +1701,17 @@
 ethod %5B%22
+ 
 + invoca
@@ -1738,16 +1738,17 @@
 Name() +
+ 
 %22%5D in cl
@@ -1753,16 +1753,17 @@
 class %5B%22
+ 
 + invoca
@@ -1807,14 +1807,19 @@
  %22%5D%22
- 
 );%0A
-%09%09
+        
 retu
@@ -1831,9 +1831,11 @@
 al;%0A
-%09
+    
 %7D%0A%7D
-%0A

Formatted the source