TABS -> SPACES
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1001145 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1e70d5a39e
commit
a2deba9de5
|
@ -54,7 +54,7 @@ public final class ConnManagerParams implements ConnManagerPNames {
|
|||
* {@link org.apache.http.conn.ClientConnectionManager}.
|
||||
*
|
||||
* @return timeout in milliseconds.
|
||||
*
|
||||
*
|
||||
* @deprecated use {@link HttpConnectionParams#getConnectionTimeout(HttpParams)}
|
||||
*/
|
||||
@Deprecated
|
||||
|
@ -71,7 +71,7 @@ public final class ConnManagerParams implements ConnManagerPNames {
|
|||
* {@link org.apache.http.conn.ClientConnectionManager}.
|
||||
*
|
||||
* @param timeout the timeout in milliseconds
|
||||
*
|
||||
*
|
||||
* @deprecated use {@link HttpConnectionParams#setConnectionTimeout(HttpParams, int)}
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
@ -88,7 +88,7 @@ public final class PlainSocketFactory implements SocketFactory, SchemeSocketFact
|
|||
* @param params Optional parameters. Parameters passed to this method will have no effect.
|
||||
* This method will create a unconnected instance of {@link Socket} class
|
||||
* using default constructor.
|
||||
*
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
public Socket createSocket(final HttpParams params) {
|
||||
|
|
|
@ -48,13 +48,13 @@ public interface SchemeSocketFactory {
|
|||
* {@link #connectSocket(Socket, InetSocketAddress, InetSocketAddress, HttpParams)}.
|
||||
*
|
||||
* @param params Optional {@link HttpParams parameters}. In most cases these parameters
|
||||
* will not be required and will have no effect, as usually socket
|
||||
* initialization should take place in the
|
||||
* will not be required and will have no effect, as usually socket
|
||||
* initialization should take place in the
|
||||
* {@link #connectSocket(Socket, InetSocketAddress, InetSocketAddress, HttpParams)}
|
||||
* method. However, in rare cases one may want to pass additional parameters
|
||||
* to this method in order to create a customized {@link Socket} instance,
|
||||
* for instance bound to a SOCKS proxy server.
|
||||
*
|
||||
*
|
||||
* @return a new socket
|
||||
*
|
||||
* @throws IOException if an I/O error occurs while creating the socket
|
||||
|
|
|
@ -99,7 +99,7 @@ public class NTLMScheme extends AuthSchemeBase {
|
|||
|
||||
@Override
|
||||
protected void parseChallenge(
|
||||
final CharArrayBuffer buffer,
|
||||
final CharArrayBuffer buffer,
|
||||
int beginIndex, int endIndex) throws MalformedChallengeException {
|
||||
String challenge = buffer.substringTrimmed(beginIndex, endIndex);
|
||||
if (challenge.length() == 0) {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class NegotiateScheme extends AuthSchemeBase {
|
|||
TOKEN_GENERATED,
|
||||
FAILED,
|
||||
}
|
||||
|
||||
|
||||
private static final String SPNEGO_OID = "1.3.6.1.5.5.2";
|
||||
private static final String KERBEROS_OID = "1.2.840.113554.1.2.2";
|
||||
|
||||
|
@ -227,7 +227,7 @@ public class NegotiateScheme extends AuthSchemeBase {
|
|||
gssContext.requestCredDeleg(true);
|
||||
}
|
||||
if (token == null) {
|
||||
token = new byte[0];
|
||||
token = new byte[0];
|
||||
}
|
||||
token = gssContext.initSecContext(token, 0, token.length);
|
||||
if (token == null) {
|
||||
|
@ -308,7 +308,7 @@ public class NegotiateScheme extends AuthSchemeBase {
|
|||
|
||||
@Override
|
||||
protected void parseChallenge(
|
||||
final CharArrayBuffer buffer,
|
||||
final CharArrayBuffer buffer,
|
||||
int beginIndex, int endIndex) throws MalformedChallengeException {
|
||||
String challenge = buffer.substringTrimmed(beginIndex, endIndex);
|
||||
if (log.isDebugEnabled()) {
|
||||
|
@ -322,5 +322,5 @@ public class NegotiateScheme extends AuthSchemeBase {
|
|||
state = State.FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ import org.apache.http.HttpConnection;
|
|||
* @see org.apache.http.conn.ClientConnectionManager#closeIdleConnections
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
*
|
||||
* @deprecated no longer used
|
||||
*/
|
||||
@Deprecated
|
||||
|
|
|
@ -81,7 +81,7 @@ public abstract class AbstractConnPool implements RefQueueHandler {
|
|||
protected ReferenceQueue<Object> refQueue;
|
||||
|
||||
protected IdleConnectionHandler idleConnHandler;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new connection pool.
|
||||
*/
|
||||
|
|
|
@ -44,11 +44,11 @@ import org.apache.http.impl.conn.AbstractPoolEntry;
|
|||
public class BasicPoolEntry extends AbstractPoolEntry {
|
||||
|
||||
private final long created;
|
||||
|
||||
|
||||
private long updated;
|
||||
private long validUntil;
|
||||
private long expiry;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated do not use
|
||||
*/
|
||||
|
@ -75,7 +75,7 @@ public class BasicPoolEntry extends AbstractPoolEntry {
|
|||
HttpRoute route) {
|
||||
this(op, route, -1, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new pool entry with a specified maximum lifetime.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ public class BasicPoolEntry extends AbstractPoolEntry {
|
|||
* @param route the planned route for the connection
|
||||
* @param connTTL maximum lifetime of this entry, <=0 implies "infinity"
|
||||
* @param timeunit TimeUnit of connTTL
|
||||
*
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
public BasicPoolEntry(ClientConnectionOperator op,
|
||||
|
@ -139,7 +139,7 @@ public class BasicPoolEntry extends AbstractPoolEntry {
|
|||
public long getExpiry() {
|
||||
return this.expiry;
|
||||
}
|
||||
|
||||
|
||||
public long getValidUntil() {
|
||||
return this.validUntil;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public class BasicPoolEntry extends AbstractPoolEntry {
|
|||
public boolean isExpired(long now) {
|
||||
return now >= this.expiry;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
private final Log log = LogFactory.getLog(getClass());
|
||||
|
||||
private final Lock poolLock;
|
||||
|
||||
|
||||
/** Connection operator for this pool */
|
||||
protected final ClientConnectionOperator operator;
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
|
||||
/** References to issued connections */
|
||||
protected final Set<BasicPoolEntry> leasedConnections;
|
||||
|
||||
|
||||
/** The list of free connections */
|
||||
protected final Queue<BasicPoolEntry> freeConnections;
|
||||
|
||||
|
@ -89,17 +89,17 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
|
||||
/** Map of route-specific pools */
|
||||
protected final Map<HttpRoute, RouteSpecificPool> routeToPool;
|
||||
|
||||
|
||||
private final long connTTL;
|
||||
|
||||
|
||||
private final TimeUnit connTTLTimeUnit;
|
||||
|
||||
protected volatile boolean shutdown;
|
||||
|
||||
|
||||
protected volatile int maxTotalConnections;
|
||||
|
||||
protected volatile int numConnections;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new connection pool, managed by route.
|
||||
*
|
||||
|
@ -111,7 +111,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
int maxTotalConnections) {
|
||||
this(operator, connPerRoute, maxTotalConnections, -1, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @since 4.1
|
||||
*/
|
||||
|
@ -143,7 +143,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
protected Lock getLock() {
|
||||
return this.poolLock;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new connection pool, managed by route.
|
||||
*
|
||||
|
@ -274,7 +274,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
poolLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PoolEntryRequest requestPoolEntry(
|
||||
final HttpRoute route,
|
||||
|
@ -705,7 +705,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
poolLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Closes idle connections.
|
||||
*
|
||||
|
@ -748,7 +748,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
public void closeExpiredConnections() {
|
||||
log.debug("Closing expired connections");
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
|
||||
poolLock.lock();
|
||||
try {
|
||||
Iterator<BasicPoolEntry> iter = freeConnections.iterator();
|
||||
|
@ -766,7 +766,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc
|
|||
poolLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
poolLock.lock();
|
||||
|
|
|
@ -96,7 +96,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
|
|||
* @param schreg the scheme registry.
|
||||
* @param connTTL max connection lifetime, <=0 implies "infinity"
|
||||
* @param connTTLTimeUnit TimeUnit of connTTL
|
||||
*
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
public ThreadSafeClientConnManager(final SchemeRegistry schreg,
|
||||
|
@ -112,7 +112,7 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
|
|||
this.pool = createConnectionPool(connTTL, connTTLTimeUnit) ;
|
||||
this.connectionPool = this.pool;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new thread safe connection manager.
|
||||
*
|
||||
|
|
|
@ -83,7 +83,7 @@ public class TestTSCCMWithServer extends ServerTestBase {
|
|||
public ThreadSafeClientConnManager createTSCCM(SchemeRegistry schreg) {
|
||||
return createTSCCM(schreg, -1, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
|
||||
public ThreadSafeClientConnManager createTSCCM(SchemeRegistry schreg,
|
||||
long connTTL, TimeUnit connTTLTimeUnit) {
|
||||
if (schreg == null)
|
||||
|
@ -394,7 +394,7 @@ public class TestTSCCMWithServer extends ServerTestBase {
|
|||
|
||||
mgr.shutdown();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testCloseExpiredTTLConnections() throws Exception {
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@ import org.apache.http.protocol.HttpContext;
|
|||
public class RequestBasicAuth implements HttpRequestInterceptor {
|
||||
|
||||
private final BasicAuthTokenExtractor authTokenExtractor;
|
||||
|
||||
|
||||
public RequestBasicAuth() {
|
||||
super();
|
||||
this.authTokenExtractor = new BasicAuthTokenExtractor();
|
||||
}
|
||||
|
||||
|
||||
public void process(
|
||||
final HttpRequest request,
|
||||
final HttpContext context) throws HttpException, IOException {
|
||||
|
|
Loading…
Reference in New Issue