Spring Framework ProxyConfig - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ProxyConfig class.

This code example shows how to use the following methods:getProxy, addAdvisor, setProxyTargetClass
	private void testAdvice(Advisor advisor, LogUserAdvice logAdvice, TestService target, String message, 
			boolean proxyTargetClass) throws Exception { 
 
		logAdvice.reset(); 
 
		ProxyFactory factory = new ProxyFactory(target); 
		factory.setProxyTargetClass(proxyTargetClass); 
		factory.addAdvisor(advisor); 
		TestService bean = (TestService) factory.getProxy(); 
 
		assertEquals(0, logAdvice.getCountThrows()); 
		try { 
			bean.sayHello(); 
			fail("Expected exception"); 
		} 
		catch (TestException ex) { 
			assertEquals(message, ex.getMessage()); 
		} 
		assertEquals(1, logAdvice.getCountThrows()); 
	} 
8
CodeRank
This code example shows how to use the following methods:getProxy, setProxyTargetClass, setTarget
	} 
 
	@Test
	public void testAopCglibProxy() throws Exception {
		ModelMap map = new ModelMap();
		ProxyFactory factory = new ProxyFactory();
		SomeInnerClass val = new SomeInnerClass();
		factory.setTarget(val);
		factory.setProxyTargetClass(true);
		map.addAttribute(factory.getProxy());
		assertTrue(map.containsKey("someInnerClass"));
		assertEquals(val, map.get("someInnerClass"));
	} 
 
	@Test
	public void testAopJdkProxy() throws Exception {
		ModelMap map = new ModelMap();
		ProxyFactory factory = new ProxyFactory();
		Map<?, ?> target = new HashMap<Object, Object>();
		factory.setTarget(target);
7
CodeRank
This code example shows how to use the following methods:
 * are passed to the business process. 
 * 
 * @author Josh Long 
 * @since 5,3 
 */ 
public class ProcessStartAnnotationBeanPostProcessor extends ProxyConfig implements BeanPostProcessor, InitializingBean {
 
	private Log log = LogFactory.getLog(getClass()) ;
 
	/** 
	 * the process engine as created by a {@link org.camunda.bpm.engine.spring.ProcessEngineFactoryBean} 
	 */ 
	private ProcessEngine processEngine;
 
	private ProcessStartingPointcutAdvisor advisor;
 
	private volatile ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
 
	public void setProcessEngine(ProcessEngine processEngine) {
		this.processEngine = processEngine;
4
CodeRank
This code example shows how to use the following methods:
 
  /** 
   * Construct a <code>CacheProxyFactoryBean</code>. 
   */ 
  public CacheProxyFactoryBean() { 
    super(); 
    flushingInterceptor = new NameMatchFlushingInterceptor();
    cachingInterceptor = new NameMatchCachingInterceptor();
  } 
 
  /** 
   * Creates the proxy for target object. This method is invoked by a 
   * BeanFactory after it has set all bean properties supplied. 
   *  
   * @throws IllegalStateException 
   *           if target is <code>null</code>. 
   * @throws AopConfigException 
   *           if the proxy interfaces or proxyTargetClass are not set and the 
   *           target type is <code>org.springframework.aop.TargetSource</code>. 
   */ 
4
CodeRank
This code example shows how to use the following methods:
 * @see #setTarget 
 * @see #setTransactionAttributes 
 * @see TransactionInterceptor 
 * @see org.springframework.aop.framework.ProxyFactoryBean 
 */ 
public class ResourceProxyFactoryBean extends ProxyConfig 
		implements FactoryBean, BeanFactoryAware, InitializingBean { 
 
	private final ResourceInterceptor resourceInterceptor = new ResourceInterceptor(); 
 
	private Object target; 
 
	private Class[] proxyInterfaces; 
 
	private Pointcut pointcut; 
 
	private Object[] preInterceptors; 
 
	private Object[] postInterceptors; 
 
4
CodeRank
This code example shows how to use the following methods:
 * TransactionFactoryBean. 
 * 
 * @author void.fm 
 * @version $Revision$ 
 */ 
public class EtmProxyFactoryBean extends ProxyConfig
  implements FactoryBean, InitializingBean {
 
  private EtmMonitor etmMonitor;
 
  private Object target;
  private Object proxy;
 
  public void setEtmMonitor(EtmMonitor aEtmMonitor) {
    etmMonitor = aEtmMonitor;
  } 
 
  public void setTarget(Object aTarget) {
    target = aTarget;
  } 
4
CodeRank
This code example shows how to use the following methods:
 *  
 * </pre> 
 *  
 * @author jianghang 2011-4-25 上午10:43:12 
 */ 
public class CompositeAutoProxyCreator extends ProxyConfig implements BeanPostProcessor, Ordered, BeanClassLoaderAware, BeanFactoryAware, AopInfrastructureBean {
 
    private static final long  serialVersionUID             = 8458055362270662345L;
    private static final Field interceptorNamesField        = ReflectionUtils.findField(ProxyFactoryBean.class,
                                                                                        "interceptorNames"); 
 
    private ClassLoader        proxyClassLoader             = ClassUtils.getDefaultClassLoader();
    private boolean            classLoaderConfigured        = false;
    private BeanFactory        beanFactory;
    private List               beanNames;
    private int                order                        = Integer.MAX_VALUE;
    private String[]           interceptorNames             = new String[0];
    private boolean            applyCommonInterceptorsFirst = false;
    private final Set          nonAdvisedBeans              = Collections.synchronizedSet(new HashSet());
 
4
CodeRank
See Code Examples for Spring Framework ProxyConfig Methods: