You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2010/04/23 21:19:31 UTC
svn commit: r937479 [7/12] - in /httpcomponents/httpclient/trunk:
httpclient-benchmark/src/main/java/org/apache/http/client/benchmark/
httpclient-contrib/src/main/java/org/apache/http/contrib/auth/
httpclient/src/main/java/org/apache/http/auth/ httpcli...
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java Fri Apr 23 19:19:23 2010
@@ -54,14 +54,14 @@ import org.apache.http.params.HttpProtoc
*/
@NotThreadSafe
public class RequestWrapper extends AbstractHttpMessage implements HttpUriRequest {
-
+
private final HttpRequest original;
private URI uri;
private String method;
private ProtocolVersion version;
private int execCount;
-
+
public RequestWrapper(final HttpRequest request) throws ProtocolException {
super();
if (request == null) {
@@ -69,7 +69,7 @@ public class RequestWrapper extends Abst
}
this.original = request;
setParams(request.getParams());
- // Make a copy of the original URI
+ // Make a copy of the original URI
if (request instanceof HttpUriRequest) {
this.uri = ((HttpUriRequest) request).getURI();
this.method = ((HttpUriRequest) request).getMethod();
@@ -79,7 +79,7 @@ public class RequestWrapper extends Abst
try {
this.uri = new URI(requestLine.getUri());
} catch (URISyntaxException ex) {
- throw new ProtocolException("Invalid request URI: "
+ throw new ProtocolException("Invalid request URI: "
+ requestLine.getUri(), ex);
}
this.method = requestLine.getMethod();
@@ -93,7 +93,7 @@ public class RequestWrapper extends Abst
this.headergroup.clear();
setHeaders(this.original.getAllHeaders());
}
-
+
public String getMethod() {
return this.method;
}
@@ -120,7 +120,7 @@ public class RequestWrapper extends Abst
public URI getURI() {
return this.uri;
}
-
+
public void setURI(final URI uri) {
this.uri = uri;
}
@@ -149,7 +149,7 @@ public class RequestWrapper extends Abst
public HttpRequest getOriginal() {
return this.original;
}
-
+
public boolean isRepeatable() {
return true;
}
@@ -157,9 +157,9 @@ public class RequestWrapper extends Abst
public int getExecCount() {
return this.execCount;
}
-
+
public void incrementExecCount() {
this.execCount++;
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java Fri Apr 23 19:19:23 2010
@@ -34,7 +34,7 @@ import org.apache.http.HttpResponse;
/**
* Signals that the tunnel request was rejected by the proxy host.
- *
+ *
* @since 4.0
*/
@Immutable
@@ -43,7 +43,7 @@ public class TunnelRefusedException exte
private static final long serialVersionUID = -8646722842745617323L;
private final HttpResponse response;
-
+
public TunnelRefusedException(final String message, final HttpResponse response) {
super(message);
this.response = response;
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractClientConnAdapter.java Fri Apr 23 19:19:23 2010
@@ -66,7 +66,7 @@ import org.apache.http.protocol.HttpCont
*
* @since 4.0
*/
-public abstract class AbstractClientConnAdapter
+public abstract class AbstractClientConnAdapter
implements ManagedClientConnection, HttpContext {
/**
@@ -84,7 +84,7 @@ public abstract class AbstractClientConn
/** True if the connection has been shut down or released. */
private volatile boolean released;
-
+
/** The duration this is valid for while idle (in ms). */
private volatile long duration;
@@ -119,11 +119,11 @@ public abstract class AbstractClientConn
protected OperatedClientConnection getWrappedConnection() {
return wrappedConnection;
}
-
+
protected ClientConnectionManager getManager() {
return connManager;
}
-
+
/**
* @deprecated use {@link #assertValid(OperatedClientConnection)}
*/
@@ -141,7 +141,7 @@ public abstract class AbstractClientConn
protected boolean isReleased() {
return released;
}
-
+
/**
* Asserts that there is a valid wrapped connection to delegate to.
*
@@ -290,7 +290,7 @@ public abstract class AbstractClientConn
public boolean isMarkedReusable() {
return markedReusable;
}
-
+
public void setIdleDuration(long duration, TimeUnit unit) {
if(duration > 0) {
this.duration = unit.toMillis(duration);
@@ -351,5 +351,5 @@ public abstract class AbstractClientConn
((HttpContext) conn).setAttribute(id, obj);
}
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPoolEntry.java Fri Apr 23 19:19:23 2010
@@ -65,10 +65,10 @@ public abstract class AbstractPoolEntry
//@@@ avoid that, derived classes should decide whether update is allowed
//@@@ SCCM: yes, TSCCM: no
protected volatile HttpRoute route;
-
+
/** Connection state object */
protected volatile Object state;
-
+
/** The tracked route, or <code>null</code> before tracking starts. */
protected volatile RouteTracker tracker;
@@ -94,22 +94,22 @@ public abstract class AbstractPoolEntry
/**
* Returns the state object associated with this pool entry.
- *
+ *
* @return The state object
*/
public Object getState() {
return state;
}
-
+
/**
* Assigns a state object to this pool entry.
- *
+ *
* @param state The state object
*/
public void setState(final Object state) {
this.state = state;
}
-
+
/**
* Opens the underlying connection.
*
@@ -150,7 +150,7 @@ public abstract class AbstractPoolEntry
route.getLocalAddress(),
context, params);
- RouteTracker localTracker = tracker; // capture volatile
+ RouteTracker localTracker = tracker; // capture volatile
// If this tracker was reset while connecting,
// fail early.
@@ -281,11 +281,11 @@ public abstract class AbstractPoolEntry
/**
* Shuts down the entry.
- *
+ *
* If {@link #open(HttpRoute, HttpContext, HttpParams)} is in progress,
* this will cause that open to possibly throw an {@link IOException}.
*/
- protected void shutdownEntry() {
+ protected void shutdownEntry() {
tracker = null;
state = null;
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/AbstractPooledConnAdapter.java Fri Apr 23 19:19:23 2010
@@ -63,7 +63,7 @@ public abstract class AbstractPooledConn
super(manager, entry.connection);
this.poolEntry = entry;
}
-
+
/**
* Obtains the pool entry.
*
@@ -78,15 +78,15 @@ public abstract class AbstractPooledConn
*
* @throws ConnectionShutdownException if there is no pool entry
* or connection has been aborted
- *
- * @see #assertValid(OperatedClientConnection)
+ *
+ * @see #assertValid(OperatedClientConnection)
*/
protected void assertValid(final AbstractPoolEntry entry) {
if (isReleased() || entry == null) {
throw new ConnectionShutdownException();
}
}
-
+
/**
* @deprecated use {@link #assertValid(AbstractPoolEntry)}
*/
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ConnectionShutdownException.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ConnectionShutdownException.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ConnectionShutdownException.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ConnectionShutdownException.java Fri Apr 23 19:19:23 2010
@@ -30,9 +30,9 @@ package org.apache.http.impl.conn;
import org.apache.http.annotation.Immutable;
/**
- * Signals that the connection has been shut down or released back to the
+ * Signals that the connection has been shut down or released back to the
* the connection pool
- *
+ *
* @since 4.1
*/
@Immutable
@@ -46,5 +46,5 @@ public class ConnectionShutdownException
public ConnectionShutdownException() {
super();
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java Fri Apr 23 19:19:23 2010
@@ -54,8 +54,8 @@ import org.apache.http.conn.OperatedClie
/**
* Default implementation of an operated client connection.
* <p>
- * The following parameters can be used to customize the behavior of this
- * class:
+ * The following parameters can be used to customize the behavior of this
+ * class:
* <ul>
* <li>{@link org.apache.http.params.CoreProtocolPNames#STRICT_TRANSFER_ENCODING}</li>
* <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
@@ -112,7 +112,7 @@ public class DefaultClientConnection ext
this.socket = sock;
this.targetHost = target;
- // Check for shutdown after assigning socket, so that
+ // Check for shutdown after assigning socket, so that
if (this.shutdown) {
sock.close(); // allow this to throw...
// ...but if it doesn't, explicitly throw one ourselves.
@@ -132,11 +132,11 @@ public class DefaultClientConnection ext
/**
* Force-closes this connection.
- * If the connection is still in the process of being open (the method
- * {@link #opening opening} was already called but
- * {@link #openCompleted openCompleted} was not), the associated
- * socket that is being connected to a remote address will be closed.
- * That will interrupt a thread that is blocked on connecting
+ * If the connection is still in the process of being open (the method
+ * {@link #opening opening} was already called but
+ * {@link #openCompleted openCompleted} was not), the associated
+ * socket that is being connected to a remote address will be closed.
+ * That will interrupt a thread that is blocked on connecting
* the socket.
* If the connection is not yet open, this will prevent the connection
* from being opened.
@@ -170,7 +170,7 @@ public class DefaultClientConnection ext
buffersize = 8192;
}
SessionInputBuffer inbuffer = super.createSessionInputBuffer(
- socket,
+ socket,
buffersize,
params);
if (wireLog.isDebugEnabled()) {
@@ -200,7 +200,7 @@ public class DefaultClientConnection ext
@Override
protected HttpMessageParser createResponseParser(
final SessionInputBuffer buffer,
- final HttpResponseFactory responseFactory,
+ final HttpResponseFactory responseFactory,
final HttpParams params) {
// override in derived class to specify a line parser
return new DefaultResponseParser
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnectionOperator.java Fri Apr 23 19:19:23 2010
@@ -53,21 +53,21 @@ import org.apache.http.conn.scheme.Schem
import org.apache.http.conn.scheme.SchemeSocketFactory;
/**
- * Default implementation of a {@link ClientConnectionOperator}. It uses a {@link SchemeRegistry}
+ * Default implementation of a {@link ClientConnectionOperator}. It uses a {@link SchemeRegistry}
* to look up {@link SchemeSocketFactory} objects.
* <p>
- * This connection operator is multihome network aware and will attempt to retry failed connects
- * against all known IP addresses sequentially until the connect is successful or all known
- * addresses fail to respond. Please note the same
- * {@link org.apache.http.params.CoreConnectionPNames#CONNECTION_TIMEOUT} value will be used
+ * This connection operator is multihome network aware and will attempt to retry failed connects
+ * against all known IP addresses sequentially until the connect is successful or all known
+ * addresses fail to respond. Please note the same
+ * {@link org.apache.http.params.CoreConnectionPNames#CONNECTION_TIMEOUT} value will be used
* for each connection attempt, so in the worst case the total elapsed time before timeout
* can be <code>CONNECTION_TIMEOUT * n</code> where <code>n</code> is the number of IP addresses
- * of the given host. One can disable multihome support by overriding
+ * of the given host. One can disable multihome support by overriding
* the {@link #resolveHostname(String)} method and returning only one IP address for the given
* host name.
* <p>
- * The following parameters can be used to customize the behavior of this
- * class:
+ * The following parameters can be used to customize the behavior of this
+ * class:
* <ul>
* <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li>
@@ -132,7 +132,7 @@ public class DefaultClientConnectionOper
for (int i = 0; i < addresses.length; i++) {
InetAddress address = addresses[i];
boolean last = i == addresses.length - 1;
-
+
Socket sock = sf.createSocket(params);
conn.opening(sock, target);
@@ -195,7 +195,7 @@ public class DefaultClientConnectionOper
}
LayeredSchemeSocketFactory lsf = (LayeredSchemeSocketFactory) schm.getSchemeSocketFactory();
- Socket sock;
+ Socket sock;
try {
sock = lsf.createLayeredSocket(
conn.getSocket(), target.getHostName(), target.getPort(), true);
@@ -216,7 +216,7 @@ public class DefaultClientConnectionOper
* @throws IOException in case of an IO problem
*/
protected void prepareSocket(
- final Socket sock,
+ final Socket sock,
final HttpContext context,
final HttpParams params) throws IOException {
sock.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
@@ -229,18 +229,18 @@ public class DefaultClientConnectionOper
}
/**
- * Resolves the given host name to an array of corresponding IP addresses, based on the
+ * Resolves the given host name to an array of corresponding IP addresses, based on the
* configured name service on the system.
- *
+ *
* @param host host name to resolve
* @return array of IP addresses
- * @exception UnknownHostException if no IP address for the host could be determined.
- *
+ * @exception UnknownHostException if no IP address for the host could be determined.
+ *
* @since 4.1
*/
protected InetAddress[] resolveHostname(final String host) throws UnknownHostException {
return InetAddress.getAllByName(host);
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java Fri Apr 23 19:19:23 2010
@@ -45,13 +45,13 @@ import org.apache.http.conn.scheme.Schem
import org.apache.http.conn.params.ConnRouteParams;
/**
- * Default implementation of an {@link HttpRoutePlanner}. This implementation
+ * Default implementation of an {@link HttpRoutePlanner}. This implementation
* is based on {@link org.apache.http.conn.params.ConnRoutePNames parameters}.
- * It will not make use of any Java system properties, nor of system or
+ * It will not make use of any Java system properties, nor of system or
* browser proxy settings.
* <p>
- * The following parameters can be used to customize the behavior of this
- * class:
+ * The following parameters can be used to customize the behavior of this
+ * class:
* <ul>
* <li>{@link org.apache.http.conn.params.ConnRoutePNames#DEFAULT_PROXY}</li>
* <li>{@link org.apache.http.conn.params.ConnRoutePNames#LOCAL_ADDRESS}</li>
@@ -120,5 +120,5 @@ public class DefaultHttpRoutePlanner imp
}
return route;
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java Fri Apr 23 19:19:23 2010
@@ -48,27 +48,27 @@ import org.apache.http.params.HttpParams
import org.apache.http.util.CharArrayBuffer;
/**
- * Default HTTP response parser implementation.
+ * Default HTTP response parser implementation.
* <p>
- * The following parameters can be used to customize the behavior of this
- * class:
+ * The following parameters can be used to customize the behavior of this
+ * class:
* <ul>
* <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH}</li>
* <li>{@link org.apache.http.conn.params.ConnConnectionPNames#MAX_STATUS_LINE_GARBAGE}</li>
* </ul>
- *
+ *
* @since 4.0
*/
@ThreadSafe // no public methods
public class DefaultResponseParser extends AbstractMessageParser {
-
+
private final Log log = LogFactory.getLog(getClass());
private final HttpResponseFactory responseFactory;
private final CharArrayBuffer lineBuf;
private final int maxGarbageLines;
-
+
public DefaultResponseParser(
final SessionInputBuffer buffer,
final LineParser parser,
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/IdleConnectionHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/IdleConnectionHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/IdleConnectionHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/IdleConnectionHandler.java Fri Apr 23 19:19:23 2010
@@ -40,51 +40,51 @@ import org.apache.http.HttpConnection;
// Currently only used by AbstractConnPool
/**
* A helper class for connection managers to track idle connections.
- *
+ *
* <p>This class is not synchronized.</p>
- *
+ *
* @see org.apache.http.conn.ClientConnectionManager#closeIdleConnections
- *
+ *
* @since 4.0
*/
@NotThreadSafe
public class IdleConnectionHandler {
private final Log log = LogFactory.getLog(getClass());
-
+
/** Holds connections and the time they were added. */
private final Map<HttpConnection,TimeValues> connectionToTimes;
-
+
public IdleConnectionHandler() {
super();
connectionToTimes = new HashMap<HttpConnection,TimeValues>();
}
-
+
/**
- * Registers the given connection with this handler. The connection will be held until
+ * Registers the given connection with this handler. The connection will be held until
* {@link #remove} or {@link #closeIdleConnections} is called.
- *
+ *
* @param connection the connection to add
- *
+ *
* @see #remove
*/
public void add(HttpConnection connection, long validDuration, TimeUnit unit) {
-
+
long timeAdded = System.currentTimeMillis();
-
+
if (log.isDebugEnabled()) {
log.debug("Adding connection at: " + timeAdded);
}
-
+
connectionToTimes.put(connection, new TimeValues(timeAdded, validDuration, unit));
}
-
+
/**
* Removes the given connection from the list of connections to be closed when idle.
* This will return true if the connection is still valid, and false
* if the connection should be considered expired and not used.
- *
+ *
* @param connection
* @return True if the connection is still valid.
*/
@@ -104,14 +104,14 @@ public class IdleConnectionHandler {
public void removeAll() {
this.connectionToTimes.clear();
}
-
+
/**
* Closes connections that have been idle for at least the given amount of time.
- *
+ *
* @param idleTime the minimum idle time, in milliseconds, for connections to be closed
*/
public void closeIdleConnections(long idleTime) {
-
+
// the latest time for which connections will be closed
long idleTimeout = System.currentTimeMillis() - idleTime;
@@ -135,7 +135,7 @@ public class IdleConnectionHandler {
}
}
}
-
+
public void closeExpiredConnections() {
long now = System.currentTimeMillis();
@@ -158,7 +158,7 @@ public class IdleConnectionHandler {
}
}
}
-
+
private static class TimeValues {
private final long timeAdded;
private final long timeExpires;
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java Fri Apr 23 19:19:23 2010
@@ -37,18 +37,18 @@ import org.apache.http.util.CharArrayBuf
/**
* Logs all data read to the wire LOG.
*
- *
+ *
* @since 4.0
*/
@Immutable
public class LoggingSessionInputBuffer implements SessionInputBuffer {
-
+
/** Original session input buffer. */
private final SessionInputBuffer in;
/** The wire log to use for writing. */
private final Wire wire;
-
+
/**
* Create an instance that wraps the specified session input buffer.
* @param in The session input buffer.
@@ -74,7 +74,7 @@ public class LoggingSessionInputBuffer i
public int read() throws IOException {
int l = this.in.read();
- if (this.wire.enabled() && l != -1) {
+ if (this.wire.enabled() && l != -1) {
this.wire.input(l);
}
return l;
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java Fri Apr 23 19:19:23 2010
@@ -37,7 +37,7 @@ import org.apache.http.util.CharArrayBuf
/**
* Logs all data written to the wire LOG.
*
- *
+ *
* @since 4.0
*/
@Immutable
@@ -45,7 +45,7 @@ public class LoggingSessionOutputBuffer
/** Original data transmitter. */
private final SessionOutputBuffer out;
-
+
/** The wire log to use. */
private final Wire wire;
@@ -59,7 +59,7 @@ public class LoggingSessionOutputBuffer
this.out = out;
this.wire = wire;
}
-
+
public void write(byte[] b, int off, int len) throws IOException {
this.out.write(b, off, len);
if (this.wire.enabled()) {
@@ -103,5 +103,5 @@ public class LoggingSessionOutputBuffer
public HttpTransportMetrics getMetrics() {
return this.out.getMetrics();
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java Fri Apr 23 19:19:23 2010
@@ -60,8 +60,8 @@ import org.apache.http.conn.params.ConnR
* though not the {@link
* org.apache.http.conn.params.ConnRoutePNames#DEFAULT_PROXY DEFAULT_PROXY}.
* <p>
- * The following parameters can be used to customize the behavior of this
- * class:
+ * The following parameters can be used to customize the behavior of this
+ * class:
* <ul>
* <li>{@link org.apache.http.conn.params.ConnRoutePNames#LOCAL_ADDRESS}</li>
* <li>{@link org.apache.http.conn.params.ConnRoutePNames#FORCED_ROUTE}</li>
@@ -71,7 +71,7 @@ import org.apache.http.conn.params.ConnR
*/
@NotThreadSafe // e.g [gs]etProxySelector()
public class ProxySelectorRoutePlanner implements HttpRoutePlanner {
-
+
/** The scheme registry. */
protected final SchemeRegistry schemeRegistry; // @ThreadSafe
@@ -224,7 +224,7 @@ public class ProxySelectorRoutePlanner i
//@@@ Having it in this method at least allows for easy workarounds.
return isa.isUnresolved() ?
isa.getHostName() : isa.getAddress().getHostAddress();
-
+
}
/**
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/SingleClientConnManager.java Fri Apr 23 19:19:23 2010
@@ -49,11 +49,11 @@ import org.apache.http.params.HttpParams
* maintains only one active connection at a time. Even though this class
* is thread-safe it ought to be used by one execution thread only.
* <p>
- * SingleClientConnManager will make an effort to reuse the connection
- * for subsequent requests with the same {@link HttpRoute route}.
+ * SingleClientConnManager will make an effort to reuse the connection
+ * for subsequent requests with the same {@link HttpRoute route}.
* It will, however, close the existing connection and open it
* for the given route, if the route of the persistent connection does
- * not match that of the connection request. If the connection has been
+ * not match that of the connection request. If the connection has been
* already been allocated {@link IllegalStateException} is thrown.
*
* @since 4.0
@@ -69,8 +69,8 @@ public class SingleClientConnManager imp
"Make sure to release the connection before allocating another one.";
/** The schemes supported by this connection manager. */
- protected final SchemeRegistry schemeRegistry;
-
+ protected final SchemeRegistry schemeRegistry;
+
/** The operator for opening and updating connections. */
protected final ClientConnectionOperator connOperator;
@@ -88,7 +88,7 @@ public class SingleClientConnManager imp
/** The time of the last connection release, or -1. */
@GuardedBy("this")
protected long lastReleaseTime;
-
+
/** The time the last released connection expires and shouldn't be reused. */
@GuardedBy("this")
protected long connectionExpiresTime;
@@ -102,7 +102,7 @@ public class SingleClientConnManager imp
* @param params the parameters for this manager
* @param schreg the scheme registry, or
* <code>null</code> for the default registry
- *
+ *
* @deprecated use {@link SingleClientConnManager#SingleClientConnManager(SchemeRegistry)}
*/
@Deprecated
@@ -173,19 +173,19 @@ public class SingleClientConnManager imp
public final ClientConnectionRequest requestConnection(
final HttpRoute route,
final Object state) {
-
+
return new ClientConnectionRequest() {
-
+
public void abortRequest() {
// Nothing to abort, since requests are immediate.
}
-
+
public ManagedClientConnection getConnection(
long timeout, TimeUnit tunit) {
return SingleClientConnManager.this.getConnection(
route, state);
}
-
+
};
}
@@ -213,10 +213,10 @@ public class SingleClientConnManager imp
// check re-usability of the connection
boolean recreate = false;
boolean shutdown = false;
-
+
// Kill the connection if it expired.
closeExpiredConnections();
-
+
if (uniquePoolEntry.connection.isOpen()) {
RouteTracker tracker = uniquePoolEntry.tracker;
shutdown = (tracker == null || // can happen if method is aborted
@@ -238,7 +238,7 @@ public class SingleClientConnManager imp
log.debug("Problem shutting down connection.", iox);
}
}
-
+
if (recreate)
uniquePoolEntry = new PoolEntry();
@@ -248,7 +248,7 @@ public class SingleClientConnManager imp
}
public synchronized void releaseConnection(
- ManagedClientConnection conn,
+ ManagedClientConnection conn,
long validDuration, TimeUnit timeUnit) {
assertStillUp();
@@ -257,7 +257,7 @@ public class SingleClientConnManager imp
("Connection class mismatch, " +
"connection not obtained from this manager.");
}
-
+
if (log.isDebugEnabled()) {
log.debug("Releasing connection " + conn);
}
@@ -300,7 +300,7 @@ public class SingleClientConnManager imp
connectionExpiresTime = Long.MAX_VALUE;
}
}
-
+
public synchronized void closeExpiredConnections() {
if(System.currentTimeMillis() >= connectionExpiresTime) {
closeIdleConnections(0, TimeUnit.MILLISECONDS);
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/Wire.java Fri Apr 23 19:19:23 2010
@@ -38,18 +38,18 @@ import org.apache.commons.logging.Log;
/**
* Logs data to the wire LOG.
*
- *
+ *
* @since 4.0
*/
@Immutable
public class Wire {
private final Log log;
-
+
public Wire(Log log) {
this.log = log;
}
-
+
private void wire(String header, InputStream instream)
throws IOException {
StringBuilder buffer = new StringBuilder();
@@ -70,7 +70,7 @@ public class Wire {
} else {
buffer.append((char) ch);
}
- }
+ }
if (buffer.length() > 0) {
buffer.append('\"');
buffer.insert(0, '\"');
@@ -82,12 +82,12 @@ public class Wire {
public boolean enabled() {
return log.isDebugEnabled();
- }
-
+ }
+
public void output(InputStream outstream)
throws IOException {
if (outstream == null) {
- throw new IllegalArgumentException("Output may not be null");
+ throw new IllegalArgumentException("Output may not be null");
}
wire(">> ", outstream);
}
@@ -95,7 +95,7 @@ public class Wire {
public void input(InputStream instream)
throws IOException {
if (instream == null) {
- throw new IllegalArgumentException("Input may not be null");
+ throw new IllegalArgumentException("Input may not be null");
}
wire("<< ", instream);
}
@@ -103,7 +103,7 @@ public class Wire {
public void output(byte[] b, int off, int len)
throws IOException {
if (b == null) {
- throw new IllegalArgumentException("Output may not be null");
+ throw new IllegalArgumentException("Output may not be null");
}
wire(">> ", new ByteArrayInputStream(b, off, len));
}
@@ -111,7 +111,7 @@ public class Wire {
public void input(byte[] b, int off, int len)
throws IOException {
if (b == null) {
- throw new IllegalArgumentException("Input may not be null");
+ throw new IllegalArgumentException("Input may not be null");
}
wire("<< ", new ByteArrayInputStream(b, off, len));
}
@@ -119,7 +119,7 @@ public class Wire {
public void output(byte[] b)
throws IOException {
if (b == null) {
- throw new IllegalArgumentException("Output may not be null");
+ throw new IllegalArgumentException("Output may not be null");
}
wire(">> ", new ByteArrayInputStream(b));
}
@@ -127,7 +127,7 @@ public class Wire {
public void input(byte[] b)
throws IOException {
if (b == null) {
- throw new IllegalArgumentException("Input may not be null");
+ throw new IllegalArgumentException("Input may not be null");
}
wire("<< ", new ByteArrayInputStream(b));
}
@@ -145,7 +145,7 @@ public class Wire {
public void output(final String s)
throws IOException {
if (s == null) {
- throw new IllegalArgumentException("Output may not be null");
+ throw new IllegalArgumentException("Output may not be null");
}
output(s.getBytes());
}
@@ -153,7 +153,7 @@ public class Wire {
public void input(final String s)
throws IOException {
if (s == null) {
- throw new IllegalArgumentException("Input may not be null");
+ throw new IllegalArgumentException("Input may not be null");
}
input(s.getBytes());
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/AbstractConnPool.java Fri Apr 23 19:19:23 2010
@@ -128,14 +128,14 @@ public abstract class AbstractConnPool i
*/
public final
BasicPoolEntry getEntry(
- HttpRoute route,
+ HttpRoute route,
Object state,
- long timeout,
+ long timeout,
TimeUnit tunit)
throws ConnectionPoolTimeoutException, InterruptedException {
return requestPoolEntry(route, state).getPoolEntry(timeout, tunit);
}
-
+
/**
* Returns a new {@link PoolEntryRequest}, from which a {@link BasicPoolEntry}
* can be obtained, or the request can be aborted.
@@ -150,7 +150,7 @@ public abstract class AbstractConnPool i
* attempt to determine whether it can be re-used or not.
*
* @param entry the entry for the connection to release
- * @param reusable <code>true</code> if the entry is deemed
+ * @param reusable <code>true</code> if the entry is deemed
* reusable, <code>false</code> otherwise.
* @param validDuration The duration that the entry should remain free and reusable.
* @param timeUnit The unit of time the duration is measured in.
@@ -186,7 +186,7 @@ public abstract class AbstractConnPool i
poolLock.unlock();
}
}
-
+
public void closeExpiredConnections() {
poolLock.lock();
try {
@@ -196,7 +196,7 @@ public abstract class AbstractConnPool i
}
}
-
+
/**
* Deletes all entries for closed connections.
*/
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java Fri Apr 23 19:19:23 2010
@@ -64,7 +64,7 @@ import org.apache.http.params.HttpParams
*/
@ThreadSafe
public class ConnPoolByRoute extends AbstractConnPool {
-
+
private final Log log = LogFactory.getLog(getClass());
/** Connection operator for this pool */
@@ -72,7 +72,7 @@ public class ConnPoolByRoute extends Abs
/** Connections per route lookup */
protected final ConnPerRoute connPerRoute;
-
+
/** The list of free connections */
protected final Queue<BasicPoolEntry> freeConnections;
@@ -89,14 +89,14 @@ public class ConnPoolByRoute extends Abs
@GuardedBy("poolLock")
protected volatile int maxTotalConnections;
-
+
/**
* Creates a new connection pool, managed by route.
- *
+ *
* @since 4.1
*/
public ConnPoolByRoute(
- final ClientConnectionOperator operator,
+ final ClientConnectionOperator operator,
final ConnPerRoute connPerRoute,
int maxTotalConnections) {
super();
@@ -116,12 +116,12 @@ public class ConnPoolByRoute extends Abs
/**
* Creates a new connection pool, managed by route.
- *
+ *
* @deprecated use {@link ConnPoolByRoute#ConnPoolByRoute(ClientConnectionOperator, ConnPerRoute, int)}
*/
@Deprecated
public ConnPoolByRoute(final ClientConnectionOperator operator, final HttpParams params) {
- this(operator,
+ this(operator,
ConnManagerParams.getMaxConnectionsPerRoute(params),
ConnManagerParams.getMaxTotalConnections(params));
}
@@ -228,16 +228,16 @@ public class ConnPoolByRoute extends Abs
poolLock.unlock();
}
}
-
+
@Override
public PoolEntryRequest requestPoolEntry(
final HttpRoute route,
final Object state) {
-
+
final WaitingThreadAborter aborter = new WaitingThreadAborter();
-
+
return new PoolEntryRequest() {
-
+
public void abortRequest() {
poolLock.lock();
try {
@@ -246,14 +246,14 @@ public class ConnPoolByRoute extends Abs
poolLock.unlock();
}
}
-
+
public BasicPoolEntry getPoolEntry(
long timeout,
TimeUnit tunit)
throws InterruptedException, ConnectionPoolTimeoutException {
return getEntryBlocking(route, state, timeout, tunit, aborter);
}
-
+
};
}
@@ -302,11 +302,11 @@ public class ConnPoolByRoute extends Abs
}
if (log.isDebugEnabled()) {
- log.debug("Total connections kept alive: " + freeConnections.size());
- log.debug("Total issued connections: " + leasedConnections.size());
+ log.debug("Total connections kept alive: " + freeConnections.size());
+ log.debug("Total issued connections: " + leasedConnections.size());
log.debug("Total allocated connection: " + numConnections + " out of " + maxTotalConnections);
}
-
+
// the cases to check for:
// - have a free connection for that route
// - allowed to create a free connection for that route
@@ -317,15 +317,15 @@ public class ConnPoolByRoute extends Abs
if (entry != null) {
break;
}
-
- boolean hasCapacity = rospl.getCapacity() > 0;
-
+
+ boolean hasCapacity = rospl.getCapacity() > 0;
+
if (log.isDebugEnabled()) {
- log.debug("Available capacity: " + rospl.getCapacity()
+ log.debug("Available capacity: " + rospl.getCapacity()
+ " out of " + rospl.getMaxEntries()
+ " [" + route + "][" + state + "]");
}
-
+
if (hasCapacity && numConnections < maxTotalConnections) {
entry = createEntry(rospl, operator);
@@ -387,7 +387,7 @@ public class ConnPoolByRoute extends Abs
HttpRoute route = entry.getPlannedRoute();
if (log.isDebugEnabled()) {
- log.debug("Releasing connection" +
+ log.debug("Releasing connection" +
" [" + route + "][" + entry.getState() + "]");
}
@@ -407,7 +407,7 @@ public class ConnPoolByRoute extends Abs
if (reusable) {
if (log.isDebugEnabled()) {
- log.debug("Pooling connection" +
+ log.debug("Pooling connection" +
" [" + route + "][" + entry.getState() + "]" +
"; keep alive for " + validDuration + " " + timeUnit.toString());
}
@@ -446,12 +446,12 @@ public class ConnPoolByRoute extends Abs
while(!done) {
entry = rospl.allocEntry(state);
-
+
if (entry != null) {
if (log.isDebugEnabled()) {
- log.debug("Getting free connection"
+ log.debug("Getting free connection"
+ " [" + rospl.getRoute() + "][" + state + "]");
-
+
}
freeConnections.remove(entry);
boolean valid = idleConnHandler.remove(entry.getConnection());
@@ -471,11 +471,11 @@ public class ConnPoolByRoute extends Abs
leasedConnections.add(entry);
done = true;
}
-
+
} else {
done = true;
if (log.isDebugEnabled()) {
- log.debug("No free connections"
+ log.debug("No free connections"
+ " [" + rospl.getRoute() + "][" + state + "]");
}
}
@@ -520,16 +520,16 @@ public class ConnPoolByRoute extends Abs
return entry;
}
-
+
/**
* Deletes a given pool entry.
* This closes the pooled connection and removes all references,
* so that it can be GCed.
- *
+ *
* <p><b>Note:</b> Does not remove the entry from the freeConnections list.
* It is assumed that the caller has already handled this step.</p>
* <!-- @@@ is that a good idea? or rather fix it? -->
- *
+ *
* @param entry the pool entry for the connection to delete
*/
protected void deleteEntry(BasicPoolEntry entry) {
@@ -537,7 +537,7 @@ public class ConnPoolByRoute extends Abs
HttpRoute route = entry.getPlannedRoute();
if (log.isDebugEnabled()) {
- log.debug("Deleting connection"
+ log.debug("Deleting connection"
+ " [" + route + "][" + entry.getState() + "]");
}
@@ -613,7 +613,7 @@ public class ConnPoolByRoute extends Abs
* This will wake a thread waiting in the specific route pool,
* if there is one.
* Otherwise, a thread in the connection pool will be notified.
- *
+ *
* @param rospl the pool in which to notify, or <code>null</code>
*/
protected void notifyWaitingThread(RouteSpecificPool rospl) {
@@ -686,9 +686,9 @@ public class ConnPoolByRoute extends Abs
while (ibpe.hasNext()) {
BasicPoolEntry entry = ibpe.next();
ibpe.remove();
-
+
if (log.isDebugEnabled()) {
- log.debug("Closing connection"
+ log.debug("Closing connection"
+ " [" + entry.getPlannedRoute() + "][" + entry.getState() + "]");
}
closeConnection(entry.getConnection());
@@ -720,7 +720,7 @@ public class ConnPoolByRoute extends Abs
poolLock.unlock();
}
}
-
+
/**
* since 4.1
@@ -728,7 +728,7 @@ public class ConnPoolByRoute extends Abs
public int getMaxTotalConnections() {
return maxTotalConnections;
}
-
+
} // class ConnPoolByRoute
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/PoolEntryRequest.java Fri Apr 23 19:19:23 2010
@@ -54,7 +54,7 @@ public interface PoolEntryRequest {
* if the calling thread was interrupted or the request was aborted
*/
BasicPoolEntry getPoolEntry(
- long timeout,
+ long timeout,
TimeUnit tunit) throws InterruptedException, ConnectionPoolTimeoutException;
/**
@@ -62,5 +62,5 @@ public interface PoolEntryRequest {
* {@link #getPoolEntry(long, TimeUnit)}.
*/
void abortRequest();
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/RouteSpecificPool.java Fri Apr 23 19:19:23 2010
@@ -48,20 +48,20 @@ import org.apache.http.util.LangUtils;
*
* @since 4.0
*/
-@NotThreadSafe // e.g. numEntries, freeEntries,
+@NotThreadSafe // e.g. numEntries, freeEntries,
public class RouteSpecificPool {
private final Log log = LogFactory.getLog(getClass());
-
+
/** The route this pool is for. */
protected final HttpRoute route; //Immutable
@Deprecated
protected final int maxEntries;
-
+
/** Connections per route */
protected final ConnPerRoute connPerRoute;
-
+
/**
* The list of free entries.
* This list is managed LIFO, to increase idle times and
@@ -109,7 +109,7 @@ public class RouteSpecificPool {
this.numEntries = 0;
}
-
+
/**
* Obtains the route for which this pool is specific.
*
@@ -119,7 +119,7 @@ public class RouteSpecificPool {
return route;
}
-
+
/**
* Obtains the maximum number of entries allowed for this pool.
*
@@ -128,8 +128,8 @@ public class RouteSpecificPool {
public final int getMaxEntries() {
return maxEntries;
}
-
-
+
+
/**
* Indicates whether this pool is unused.
* A pool is unused if there is neither an entry nor a waiting thread.
@@ -145,14 +145,14 @@ public class RouteSpecificPool {
/**
* Return remaining capacity of this pool
- *
+ *
* @return capacity
*/
public int getCapacity() {
return connPerRoute.getMaxForRoute(route) - numEntries;
}
-
-
+
+
/**
* Obtains the number of entries.
* This includes not only the free entries, but also those that
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java Fri Apr 23 19:19:23 2010
@@ -45,16 +45,16 @@ import org.apache.http.params.HttpParams
import org.apache.http.impl.conn.DefaultClientConnectionOperator;
/**
- * Manages a pool of {@link OperatedClientConnection client connections} and
- * is able to service connection requests from multiple execution threads.
- * Connections are pooled on a per route basis. A request for a route which
- * already the manager has persistent connections for available in the pool
- * will be services by leasing a connection from the pool rather than
+ * Manages a pool of {@link OperatedClientConnection client connections} and
+ * is able to service connection requests from multiple execution threads.
+ * Connections are pooled on a per route basis. A request for a route which
+ * already the manager has persistent connections for available in the pool
+ * will be services by leasing a connection from the pool rather than
* creating a brand new connection.
* <p>
- * ThreadSafeClientConnManager maintains a maximum limit of connection on
+ * ThreadSafeClientConnManager maintains a maximum limit of connection on
* a per route basis and in total. Per default this implementation will
- * create no more than than 2 concurrent connections per given route
+ * create no more than than 2 concurrent connections per given route
* and no more 20 connections in total. For many real-world applications
* these limits may prove too constraining, especially if they use HTTP
* as a transport protocol for their services. Connection limits, however,
@@ -69,7 +69,7 @@ public class ThreadSafeClientConnManager
/** The schemes supported by this connection manager. */
protected final SchemeRegistry schemeRegistry; // @ThreadSafe
-
+
@Deprecated
protected final AbstractConnPool connectionPool;
@@ -78,9 +78,9 @@ public class ThreadSafeClientConnManager
/** The operator for opening and updating connections. */
protected final ClientConnectionOperator connOperator; // DefaultClientConnectionOperator is @ThreadSafe
-
+
protected final ConnPerRouteBean connPerRoute;
-
+
/**
* Creates a new thread safe connection manager.
*
@@ -104,7 +104,7 @@ public class ThreadSafeClientConnManager
*
* @param params the parameters for this manager.
* @param schreg the scheme registry.
- *
+ *
* @deprecated use {@link ThreadSafeClientConnManager#ThreadSafeClientConnManager(SchemeRegistry)}
*/
@Deprecated
@@ -120,7 +120,7 @@ public class ThreadSafeClientConnManager
this.pool = (ConnPoolByRoute) createConnectionPool(params) ;
this.connectionPool = this.pool;
}
-
+
@Override
protected void finalize() throws Throwable {
try {
@@ -134,7 +134,7 @@ public class ThreadSafeClientConnManager
* Hook for creating the connection pool.
*
* @return the connection pool to use
- *
+ *
* @deprecated use {@link #createConnectionPool()}
*/
@Deprecated
@@ -146,7 +146,7 @@ public class ThreadSafeClientConnManager
* Hook for creating the connection pool.
*
* @return the connection pool to use
- *
+ *
* @since 4.1
*/
protected ConnPoolByRoute createConnectionPool() {
@@ -176,18 +176,18 @@ public class ThreadSafeClientConnManager
}
public ClientConnectionRequest requestConnection(
- final HttpRoute route,
+ final HttpRoute route,
final Object state) {
-
+
final PoolEntryRequest poolRequest = pool.requestPoolEntry(
route, state);
-
+
return new ClientConnectionRequest() {
-
+
public void abortRequest() {
poolRequest.abortRequest();
}
-
+
public ManagedClientConnection getConnection(
long timeout, TimeUnit tunit) throws InterruptedException,
ConnectionPoolTimeoutException {
@@ -203,9 +203,9 @@ public class ThreadSafeClientConnManager
BasicPoolEntry entry = poolRequest.getPoolEntry(timeout, tunit);
return new BasicPooledConnAdapter(ThreadSafeClientConnManager.this, entry);
}
-
+
};
-
+
}
public void releaseConnection(ManagedClientConnection conn, long validDuration, TimeUnit timeUnit) {
@@ -267,7 +267,7 @@ public class ThreadSafeClientConnManager
* This is the total number of connections that have been created and
* are still in use by this connection manager for the route.
* This value will not exceed the maximum number of connections per host.
- *
+ *
* @param route the route in question
*
* @return the total number of pooled connections for that route
@@ -277,11 +277,11 @@ public class ThreadSafeClientConnManager
}
/**
- * Gets the total number of pooled connections. This is the total number of
- * connections that have been created and are still in use by this connection
+ * Gets the total number of pooled connections. This is the total number of
+ * connections that have been created and are still in use by this connection
* manager. This value will not exceed the maximum number of connections
* in total.
- *
+ *
* @return the total number of pooled connections
*/
public int getConnectionsInPool() {
@@ -300,7 +300,7 @@ public class ThreadSafeClientConnManager
pool.closeIdleConnections(idleTimeout, tunit);
pool.deleteClosedConnections();
}
-
+
public void closeExpiredConnections() {
log.debug("Closing expired connections");
pool.closeExpiredConnections();
@@ -313,14 +313,14 @@ public class ThreadSafeClientConnManager
public int getMaxTotalConnections() {
return pool.getMaxTotalConnections();
}
-
+
/**
* since 4.1
*/
public void setMaxTotalConnections(int max) {
pool.setMaxTotalConnections(max);
}
-
+
/**
* @since 4.1
*/
@@ -341,7 +341,7 @@ public class ThreadSafeClientConnManager
public int getMaxForRoute(final HttpRoute route) {
return connPerRoute.getMaxForRoute(route);
}
-
+
/**
* @since 4.1
*/
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThread.java Fri Apr 23 19:19:23 2010
@@ -57,7 +57,7 @@ public class WaitingThread {
/** The thread that is waiting for an entry. */
private Thread waiter;
-
+
/** True if this was interrupted. */
private boolean aborted;
@@ -147,7 +147,7 @@ public class WaitingThread {
if (aborted)
throw new InterruptedException("Operation interrupted");
-
+
this.waiter = Thread.currentThread();
boolean success = false;
@@ -186,7 +186,7 @@ public class WaitingThread {
// It probably isn't, but just in case: wake all, not just one.
this.cond.signalAll();
}
-
+
public void interrupt() {
aborted = true;
this.cond.signalAll();
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/WaitingThreadAborter.java Fri Apr 23 19:19:23 2010
@@ -29,34 +29,34 @@ package org.apache.http.impl.conn.tsccm;
import org.apache.http.annotation.NotThreadSafe;
// TODO - only called from ConnPoolByRoute currently; consider adding it as nested class
-/**
+/**
* A simple class that can interrupt a {@link WaitingThread}.
- *
+ *
* Must be called with the pool lock held.
- *
+ *
* @since 4.0
*/
@NotThreadSafe
public class WaitingThreadAborter {
-
+
private WaitingThread waitingThread;
private boolean aborted;
-
+
/**
* If a waiting thread has been set, interrupts it.
*/
public void abort() {
aborted = true;
-
+
if (waitingThread != null)
waitingThread.interrupt();
-
+
}
-
+
/**
* Sets the waiting thread. If this has already been aborted,
* the waiting thread is immediately interrupted.
- *
+ *
* @param waitingThread The thread to interrupt when aborting.
*/
public void setWaitingThread(WaitingThread waitingThread) {
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieAttributeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieAttributeHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieAttributeHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieAttributeHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import org.apache.http.annotation.Immutable;
@@ -40,14 +40,14 @@ import org.apache.http.cookie.MalformedC
@Immutable
public abstract class AbstractCookieAttributeHandler implements CookieAttributeHandler {
- public void validate(final Cookie cookie, final CookieOrigin origin)
+ public void validate(final Cookie cookie, final CookieOrigin origin)
throws MalformedCookieException {
// Do nothing
}
-
+
public boolean match(final Cookie cookie, final CookieOrigin origin) {
// Always match
return true;
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/AbstractCookieSpec.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
@@ -38,26 +38,26 @@ import org.apache.http.cookie.CookieSpec
/**
* Abstract cookie specification which can delegate the job of parsing,
- * validation or matching cookie attributes to a number of arbitrary
+ * validation or matching cookie attributes to a number of arbitrary
* {@link CookieAttributeHandler}s.
- *
- *
- * @since 4.0
+ *
+ *
+ * @since 4.0
*/
@NotThreadSafe // HashMap is not thread-safe
public abstract class AbstractCookieSpec implements CookieSpec {
-
+
/**
* Stores attribute name -> attribute handler mappings
*/
private final Map<String, CookieAttributeHandler> attribHandlerMap;
- /**
- * Default constructor
+ /**
+ * Default constructor
* */
public AbstractCookieSpec() {
super();
- this.attribHandlerMap = new HashMap<String, CookieAttributeHandler>(10);
+ this.attribHandlerMap = new HashMap<String, CookieAttributeHandler>(10);
}
public void registerAttribHandler(
@@ -70,7 +70,7 @@ public abstract class AbstractCookieSpec
}
this.attribHandlerMap.put(name, handler);
}
-
+
/**
* Finds an attribute handler {@link CookieAttributeHandler} for the
* given attribute. Returns <tt>null</tt> if no attribute handler is
@@ -82,7 +82,7 @@ public abstract class AbstractCookieSpec
protected CookieAttributeHandler findAttribHandler(final String name) {
return this.attribHandlerMap.get(name);
}
-
+
/**
* Gets attribute handler {@link CookieAttributeHandler} for the
* given attribute.
@@ -104,5 +104,5 @@ public abstract class AbstractCookieSpec
protected Collection<CookieAttributeHandler> getAttribHandlers() {
return this.attribHandlerMap.values();
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie.java Fri Apr 23 19:19:23 2010
@@ -50,7 +50,7 @@ public class BasicClientCookie implement
/**
* Default Constructor taking a name and a value. The value may be null.
- *
+ *
* @param name The name.
* @param value The value.
*/
@@ -84,7 +84,7 @@ public class BasicClientCookie implement
/**
* Sets the value
- *
+ *
* @param value
*/
public void setValue(final String value) {
@@ -94,8 +94,8 @@ public class BasicClientCookie implement
/**
* Returns the comment describing the purpose of this cookie, or
* <tt>null</tt> if no such comment has been defined.
- *
- * @return comment
+ *
+ * @return comment
*
* @see #setComment(String)
*/
@@ -106,16 +106,16 @@ public class BasicClientCookie implement
/**
* If a user agent (web browser) presents this cookie to a user, the
* cookie's purpose will be described using this comment.
- *
+ *
* @param comment
- *
+ *
* @see #getComment()
*/
public void setComment(String comment) {
cookieComment = comment;
}
-
+
/**
* Returns null. Cookies prior to RFC2965 do not set this attribute
*/
@@ -123,11 +123,11 @@ public class BasicClientCookie implement
return null;
}
-
+
/**
* Returns the expiration {@link Date} of the cookie, or <tt>null</tt>
* if none exists.
- * <p><strong>Note:</strong> the object returned by this method is
+ * <p><strong>Note:</strong> the object returned by this method is
* considered immutable. Changing it (e.g. using setTime()) could result
* in undefined behaviour. Do so at your peril. </p>
* @return Expiration {@link Date}, or <tt>null</tt>.
@@ -142,7 +142,7 @@ public class BasicClientCookie implement
/**
* Sets expiration date.
* <p><strong>Note:</strong> the object returned by this method is considered
- * immutable. Changing it (e.g. using setTime()) could result in undefined
+ * immutable. Changing it (e.g. using setTime()) could result in undefined
* behaviour. Do so at your peril.</p>
*
* @param expiryDate the {@link Date} after which this cookie is no longer valid.
@@ -169,7 +169,7 @@ public class BasicClientCookie implement
/**
* Returns domain attribute of the cookie.
- *
+ *
* @return the value of the domain attribute
*
* @see #setDomain(java.lang.String)
@@ -180,7 +180,7 @@ public class BasicClientCookie implement
/**
* Sets the domain attribute.
- *
+ *
* @param domain The value of the domain attribute
*
* @see #getDomain
@@ -196,9 +196,9 @@ public class BasicClientCookie implement
/**
* Returns the path attribute of the cookie
- *
+ *
* @return The value of the path attribute.
- *
+ *
* @see #setPath(java.lang.String)
*/
public String getPath() {
@@ -234,7 +234,7 @@ public class BasicClientCookie implement
* cookie's value.
*
* @param secure The value of the secure attribute
- *
+ *
* @see #isSecure()
*/
public void setSecure (boolean secure) {
@@ -249,13 +249,13 @@ public class BasicClientCookie implement
return null;
}
-
+
/**
* Returns the version of the cookie specification to which this
* cookie conforms.
*
* @return the version of the cookie.
- *
+ *
* @see #setVersion(int)
*
*/
@@ -265,10 +265,10 @@ public class BasicClientCookie implement
/**
* Sets the version of the cookie specification to which this
- * cookie conforms.
+ * cookie conforms.
*
* @param version the version of the cookie.
- *
+ *
* @see #getVersion
*/
public void setVersion(int version) {
@@ -278,21 +278,21 @@ public class BasicClientCookie implement
/**
* Returns true if this cookie has expired.
* @param date Current time
- *
+ *
* @return <tt>true</tt> if the cookie has expired.
*/
public boolean isExpired(final Date date) {
if (date == null) {
throw new IllegalArgumentException("Date may not be null");
}
- return (cookieExpiryDate != null
+ return (cookieExpiryDate != null
&& cookieExpiryDate.getTime() <= date.getTime());
}
public void setAttribute(final String name, final String value) {
this.attribs.put(name, value);
}
-
+
public String getAttribute(final String name) {
return this.attribs.get(name);
}
@@ -300,7 +300,7 @@ public class BasicClientCookie implement
public boolean containsAttribute(final String name) {
return this.attribs.get(name) != null;
}
-
+
@Override
public Object clone() throws CloneNotSupportedException {
BasicClientCookie clone = (BasicClientCookie) super.clone();
@@ -331,7 +331,7 @@ public class BasicClientCookie implement
buffer.append("]");
return buffer.toString();
}
-
+
// ----------------------------------------------------- Instance Variables
/** Cookie name */
@@ -339,7 +339,7 @@ public class BasicClientCookie implement
/** Cookie attributes as specified by the origin server */
private Map<String, String> attribs;
-
+
/** Cookie value */
private String value;
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie2.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie2.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie2.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicClientCookie2.java Fri Apr 23 19:19:23 2010
@@ -43,14 +43,14 @@ import org.apache.http.cookie.SetCookie2
public class BasicClientCookie2 extends BasicClientCookie implements SetCookie2, Serializable {
private static final long serialVersionUID = -7744598295706617057L;
-
+
private String commentURL;
private int[] ports;
private boolean discard;
-
+
/**
* Default Constructor taking a name and a value. The value may be null.
- *
+ *
* @param name The name.
* @param value The value.
*/
@@ -66,7 +66,7 @@ public class BasicClientCookie2 extends
public void setPorts(final int[] ports) {
this.ports = ports;
}
-
+
@Override
public String getCommentURL() {
return this.commentURL;
@@ -89,13 +89,13 @@ public class BasicClientCookie2 extends
public boolean isExpired(final Date date) {
return this.discard || super.isExpired(date);
}
-
+
@Override
public Object clone() throws CloneNotSupportedException {
BasicClientCookie2 clone = (BasicClientCookie2) super.clone();
clone.ports = this.ports.clone();
return clone;
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicCommentHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicCommentHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicCommentHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicCommentHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import org.apache.http.annotation.Immutable;
@@ -41,13 +41,13 @@ public class BasicCommentHandler extends
public BasicCommentHandler() {
super();
}
-
- public void parse(final SetCookie cookie, final String value)
+
+ public void parse(final SetCookie cookie, final String value)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
}
cookie.setComment(value);
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicDomainHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicDomainHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicDomainHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicDomainHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import org.apache.http.annotation.Immutable;
@@ -45,8 +45,8 @@ public class BasicDomainHandler implemen
public BasicDomainHandler() {
super();
}
-
- public void parse(final SetCookie cookie, final String value)
+
+ public void parse(final SetCookie cookie, final String value)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -60,7 +60,7 @@ public class BasicDomainHandler implemen
cookie.setDomain(value);
}
- public void validate(final Cookie cookie, final CookieOrigin origin)
+ public void validate(final Cookie cookie, final CookieOrigin origin)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -68,10 +68,10 @@ public class BasicDomainHandler implemen
if (origin == null) {
throw new IllegalArgumentException("Cookie origin may not be null");
}
- // Validate the cookies domain attribute. NOTE: Domains without
- // any dots are allowed to support hosts on private LANs that don't
- // have DNS names. Since they have no dots, to domain-match the
- // request-host and domain must be identical for the cookie to sent
+ // Validate the cookies domain attribute. NOTE: Domains without
+ // any dots are allowed to support hosts on private LANs that don't
+ // have DNS names. Since they have no dots, to domain-match the
+ // request-host and domain must be identical for the cookie to sent
// back to the origin-server.
String host = origin.getHost();
String domain = cookie.getDomain();
@@ -87,21 +87,21 @@ public class BasicDomainHandler implemen
if (domain.startsWith(".")) {
domain = domain.substring(1, domain.length());
}
- if (!host.equals(domain)) {
+ if (!host.equals(domain)) {
throw new CookieRestrictionViolationException(
- "Illegal domain attribute \"" + domain
+ "Illegal domain attribute \"" + domain
+ "\". Domain of origin: \"" + host + "\"");
}
}
} else {
if (!host.equals(domain)) {
throw new CookieRestrictionViolationException(
- "Illegal domain attribute \"" + domain
+ "Illegal domain attribute \"" + domain
+ "\". Domain of origin: \"" + host + "\"");
}
}
}
-
+
public boolean match(final Cookie cookie, final CookieOrigin origin) {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -122,5 +122,5 @@ public class BasicDomainHandler implemen
}
return host.endsWith(domain) || host.equals(domain.substring(1));
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicExpiresHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicExpiresHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicExpiresHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicExpiresHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import org.apache.http.annotation.Immutable;
@@ -49,7 +49,7 @@ public class BasicExpiresHandler extends
this.datepatterns = datepatterns;
}
- public void parse(final SetCookie cookie, final String value)
+ public void parse(final SetCookie cookie, final String value)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -60,7 +60,7 @@ public class BasicExpiresHandler extends
try {
cookie.setExpiryDate(DateUtils.parseDate(value, this.datepatterns));
} catch (DateParseException dpe) {
- throw new MalformedCookieException("Unable to parse expires attribute: "
+ throw new MalformedCookieException("Unable to parse expires attribute: "
+ value);
}
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicMaxAgeHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import java.util.Date;
@@ -43,8 +43,8 @@ public class BasicMaxAgeHandler extends
public BasicMaxAgeHandler() {
super();
}
-
- public void parse(final SetCookie cookie, final String value)
+
+ public void parse(final SetCookie cookie, final String value)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -56,14 +56,14 @@ public class BasicMaxAgeHandler extends
try {
age = Integer.parseInt(value);
} catch (NumberFormatException e) {
- throw new MalformedCookieException ("Invalid max-age attribute: "
+ throw new MalformedCookieException ("Invalid max-age attribute: "
+ value);
}
if (age < 0) {
- throw new MalformedCookieException ("Negative max-age attribute: "
+ throw new MalformedCookieException ("Negative max-age attribute: "
+ value);
}
cookie.setExpiryDate(new Date(System.currentTimeMillis() + age * 1000L));
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicPathHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import org.apache.http.annotation.Immutable;
@@ -45,8 +45,8 @@ public class BasicPathHandler implements
public BasicPathHandler() {
super();
}
-
- public void parse(final SetCookie cookie, String value)
+
+ public void parse(final SetCookie cookie, String value)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -57,15 +57,15 @@ public class BasicPathHandler implements
cookie.setPath(value);
}
- public void validate(final Cookie cookie, final CookieOrigin origin)
+ public void validate(final Cookie cookie, final CookieOrigin origin)
throws MalformedCookieException {
if (!match(cookie, origin)) {
throw new CookieRestrictionViolationException(
- "Illegal path attribute \"" + cookie.getPath()
+ "Illegal path attribute \"" + cookie.getPath()
+ "\". Path of origin: \"" + origin.getPath() + "\"");
}
}
-
+
public boolean match(final Cookie cookie, final CookieOrigin origin) {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
@@ -91,5 +91,5 @@ public class BasicPathHandler implements
}
return match;
}
-
+
}
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicSecureHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicSecureHandler.java?rev=937479&r1=937478&r2=937479&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicSecureHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/cookie/BasicSecureHandler.java Fri Apr 23 19:19:23 2010
@@ -23,7 +23,7 @@
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
- */
+ */
package org.apache.http.impl.cookie;
import org.apache.http.annotation.Immutable;
@@ -43,15 +43,15 @@ public class BasicSecureHandler extends
public BasicSecureHandler() {
super();
}
-
- public void parse(final SetCookie cookie, final String value)
+
+ public void parse(final SetCookie cookie, final String value)
throws MalformedCookieException {
if (cookie == null) {
throw new IllegalArgumentException("Cookie may not be null");
}
cookie.setSecure(true);
}
-
+
@Override
public boolean match(final Cookie cookie, final CookieOrigin origin) {
if (cookie == null) {
@@ -62,5 +62,5 @@ public class BasicSecureHandler extends
}
return !cookie.isSecure() || origin.isSecure();
}
-
+
}