Package org.springframework.aop.aspectj.annotation

Examples of org.springframework.aop.aspectj.annotation.AspectJProxyFactory.addAdvice()


    protected void buildDocument(Context context, Item item)
            throws SQLException, IOException
    {
        AspectJProxyFactory pf = new AspectJProxyFactory(item);
        pf.setProxyTargetClass(true);
        pf.addAdvice(new CrisItemWrapper());
        // ProxyFactory pf = new ProxyFactory(item);
        super.buildDocument(context, (Item) pf.getProxy());
    }

    public <P extends Property<TP>, TP extends PropertiesDefinition, NP extends ANestedProperty<NTP>, NTP extends ANestedPropertiesDefinition, ACNO extends ACrisNestedObject<NP, NTP, P, TP>, ATNO extends ATypeNestedObject<NTP>> boolean indexCrisObject(
View Full Code Here


        final AspectJAroundAdvice aspectJAroundAdvice = new AspectJAroundAdvice(
                interceptorMethod,
                repositoryPointcutInterfaceExecutionPointcut,
                new SingletonAspectInstanceFactory(this.countingMethodInterceptor));
       
        portletPreferencesProxyFactory.addAdvice(aspectJAroundAdvice);

        final RepositoryPointcutInterface proxiedPointcutInterface = (RepositoryPointcutInterface) portletPreferencesProxyFactory.getProxy();

        assertEquals(0, countingMethodInterceptor.getCount());
        proxiedPointcutInterface.methodOne("test");
View Full Code Here

    @Test
    public void testProgramaticPointcut2() {
        final RepositoryPointcutInterface targetPointcutInterface = new RepositoryPointcutInterfaceImpl();
       
        final AspectJProxyFactory portletPreferencesProxyFactory = new AspectJProxyFactory(targetPointcutInterface);
        portletPreferencesProxyFactory.addAdvice(countingMethodInterceptorRepositoryAdvice);
        final RepositoryPointcutInterface proxiedPointcutInterface = (RepositoryPointcutInterface) portletPreferencesProxyFactory.getProxy();

        assertEquals(0, countingMethodInterceptor.getCount());
        proxiedPointcutInterface.methodOne("test");
        assertEquals(1, countingMethodInterceptor.getCount());
View Full Code Here

        }
       
        final AspectJProxyFactory portletPreferencesProxyFactory = new AspectJProxyFactory(result);
       
        for (final Advice advice : this.advices) {
            portletPreferencesProxyFactory.addAdvice(advice);
        }
       
        return portletPreferencesProxyFactory.getProxy();
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.