Codota Logo
XmlRpcCommonsTransportFactory.setHttpClient
Code IndexAdd Codota to your IDE (free)

How to use
setHttpClient
method
in
org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory

Best Java code snippets using org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory.setHttpClient (Showing top 7 results out of 315)

  • Common ways to obtain XmlRpcCommonsTransportFactory
private void myMethod () {
XmlRpcCommonsTransportFactory x =
  • Codota IconXmlRpcClient pClient;new XmlRpcCommonsTransportFactory(pClient)
  • Smart code suggestions by Codota
}
origin: net.exogeni.orca.core/shirako

f.setHttpClient(h);
client.setTransportFactory(f);
origin: bsorrentino/maven-confluence-plugin

protected Confluence(String endpoint, ConfluenceProxy proxyInfo ) throws URISyntaxException, MalformedURLException {
  this(new XmlRpcClient());
if (endpoint.endsWith("/")) {
    endpoint = endpoint.substring(0, endpoint.length() - 1);
  }
  endpoint = ConfluenceService.Protocol.XMLRPC.addTo(endpoint);

  final java.net.URI serviceURI = new java.net.URI(endpoint);
  XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl();
  clientConfig.setServerURL(serviceURI.toURL() );
  clientConfig.setEnabledForExtensions(true); // add this to support attachment upload
  client.setConfig( clientConfig );
  if( isProxyEnabled(proxyInfo, serviceURI) ) {
    
    final XmlRpcCommonsTransportFactory transportFactory = new XmlRpcCommonsTransportFactory( client );
    final HttpClient httpClient = new HttpClient();
    final HostConfiguration hostConfiguration = httpClient.getHostConfiguration();
    hostConfiguration.setProxy( proxyInfo.host, proxyInfo.port );
    hostConfiguration.setHost(serviceURI.getHost(), serviceURI.getPort(), serviceURI.toURL().getProtocol());
    if( !isNullOrEmpty(proxyInfo.userName) && !isNullOrEmpty(proxyInfo.password) ) {
      Credentials cred = new UsernamePasswordCredentials(proxyInfo.userName,proxyInfo.password);
      httpClient.getState().setProxyCredentials(AuthScope.ANY, cred);
    }
    transportFactory.setHttpClient( httpClient );
    client.setTransportFactory( transportFactory );
  }
}
// Would have been nicer to have a constructor with clientConfig and optionally a transport
origin: org.bsc.maven/maven-confluence-core

protected Confluence(String endpoint, ConfluenceProxy proxyInfo ) throws URISyntaxException, MalformedURLException {
  this(new XmlRpcClient());
if (endpoint.endsWith("/")) {
    endpoint = endpoint.substring(0, endpoint.length() - 1);
  }
  endpoint = ConfluenceService.Protocol.XMLRPC.addTo(endpoint);

  final java.net.URI serviceURI = new java.net.URI(endpoint);
  XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl();
  clientConfig.setServerURL(serviceURI.toURL() );
  clientConfig.setEnabledForExtensions(true); // add this to support attachment upload
  client.setConfig( clientConfig );
  if( isProxyEnabled(proxyInfo, serviceURI) ) {
    
    final XmlRpcCommonsTransportFactory transportFactory = new XmlRpcCommonsTransportFactory( client );
    final HttpClient httpClient = new HttpClient();
    final HostConfiguration hostConfiguration = httpClient.getHostConfiguration();
    hostConfiguration.setProxy( proxyInfo.host, proxyInfo.port );
    hostConfiguration.setHost(serviceURI.getHost(), serviceURI.getPort(), serviceURI.toURL().getProtocol());
    if( !isNullOrEmpty(proxyInfo.userName) && !isNullOrEmpty(proxyInfo.password) ) {
      Credentials cred = new UsernamePasswordCredentials(proxyInfo.userName,proxyInfo.password);
      httpClient.getState().setProxyCredentials(AuthScope.ANY, cred);
    }
    transportFactory.setHttpClient( httpClient );
    client.setTransportFactory( transportFactory );
  }
}
// Would have been nicer to have a constructor with clientConfig and optionally a transport
origin: net.exogeni.orca.core/shirako

f.setHttpClient(h);
client.setTransportFactory(f);
origin: net.exogeni.orca.core/shirako

f.setHttpClient(h);
client.setTransportFactory(f);
origin: net.exogeni.orca.core/shirako

protected TalkToRegistry() {
  super();
  // We use our own HttpClient with an HttpConnectionManager
  // configured with timeouts, so we don't block the liveness
  // thread forever.
  // Connect timeout, 10 seconds; Read timeout, 5 seconds; Close timeout, 3 seconds.
  connMgr = new SimpleHttpConnectionManager(true);
  connMgr.getParams().setConnectionTimeout(10*1000);
  connMgr.getParams().setSoTimeout(5*1000);
  connMgr.getParams().setLinger(3);
  httpClient = new HttpClient(connMgr);
  // We use XmlRpcCommonsTransportFactory, initialized
  // using the HttpClient from above, so that SSLContexts
  // work.
  xmlrpcClient = new XmlRpcClient();
  xmlrpcClientConfig = new XmlRpcClientConfigImpl();
  transportFactory =
    new XmlRpcCommonsTransportFactory(xmlrpcClient);
  transportFactory.setHttpClient(httpClient);
  xmlrpcClient.setTransportFactory(transportFactory);
  // Finally - since the SimpleHttpConnectionManager only
  // provides one backend HttpConnection, ensure that the
  // XmlRpcClient only has one backend worker available to
  // consume it.
  xmlrpcClient.setMaxThreads(1);
}
origin: org.apache.continuum/continuum-distributed-commons

  private XmlRpcClient getXmlRpcClient( URL url, ConnectionInfo connectionInfo )
  {
    XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl();
    clientConfig.setServerURL( url );
    clientConfig.setEnabledForExceptions( true );

    if ( connectionInfo != null )
    {
      clientConfig.setBasicUserName( connectionInfo.getUsername() );
      clientConfig.setBasicPassword( connectionInfo.getPassword() );
      clientConfig.setBasicEncoding( connectionInfo.getEncoding() );
      clientConfig.setGzipCompressing( connectionInfo.isGzip() );
      clientConfig.setGzipRequesting( connectionInfo.isGzip() );
      clientConfig.setReplyTimeout( connectionInfo.getTimeout() );
      clientConfig.setConnectionTimeout( connectionInfo.getTimeout() );
      clientConfig.setTimeZone( connectionInfo.getTimeZone() );
    }

    final XmlRpcClient client = new XmlRpcClient();
    client.setTypeFactory( new BinderTypeFactory( client ) );
    XmlRpcCommonsTransportFactory factory = new XmlRpcCommonsTransportFactory( client );
    // Alternative - use simple connection manager, but make sure it closes the connection each time
    // This would be set here since it would not be thread-safe
//        factory.setHttpClient( new HttpClient( new SimpleHttpConnectionManager( true ) ) );
    factory.setHttpClient( httpClient );
    client.setConfig( clientConfig );
    return client;
  }

org.apache.xmlrpc.clientXmlRpcCommonsTransportFactorysetHttpClient

Javadoc

Sets the factories HttpClient. By default, a new instance of HttpClient is created for any request.

Reusing the HttpClient is required, if you want to preserve some state between requests. This applies, in particular, if you want to use cookies: In that case, create an instance of HttpClient, give it to the factory, and use HttpClient#getState() to read or set cookies.

Popular methods of XmlRpcCommonsTransportFactory

  • <init>
    Creates a new instance.
  • getClient
  • getHttpClient
    Returns the factories HttpClient. By default, a new instance of HttpClient is created for any reques

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now