Package org.springframework.aop.framework

Examples of org.springframework.aop.framework.ProxyFactory.addInterface()


        pf.addAdvice(new DelegatingIntroductionInterceptor(scopedObject));

        // Add the AopInfrastructureBean marker to indicate that the scoped proxy
        // itself is not subject to auto-proxying! Only its target bean is.
        // Not sure if this is needed....
        pf.addInterface(AopInfrastructureBean.class);

        return pf.getProxy(cbf.getBeanClassLoader());
    }

    /**
 
View Full Code Here


        for(int i=0; i<advisors.length; ++i)
        {
            proxyFactory.addAdvisor(advisors[i]);
        }

        proxyFactory.addInterface(SpringProxy.class);
        return proxyFactory.getProxy(instance.getClass().getClassLoader());
    }
}
View Full Code Here

    }

    protected Object createScaProxy(Object bean, ServiceMetadata smd) {
        ProxyFactory pf = new ProxyFactory(bean);
        for (Class intf : smd.getServiceInterfaces()) {
            pf.addInterface(intf);
        }

//pf.addAdvisor(ExposeInvocationInterceptor.ADVISOR);
//pf.addAdvisor(new ExposeBeanNameAdvisor(smd.getServiceName()));
        // TODO enforce call by value
View Full Code Here

    @SuppressWarnings("unchecked")
    private static <T> T initProxy(Class<?> type, ControllerMethodInvocationInterceptor interceptor) {

        if (type.isInterface()) {
            ProxyFactory factory = new ProxyFactory(EmptyTargetSource.INSTANCE);
            factory.addInterface(type);
            factory.addInterface(MethodInvocationInfo.class);
            factory.addAdvice(interceptor);
            return (T) factory.getProxy();
        } else {
            Enhancer enhancer = new Enhancer();
View Full Code Here

    private static <T> T initProxy(Class<?> type, ControllerMethodInvocationInterceptor interceptor) {

        if (type.isInterface()) {
            ProxyFactory factory = new ProxyFactory(EmptyTargetSource.INSTANCE);
            factory.addInterface(type);
            factory.addInterface(MethodInvocationInfo.class);
            factory.addAdvice(interceptor);
            return (T) factory.getProxy();
        } else {
            Enhancer enhancer = new Enhancer();
            enhancer.setSuperclass(type);
View Full Code Here

        for(int i=0; i<advisors.length; ++i)
        {
            proxyFactory.addAdvisor(advisors[i]);
        }

        proxyFactory.addInterface(SpringProxy.class);
        return proxyFactory.getProxy(instance.getClass().getClassLoader());
    }
}
View Full Code Here

        pf.addAdvice(new DelegatingIntroductionInterceptor(scopedObject));

        // Add the AopInfrastructureBean marker to indicate that the scoped proxy
        // itself is not subject to auto-proxying! Only its target bean is.
        // Not sure if this is needed....
        pf.addInterface(AopInfrastructureBean.class);

        return pf.getProxy(cbf.getBeanClassLoader());
    }

    /**
 
View Full Code Here

        pf.addAdvice(new DelegatingIntroductionInterceptor(scopedObject));

        // Add the AopInfrastructureBean marker to indicate that the scoped proxy
        // itself is not subject to auto-proxying! Only its target bean is.
        // Not sure if this is needed....
        pf.addInterface(AopInfrastructureBean.class);

        return pf.getProxy(cbf.getBeanClassLoader());
    }

    /**
 
View Full Code Here

  private static <T> T getProxyWithInterceptor(Class<?> type, InvocationRecordingMethodInterceptor interceptor, ClassLoader classLoader) {

    if (type.isInterface()) {

      ProxyFactory factory = new ProxyFactory(EmptyTargetSource.INSTANCE);
      factory.addInterface(type);
      factory.addInterface(LastInvocationAware.class);
      factory.addAdvice(interceptor);

      return (T) factory.getProxy();
    }
View Full Code Here

    if (type.isInterface()) {

      ProxyFactory factory = new ProxyFactory(EmptyTargetSource.INSTANCE);
      factory.addInterface(type);
      factory.addInterface(LastInvocationAware.class);
      factory.addAdvice(interceptor);

      return (T) factory.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.