Package com.atlassian.confluence.util
Class AopUtils
java.lang.Object
com.atlassian.confluence.util.AopUtils
Utilities for aspect oriented programming
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
adaptInterface
(Object target, Class newInterface, Class oldInterface, Object delegate) Adapt an interface of an object via a delegatestatic Object
createAdvisedDynamicProxy
(Object target, org.springframework.aop.Advisor advisor) Convenience method for creating an advised proxy, the proxy will implement all interfaces present on the targetstatic <T> T
createAdvisedProxy
(Object target, Class<T> advisedInterface, List<org.springframework.aop.Advisor> advisors) Convenience method for creating an advised proxystatic <T> T
createAdvisedProxy
(Object target, Class<T> advisedInterface, org.springframework.aop.Advisor... advisors) Convenience method for creating an advised proxystatic <T> T
createAdvisedProxy
(Object target, org.springframework.aop.Advisor advisor, Class<T> advisedInterface) Convenience method for creating an advised proxy
-
Constructor Details
-
AopUtils
public AopUtils()
-
-
Method Details
-
adaptInterface
public static Object adaptInterface(Object target, Class newInterface, Class oldInterface, Object delegate) Adapt an interface of an object via a delegate- Parameters:
target
- Object to adaptnewInterface
- The new interface to implementoldInterface
- The old interface to removedelegate
- A delegate object - this object will intercept all calls made on the newInterface of the target object- Returns:
- The adapted object
-
createAdvisedProxy
public static <T> T createAdvisedProxy(Object target, org.springframework.aop.Advisor advisor, Class<T> advisedInterface) Convenience method for creating an advised proxy- Parameters:
target
- Object to adviseadvisor
- Advisor to provide advice to method calls for the proxied objectadvisedInterface
- Interface to advise- Returns:
- Proxied object
-
createAdvisedProxy
public static <T> T createAdvisedProxy(Object target, Class<T> advisedInterface, org.springframework.aop.Advisor... advisors) Convenience method for creating an advised proxy- Parameters:
target
- Object to adviseadvisedInterface
- Interface to adviseadvisors
- Advisor list to provide advice to method calls for the proxied object- Returns:
- Proxied object
- Since:
- 5.8
-
createAdvisedProxy
public static <T> T createAdvisedProxy(Object target, Class<T> advisedInterface, List<org.springframework.aop.Advisor> advisors) Convenience method for creating an advised proxy- Parameters:
target
- Object to adviseadvisedInterface
- Interface to adviseadvisors
- Advisor list to provide advice to method calls for the proxied object- Returns:
- Proxied object
- Since:
- 5.8
-
createAdvisedDynamicProxy
public static Object createAdvisedDynamicProxy(Object target, org.springframework.aop.Advisor advisor) Convenience method for creating an advised proxy, the proxy will implement all interfaces present on the target- Parameters:
target
- object to advise, must implement at least one interfaceadvisor
- Advisor to provide advice to method calls for the proxied object- Returns:
- proxied object
-