Tabnine Logo
HttpClientTransport.createClientConnectionManager
Code IndexAdd Tabnine to your IDE (free)

How to use
createClientConnectionManager
method
in
org.apache.activemq.transport.http.HttpClientTransport

Best Java code snippets using org.apache.activemq.transport.http.HttpClientTransport.createClientConnectionManager (Showing top 3 results out of 315)

origin: org.apache.activemq/activemq-all

protected HttpClient createHttpClient() {
  DefaultHttpClient client = new DefaultHttpClient(createClientConnectionManager());
  if (useCompression) {
    client.addRequestInterceptor( new HttpRequestInterceptor() {
      @Override
      public void process(HttpRequest request, HttpContext context) {
        // We expect to received a compression response that we un-gzip
        request.addHeader("Accept-Encoding", "gzip");
      }
    });
  }
  if (getProxyHost() != null) {
    HttpHost proxy = new HttpHost(getProxyHost(), getProxyPort());
    client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
    if (client.getConnectionManager().getSchemeRegistry().get("http") == null) {
      client.getConnectionManager().getSchemeRegistry().register(
        new Scheme("http", getProxyPort(), PlainSocketFactory.getSocketFactory()));
    }
    if(getProxyUser() != null && getProxyPassword() != null) {
      client.getCredentialsProvider().setCredentials(
        new AuthScope(getProxyHost(), getProxyPort()),
        new UsernamePasswordCredentials(getProxyUser(), getProxyPassword()));
    }
  }
  HttpParams params = client.getParams();
  HttpConnectionParams.setSoTimeout(params, soTimeout);
  HttpClientParams.setCookiePolicy(params, CookiePolicy.BROWSER_COMPATIBILITY);
  return client;
}
origin: org.apache.activemq/activemq-osgi

protected HttpClient createHttpClient() {
  DefaultHttpClient client = new DefaultHttpClient(createClientConnectionManager());
  if (useCompression) {
    client.addRequestInterceptor( new HttpRequestInterceptor() {
      @Override
      public void process(HttpRequest request, HttpContext context) {
        // We expect to received a compression response that we un-gzip
        request.addHeader("Accept-Encoding", "gzip");
      }
    });
  }
  if (getProxyHost() != null) {
    HttpHost proxy = new HttpHost(getProxyHost(), getProxyPort());
    client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
    if (client.getConnectionManager().getSchemeRegistry().get("http") == null) {
      client.getConnectionManager().getSchemeRegistry().register(
        new Scheme("http", getProxyPort(), PlainSocketFactory.getSocketFactory()));
    }
    if(getProxyUser() != null && getProxyPassword() != null) {
      client.getCredentialsProvider().setCredentials(
        new AuthScope(getProxyHost(), getProxyPort()),
        new UsernamePasswordCredentials(getProxyUser(), getProxyPassword()));
    }
  }
  HttpParams params = client.getParams();
  HttpConnectionParams.setSoTimeout(params, soTimeout);
  HttpClientParams.setCookiePolicy(params, CookiePolicy.BROWSER_COMPATIBILITY);
  return client;
}
origin: org.apache.activemq/activemq-http

protected HttpClient createHttpClient() {
  DefaultHttpClient client = new DefaultHttpClient(createClientConnectionManager());
  if (useCompression) {
    client.addRequestInterceptor( new HttpRequestInterceptor() {
      @Override
      public void process(HttpRequest request, HttpContext context) {
        // We expect to received a compression response that we un-gzip
        request.addHeader("Accept-Encoding", "gzip");
      }
    });
  }
  if (getProxyHost() != null) {
    HttpHost proxy = new HttpHost(getProxyHost(), getProxyPort());
    client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
    if (client.getConnectionManager().getSchemeRegistry().get("http") == null) {
      client.getConnectionManager().getSchemeRegistry().register(
        new Scheme("http", getProxyPort(), PlainSocketFactory.getSocketFactory()));
    }
    if(getProxyUser() != null && getProxyPassword() != null) {
      client.getCredentialsProvider().setCredentials(
        new AuthScope(getProxyHost(), getProxyPort()),
        new UsernamePasswordCredentials(getProxyUser(), getProxyPassword()));
    }
  }
  HttpParams params = client.getParams();
  HttpConnectionParams.setSoTimeout(params, soTimeout);
  HttpClientParams.setCookiePolicy(params, CookiePolicy.BROWSER_COMPATIBILITY);
  return client;
}
org.apache.activemq.transport.httpHttpClientTransportcreateClientConnectionManager

Popular methods of HttpClientTransport

  • <init>
  • configureMethod
  • createDataInputStream
  • createHttpClient
  • doConsume
  • getProxyHost
  • getProxyPassword
  • getProxyPort
  • getProxyUser
  • getReceiveHttpClient
  • getRemoteUrl
  • getSendHttpClient
  • getRemoteUrl,
  • getSendHttpClient,
  • getTextWireFormat,
  • isStopped,
  • isStopping,
  • isTrace,
  • onException,
  • stop

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • setContentView (Activity)
  • setRequestProperty (URLConnection)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now