Examples of ProxyConfig


Examples of org.springframework.aop.framework.ProxyConfig

  @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

Examples of org.springframework.aop.framework.ProxyConfig

    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

Examples of org.springframework.aop.framework.ProxyConfig

  @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

Examples of org.wiztools.restclient.ProxyConfig

       
        String username = jtf_username.getText();
        char[] password = jpf_password.getPassword();
       
        // Setting proxy object
        ProxyConfig proxy = ProxyConfig.getInstance();
        proxy.acquire();
        if(enabled){
            proxy.setEnabled(true);
            proxy.setHost(host);
            proxy.setPort(port);
           
            if(authEnabled){
                proxy.setAuthEnabled(true);
                proxy.setUsername(username);
                proxy.setPassword(password);
            }
        }
        else{
            proxy.setEnabled(false);
        }
        proxy.release();
        return true;
    }
View Full Code Here

Examples of org.wiztools.restclient.ProxyConfig

        proxy.release();
        return true;
    }
   
    private void setUIFromCache(){
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        jcb_enable.setSelected(proxy.isEnabled());
        jtf_host.setText(proxy.getHost());
        jtf_port.setText("" + proxy.getPort());
        jcb_auth_enable.setSelected(proxy.isAuthEnabled());
        jtf_username.setText(proxy.getUsername());
        if(proxy.getPassword() == null){
            jpf_password.setText("");
        }
        else{
            jpf_password.setText(new String(proxy.getPassword()));
        }
        proxy.release();

        // Disable/enable the interface:
        toggleEnable(proxy.isEnabled());
        // toggleAuthEnable(proxy.isAuthEnabled());
    }
View Full Code Here

Examples of org.wiztools.restclient.ProxyConfig

    }

    @Override
    public void initOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        try{
            proxy.setEnabled(Boolean.valueOf(options.getProperty(PROP_PREFIX + "is_enabled")));
            proxy.setHost(options.getProperty(PROP_PREFIX + "host"));
            proxy.setPort(Integer.parseInt(options.getProperty(PROP_PREFIX + "port")));
            proxy.setAuthEnabled(Boolean.valueOf(options.getProperty(PROP_PREFIX + "is_auth_enabled")));
            proxy.setUsername(options.getProperty(PROP_PREFIX + "username"));
            proxy.setPassword(options.getProperty(PROP_PREFIX + "password").toCharArray());
            setUIFromCache();
        }
        catch(Exception ex){
            LOG.info("Cannot load Proxy options from properties.");
        }
        proxy.release();
    }
View Full Code Here

Examples of org.wiztools.restclient.ProxyConfig

    }

    @Override
    public void shutdownOptions() {
        IGlobalOptions options = Implementation.of(IGlobalOptions.class);
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        options.setProperty(PROP_PREFIX + "is_enabled", String.valueOf(proxy.isEnabled()));
        options.setProperty(PROP_PREFIX + "host", proxy.getHost());
        options.setProperty(PROP_PREFIX + "port", String.valueOf(proxy.getPort()));
        options.setProperty(PROP_PREFIX + "is_auth_enabled", String.valueOf(proxy.isAuthEnabled()));
        options.setProperty(PROP_PREFIX + "username", proxy.getUsername());
        String pwd = proxy.getPassword()==null? "": new String(proxy.getPassword());
        options.setProperty(PROP_PREFIX + "password", pwd);
        proxy.release();
    }
View Full Code Here

Examples of org.wiztools.restclient.ProxyConfig

       
        String username = jtf_username.getText();
        char[] password = jpf_password.getPassword();
       
        // Setting proxy object
        ProxyConfig proxy = ProxyConfig.getInstance();
        proxy.acquire();
        if(enabled){
            proxy.setEnabled(true);
            proxy.setHost(host);
            proxy.setPort(port);
           
            if(authEnabled){
                proxy.setAuthEnabled(true);
                proxy.setUsername(username);
                proxy.setPassword(password);
            }
        }
        else{
            proxy.setEnabled(false);
        }
        proxy.release();
        return true;
    }
View Full Code Here

Examples of org.wiztools.restclient.ProxyConfig

        proxy.release();
        return true;
    }
   
    private void setUIFromCache(){
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        jcb_enable.setSelected(proxy.isEnabled());
        jtf_host.setText(proxy.getHost());
        jtf_port.setText("" + proxy.getPort());
        jcb_auth_enable.setSelected(proxy.isAuthEnabled());
        jtf_username.setText(proxy.getUsername());
        if(proxy.getPassword() == null){
            jpf_password.setText("");
        }
        else{
            jpf_password.setText(new String(proxy.getPassword()));
        }
        proxy.release();

        // Disable/enable the interface:
        toggleEnable(proxy.isEnabled());
        // toggleAuthEnable(proxy.isAuthEnabled());
    }
View Full Code Here

Examples of org.wiztools.restclient.ProxyConfig

        return true;
    }

    @Override
    public void initOptions() {
        ProxyConfig proxy = ProxyConfig.getInstance();
       
        proxy.acquire();
        setUIFromCache();
        proxy.release();
    }
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.