Java Code Examples for org.springframework.aop.framework.ProxyFactoryBean#setProxyTargetClass()

The following examples show how to use org.springframework.aop.framework.ProxyFactoryBean#setProxyTargetClass() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExecutorBeanPostProcessor.java    From java-spring-cloud with Apache License 2.0 5 votes vote down vote up
private <T extends Executor> Object proxify(T executor, BiFunction<T, Tracer, T> tracingExecutorProvider, boolean useCglib) {
  ProxyFactoryBean factory = new ProxyFactoryBean();
  factory.setProxyTargetClass(useCglib);
  factory.addAdvice(new ExecutorMethodInterceptor<>(executor, tracingExecutorProvider, tracer));
  factory.setTarget(executor);
  return factory.getObject();
}
 
Example 2
Source File: TraceMessagingAutoConfiguration.java    From spring-cloud-sleuth with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
Object createProxy(Object bean) {
	ProxyFactoryBean factory = new ProxyFactoryBean();
	factory.setProxyTargetClass(true);
	factory.addAdvice(
			new MessageListenerMethodInterceptor(this.kafkaTracing, this.tracer));
	factory.setTarget(bean);
	return factory.getObject();
}
 
Example 3
Source File: ExecutorBeanPostProcessor.java    From spring-cloud-sleuth with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
Object createProxy(Object bean, boolean cglibProxy, Advice advice) {
	ProxyFactoryBean factory = new ProxyFactoryBean();
	factory.setProxyTargetClass(cglibProxy);
	factory.addAdvice(advice);
	factory.setTarget(bean);
	return getObject(factory);
}
 
Example 4
Source File: ExecutorBeanPostProcessor.java    From elasticactors with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
Object createProxy(Object bean, boolean cglibProxy, Advice advice) {
    ProxyFactoryBean factory = new ProxyFactoryBean();
    factory.setProxyTargetClass(cglibProxy);
    factory.addAdvice(advice);
    factory.setTarget(bean);
    return getObject(factory);
}