• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
AbstractPoolEntry Class Referenceabstract

A pool entry for use by connection manager implementations. More...

Inheritance diagram for AbstractPoolEntry:
SingleClientConnManager.PoolEntry BasicPoolEntry

Description

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.

Author
Roland Weber
Michael Becke
Version
Revision
658775
Since
4.0

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

Object getState ()
 Returns the state object associated with this pool entry. More...
 
void setState (final Object state)
 Assigns a state object to this pool entry. More...
 
void open (HttpRoute route, HttpContext context, HttpParams params) throws IOException
 Opens the underlying connection. More...
 
void tunnelTarget (boolean secure, HttpParams params) throws IOException
 Tracks tunnelling of the connection to the target. More...
 
void tunnelProxy (HttpHost next, boolean secure, HttpParams params) throws IOException
 Tracks tunnelling of the connection to a chained proxy. More...
 
void layerProtocol (HttpContext context, HttpParams params) throws IOException
 Layers a protocol on top of an established tunnel. More...
 

Protected Member Functions

 AbstractPoolEntry (ClientConnectionOperator connOperator, HttpRoute route)
 Creates a new pool entry. More...
 
void shutdownEntry ()
 Shuts down the entry. More...
 

Protected Attributes

final ClientConnectionOperator connOperator
 The connection operator. More...
 
final OperatedClientConnection connection
 The underlying connection being pooled or used. More...
 
volatile HttpRoute route
 The route for which this entry gets allocated. More...
 
volatile Object state
 Connection state object.
 
volatile RouteTracker tracker
 The tracked route, or null before tracking starts. More...
 

Constructor & Destructor Documentation

◆ AbstractPoolEntry()

AbstractPoolEntry ( ClientConnectionOperator  connOperator,
HttpRoute  route 
)
protected
Parameters
connOperatorthe Connection Operator for this entry
routethe planned route for the connection, or null

Member Function Documentation

◆ getState()

Object getState ( )
Returns
The state object

◆ setState()

void setState ( final Object  state)
Parameters
stateThe state object

◆ open()

void open ( HttpRoute  route,
HttpContext  context,
HttpParams  params 
) throws IOException
Parameters
routethe route along which to open the connection
contextthe context for opening the connection
paramsthe parameters for opening the connection
Exceptions
IOExceptionin case of a problem

◆ tunnelTarget()

void tunnelTarget ( boolean  secure,
HttpParams  params 
) throws IOException

The tunnel has to be established outside by sending a CONNECT request to the (last) proxy.

Parameters
securetrue if the tunnel should be considered secure, false otherwise
paramsthe parameters for tunnelling the connection
Exceptions
IOExceptionin case of a problem

◆ tunnelProxy()

void tunnelProxy ( HttpHost  next,
boolean  secure,
HttpParams  params 
) throws IOException

The tunnel has to be established outside by sending a CONNECT request to the previous proxy.

Parameters
nextthe proxy to which the tunnel was established. See ManagedClientConnection.tunnelProxy for details.
securetrue if the tunnel should be considered secure, false otherwise
paramsthe parameters for tunnelling the connection
Exceptions
IOExceptionin case of a problem

◆ layerProtocol()

void layerProtocol ( HttpContext  context,
HttpParams  params 
) throws IOException
Parameters
contextthe context for layering
paramsthe parameters for layering
Exceptions
IOExceptionin case of a problem

◆ shutdownEntry()

void shutdownEntry ( )
protected

If (HttpRoute, HttpContext, HttpParams) is in progress, this will cause that open to possibly throw an java.io.IOException.

Member Data Documentation

◆ connOperator

final ClientConnectionOperator connOperator
protected

◆ connection

final OperatedClientConnection connection
protected

◆ route

volatile HttpRoute route
protected

◆ tracker

volatile RouteTracker tracker
protected