to top
Android APIs
public abstract class

AbstractPoolEntry

extends Object
java.lang.Object
   ↳ org.apache.http.impl.conn.AbstractPoolEntry
Known Direct Subclasses

Class Overview

A pool entry for use by connection manager implementations. Pool entries work in conjunction with an adapter. The adapter is handed out to applications that obtain a connection. The pool entry stores the underlying connection and tracks the route established. The adapter delegates methods for establishing the route to it's pool entry.
If the managed connections is released or revoked, the adapter gets disconnected, but the pool entry still contains the underlying connection and the established route.

Summary

Fields
protected final ClientConnectionOperator connOperator The connection operator.
protected final OperatedClientConnection connection The underlying connection being pooled or used.
protected HttpRoute route The route for which this entry gets allocated.
protected Object state Connection state object
protected RouteTracker tracker The tracked route, or null before tracking starts.
Protected Constructors
AbstractPoolEntry(ClientConnectionOperator connOperator, HttpRoute route)
Creates a new pool entry.
Public Methods
Object getState()
Returns the state object associated with this pool entry.
void layerProtocol(HttpContext context, HttpParams params)
Layers a protocol on top of an established tunnel.
void open(HttpRoute route, HttpContext context, HttpParams params)
Opens the underlying connection.
void setState(Object state)
Assigns a state object to this pool entry.
void tunnelProxy(HttpHost next, boolean secure, HttpParams params)
Tracks tunnelling of the connection to a chained proxy.
void tunnelTarget(boolean secure, HttpParams params)
Tracks tunnelling of the connection to the target.
Protected Methods
void shutdownEntry()
Shuts down the entry.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final ClientConnectionOperator connOperator

Since: API Level 1

The connection operator.

protected final OperatedClientConnection connection

Since: API Level 1

The underlying connection being pooled or used.

protected HttpRoute route

Since: API Level 1

The route for which this entry gets allocated.

protected Object state

Since: API Level 1

Connection state object

protected RouteTracker tracker

Since: API Level 1

The tracked route, or null before tracking starts.

Protected Constructors

protected AbstractPoolEntry (ClientConnectionOperator connOperator, HttpRoute route)

Since: API Level 1

Creates a new pool entry.

Parameters
connOperator the Connection Operator for this entry
route the planned route for the connection, or null

Public Methods

public Object getState ()

Since: API Level 1

Returns the state object associated with this pool entry.

Returns
  • The state object

public void layerProtocol (HttpContext context, HttpParams params)

Since: API Level 1

Layers a protocol on top of an established tunnel.

Parameters
context the context for layering
params the parameters for layering
Throws
IOException in case of a problem

public void open (HttpRoute route, HttpContext context, HttpParams params)

Since: API Level 1

Opens the underlying connection.

Parameters
route the route along which to open the connection
context the context for opening the connection
params the parameters for opening the connection
Throws
IOException in case of a problem

public void setState (Object state)

Since: API Level 1

Assigns a state object to this pool entry.

Parameters
state The state object

public void tunnelProxy (HttpHost next, boolean secure, HttpParams params)

Since: API Level 1

Tracks tunnelling of the connection to a chained proxy. The tunnel has to be established outside by sending a CONNECT request to the previous proxy.

Parameters
next the proxy to which the tunnel was established. See ManagedClientConnection.tunnelProxy for details.
secure true if the tunnel should be considered secure, false otherwise
params the parameters for tunnelling the connection
Throws
IOException in case of a problem

public void tunnelTarget (boolean secure, HttpParams params)

Since: API Level 1

Tracks tunnelling of the connection to the target. The tunnel has to be established outside by sending a CONNECT request to the (last) proxy.

Parameters
secure true if the tunnel should be considered secure, false otherwise
params the parameters for tunnelling the connection
Throws
IOException in case of a problem

Protected Methods

protected void shutdownEntry ()

Since: API Level 1

Shuts down the entry. If open(HttpRoute, HttpContext, HttpParams) is in progress, this will cause that open to possibly throw an IOException.