Example usage for org.springframework.aop.interceptor ExposeInvocationInterceptor INSTANCE

List of usage examples for org.springframework.aop.interceptor ExposeInvocationInterceptor INSTANCE

Introduction

In this page you can find the example usage for org.springframework.aop.interceptor ExposeInvocationInterceptor INSTANCE.

Prototype

ExposeInvocationInterceptor INSTANCE

To view the source code for org.springframework.aop.interceptor ExposeInvocationInterceptor INSTANCE.

Click Source Link

Document

Singleton instance of this class.

Usage

From source file:aop.DeclareMixinAspectJAdvisorFactoryTest.java

protected Object createProxy(Object target, List<Advisor> advisors, Class<?>... interfaces) {
    ProxyFactory pf = new ProxyFactory(target);
    if (interfaces.length > 1 || interfaces[0].isInterface()) {
        pf.setInterfaces(interfaces);//from   w w  w  .  j av  a  2  s  .  c om
    } else {
        pf.setProxyTargetClass(true);
    }

    // Required everywhere we use AspectJ proxies
    pf.addAdvice(ExposeInvocationInterceptor.INSTANCE);

    for (Object a : advisors) {
        pf.addAdvisor((Advisor) a);
    }

    pf.setExposeProxy(true);
    return pf.getProxy();
}