Android DefaultConnectionReuseStrategy - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android DefaultConnectionReuseStrategy class.

This code example shows how to use the following methods:
                new ResponseDate(),
                new ResponseServer(),
                new ResponseContent(),
                new ResponseConnControl()
        }); 
        BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                httpproc,
                new DefaultHttpResponseFactory(),
                new DefaultConnectionReuseStrategy(),
                this.server.getParams());
 
        serviceHandler.setHandlerResolver(
                new SimpleHttpRequestHandlerResolver(requestHandler));
        serviceHandler.setExpectationVerifier(expectationVerifier);
        serviceHandler.setEventListener(eventListener);
 
        return serviceHandler;
    } 
 
    private TrustManagerFactory createTrustManagerFactory() throws NoSuchAlgorithmException {
5
CodeRank
This code example shows how to use the following methods:
                          "LocalTestServer/1.1"); 
        return params;
    } 
 
    protected ConnectionReuseStrategy newConnectionReuseStrategy() {
        return new DefaultConnectionReuseStrategy();
    } 
 
    protected HttpResponseFactory newHttpResponseFactory() {
        return new DefaultHttpResponseFactory();
    } 
 
    /** 
     * Returns the number of connections this test server has accepted. 
     */ 
    public int getAcceptedConnectionCount() { 
        return acceptedConnections.get();
    } 
 
    /** 
3
CodeRank
This code example shows how to use the following methods:
		return context;
	} 
 
	@Override 
	protected ConnectionReuseStrategy createConnectionReuseStrategy() {
		return new DefaultConnectionReuseStrategy();
	} 
 
	@Override 
	protected ConnectionKeepAliveStrategy createConnectionKeepAliveStrategy() {
		return new DefaultConnectionKeepAliveStrategy();
	} 
 
	@Override 
	protected AuthSchemeRegistry createAuthSchemeRegistry() {
		AuthSchemeRegistry registry = new AuthSchemeRegistry();
		registry.register(AuthPolicy.BASIC, new BasicSchemeFactory());
		registry.register(AuthPolicy.DIGEST, new DigestSchemeFactory());
		return registry;
	} 
3
CodeRank
This code example shows how to use the following methods:
			// Set up request handlers 
			HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
			reqistry.register( "*", new HttpFileHandler( docroot ) );
 
			// Set up the HTTP service 
			this.httpService = new HttpService( httpproc, new DefaultConnectionReuseStrategy(),
					new DefaultHttpResponseFactory() );
			this.httpService.setParams( this.params );
			this.httpService.setHandlerResolver( reqistry );
		} 
 
 
		public void run() 
		{ 
			System.out.println( "Listening on port " + this.serversocket.getLocalPort() );
			while (!Thread.interrupted())
			{ 
				try 
				{ 
					// Set up HTTP connection 
3
CodeRank
This code example shows how to use the following methods:
 
  private DefaultHttpClient client;
 
  public CloudApi(String mail, String pw) {
    client = new DefaultHttpClient();
    client.setReuseStrategy(new DefaultConnectionReuseStrategy());
 
    // Try to authenticate. 
    AuthScope scope = new AuthScope("my.cl.ly", 80);
    client.getCredentialsProvider().setCredentials(scope,
        new UsernamePasswordCredentials(mail, pw));
  } 
 
  /** 
   * Create a bookmark. 
   *  
   * @param name 
   *          The name of the bookmark. 
   * @param url 
   *          The URL of the bookmark 
3
CodeRank
This code example shows how to use the following methods:
		{ 
			super(); 
			this.target = target;
			this.httpproc = httpproc;
			this.httpexecutor = httpexecutor;
			this.connStrategy = new DefaultConnectionReuseStrategy();
		} 
 
 
		public void handle(final HttpRequest request, final HttpResponse response, final HttpContext context)
				throws HttpException, IOException 
		{ 
 
			HttpClientConnection conn = (HttpClientConnection) context.getAttribute( HTTP_OUT_CONN );
 
			context.setAttribute( ExecutionContext.HTTP_CONNECTION, conn );
			context.setAttribute( ExecutionContext.HTTP_TARGET_HOST, this.target );
 
			System.out.println( ">> Request URI: " + request.getRequestLine().getUri() );
 
3
CodeRank
This code example shows how to use the following methods:
                    httpexecutor));
 
            // Set up the HTTP service 
            this.httpService = new HttpService(
                    inhttpproc,
                    new DefaultConnectionReuseStrategy(),
                    new DefaultHttpResponseFactory(),
                    reqistry,
                    this.params);
        } 
 
        @Override 
        public void run() { 
            System.out.println("Listening on port " + this.serversocket.getLocalPort());
            while (!Thread.interrupted()) {
                try { 
                    // Set up incoming HTTP connection 
                    Socket insocket = this.serversocket.accept();
                    DefaultHttpServerConnection inconn = new DefaultHttpServerConnection();
                    System.out.println("Incoming connection from " + insocket.getInetAddress());
3
CodeRank
This code example shows how to use the following methods:
			// Set up request handlers 
			HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
			reqistry.register( "*", new HttpFileHandler( docroot ) );
 
			// Set up the HTTP service 
			this.httpService = new HttpService( httpproc, new DefaultConnectionReuseStrategy(),
					new DefaultHttpResponseFactory() );
			this.httpService.setParams( this.params );
			this.httpService.setHandlerResolver( reqistry );
		} 
 
 
		public void run() 
		{ 
			System.out.println( "Listening on port " + this.serversocket.getLocalPort() );
			while (!Thread.interrupted())
			{ 
				try 
				{ 
					// Set up HTTP connection 
3
CodeRank
This code example shows how to use the following methods:
        // Recommended request interceptors 
        this.httpProcessor.addInterceptor(new RequestConnControl());
        this.httpProcessor.addInterceptor(new RequestUserAgent());
        this.httpProcessor.addInterceptor(new RequestExpectContinue());
 
        this.connstrategy = new DefaultConnectionReuseStrategy();
        this.verbosity = verbosity;
        this.socketFactory = socketFactory;
    } 
 
    public void run() { 
 
        HttpResponse response = null;
        BenchmarkConnection conn = new BenchmarkConnection(this.stats);
 
        String scheme = targetHost.getSchemeName();
        String hostname = targetHost.getHostName();
        int port = targetHost.getPort();
        if (port == -1) {
            if (scheme.equalsIgnoreCase("https")) {
3
CodeRank
This code example shows how to use the following methods:
			// Set up request handlers 
			HttpRequestHandlerRegistry reqistry = new HttpRequestHandlerRegistry();
			reqistry.register( "*", new HttpFileHandler( docroot ) );
 
			// Set up the HTTP service 
			this.httpService = new HttpService( httpproc, new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory(),
					reqistry, this.params );
		} 
 
 
		@Override 
		public void run() 
		{ 
			System.out.println( "Listening on port " + this.serversocket.getLocalPort() );
			while (!Thread.interrupted())
			{ 
				try 
				{ 
					// Set up HTTP connection 
					Socket socket = this.serversocket.accept();
4
CodeRank
See Code Examples for Android DefaultConnectionReuseStrategy Methods: