public Object getTargetObject() { return wrapped.getTargetObject(); }
/** * Invokes the target joinpoint for this invocation skipping any subsequent * interceptors in the chain. */ public Object invokeTarget() throws Throwable { try { return method.invoke(getTargetObject(), arguments); } catch (InvocationTargetException e) { throw e.getTargetException(); } }
/** * Advice for calls to Class.getDeclaredClasses(). Cleans inner classes that get added to the * class by the AOP framework. Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.Class[] containing the Class objects representing inner classes of the class * @throws Throwable * @see Class#getDeclaredClasses() */ public final Object interceptGetDeclaredClasses(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); return interceptGetDeclaredClasses((Class<?>) targetObject); }
/** * Advice for calls to Class.getDeclaredFields(). Cleans fields that get added to the * class by the AOP framework. Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.reflect.Field[] containing the Fields of the class * @throws Throwable * @see Class#getDeclaredFields() */ public final Object interceptGetDeclaredFields(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); return interceptGetDeclaredFields((Class<?>) targetObject); }
/** * Advice for calls to Class.getClasses(). Cleans inner classes that get added to the * class by the AOP framework. Intended use is for caller pointcuts. * Extra stuff only seems to get returned when using JRockit * * @param invocation The invocation * @return java.lang.Class[] containing the Class objects representing inner classes of the class * @throws Throwable * @see Class#getDeclaredClasses() */ public final Object interceptGetClasses(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); return interceptGetClasses((Class<?>) targetObject); }
/** * Advice for calls to Class.getInterfaces(). Cleans interfaces that get added to the * class by the AOP framework. (Interfaces introduced by introductions will * still be returned). Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.Class[] containing the interfaces of the class * @throws Throwable * @see Class#getInterfaces() */ public final Object interceptGetInterfaces(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); return interceptGetInterfaces((Class<?>) targetObject); }
/** * Advice for calls to Class.getDeclaredMethods(). Cleans methods that get added to the * class by the AOP framework (Methods introduced by introductions/mixin classes will * still be returned). Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.reflect.Method[] containing the declared methods of the class * @throws Throwable * @see Class#getDeclaredMethods()() */ public final Object interceptGetDeclaredMethods(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); return interceptGetDeclaredMethods((Class<?>) targetObject); }
/** * Advice for calls to Class.getMethods(). Cleans methods that get added to the * class by the AOP framework (Methods introduced by introductions/mixin classes will * still be returned). Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.reflect.Method[] The methods of the class * @throws Throwable * @see Class#getMethods()() */ public final Object interceptGetMethods(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); return interceptGetMethods((Class<?>) targetObject); }
/** * Advice for calls to Class.getDeclaredMethod(). Cleans methods that get added to the * class by the AOP framework (Methods introduced by introductions/mixin classes will * still be returned). Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.reflect.Method the declared method * @throws Throwable * @see Class#getDeclaredMethod()() */ public final Object interceptGetDeclaredMethod(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptGetDeclaredMethod((Class<?>) targetObject, args); }
/** * Advice for calls to Class.getMethod(). Cleans methods that get added to the * class by the AOP framework (Methods introduced by introductions/mixin classes will * still be returned). Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.reflect.Method The method * @throws Throwable * @see Class#getDeclaredMethod()() */ public final Object interceptGetMethod(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptGetMethod((Class<?>) targetObject, args); }
/** * Advice for calls to Class.getDeclaredField(). Cleans fields that get added to the * class by the AOP framework. Intended use is for caller pointcuts. * * @param invocation The invocation * @return java.lang.reflect.Field[] The Field * @throws Throwable * @see Class#getDeclaredField() */ public final Object interceptGetDeclaredField(MethodCalledByMethodInvocation invocation) throws Throwable { Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptGetDeclaredField((Class<?>) targetObject, args); }
/** * Advice for calls to Field.setXXX(). Intended use is for caller pointcuts. If you wish to handle * the intercepted calls, override interceptFieldWrite. * * @param invocation * @return result of invocation * @throws Throwable * @see ReflectionAspect#interceptFieldWrite(Invocation, Field, Object, Object) */ public Object interceptFieldSet(MethodCalledByMethodInvocation invocation) throws Throwable { Method reflectionMethod = invocation.getCalledMethod(); Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptFieldSet(invocation, reflectionMethod, targetObject, args); }
/** * Advice for calls to Class.newInstance() and Constructor.newInstance(). Intended use is for * caller pointcuts. If you wish to handle the intercepted calls, override interceptMethod. * * @param invocation * @return result of invocation * @throws Throwable * @see ReflectionAspect#interceptMethod(Invocation, Object, Method, Object[]) */ public Object interceptMethodInvoke(MethodCalledByMethodInvocation invocation) throws Throwable { Method reflectionMethod = invocation.getCalledMethod(); Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptMethodInvoke(invocation, reflectionMethod, targetObject, args); }
/** * Advice for calls to Class.newInstance() and Constructor.newInstance(). Intended use is for * caller pointcuts. If you wish to handle the intercepted calls, override interceptConstructor. * * @param invocation * @return result of invocation * @throws Throwable * @see ReflectionAspect#interceptConstructor(Invocation, Constructor, Object[]) */ public Object interceptNewInstance(MethodCalledByMethodInvocation invocation) throws Throwable { Method reflectionMethod = invocation.getCalledMethod(); Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptNewInstance(invocation, reflectionMethod, targetObject, args); }
/** * Advice for calls to Field.getXXX(). Intended use is for caller pointcuts. If you wish to handle * the intercepted calls, override interceptFieldRead. * * @param invocation * @return The value of the field (or whatever you choose) * @throws Throwable * @see ReflectionAspect#interceptFieldRead(Invocation, Field, Object) */ public Object interceptFieldGet(MethodCalledByMethodInvocation invocation) throws Throwable { Method reflectionMethod = invocation.getCalledMethod(); Object targetObject = invocation.getTargetObject(); Object[] args = invocation.getArguments(); return interceptFieldGet(invocation, reflectionMethod, targetObject, args); }