View Javadoc
1 /* 2 * Around.java 3 * Created on August 8, 2003 4 * 5 * The Blues Framework - A lightweight application framework 6 * Copyright (C) 2003 Lonnie Pryor 7 * http://blues.lonniepryor.com 8 * 9 * This library is free software; you can redistribute it and/or modify it under the 10 * terms of the GNU Lesser General Public License as published by the Free Software 11 * Foundation; either version 2.1 of the License, or (at your option) any later 12 * version. 13 * 14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY 15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 16 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License along 19 * with this library; if not, write to: 20 * 21 * The Free Software Foundation, Inc. 22 * 59 Temple Place, Suite 330 23 * Boston, MA 02111-1307 USA 24 * 25 */ 26 package com.lonniepryor.blues.aop; 27 28 import java.lang.reflect.Method; 29 30 /*** 31 * Interface that describes the behavour of advice that executes around the 32 * invocation of a join point. 33 * 34 * @author Lonnie Pryor 35 * @version $Revision: 1.1 $ 36 */ 37 public interface Around { 38 /*** 39 * Called before the invocation of a join point. Calling invokeNext() on the 40 * supplied invocation chain will propagate the invocation to the target object 41 * and return the result of the underlying method call. 42 * 43 * @param method The method that was invoked. 44 * @param target The object the invocation occurred on. 45 * @param params The parameters passed to the method. 46 * @param chain The chain of around advice to propagate invocations to. 47 * 48 * @return The value to be returned by the join point invocation. 49 * 50 * @throws Throwable If an error occurrs. 51 */ 52 Object around ( 53 Object target, Method method, Object[] params, InvoctionChain chain) 54 throws Throwable; 55 56 /*** 57 * Passed to around() to represent the next element in the chain used to invoke a 58 * join point. 59 * 60 * @author Lonnie Pryor 61 * @version $Revision: 1.1 $ 62 */ 63 interface InvoctionChain { 64 /*** 65 * Passes control to the next element in the invocation chain. 66 * 67 * @return The value returned by the next element in the invocation chain. 68 * 69 * @throws Throwable if the next element in the invocation chain fails. 70 */ 71 Object invokeNext () 72 throws Throwable; 73 } 74 }

This page was automatically generated by Maven