List of usage examples for org.apache.http.params CoreConnectionPNames STALE_CONNECTION_CHECK
String STALE_CONNECTION_CHECK
To view the source code for org.apache.http.params CoreConnectionPNames STALE_CONNECTION_CHECK.
Click Source Link
From source file:anhttpclient.impl.DefaultWebBrowser.java
private HttpParams getBasicHttpParams() { HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); params.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, HTTP.UTF_8); params.setParameter(CoreProtocolPNames.USER_AGENT, WebBrowserConstants.DEFAULT_USER_AGENT); params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectionTimeout); params.setParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false); params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, clientConnectionFactoryClassName); /*Custom parameter to be used in implementation of {@link ClientConnectionManagerFactory}*/ params.setParameter(ClientConnectionManagerFactoryImpl.THREAD_SAFE_CONNECTION_MANAGER, this.threadSafe); return params; }
From source file:org.apache.http.localserver.LocalTestServer.java
/** * Obtains a set of reasonable default parameters for a server. * * @return default parameters/*from w w w . ja v a 2s. c o m*/ */ protected HttpParams newDefaultParams() { HttpParams params = new BasicHttpParams(); params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "org.apache.http.localserver.LocalTestServer/1.1"); return params; }
From source file:marytts.server.http.MaryHttpServer.java
public void run() { logger.info("Starting server."); int localPort = MaryProperties.needInteger("socket.port"); HttpParams params = new BasicHttpParams(); params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0) // 0 means no timeout, any positive value means time out in miliseconds (i.e. 50000 for 50 seconds) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1"); BasicHttpProcessor httpproc = new BasicHttpProcessor(); httpproc.addInterceptor(new ResponseDate()); httpproc.addInterceptor(new ResponseServer()); httpproc.addInterceptor(new ResponseContent()); httpproc.addInterceptor(new ResponseConnControl()); BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(httpproc, new DefaultHttpResponseFactory(), new DefaultConnectionReuseStrategy(), params); // Set up request handlers HttpRequestHandlerRegistry registry = new HttpRequestHandlerRegistry(); registry.register("/process", new SynthesisRequestHandler()); InfoRequestHandler infoRH = new InfoRequestHandler(); registry.register("/version", infoRH); registry.register("/datatypes", infoRH); registry.register("/locales", infoRH); registry.register("/voices", infoRH); registry.register("/audioformats", infoRH); registry.register("/exampletext", infoRH); registry.register("/audioeffects", infoRH); registry.register("/audioeffect-default-param", infoRH); registry.register("/audioeffect-full", infoRH); registry.register("/audioeffect-help", infoRH); registry.register("/audioeffect-is-hmm-effect", infoRH); registry.register("/features", infoRH); registry.register("/features-discrete", infoRH); registry.register("/vocalizations", infoRH); registry.register("/styles", infoRH); registry.register("*", new FileRequestHandler()); handler.setHandlerResolver(registry); // Provide an event logger handler.setEventListener(new EventLogger()); IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params); int numParallelThreads = MaryProperties.getInteger("server.http.parallelthreads", 5); logger.info("Waiting for client to connect on port " + localPort); try {//from w w w. j a v a 2 s . co m ListeningIOReactor ioReactor = new DefaultListeningIOReactor(numParallelThreads, params); ioReactor.listen(new InetSocketAddress(localPort)); isReady = true; ioReactor.execute(ioEventDispatch); } catch (InterruptedIOException ex) { logger.info("Interrupted", ex); } catch (IOException e) { logger.info("Problem with HTTP connection", e); } logger.debug("Shutdown"); }
From source file:com.funambol.platform.HttpConnectionAdapter.java
public HttpConnectionAdapter() { // These default values are mostly grabbed from the AndroidDefaultClient // implementation that was introduced in Android 2.2 HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); params.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, HTTP.UTF_8); params.setParameter(CoreProtocolPNames.USER_AGENT, "Apache-HttpClient/Android"); HttpConnectionParams.setConnectionTimeout(params, SOCKET_OPERATION_TIMEOUT); HttpConnectionParams.setSoTimeout(params, SOCKET_OPERATION_TIMEOUT); // Turn off stale checking. Our connections break all the time anyway, // and it's not worth it to pay the penalty of checking every time. params.setParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false); //HttpConnectionParams.setSocketBufferSize(params, 8192); SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443)); ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager(params, schemeRegistry); httpClient = new DefaultHttpClient(cm, params); }
From source file:net.facework.core.http.TinyHttpServer.java
@Override public void onCreate() { super.onCreate(); mContext = getApplicationContext();//from w w w.ja va 2 s . c o m mRegistry = new MHttpRequestHandlerRegistry(); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); mParams = new BasicHttpParams(); mParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "MajorKernelPanic HTTP Server"); // Set up the HTTP protocol processor mHttpProcessor = new BasicHttpProcessor(); mHttpProcessor.addInterceptor(new ResponseDate()); mHttpProcessor.addInterceptor(new ResponseServer()); mHttpProcessor.addInterceptor(new ResponseContent()); mHttpProcessor.addInterceptor(new ResponseConnControl()); // Will be used in the "Last-Modifed" entity-header field try { String packageName = mContext.getPackageName(); mLastModified = new Date(mContext.getPackageManager().getPackageInfo(packageName, 0).lastUpdateTime); } catch (NameNotFoundException e) { mLastModified = new Date(0); } // Let's restore the state of the service mHttpPort = Integer.parseInt(mSharedPreferences.getString(mHttpPortKey, String.valueOf(mHttpPort))); mHttpsPort = Integer.parseInt(mSharedPreferences.getString(mHttpsPortKey, String.valueOf(mHttpsPort))); mHttpEnabled = mSharedPreferences.getBoolean(mHttpEnabledKey, mHttpEnabled); mHttpsEnabled = mSharedPreferences.getBoolean(mHttpsEnabledKey, mHttpsEnabled); // If the configuration is modified, the server will adjust mSharedPreferences.registerOnSharedPreferenceChangeListener(mOnSharedPreferenceChangeListener); // Loads plugins available in the package net.majorkernelpanic.http for (int i = 0; i < MODULES.length; i++) { try { Class<?> pluginClass = Class .forName(TinyHttpServer.class.getPackage().getName() + "." + MODULES[i]); Constructor<?> pluginConstructor = pluginClass.getConstructor(new Class[] { TinyHttpServer.class }); addRequestHandler((String) pluginClass.getField("PATTERN").get(null), (HttpRequestHandler) pluginConstructor.newInstance(this)); } catch (ClassNotFoundException ignore) { // Module disabled } catch (Exception e) { Log.e(TAG, "Bad module: " + MODULES[i]); e.printStackTrace(); } } start(); }
From source file:net.kseek.http.TinyHttpServer.java
@Override public void onCreate() { super.onCreate(); mContext = getApplicationContext();/*from w ww . j a v a 2 s.c o m*/ mRegistry = new MHttpRequestHandlerRegistry(); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); mParams = new BasicHttpParams(); mParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "MajorKernelPanic HTTP Server"); // Set up the HTTP protocol processor mHttpProcessor = new BasicHttpProcessor(); mHttpProcessor.addInterceptor(new ResponseDate()); mHttpProcessor.addInterceptor(new ResponseServer()); mHttpProcessor.addInterceptor(new ResponseContent()); mHttpProcessor.addInterceptor(new ResponseConnControl()); // Will be used in the "Last-Modifed" entity-header field try { String packageName = mContext.getPackageName(); mLastModified = new Date(mContext.getPackageManager().getPackageInfo(packageName, 0).lastUpdateTime); } catch (NameNotFoundException e) { mLastModified = new Date(0); } // Restores the state of the service mHttpPort = Integer.parseInt(mSharedPreferences.getString(KEY_HTTP_PORT, String.valueOf(mHttpPort))); mHttpsPort = Integer.parseInt(mSharedPreferences.getString(KEY_HTTPS_PORT, String.valueOf(mHttpsPort))); mHttpEnabled = mSharedPreferences.getBoolean(KEY_HTTP_ENABLED, mHttpEnabled); mHttpsEnabled = mSharedPreferences.getBoolean(KEY_HTTPS_ENABLED, mHttpsEnabled); // If the configuration is modified, the server will adjust mSharedPreferences.registerOnSharedPreferenceChangeListener(mOnSharedPreferenceChangeListener); // Loads plugins available in the package net.kseek.http for (int i = 0; i < MODULES.length; i++) { try { Class<?> pluginClass = Class .forName(TinyHttpServer.class.getPackage().getName() + "." + MODULES[i]); Constructor<?> pluginConstructor = pluginClass.getConstructor(new Class[] { TinyHttpServer.class }); addRequestHandler((String) pluginClass.getField("PATTERN").get(null), (HttpRequestHandler) pluginConstructor.newInstance(this)); } catch (ClassNotFoundException ignore) { // Module disabled } catch (Exception e) { Log.e(TAG, "Bad module: " + MODULES[i]); e.printStackTrace(); } } start(); }
From source file:com.baqr.baqrcam.http.TinyHttpServer.java
@Override public void onCreate() { super.onCreate(); mContext = getApplicationContext();//from w w w . j a v a 2 s .c o m mRegistry = new MHttpRequestHandlerRegistry(); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); mParams = new BasicHttpParams(); mParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "MajorKernelPanic HTTP Server"); // Set up the HTTP protocol processor mHttpProcessor = new BasicHttpProcessor(); mHttpProcessor.addInterceptor(new ResponseDate()); mHttpProcessor.addInterceptor(new ResponseServer()); mHttpProcessor.addInterceptor(new ResponseContent()); mHttpProcessor.addInterceptor(new ResponseConnControl()); // Will be used in the "Last-Modifed" entity-header field try { String packageName = mContext.getPackageName(); mLastModified = new Date(mContext.getPackageManager().getPackageInfo(packageName, 0).lastUpdateTime); } catch (NameNotFoundException e) { mLastModified = new Date(0); } // Restores the state of the service mHttpPort = Integer.parseInt(mSharedPreferences.getString(KEY_HTTP_PORT, String.valueOf(mHttpPort))); mHttpsPort = Integer.parseInt(mSharedPreferences.getString(KEY_HTTPS_PORT, String.valueOf(mHttpsPort))); mHttpEnabled = mSharedPreferences.getBoolean(KEY_HTTP_ENABLED, mHttpEnabled); mHttpsEnabled = mSharedPreferences.getBoolean(KEY_HTTPS_ENABLED, mHttpsEnabled); // If the configuration is modified, the server will adjust mSharedPreferences.registerOnSharedPreferenceChangeListener(mOnSharedPreferenceChangeListener); // Loads plugins available in the package net.majorkernelpanic.http for (int i = 0; i < MODULES.length; i++) { try { Class<?> pluginClass = Class .forName(TinyHttpServer.class.getPackage().getName() + "." + MODULES[i]); Constructor<?> pluginConstructor = pluginClass.getConstructor(new Class[] { TinyHttpServer.class }); addRequestHandler((String) pluginClass.getField("PATTERN").get(null), (HttpRequestHandler) pluginConstructor.newInstance(this)); } catch (ClassNotFoundException ignore) { // Module disabled } catch (Exception e) { Log.e(TAG, "Bad module: " + MODULES[i]); e.printStackTrace(); } } start(); }
From source file:com.wifi.brainbreaker.mydemo.http.TinyHttpServer.java
@Override public void onCreate() { super.onCreate(); mContext = getApplicationContext();/*from w ww. ja v a 2 s .c o m*/ mRegistry = new MHttpRequestHandlerRegistry(); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); mParams = new BasicHttpParams(); mParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000) .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "MajorKernelPanic HTTP Server"); // Set up the HTTP protocol processor mHttpProcessor = new BasicHttpProcessor(); mHttpProcessor.addInterceptor(new ResponseDate()); mHttpProcessor.addInterceptor(new ResponseServer()); mHttpProcessor.addInterceptor(new ResponseContent()); mHttpProcessor.addInterceptor(new ResponseConnControl()); // Will be used in the "Last-Modifed" entity-header field try { String packageName = mContext.getPackageName(); mLastModified = new Date(mContext.getPackageManager().getPackageInfo(packageName, 0).lastUpdateTime); } catch (NameNotFoundException e) { mLastModified = new Date(0); } // Restores the state of the service mHttpPort = Integer.parseInt(mSharedPreferences.getString(KEY_HTTP_PORT, String.valueOf(mHttpPort))); mHttpsPort = Integer.parseInt(mSharedPreferences.getString(KEY_HTTPS_PORT, String.valueOf(mHttpsPort))); mHttpEnabled = mSharedPreferences.getBoolean(KEY_HTTP_ENABLED, mHttpEnabled); mHttpsEnabled = mSharedPreferences.getBoolean(KEY_HTTPS_ENABLED, mHttpsEnabled); // If the configuration is modified, the server will adjust mSharedPreferences.registerOnSharedPreferenceChangeListener(mOnSharedPreferenceChangeListener); // Loads plugins available in the package net.majorkernelpanic.http for (int i = 0; i < MODULES.length; i++) { try { Class<?> pluginClass = Class .forName(TinyHttpServer.class.getPackage().getName() + "." + MODULES[i]); Constructor<?> pluginConstructor = pluginClass.getConstructor(new Class[] { TinyHttpServer.class }); addRequestHandler((String) pluginClass.getField("PATTERN").get(null), (HttpRequestHandler) pluginConstructor.newInstance(this)); } catch (ClassNotFoundException ignore) { // Module disabled } catch (Exception e) { Log.e(TAG, "Bad module: " + MODULES[i]); e.printStackTrace(); } } start(); }
From source file:com.google.apphosting.vmruntime.VmApiProxyDelegate.java
/** * Create an HTTP post request suitable for sending to the API server. * * @param environment The current VMApiProxyEnvironment * @param packageName The API call package * @param methodName The API call method * @param requestData The POST payload./* ww w . jav a 2 s .c om*/ * @param timeoutMs The timeout for this request * @return an HttpPost object to send to the API. */ // static HttpPost createRequest(VmApiProxyEnvironment environment, String packageName, String methodName, byte[] requestData, int timeoutMs) { // Wrap the payload in a RemoteApi Request. RemoteApiPb.Request remoteRequest = new RemoteApiPb.Request(); remoteRequest.setServiceName(packageName); remoteRequest.setMethod(methodName); remoteRequest.setRequestId(environment.getTicket()); remoteRequest.setRequestAsBytes(requestData); HttpPost request = new HttpPost("http://" + environment.getServer() + REQUEST_ENDPOINT); request.setHeader(RPC_STUB_ID_HEADER, REQUEST_STUB_ID); request.setHeader(RPC_METHOD_HEADER, REQUEST_STUB_METHOD); // Set TCP connection timeouts. HttpParams params = new BasicHttpParams(); params.setLongParameter(ConnManagerPNames.TIMEOUT, timeoutMs + ADDITIONAL_HTTP_TIMEOUT_BUFFER_MS); params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, timeoutMs + ADDITIONAL_HTTP_TIMEOUT_BUFFER_MS); params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, timeoutMs + ADDITIONAL_HTTP_TIMEOUT_BUFFER_MS); // Performance tweaks. params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, Boolean.TRUE); params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, Boolean.FALSE); request.setParams(params); // The request deadline can be overwritten by the environment, read deadline if available. Double deadline = (Double) (environment.getAttributes().get(API_DEADLINE_KEY)); if (deadline == null) { request.setHeader(RPC_DEADLINE_HEADER, Double.toString(TimeUnit.SECONDS.convert(timeoutMs, TimeUnit.MILLISECONDS))); } else { request.setHeader(RPC_DEADLINE_HEADER, Double.toString(deadline)); } // If the incoming request has a dapper trace header: set it on outgoing API calls // so they are tied to the original request. Object dapperHeader = environment.getAttributes() .get(VmApiProxyEnvironment.AttributeMapping.DAPPER_ID.attributeKey); if (dapperHeader instanceof String) { request.setHeader(VmApiProxyEnvironment.AttributeMapping.DAPPER_ID.headerKey, (String) dapperHeader); } // If the incoming request has a Cloud trace header: set it on outgoing API calls // so they are tied to the original request. // TODO(user): For now, this uses the incoming span id - use the one from the active span. Object traceHeader = environment.getAttributes() .get(VmApiProxyEnvironment.AttributeMapping.CLOUD_TRACE_CONTEXT.attributeKey); if (traceHeader instanceof String) { request.setHeader(VmApiProxyEnvironment.AttributeMapping.CLOUD_TRACE_CONTEXT.headerKey, (String) traceHeader); } ByteArrayEntity postPayload = new ByteArrayEntity(remoteRequest.toByteArray(), ContentType.APPLICATION_OCTET_STREAM); postPayload.setChunked(false); request.setEntity(postPayload); return request; }
From source file:org.apache.manifoldcf.crawler.connectors.meridio.meridiowrapper.MeridioWrapper.java
/** The Meridio Wrapper constructor that calls the Meridio login method * *@param log a handle to a Log4j logger *@param meridioDmwsUrl the URL to the Meridio Document Management Web Service *@param meridioRmwsUrl the URL to the Meridio Records Management Web Service *@param dmwsProxyHost the proxy for DMWS, or null if none *@param dmwsProxyPort the proxy port for DMWS, or -1 if default *@param rmwsProxyHost the proxy for RMWS, or null if none *@param rmwsProxyPort the proxy port for RMWS, or -1 if default *@param userName the username of the user to log in as, must include the Windows, e.g. domain\\user *@param password the password of the user who is logging in *@param clientWorkstation an identifier for the client workstation, could be the IP address, for auditing purposes *@param protocolFactory the protocol factory object to use for https communication *@param engineConfigurationFile the engine configuration object to use to communicate with the web services * *@throws RemoteException if an error is encountered logging into Meridio *///www . ja v a2s. c om public MeridioWrapper(Logger log, URL meridioDmwsUrl, URL meridioRmwsUrl, URL meridioManifoldCFWSUrl, String dmwsProxyHost, String dmwsProxyPort, String rmwsProxyHost, String rmwsProxyPort, String mcwsProxyHost, String mcwsProxyPort, String userName, String password, String clientWorkstation, javax.net.ssl.SSLSocketFactory mySSLFactory, Class resourceClass, String engineConfigurationFile) throws RemoteException, NumberFormatException { // Initialize local instance variables oLog = log; this.engineConfiguration = new ResourceProvider(resourceClass, engineConfigurationFile); this.clientWorkstation = clientWorkstation; // Set up the pool. // We have a choice: We can either have one httpclient instance, which gets reinitialized for every service // it connects with (because each one has a potentially different proxy setup), OR we can have a different // httpclient for each service. The latter approach is obviously the more efficient, so I've chosen to do it // that way. PoolingClientConnectionManager localConnectionManager = new PoolingClientConnectionManager(); localConnectionManager.setMaxTotal(1); if (mySSLFactory != null) { SSLSocketFactory myFactory = new SSLSocketFactory(mySSLFactory, new BrowserCompatHostnameVerifier()); Scheme myHttpsProtocol = new Scheme("https", 443, myFactory); localConnectionManager.getSchemeRegistry().register(myHttpsProtocol); } connectionManager = localConnectionManager; // Parse the user and password values int index = userName.indexOf("\\"); String domainUser; String domain; if (index != -1) { domainUser = userName.substring(index + 1); domain = userName.substring(0, index); if (oLog != null && oLog.isDebugEnabled()) oLog.debug("Meridio: User is '" + domainUser + "', domain is '" + domain + "'"); } else { domain = null; domainUser = userName; if (oLog != null && oLog.isDebugEnabled()) oLog.debug("Meridio: User is '" + domainUser + "'; there is no domain specified"); } if (oLog != null && oLog.isDebugEnabled()) { if (password != null && password.length() > 0) oLog.debug("Meridio: Password exists"); else oLog.debug("Meridio: Password is null"); } // Initialize the three httpclient objects // dmws first BasicHttpParams dmwsParams = new BasicHttpParams(); dmwsParams.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true); dmwsParams.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false); dmwsParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000); dmwsParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 900000); dmwsParams.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true); DefaultHttpClient localDmwsHttpClient = new DefaultHttpClient(connectionManager, dmwsParams); // No retries localDmwsHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler() { public boolean retryRequest(IOException exception, int executionCount, HttpContext context) { return false; } }); localDmwsHttpClient.setRedirectStrategy(new DefaultRedirectStrategy()); if (domainUser != null) { localDmwsHttpClient.getCredentialsProvider().setCredentials( new AuthScope(meridioDmwsUrl.getHost(), meridioDmwsUrl.getPort()), new NTCredentials(domainUser, password, currentHost, domain)); } // Initialize proxy if (dmwsProxyHost != null && dmwsProxyHost.length() > 0) { int port = (dmwsProxyPort == null || dmwsProxyPort.length() == 0) ? 8080 : Integer.parseInt(dmwsProxyPort); // Configure proxy authentication if (domainUser != null && domainUser.length() > 0) { localDmwsHttpClient.getCredentialsProvider().setCredentials(new AuthScope(dmwsProxyHost, port), new NTCredentials(domainUser, password, currentHost, domain)); } HttpHost proxy = new HttpHost(dmwsProxyHost, port); localDmwsHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); } dmwsHttpClient = localDmwsHttpClient; // rmws BasicHttpParams rmwsParams = new BasicHttpParams(); rmwsParams.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true); rmwsParams.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false); rmwsParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000); rmwsParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 900000); rmwsParams.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true); DefaultHttpClient localRmwsHttpClient = new DefaultHttpClient(connectionManager, rmwsParams); // No retries localRmwsHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler() { public boolean retryRequest(IOException exception, int executionCount, HttpContext context) { return false; } }); localRmwsHttpClient.setRedirectStrategy(new DefaultRedirectStrategy()); if (domainUser != null) { localRmwsHttpClient.getCredentialsProvider().setCredentials( new AuthScope(meridioRmwsUrl.getHost(), meridioRmwsUrl.getPort()), new NTCredentials(domainUser, password, currentHost, domain)); } // Initialize proxy if (rmwsProxyHost != null && rmwsProxyHost.length() > 0) { int port = (rmwsProxyPort == null || rmwsProxyPort.length() == 0) ? 8080 : Integer.parseInt(rmwsProxyPort); // Configure proxy authentication if (domainUser != null && domainUser.length() > 0) { localRmwsHttpClient.getCredentialsProvider().setCredentials(new AuthScope(rmwsProxyHost, port), new NTCredentials(domainUser, password, currentHost, domain)); } HttpHost proxy = new HttpHost(rmwsProxyHost, port); localRmwsHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); } rmwsHttpClient = localRmwsHttpClient; // mcws if (meridioManifoldCFWSUrl != null) { BasicHttpParams mcwsParams = new BasicHttpParams(); mcwsParams.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true); mcwsParams.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false); mcwsParams.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 60000); mcwsParams.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 900000); mcwsParams.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true); DefaultHttpClient localMcwsHttpClient = new DefaultHttpClient(connectionManager, mcwsParams); // No retries localMcwsHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler() { public boolean retryRequest(IOException exception, int executionCount, HttpContext context) { return false; } }); localMcwsHttpClient.setRedirectStrategy(new DefaultRedirectStrategy()); if (domainUser != null) { localMcwsHttpClient.getCredentialsProvider().setCredentials( new AuthScope(meridioManifoldCFWSUrl.getHost(), meridioManifoldCFWSUrl.getPort()), new NTCredentials(domainUser, password, currentHost, domain)); } // Initialize proxy if (mcwsProxyHost != null && mcwsProxyHost.length() > 0) { int port = (mcwsProxyPort == null || mcwsProxyPort.length() == 0) ? 8080 : Integer.parseInt(mcwsProxyPort); // Configure proxy authentication if (domainUser != null && domainUser.length() > 0) { localMcwsHttpClient.getCredentialsProvider().setCredentials(new AuthScope(mcwsProxyHost, port), new NTCredentials(domainUser, password, currentHost, domain)); } HttpHost proxy = new HttpHost(mcwsProxyHost, port); localMcwsHttpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); } mcwsHttpClient = localMcwsHttpClient; } else mcwsHttpClient = null; // Set up the stub handles /*================================================================= * Get a handle to the DMWS *================================================================*/ MeridioDMLocator meridioDMLocator = new MeridioDMLocator(engineConfiguration); MeridioDMSoapStub meridioDMWebService = new MeridioDMSoapStub(meridioDmwsUrl, meridioDMLocator); meridioDMWebService.setPortName(meridioDMLocator.getMeridioDMSoapWSDDServiceName()); meridioDMWebService.setUsername(userName); meridioDMWebService.setPassword(password); meridioDMWebService._setProperty(HTTPCLIENT_PROPERTY, dmwsHttpClient); meridioDMWebService_ = meridioDMWebService; /*================================================================= * Get a handle to the RMWS *================================================================*/ MeridioRMLocator meridioRMLocator = new MeridioRMLocator(engineConfiguration); MeridioRMSoapStub meridioRMWebService = new MeridioRMSoapStub(meridioRmwsUrl, meridioRMLocator); meridioRMWebService.setPortName(meridioRMLocator.getMeridioRMSoapWSDDServiceName()); meridioRMWebService.setUsername(userName); meridioRMWebService.setPassword(password); meridioRMWebService._setProperty(HTTPCLIENT_PROPERTY, rmwsHttpClient); meridioRMWebService_ = meridioRMWebService; /*================================================================= * Get a handle to the MeridioMetaCarta Web Service *================================================================*/ if (meridioManifoldCFWSUrl != null) { MetaCartaLocator meridioMCWS = new MetaCartaLocator(engineConfiguration); Service McWsService = null; MetaCartaSoapStub meridioMetaCartaWebService = new MetaCartaSoapStub(meridioManifoldCFWSUrl, McWsService); meridioMetaCartaWebService.setPortName(meridioMCWS.getMetaCartaSoapWSDDServiceName()); meridioMetaCartaWebService.setUsername(userName); meridioMetaCartaWebService.setPassword(password); meridioMetaCartaWebService._setProperty(HTTPCLIENT_PROPERTY, mcwsHttpClient); meridioMCWS_ = meridioMetaCartaWebService; } this.loginUnified(); }