Mainly for internal use within Spring's AOP support.
See org. for a
collection of framework-specific AOP utility methods which depend
on internals of Spring's AOP framework implementation.
org.springframework.aop.framework.AopProxyUtils
| Modifier and Type | Class and Description |
|---|---|
| private static class | AopUtils.KotlinDelegate
Inner class to avoid a hard dependency on Kotlin at runtime. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static List | Returns: sublist of Advisors that can apply to an object of the given class (may be the incoming List as-is)the Advisors to evaluate candidateAdvisors, Class<?> the target class clazz)Determine the sublist of the |
| public static Method | Returns: the specific target method, or the original method if thetargetClass doesn't implement it or is nullthe method to be invoked, which may come from an interface method, Class<?> the target class for the current invocation.
May be targetClass)null or may not even implement the method.Given a method, which may come from an interface, and a target class used in the current AOP invocation, find the corresponding target method if there is one. |
| public static Class | Returns: the target class (or the plain class of the given object as fallback; nevernull)the instance to check (might be an AOP proxy) candidate)Determine the target class of the given bean instance which might be an AOP proxy. |
| public static Object | Returns: the invocation result, if anythe target object target, Method the method to invoke method, Object[] the arguments for the method args)Invoke the given target via reflection, as part of an AOP method invocation. |
| public static boolean | isAopProxy(Object
the object to check object)Check whether the given object is a JDK dynamic proxy or a CGLIB proxy. |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | isJdkDynamicProxy(Object
the object to check object)Check whether the given object is a JDK dynamic proxy. |
| public static boolean | |
| public static Method | Returns: a corresponding invocable method on the target typethe method to check method, Class<?> the target type to search methods on (typically an AOP proxy) targetType)Select an invocable method on the target type: either the given method itself if actually exposed on the target type, or otherwise a corresponding method on one of the target type's interfaces or on the target type itself. |
| AopUtils | back to summary |
|---|---|
| public AopUtils() | |
| canApply | back to summary |
|---|---|
| public static boolean canApply(Pointcut pc, Class<?> targetClass) Can the given pointcut apply at all on the given class? This is an important test as it can be used to optimize out a pointcut for a class. | |
| canApply | back to summary |
|---|---|
| public static boolean canApply(Pointcut pc, Class<?> targetClass, boolean hasIntroductions) Can the given pointcut apply at all on the given class? This is an important test as it can be used to optimize out a pointcut for a class. | |
| canApply | back to summary |
|---|---|
| public static boolean canApply(Advisor advisor, Class<?> targetClass) Can the given advisor apply at all on the given class? This is an important test as it can be used to optimize out an advisor for a class. | |
| canApply | back to summary |
|---|---|
| public static boolean canApply(Advisor advisor, Class<?> targetClass, boolean hasIntroductions) Can the given advisor apply at all on the given class? This is an important test as it can be used to optimize out an advisor for a class. This version also takes into account introductions (for IntroductionAwareMethodMatchers). | |
| findAdvisorsThatCanApply | back to summary |
|---|---|
| public static List Determine the sublist of the | |
| getMostSpecificMethod | back to summary |
|---|---|
| public static Method getMostSpecificMethod(Method method, Class<?> targetClass) Given a method, which may come from an interface, and a target class used
in the current AOP invocation, find the corresponding target method if there
is one. E.g. the method may be Note In contrast to
| |
| getTargetClass | back to summary |
|---|---|
| public static Class Determine the target class of the given bean instance which might be an AOP proxy. Returns the target class for an AOP proxy or the plain class otherwise.
| |
| invokeJoinpointUsingReflection | back to summary |
|---|---|
| public static Object invokeJoinpointUsingReflection(Object target, Method method, Object[] args) throws Throwable Invoke the given target via reflection, as part of an AOP method invocation. | |
| isAopProxy | back to summary |
|---|---|
| public static boolean isAopProxy(Object object) Check whether the given object is a JDK dynamic proxy or a CGLIB proxy. This method additionally checks if the given object is an instance
of
| |
| isCglibProxy | back to summary |
|---|---|
| public static boolean isCglibProxy(Object object) Check whether the given object is a CGLIB proxy. This method goes beyond the implementation of
| |
| isEqualsMethod | back to summary |
|---|---|
| public static boolean isEqualsMethod(Method method) Determine whether the given method is an "equals" method.
| |
| isFinalizeMethod | back to summary |
|---|---|
| public static boolean isFinalizeMethod(Method method) Determine whether the given method is a "finalize" method.
| |
| isHashCodeMethod | back to summary |
|---|---|
| public static boolean isHashCodeMethod(Method method) Determine whether the given method is a "hashCode" method.
| |
| isJdkDynamicProxy | back to summary |
|---|---|
| public static boolean isJdkDynamicProxy(Object object) Check whether the given object is a JDK dynamic proxy. This method goes beyond the implementation of
| |
| isToStringMethod | back to summary |
|---|---|
| public static boolean isToStringMethod(Method method) Determine whether the given method is a "toString" method.
| |
| selectInvocableMethod | back to summary |
|---|---|
| public static Method selectInvocableMethod(Method method, Class<?> targetType) Select an invocable method on the target type: either the given method itself if actually exposed on the target type, or otherwise a corresponding method on one of the target type's interfaces or on the target type itself.
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Publisher |
| KotlinDelegate | back to summary |
|---|---|
| private KotlinDelegate() | |
| invokeSuspendingFunction | back to summary |
|---|---|
| public static Publisher | |