Package org.springframework.aop.framework

Examples of org.springframework.aop.framework.ProxyConfig


  public void testForceProxyTargetClass() {
    ClassPathXmlApplicationContext bf = new ClassPathXmlApplicationContext(
        "/org/springframework/aop/aspectj/autoproxy/aspectsWithCGLIB.xml");

    ProxyConfig pc = (ProxyConfig) bf.getBean(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
    assertTrue("should be proxying classes", pc.isProxyTargetClass());
  }
View Full Code Here


  @Test
  public void testForceProxyTargetClass() {
    ClassPathXmlApplicationContext bf = newContext("aspectsWithCGLIB.xml");

    ProxyConfig pc = (ProxyConfig) bf.getBean(AopConfigUtils.AUTO_PROXY_CREATOR_BEAN_NAME);
    assertTrue("should be proxying classes", pc.isProxyTargetClass());
    assertTrue("should expose proxy", pc.isExposeProxy());
  }
View Full Code Here

    String healthCheckBeanName = element.getAttribute("health-check-registry");
    if (!StringUtils.hasText(healthCheckBeanName)) {
      healthCheckBeanName = registerComponent(parserContext, build(HealthCheckRegistry.class, source, ROLE_APPLICATION));
    }

    final ProxyConfig proxyConfig = new ProxyConfig();

    if (StringUtils.hasText(element.getAttribute("expose-proxy"))) {
      proxyConfig.setExposeProxy(Boolean.valueOf(element.getAttribute("expose-proxy")));
    }

    if (StringUtils.hasText(element.getAttribute("proxy-target-class"))) {
      proxyConfig.setProxyTargetClass(Boolean.valueOf(element.getAttribute("proxy-target-class")));
    }

    //@formatter:off

    registerComponent(parserContext,
View Full Code Here

  @Override
  public void setImportMetadata(AnnotationMetadata importMetadata) {
    final AnnotationAttributes enableMetrics = AnnotationAttributes.fromMap(importMetadata.getAnnotationAttributes(EnableMetrics.class.getName(), false));
    Assert.notNull(enableMetrics, "@" + EnableMetrics.class.getSimpleName() + " is not present on importing class " + importMetadata.getClassName());

    this.proxyConfig = new ProxyConfig();
    this.proxyConfig.setExposeProxy(enableMetrics.getBoolean("exposeProxy"));
    this.proxyConfig.setProxyTargetClass(enableMetrics.getBoolean("proxyTargetClass"));
  }
View Full Code Here

TOP

Related Classes of org.springframework.aop.framework.ProxyConfig

Copyright © 2018 www.massapicom. 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.