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");
httpInvokerProxyFactoryBean.afterPropertiesSet();
httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
loginService = (LoginService) httpInvokerProxyFactoryBean.getObject();
}
final String sessionId;
if(secureConnect) {
try {
sessionId = loginService.doLogin(user, password);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
} else {
sessionId = "";
}
if (sessionId == null) {
getIssueReporterSingleton().reportWarning("Invalid user/password", null, new Runnable() {
@Override
public void run() {
createLoginForm().show();
}
});
} else {
HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean();
httpInvokerProxyFactoryBean.setServiceUrl(serverAdress + "copperMonitoringService");
httpInvokerProxyFactoryBean.setServiceInterface(CopperMonitoringService.class);
RemoteInvocationFactory remoteInvocationFactory = secureConnect ?
new SecureRemoteInvocationFactory(sessionId) : new DefaultRemoteInvocationFactory();
httpInvokerProxyFactoryBean.setRemoteInvocationFactory(remoteInvocationFactory);
httpInvokerProxyFactoryBean.setHttpInvokerRequestExecutor(httpInvokerRequestExecutor);
httpInvokerProxyFactoryBean.afterPropertiesSet();
final CopperMonitoringService copperMonitoringService = (CopperMonitoringService) httpInvokerProxyFactoryBean.getObject();
final String serverAdressFinal = serverAdress;
Platform.runLater(new Runnable() {
@Override
public void run() {