Package org.springframework.remoting.httpinvoker

Examples of org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor


    if (!serverAdress.endsWith("/")) {
      serverAdress = serverAdress + "/";
    }

    final LoginService loginService;
    final CommonsHttpInvokerRequestExecutor httpInvokerRequestExecutor = new CommonsHttpInvokerRequestExecutor();
    DefaultHttpMethodRetryHandler retryHandler = new DefaultHttpMethodRetryHandler(10, false);
    httpInvokerRequestExecutor.getHttpClient().getParams().setParameter(HttpMethodParams.RETRY_HANDLER, retryHandler);
    httpInvokerRequestExecutor.getHttpClient().getParams().setSoTimeout(1000*60*5);
    {
      HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
      httpInvokerProxyFactoryBean.setServiceUrl(serverAdress + "copperMonitoringService");
      httpInvokerProxyFactoryBean.setServiceInterface(LoginService.class);
      httpInvokerProxyFactoryBean.setServiceUrl(serverAdress + "loginService");
View Full Code Here


    /**
     * Constructor. Install the default executor.
     */
    public BasicAuthCommonsHttpInvokerProxyFactoryBean() {
        setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
    }
View Full Code Here

    public void setAuthenticationToken(Authentication authentication) {
        if( logger.isDebugEnabled() ) {
            logger.debug("New authentication token: " + authentication);
        }

        CommonsHttpInvokerRequestExecutor executor
                = (CommonsHttpInvokerRequestExecutor) getHttpInvokerRequestExecutor();
        HttpClient httpClient = executor.getHttpClient();
        httpClient.getParams().setAuthenticationPreemptive(authentication != null);
        UsernamePasswordCredentials usernamePasswordCredentials;
        if (authentication != null) {
            usernamePasswordCredentials = new UsernamePasswordCredentials(
                    authentication.getName(), authentication.getCredentials().toString());
View Full Code Here

    String sessionId;
    {
      HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
      httpInvokerProxyFactoryBean.setServiceInterface(LoginService.class);
      httpInvokerProxyFactoryBean.setServiceUrl(LOGIN_SERVICE);
      httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
      httpInvokerProxyFactoryBean.afterPropertiesSet();
      LoginService loginService = (LoginService)httpInvokerProxyFactoryBean.getObject();
      sessionId = loginService.doLogin("user1", "pass1");
    }
 
    {
      final HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
      httpInvokerProxyFactoryBean.setServiceInterface(CopperMonitoringService.class);
      httpInvokerProxyFactoryBean.setServiceUrl(COPPER_MONITORING_SERVICE);
      httpInvokerProxyFactoryBean.setRemoteInvocationFactory(new SecureRemoteInvocationFactory(sessionId));
      httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
      httpInvokerProxyFactoryBean.afterPropertiesSet();
     
     
      CopperMonitoringService copperMonitorService = (CopperMonitoringService)httpInvokerProxyFactoryBean.getObject();
      assertNotNull(copperMonitorService);
View Full Code Here

    String sessionId;
    {
      HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
      httpInvokerProxyFactoryBean.setServiceInterface(LoginService.class);
      httpInvokerProxyFactoryBean.setServiceUrl(LOGIN_SERVICE);
      httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
      httpInvokerProxyFactoryBean.afterPropertiesSet();
      LoginService loginService = (LoginService)httpInvokerProxyFactoryBean.getObject();
      sessionId = loginService.doLogin("userXXXX", "passXXXX");
      assertNull(sessionId);
    }
 
    {
      final HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
      httpInvokerProxyFactoryBean.setServiceInterface(CopperMonitoringService.class);
      httpInvokerProxyFactoryBean.setServiceUrl(COPPER_MONITORING_SERVICE);
      httpInvokerProxyFactoryBean.setRemoteInvocationFactory(new SecureRemoteInvocationFactory(sessionId));
      httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
      httpInvokerProxyFactoryBean.afterPropertiesSet();
     
     
      CopperMonitoringService copperMonitorService = (CopperMonitoringService)httpInvokerProxyFactoryBean.getObject();
      assertNotNull(copperMonitorService);
View Full Code Here

  public void test_without_user() throws RemoteException{
    HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
    httpInvokerProxyFactoryBean.setServiceInterface(CopperMonitoringService.class);
    httpInvokerProxyFactoryBean.setServiceUrl(COPPER_MONITORING_SERVICE);;
    httpInvokerProxyFactoryBean.setRemoteInvocationFactory(new SecureRemoteInvocationFactory("dgfdgdg"));
    httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(new CommonsHttpInvokerRequestExecutor());
    httpInvokerProxyFactoryBean.afterPropertiesSet();
     
    CopperMonitoringService copperMonitorService = (CopperMonitoringService)httpInvokerProxyFactoryBean.getObject();
    assertNotNull(copperMonitorService);
    copperMonitorService.getSettings();
View Full Code Here

          con.setConnectTimeout(url.getParameter(Constants.CONNECT_TIMEOUT_KEY, Constants.DEFAULT_CONNECT_TIMEOUT));
        }
          };
          httpProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
        } else if ("commons".equals(client)) {
          CommonsHttpInvokerRequestExecutor httpInvokerRequestExecutor = new CommonsHttpInvokerRequestExecutor();
          httpInvokerRequestExecutor.setReadTimeout(url.getParameter(Constants.CONNECT_TIMEOUT_KEY, Constants.DEFAULT_CONNECT_TIMEOUT));
          httpProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
        } else if (client != null && client.length() > 0) {
          throw new IllegalStateException("Unsupported http protocol client " + client + ", only supported: simple, commons");
        }
        httpProxyFactoryBean.afterPropertiesSet();
View Full Code Here

TOP

Related Classes of org.springframework.remoting.httpinvoker.CommonsHttpInvokerRequestExecutor

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.