Search in sources :

Example 1 with LockMixinAdvisor

use of cn.taketoday.aop.mixin.LockMixinAdvisor in project today-framework by TAKETODAY.

the class UnsupportedInterceptor method getIntroductionAdvisorProxy.

private ITestBean getIntroductionAdvisorProxy(TestBean target) {
    ProxyFactory pf = new ProxyFactory(ITestBean.class);
    pf.setProxyTargetClass(true);
    pf.addAdvisor(new LockMixinAdvisor());
    pf.setTarget(target);
    pf.setFrozen(true);
    pf.setExposeProxy(false);
    return (ITestBean) pf.getProxy();
}
Also used : ITestBean(cn.taketoday.beans.testfixture.beans.ITestBean) ProxyFactory(cn.taketoday.aop.framework.ProxyFactory) LockMixinAdvisor(cn.taketoday.aop.mixin.LockMixinAdvisor)

Example 2 with LockMixinAdvisor

use of cn.taketoday.aop.mixin.LockMixinAdvisor in project today-framework by TAKETODAY.

the class AbstractAopProxyTests method testMixinWithIntroductionAdvisor.

/**
 * Test stateful interceptor
 */
@Test
public void testMixinWithIntroductionAdvisor() throws Throwable {
    TestBean tb = new TestBean();
    ProxyFactory pc = new ProxyFactory();
    pc.addInterface(ITestBean.class);
    pc.addAdvisor(new LockMixinAdvisor());
    pc.setTarget(tb);
    testTestBeanIntroduction(pc);
}
Also used : ITestBean(cn.taketoday.beans.testfixture.beans.ITestBean) TestBean(cn.taketoday.beans.testfixture.beans.TestBean) ProxyFactory(cn.taketoday.aop.framework.ProxyFactory) LockMixinAdvisor(cn.taketoday.aop.mixin.LockMixinAdvisor) Test(org.junit.jupiter.api.Test)

Aggregations

ProxyFactory (cn.taketoday.aop.framework.ProxyFactory)2 LockMixinAdvisor (cn.taketoday.aop.mixin.LockMixinAdvisor)2 ITestBean (cn.taketoday.beans.testfixture.beans.ITestBean)2 TestBean (cn.taketoday.beans.testfixture.beans.TestBean)1 Test (org.junit.jupiter.api.Test)1