KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > soto > aop > ReturnAdvice


1 package org.sapia.soto.aop;
2
3
4 /**
5  * Implements an advice that is called before an invocation returns.
6  *
7  * @author Yanick Duchesne
8  * <dl>
9  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
10  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
11  * <a HREF="http://www.sapia-oss.org/license.html">license page</a> at the Sapia OSS web site</dd></dt>
12  * </dl>
13  */

14 public interface ReturnAdvice extends Advice {
15   /**
16    * This method is called when the given method does NOT have
17    * a <code>void</code> return type. The method returns the object
18    * that will be returned in place of the return value that is contained
19    * in the given invocation object. If the latter is not to be replaced, then
20    * the object already in the invocation object should be returned, with
21    * code similar to the following:
22    *
23    * <pre>
24    * return invocation.getReturnValue();
25    * </pre>
26    *
27    * <p>
28    * This method allows to return a proxy for the object passed in.
29    * <p>
30    * WARNING: implementations of this method should check if the passed
31    * in instance is null and act appropriately.
32    *
33    * @param an <code>Invocation</code> instance.
34    */

35   public Object JavaDoc onReturn(Invocation invocation) throws Throwable JavaDoc;
36 }
37
Popular Tags