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:11:57 UTC
svn commit: r937477 [3/9] - in
/httpcomponents/httpcore/trunk/httpcore-nio/src:
main/java/org/apache/http/impl/nio/
main/java/org/apache/http/impl/nio/codecs/
main/java/org/apache/http/impl/nio/reactor/
main/java/org/apache/http/impl/nio/ssl/ main/java...
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/IOSessionImpl.java Fri Apr 23 19:11:53 2010
@@ -46,30 +46,30 @@ import org.apache.http.nio.reactor.Sessi
* @since 4.0
*/
public class IOSessionImpl implements IOSession {
-
+
private volatile int status;
-
+
private final SelectionKey key;
private final ByteChannel channel;
private final Map<String, Object> attributes;
private final InterestOpsCallback interestOpsCallback;
private final SessionClosedCallback sessionClosedCallback;
-
+
private SessionBufferStatus bufferStatus;
private int socketTimeout;
private volatile int currentEventMask;
-
+
/**
* Creates new instance of IOSessionImpl.
- *
+ *
* @param key the selection key.
* @param interestOpsCallback interestOps callback.
* @param sessionClosedCallback session closed callback.
- *
+ *
* @since 4.1
*/
public IOSessionImpl(
- final SelectionKey key,
+ final SelectionKey key,
final InterestOpsCallback interestOpsCallback,
final SessionClosedCallback sessionClosedCallback) {
super();
@@ -85,23 +85,23 @@ public class IOSessionImpl implements IO
this.socketTimeout = 0;
this.status = ACTIVE;
}
-
+
/**
* Creates new instance of IOSessionImpl.
- *
+ *
* @param key the selection key.
* @param sessionClosedCallback session closed callback.
*/
public IOSessionImpl(
- final SelectionKey key,
+ final SelectionKey key,
final SessionClosedCallback sessionClosedCallback) {
this(key, null, sessionClosedCallback);
}
-
+
public ByteChannel channel() {
return this.channel;
}
-
+
public SocketAddress getLocalAddress() {
Channel channel = this.key.channel();
if (channel instanceof SocketChannel) {
@@ -123,7 +123,7 @@ public class IOSessionImpl implements IO
public int getEventMask() {
return this.interestOpsCallback != null ? this.currentEventMask : this.key.interestOps();
}
-
+
public void setEventMask(int ops) {
if (this.status == CLOSED) {
return;
@@ -190,11 +190,11 @@ public class IOSessionImpl implements IO
public int getSocketTimeout() {
return this.socketTimeout;
}
-
+
public void setSocketTimeout(int timeout) {
this.socketTimeout = timeout;
}
-
+
public void close() {
if (this.status == CLOSED) {
return;
@@ -214,7 +214,7 @@ public class IOSessionImpl implements IO
this.key.selector().wakeup();
}
}
-
+
public int getStatus() {
return this.status;
}
@@ -222,17 +222,17 @@ public class IOSessionImpl implements IO
public boolean isClosed() {
return this.status == CLOSED || !this.key.isValid();
}
-
+
public void shutdown() {
// For this type of session, a close() does exactly
// what we need and nothing more.
close();
}
-
+
public boolean hasBufferedInput() {
return this.bufferStatus != null && this.bufferStatus.hasBufferedInput();
}
-
+
public boolean hasBufferedOutput() {
return this.bufferStatus != null && this.bufferStatus.hasBufferedOutput();
}
@@ -240,7 +240,7 @@ public class IOSessionImpl implements IO
public void setBufferStatus(final SessionBufferStatus bufferStatus) {
this.bufferStatus = bufferStatus;
}
-
+
public Object getAttribute(final String name) {
return this.attributes.get(name);
}
@@ -269,14 +269,14 @@ public class IOSessionImpl implements IO
}
buffer.append(']');
}
-
+
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append("[");
if (this.key.isValid()) {
buffer.append("interested ops: ");
- formatOps(buffer, this.interestOpsCallback != null ?
+ formatOps(buffer, this.interestOpsCallback != null ?
this.currentEventMask : this.key.interestOps());
buffer.append("; ready ops: ");
formatOps(buffer, this.key.readyOps());
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpEntry.java Fri Apr 23 19:11:53 2010
@@ -30,9 +30,9 @@ package org.apache.http.impl.nio.reactor
import java.nio.channels.SelectionKey;
/**
- * Helper class, representing an entry on an {@link java.nio.channels.SelectionKey#interestOps(int)
+ * Helper class, representing an entry on an {@link java.nio.channels.SelectionKey#interestOps(int)
* interestOps(int)} queue.
- *
+ *
* @since 4.1
*/
public class InterestOpEntry {
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpsCallback.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpsCallback.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpsCallback.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/InterestOpsCallback.java Fri Apr 23 19:11:53 2010
@@ -28,7 +28,7 @@
package org.apache.http.impl.nio.reactor;
/**
- * Callback interface used internally by I/O session implementations to delegate execution
+ * Callback interface used internally by I/O session implementations to delegate execution
* of a {@link java.nio.channels.SelectionKey#interestOps(int)} operation to the I/O reactor.
*
* @since 4.1
@@ -36,5 +36,5 @@ package org.apache.http.impl.nio.reactor
public interface InterestOpsCallback {
void addInterestOps(InterestOpEntry entry);
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointClosedCallback.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointClosedCallback.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointClosedCallback.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointClosedCallback.java Fri Apr 23 19:11:53 2010
@@ -30,7 +30,7 @@ package org.apache.http.impl.nio.reactor
import org.apache.http.nio.reactor.ListenerEndpoint;
/**
- * Listener endpoint callback interface used internally by I/O reactor
+ * Listener endpoint callback interface used internally by I/O reactor
* implementations.
*
* @since 4.0
@@ -38,5 +38,5 @@ import org.apache.http.nio.reactor.Liste
public interface ListenerEndpointClosedCallback {
void endpointClosed(ListenerEndpoint endpoint);
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointImpl.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ListenerEndpointImpl.java Fri Apr 23 19:11:53 2010
@@ -48,7 +48,7 @@ public class ListenerEndpointImpl implem
private volatile IOException exception;
private final ListenerEndpointClosedCallback callback;
-
+
public ListenerEndpointImpl(
final SocketAddress address,
final ListenerEndpointClosedCallback callback) {
@@ -59,19 +59,19 @@ public class ListenerEndpointImpl implem
this.address = address;
this.callback = callback;
}
-
+
public SocketAddress getAddress() {
return this.address;
}
-
+
public boolean isCompleted() {
return this.completed;
}
-
+
public IOException getException() {
return this.exception;
}
-
+
public void waitFor() throws InterruptedException {
if (this.completed) {
return;
@@ -82,7 +82,7 @@ public class ListenerEndpointImpl implem
}
}
}
-
+
public void completed(final SocketAddress address) {
if (address == null) {
throw new IllegalArgumentException("Address may not be null");
@@ -96,7 +96,7 @@ public class ListenerEndpointImpl implem
notifyAll();
}
}
-
+
public void failed(final IOException exception) {
if (exception == null) {
return;
@@ -110,7 +110,7 @@ public class ListenerEndpointImpl implem
notifyAll();
}
}
-
+
public void cancel() {
if (this.completed) {
return;
@@ -121,7 +121,7 @@ public class ListenerEndpointImpl implem
notifyAll();
}
}
-
+
protected void setKey(final SelectionKey key) {
this.key = key;
}
@@ -152,5 +152,5 @@ public class ListenerEndpointImpl implem
notifyAll();
}
}
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSession.java Fri Apr 23 19:11:53 2010
@@ -112,7 +112,7 @@ public class SSLIOSession implements IOS
/**
* @since 4.1
- *
+ *
* @deprecated
*/
@Deprecated
@@ -122,7 +122,7 @@ public class SSLIOSession implements IOS
final SSLIOSessionHandler handler) {
this(session, sslContext, handler != null ? new SSLIOSessionHandlerAdaptor(handler) : null);
}
-
+
public synchronized void bind(
final SSLMode mode,
final HttpParams params) throws SSLException {
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandler.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandler.java Fri Apr 23 19:11:53 2010
@@ -36,40 +36,40 @@ import javax.net.ssl.SSLSession;
import org.apache.http.params.HttpParams;
/**
- * Callback interface that can be used to customize various aspects of
+ * Callback interface that can be used to customize various aspects of
* the TLS/SSl protocol.
*
* @since 4.0
- *
+ *
* @deprecated Use {@link SSLSetupHandler}
*/
@Deprecated
public interface SSLIOSessionHandler {
/**
- * Triggered when the SSL connection is being initialized. Custom handlers
- * can use this callback to customize properties of the {@link SSLEngine}
+ * Triggered when the SSL connection is being initialized. Custom handlers
+ * can use this callback to customize properties of the {@link SSLEngine}
* used to establish the SSL session.
- *
+ *
* @param sslengine the SSL engine.
* @param params HTTP parameters.
- * @throws SSLException if case of SSL protocol error.
+ * @throws SSLException if case of SSL protocol error.
*/
void initalize(SSLEngine sslengine, HttpParams params)
throws SSLException;
/**
- * Triggered when the SSL connection has been established and initial SSL
- * handshake has been successfully completed. Custom handlers can use
- * this callback to verify properties of the {@link SSLSession}.
- * For instance this would be the right place to enforce SSL cipher
+ * Triggered when the SSL connection has been established and initial SSL
+ * handshake has been successfully completed. Custom handlers can use
+ * this callback to verify properties of the {@link SSLSession}.
+ * For instance this would be the right place to enforce SSL cipher
* strength, validate certificate chain and do hostname checks.
- *
+ *
* @param remoteAddress the remote address of the connection.
* @param session newly created SSL session.
- * @throws SSLException if case of SSL protocol error.
+ * @throws SSLException if case of SSL protocol error.
*/
void verify(SocketAddress remoteAddress, SSLSession session)
throws SSLException;
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandlerAdaptor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandlerAdaptor.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandlerAdaptor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLIOSessionHandlerAdaptor.java Fri Apr 23 19:11:53 2010
@@ -38,12 +38,12 @@ import org.apache.http.params.HttpParams
class SSLIOSessionHandlerAdaptor implements SSLSetupHandler {
private final SSLIOSessionHandler handler;
-
+
public SSLIOSessionHandlerAdaptor(final SSLIOSessionHandler handler) {
super();
this.handler = handler;
}
-
+
public void initalize(final SSLEngine sslengine, final HttpParams params) throws SSLException {
this.handler.initalize(sslengine, params);
}
@@ -51,5 +51,5 @@ class SSLIOSessionHandlerAdaptor impleme
public void verify(final IOSession iosession, final SSLSession sslsession) throws SSLException {
this.handler.verify(iosession.getRemoteAddress(), sslsession);
}
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLMode.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLMode.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLMode.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLMode.java Fri Apr 23 19:11:53 2010
@@ -34,5 +34,5 @@ public enum SSLMode {
CLIENT,
SERVER
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLSetupHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLSetupHandler.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLSetupHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SSLSetupHandler.java Fri Apr 23 19:11:53 2010
@@ -35,7 +35,7 @@ import org.apache.http.nio.reactor.IOSes
import org.apache.http.params.HttpParams;
/**
- * Callback interface that can be used to customize various aspects of
+ * Callback interface that can be used to customize various aspects of
* the TLS/SSl protocol.
*
* @since 4.1
@@ -43,29 +43,29 @@ import org.apache.http.params.HttpParams
public interface SSLSetupHandler {
/**
- * Triggered when the SSL connection is being initialized. Custom handlers
- * can use this callback to customize properties of the {@link SSLEngine}
+ * Triggered when the SSL connection is being initialized. Custom handlers
+ * can use this callback to customize properties of the {@link SSLEngine}
* used to establish the SSL session.
- *
+ *
* @param sslengine the SSL engine.
* @param params HTTP parameters.
- * @throws SSLException if case of SSL protocol error.
+ * @throws SSLException if case of SSL protocol error.
*/
void initalize(SSLEngine sslengine, HttpParams params)
throws SSLException;
/**
- * Triggered when the SSL connection has been established and initial SSL
- * handshake has been successfully completed. Custom handlers can use
- * this callback to verify properties of the {@link SSLSession}.
- * For instance this would be the right place to enforce SSL cipher
+ * Triggered when the SSL connection has been established and initial SSL
+ * handshake has been successfully completed. Custom handlers can use
+ * this callback to verify properties of the {@link SSLSession}.
+ * For instance this would be the right place to enforce SSL cipher
* strength, validate certificate chain and do hostname checks.
- *
+ *
* @param iosession the underlying IOSession for the SSL connection.
* @param sslsession newly created SSL session.
- * @throws SSLException if case of SSL protocol error.
+ * @throws SSLException if case of SSL protocol error.
*/
void verify(IOSession iosession, SSLSession sslsession)
throws SSLException;
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionClosedCallback.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionClosedCallback.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionClosedCallback.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionClosedCallback.java Fri Apr 23 19:11:53 2010
@@ -37,5 +37,5 @@ import org.apache.http.nio.reactor.IOSes
public interface SessionClosedCallback {
void sessionClosed(IOSession session);
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionHandle.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionHandle.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionHandle.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionHandle.java Fri Apr 23 19:11:53 2010
@@ -30,8 +30,8 @@ package org.apache.http.impl.nio.reactor
import org.apache.http.nio.reactor.IOSession;
/**
- * Session handle class used by I/O reactor implementations to keep a reference
- * to a {@link IOSession} along with information about time of last I/O
+ * Session handle class used by I/O reactor implementations to keep a reference
+ * to a {@link IOSession} along with information about time of last I/O
* operations on that session.
*
* @since 4.0
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java Fri Apr 23 19:11:53 2010
@@ -47,11 +47,11 @@ import org.apache.http.protocol.HTTP;
import org.apache.http.util.CharArrayBuffer;
/**
- * Default implementation of {@link SessionInputBuffer} based on
+ * Default implementation of {@link SessionInputBuffer} based on
* the {@link ExpandableBuffer} class.
* <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>
* </ul>
@@ -59,29 +59,29 @@ import org.apache.http.util.CharArrayBuf
* @since 4.0
*/
public class SessionInputBufferImpl extends ExpandableBuffer implements SessionInputBuffer {
-
+
private CharBuffer charbuffer = null;
private Charset charset = null;
private CharsetDecoder chardecoder = null;
-
+
public SessionInputBufferImpl(
- int buffersize,
- int linebuffersize,
+ int buffersize,
+ int linebuffersize,
final ByteBufferAllocator allocator,
final HttpParams params) {
super(buffersize, allocator);
this.charbuffer = CharBuffer.allocate(linebuffersize);
- this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
+ this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
this.chardecoder = this.charset.newDecoder();
}
public SessionInputBufferImpl(
- int buffersize,
- int linebuffersize,
+ int buffersize,
+ int linebuffersize,
final HttpParams params) {
this(buffersize, linebuffersize, new HeapByteBufferAllocator(), params);
}
-
+
public int fill(final ReadableByteChannel channel) throws IOException {
if (channel == null) {
throw new IllegalArgumentException("Channel may not be null");
@@ -93,12 +93,12 @@ public class SessionInputBufferImpl exte
int readNo = channel.read(this.buffer);
return readNo;
}
-
+
public int read() {
setOutputMode();
return this.buffer.get() & 0xff;
}
-
+
public int read(final ByteBuffer dst, int maxLen) {
if (dst == null) {
return 0;
@@ -111,7 +111,7 @@ public class SessionInputBufferImpl exte
}
return chunk;
}
-
+
public int read(final ByteBuffer dst) {
if (dst == null) {
return 0;
@@ -136,7 +136,7 @@ public class SessionInputBufferImpl exte
}
return bytesRead;
}
-
+
public int read(final WritableByteChannel dst) throws IOException {
if (dst == null) {
return 0;
@@ -144,11 +144,11 @@ public class SessionInputBufferImpl exte
setOutputMode();
return dst.write(this.buffer);
}
-
+
public boolean readLine(
- final CharArrayBuffer linebuffer,
+ final CharArrayBuffer linebuffer,
boolean endOfStream) throws CharacterCodingException {
-
+
setOutputMode();
// See if there is LF char present in the buffer
int pos = -1;
@@ -166,7 +166,7 @@ public class SessionInputBufferImpl exte
// No more data. Get the rest
pos = this.buffer.limit();
} else {
- // Either no complete line present in the buffer
+ // Either no complete line present in the buffer
// or no more data is expected
return false;
}
@@ -177,13 +177,13 @@ public class SessionInputBufferImpl exte
int len = this.buffer.limit() - this.buffer.position();
// Ensure capacity of len assuming ASCII as the most likely charset
linebuffer.ensureCapacity(len);
-
+
this.chardecoder.reset();
-
+
for (;;) {
CoderResult result = this.chardecoder.decode(
- this.buffer,
- this.charbuffer,
+ this.buffer,
+ this.charbuffer,
true);
if (result.isError()) {
result.throwException();
@@ -191,8 +191,8 @@ public class SessionInputBufferImpl exte
if (result.isOverflow()) {
this.charbuffer.flip();
linebuffer.append(
- this.charbuffer.array(),
- this.charbuffer.position(),
+ this.charbuffer.array(),
+ this.charbuffer.position(),
this.charbuffer.remaining());
this.charbuffer.clear();
}
@@ -208,13 +208,13 @@ public class SessionInputBufferImpl exte
// append the decoded content to the line buffer
if (this.charbuffer.hasRemaining()) {
linebuffer.append(
- this.charbuffer.array(),
- this.charbuffer.position(),
+ this.charbuffer.array(),
+ this.charbuffer.position(),
this.charbuffer.remaining());
}
-
+
// discard LF if found
- int l = linebuffer.length();
+ int l = linebuffer.length();
if (l > 0) {
if (linebuffer.charAt(l - 1) == HTTP.LF) {
l--;
@@ -230,7 +230,7 @@ public class SessionInputBufferImpl exte
}
return true;
}
-
+
public String readLine(boolean endOfStream) throws CharacterCodingException {
CharArrayBuffer charbuffer = new CharArrayBuffer(64);
boolean found = readLine(charbuffer, endOfStream);
@@ -240,5 +240,5 @@ public class SessionInputBufferImpl exte
return null;
}
}
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java Fri Apr 23 19:11:53 2010
@@ -47,11 +47,11 @@ import org.apache.http.protocol.HTTP;
import org.apache.http.util.CharArrayBuffer;
/**
- * Default implementation of {@link SessionOutputBuffer} based on
+ * Default implementation of {@link SessionOutputBuffer} based on
* the {@link ExpandableBuffer} class.
* <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>
* </ul>
@@ -65,21 +65,21 @@ public class SessionOutputBufferImpl ext
private CharBuffer charbuffer = null;
private Charset charset = null;
private CharsetEncoder charencoder = null;
-
+
public SessionOutputBufferImpl(
- int buffersize,
- int linebuffersize,
+ int buffersize,
+ int linebuffersize,
final ByteBufferAllocator allocator,
final HttpParams params) {
super(buffersize, allocator);
this.charbuffer = CharBuffer.allocate(linebuffersize);
- this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
+ this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
this.charencoder = this.charset.newEncoder();
}
public SessionOutputBufferImpl(
- int buffersize,
- int linebuffersize,
+ int buffersize,
+ int linebuffersize,
final HttpParams params) {
this(buffersize, linebuffersize, new HeapByteBufferAllocator(), params);
}
@@ -152,7 +152,7 @@ public class SessionOutputBufferImpl ext
}
this.charbuffer.put(linebuffer.buffer(), offset, l);
this.charbuffer.flip();
-
+
boolean retry = true;
while (retry) {
CoderResult result = this.charencoder.encode(this.charbuffer, this.buffer, eol);
@@ -183,7 +183,7 @@ public class SessionOutputBufferImpl ext
}
writeCRLF();
}
-
+
public void writeLine(final String s) throws IOException {
if (s == null) {
return;
@@ -196,5 +196,5 @@ public class SessionOutputBufferImpl ext
write(CRLF);
}
}
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestHandle.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestHandle.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestHandle.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestHandle.java Fri Apr 23 19:11:53 2010
@@ -30,7 +30,7 @@ package org.apache.http.impl.nio.reactor
import org.apache.http.nio.reactor.SessionRequest;
/**
- * Session request handle class used by I/O reactor implementations to keep
+ * Session request handle class used by I/O reactor implementations to keep
* a reference to a {@link SessionRequest} along with the time the request
* was made.
* @since 4.0
@@ -39,7 +39,7 @@ public class SessionRequestHandle {
private final SessionRequestImpl sessionRequest;
private final long requestTime;
-
+
public SessionRequestHandle(final SessionRequestImpl sessionRequest) {
super();
if (sessionRequest == null) {
@@ -48,13 +48,13 @@ public class SessionRequestHandle {
this.sessionRequest = sessionRequest;
this.requestTime = System.currentTimeMillis();
}
-
+
public SessionRequestImpl getSessionRequest() {
return this.sessionRequest;
}
-
+
public long getRequestTime() {
return this.requestTime;
}
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionRequestImpl.java Fri Apr 23 19:11:53 2010
@@ -50,11 +50,11 @@ public class SessionRequestImpl implemen
private final SocketAddress localAddress;
private final Object attachment;
private final SessionRequestCallback callback;
-
+
private volatile int connectTimeout;
private volatile IOSession session = null;
private volatile IOException exception = null;
-
+
public SessionRequestImpl(
final SocketAddress remoteAddress,
final SocketAddress localAddress,
@@ -70,23 +70,23 @@ public class SessionRequestImpl implemen
this.callback = callback;
this.connectTimeout = 0;
}
-
+
public SocketAddress getRemoteAddress() {
return this.remoteAddress;
}
-
+
public SocketAddress getLocalAddress() {
return this.localAddress;
}
-
+
public Object getAttachment() {
return this.attachment;
}
-
+
public boolean isCompleted() {
return this.completed;
}
-
+
public void waitFor() throws InterruptedException {
if (this.completed) {
return;
@@ -97,19 +97,19 @@ public class SessionRequestImpl implemen
}
}
}
-
+
public IOSession getSession() {
synchronized (this) {
return this.session;
}
}
-
+
public IOException getException() {
synchronized (this) {
return this.exception;
}
}
-
+
public void completed(final IOSession session) {
if (session == null) {
throw new IllegalArgumentException("Session may not be null");
@@ -126,7 +126,7 @@ public class SessionRequestImpl implemen
notifyAll();
}
}
-
+
public void failed(final IOException exception) {
if (exception == null) {
return;
@@ -143,7 +143,7 @@ public class SessionRequestImpl implemen
notifyAll();
}
}
-
+
public void timeout() {
if (this.completed) {
return;
@@ -164,7 +164,7 @@ public class SessionRequestImpl implemen
}
}
}
-
+
public int getConnectTimeout() {
return this.connectTimeout;
}
@@ -203,5 +203,5 @@ public class SessionRequestImpl implemen
notifyAll();
}
}
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/package.html
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/package.html?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/package.html (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/package.html Fri Apr 23 19:11:53 2010
@@ -30,8 +30,8 @@
-->
</head>
<body>
-Default implementations for interfaces in
-{@link org.apache.http.nio org.apache.http.nio} including default
-I/O reactor implementations and support for SSL/TLS transport security.
+Default implementations for interfaces in
+{@link org.apache.http.nio org.apache.http.nio} including default
+I/O reactor implementations and support for SSL/TLS transport security.
</body>
</html>
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java Fri Apr 23 19:11:53 2010
@@ -52,8 +52,8 @@ import org.apache.http.protocol.Executio
* Default implementation of {@link IOEventDispatch} interface for SSL
* (encrypted) client-side HTTP connections.
* <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#SOCKET_BUFFER_SIZE}</li>
@@ -66,18 +66,18 @@ import org.apache.http.protocol.Executio
public class SSLClientIOEventDispatch implements IOEventDispatch {
private static final String SSL_SESSION = "SSL_SESSION";
-
+
private final NHttpClientHandler handler;
private final SSLContext sslcontext;
private final SSLSetupHandler sslHandler;
private final HttpParams params;
-
+
/**
- * Creates a new instance of this class to be used for dispatching I/O event
- * notifications to the given protocol handler using the given
- * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
+ * Creates a new instance of this class to be used for dispatching I/O event
+ * notifications to the given protocol handler using the given
+ * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
* protocol aspects for HTTP connections.
- *
+ *
* @param handler the client protocol handler.
* @param sslcontext the SSL context.
* @param sslHandler the SSL setup handler.
@@ -103,13 +103,13 @@ public class SSLClientIOEventDispatch im
this.sslcontext = sslcontext;
this.sslHandler = sslHandler;
}
-
+
/**
- * Creates a new instance of this class to be used for dispatching I/O event
- * notifications to the given protocol handler using the given
- * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
+ * Creates a new instance of this class to be used for dispatching I/O event
+ * notifications to the given protocol handler using the given
+ * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
* protocol aspects for HTTP connections.
- *
+ *
* @param handler the client protocol handler.
* @param sslcontext the SSL context.
* @param params HTTP parameters.
@@ -120,60 +120,60 @@ public class SSLClientIOEventDispatch im
final HttpParams params) {
this(handler, sslcontext, null, params);
}
-
+
/**
- * Creates an instance of {@link HeapByteBufferAllocator} to be used
+ * Creates an instance of {@link HeapByteBufferAllocator} to be used
* by HTTP connections for allocating {@link java.nio.ByteBuffer} objects.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of the {@link ByteBufferAllocator} interface.
- *
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of the {@link ByteBufferAllocator} interface.
+ *
* @return byte buffer allocator.
*/
protected ByteBufferAllocator createByteBufferAllocator() {
- return new HeapByteBufferAllocator();
+ return new HeapByteBufferAllocator();
}
-
+
/**
- * Creates an instance of {@link DefaultHttpResponseFactory} to be used
+ * Creates an instance of {@link DefaultHttpResponseFactory} to be used
* by HTTP connections for creating {@link HttpResponse} objects.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of the {@link HttpResponseFactory} interface.
- *
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of the {@link HttpResponseFactory} interface.
+ *
* @return HTTP response factory.
*/
protected HttpResponseFactory createHttpResponseFactory() {
return new DefaultHttpResponseFactory();
}
-
+
/**
* Creates an instance of {@link DefaultNHttpClientConnection} based on the
* given SSL {@link IOSession}.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of the {@link NHttpClientIOTarget} interface.
- *
- * @param session the underlying SSL I/O session.
- *
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of the {@link NHttpClientIOTarget} interface.
+ *
+ * @param session the underlying SSL I/O session.
+ *
* @return newly created HTTP connection.
*/
protected NHttpClientIOTarget createConnection(final IOSession session) {
return new DefaultNHttpClientConnection(
- session,
+ session,
createHttpResponseFactory(),
createByteBufferAllocator(),
- this.params);
+ this.params);
}
-
+
/**
* Creates an instance of {@link SSLIOSession} decorating the given
* {@link IOSession}.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of SSL I/O session.
- *
- * @param session the underlying I/O session.
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of SSL I/O session.
+ *
+ * @param session the underlying I/O session.
* @param sslcontext the SSL context.
* @param sslHandler the SSL setup handler.
* @return newly created SSL I/O session.
@@ -182,22 +182,22 @@ public class SSLClientIOEventDispatch im
final IOSession session,
final SSLContext sslcontext,
final SSLSetupHandler sslHandler) {
- return new SSLIOSession(session, sslcontext, sslHandler);
+ return new SSLIOSession(session, sslcontext, sslHandler);
}
-
+
public void connected(final IOSession session) {
SSLIOSession sslSession = createSSLIOSession(
- session,
+ session,
this.sslcontext,
- this.sslHandler);
-
+ this.sslHandler);
+
NHttpClientIOTarget conn = createConnection(
sslSession);
-
+
session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
session.setAttribute(SSL_SESSION, sslSession);
-
+
Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
this.handler.connected(conn, attachment);
@@ -210,7 +210,7 @@ public class SSLClientIOEventDispatch im
}
public void disconnected(final IOSession session) {
- NHttpClientIOTarget conn =
+ NHttpClientIOTarget conn =
(NHttpClientIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null) {
this.handler.closed(conn);
@@ -218,9 +218,9 @@ public class SSLClientIOEventDispatch im
}
public void inputReady(final IOSession session) {
- NHttpClientIOTarget conn =
+ NHttpClientIOTarget conn =
(NHttpClientIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
- SSLIOSession sslSession =
+ SSLIOSession sslSession =
(SSLIOSession) session.getAttribute(SSL_SESSION);
try {
@@ -235,9 +235,9 @@ public class SSLClientIOEventDispatch im
}
public void outputReady(final IOSession session) {
- NHttpClientIOTarget conn =
+ NHttpClientIOTarget conn =
(NHttpClientIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
- SSLIOSession sslSession =
+ SSLIOSession sslSession =
(SSLIOSession) session.getAttribute(SSL_SESSION);
try {
@@ -252,15 +252,15 @@ public class SSLClientIOEventDispatch im
}
public void timeout(final IOSession session) {
- NHttpClientIOTarget conn =
+ NHttpClientIOTarget conn =
(NHttpClientIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
- SSLIOSession sslSession =
+ SSLIOSession sslSession =
(SSLIOSession) session.getAttribute(SSL_SESSION);
this.handler.timeout(conn);
synchronized (sslSession) {
if (sslSession.isOutboundDone() && !sslSession.isInboundDone()) {
- // The session failed to terminate cleanly
+ // The session failed to terminate cleanly
sslSession.shutdown();
}
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java Fri Apr 23 19:11:53 2010
@@ -52,8 +52,8 @@ import org.apache.http.protocol.Executio
* Default implementation of {@link IOEventDispatch} interface for SSL
* (encrypted) server-side HTTP connections.
* <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#SOCKET_BUFFER_SIZE}</li>
@@ -66,18 +66,18 @@ import org.apache.http.protocol.Executio
public class SSLServerIOEventDispatch implements IOEventDispatch {
private static final String SSL_SESSION = "SSL_SESSION";
-
+
private final NHttpServiceHandler handler;
private final SSLContext sslcontext;
private final SSLSetupHandler sslHandler;
private final HttpParams params;
-
+
/**
- * Creates a new instance of this class to be used for dispatching I/O event
- * notifications to the given protocol handler using the given
- * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
+ * Creates a new instance of this class to be used for dispatching I/O event
+ * notifications to the given protocol handler using the given
+ * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
* protocol aspects for HTTP connections.
- *
+ *
* @param handler the server protocol handler.
* @param sslcontext the SSL context.
* @param sslHandler the SSL setup handler.
@@ -103,13 +103,13 @@ public class SSLServerIOEventDispatch im
this.sslcontext = sslcontext;
this.sslHandler = sslHandler;
}
-
+
/**
- * Creates a new instance of this class to be used for dispatching I/O event
- * notifications to the given protocol handler using the given
- * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
+ * Creates a new instance of this class to be used for dispatching I/O event
+ * notifications to the given protocol handler using the given
+ * {@link SSLContext}. This I/O dispatcher will transparently handle SSL
* protocol aspects for HTTP connections.
- *
+ *
* @param handler the server protocol handler.
* @param sslcontext the SSL context.
* @param params HTTP parameters.
@@ -120,60 +120,60 @@ public class SSLServerIOEventDispatch im
final HttpParams params) {
this(handler, sslcontext, null, params);
}
-
+
/**
- * Creates an instance of {@link HeapByteBufferAllocator} to be used
+ * Creates an instance of {@link HeapByteBufferAllocator} to be used
* by HTTP connections for allocating {@link java.nio.ByteBuffer} objects.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of the {@link ByteBufferAllocator} interface.
- *
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of the {@link ByteBufferAllocator} interface.
+ *
* @return byte buffer allocator.
*/
protected ByteBufferAllocator createByteBufferAllocator() {
- return new HeapByteBufferAllocator();
+ return new HeapByteBufferAllocator();
}
-
+
/**
- * Creates an instance of {@link DefaultHttpRequestFactory} to be used
+ * Creates an instance of {@link DefaultHttpRequestFactory} to be used
* by HTTP connections for creating {@link HttpRequest} objects.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of the {@link HttpRequestFactory} interface.
- *
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of the {@link HttpRequestFactory} interface.
+ *
* @return HTTP request factory.
*/
protected HttpRequestFactory createHttpRequestFactory() {
- return new DefaultHttpRequestFactory();
+ return new DefaultHttpRequestFactory();
}
-
+
/**
* Creates an instance of {@link DefaultNHttpServerConnection} based on the
* given {@link IOSession}.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of the {@link NHttpServerIOTarget} interface.
- *
- * @param session the underlying SSL I/O session.
- *
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of the {@link NHttpServerIOTarget} interface.
+ *
+ * @param session the underlying SSL I/O session.
+ *
* @return newly created HTTP connection.
*/
protected NHttpServerIOTarget createConnection(final IOSession session) {
return new DefaultNHttpServerConnection(
- session,
+ session,
createHttpRequestFactory(),
createByteBufferAllocator(),
- this.params);
+ this.params);
}
-
+
/**
* Creates an instance of {@link SSLIOSession} decorating the given
* {@link IOSession}.
* <p>
- * This method can be overridden in a super class in order to provide
- * a different implementation of SSL I/O session.
- *
- * @param session the underlying I/O session.
+ * This method can be overridden in a super class in order to provide
+ * a different implementation of SSL I/O session.
+ *
+ * @param session the underlying I/O session.
* @param sslcontext the SSL context.
* @param sslHandler the SSL setup handler.
* @return newly created SSL I/O session.
@@ -182,19 +182,19 @@ public class SSLServerIOEventDispatch im
final IOSession session,
final SSLContext sslcontext,
final SSLSetupHandler sslHandler) {
- return new SSLIOSession(session, sslcontext, sslHandler);
+ return new SSLIOSession(session, sslcontext, sslHandler);
}
-
+
public void connected(final IOSession session) {
SSLIOSession sslSession = createSSLIOSession(
- session,
+ session,
this.sslcontext,
- this.sslHandler);
-
+ this.sslHandler);
+
NHttpServerIOTarget conn = createConnection(
- sslSession);
-
+ sslSession);
+
session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
session.setAttribute(SSL_SESSION, sslSession);
@@ -209,7 +209,7 @@ public class SSLServerIOEventDispatch im
}
public void disconnected(final IOSession session) {
- NHttpServerIOTarget conn =
+ NHttpServerIOTarget conn =
(NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
if (conn != null) {
@@ -218,9 +218,9 @@ public class SSLServerIOEventDispatch im
}
public void inputReady(final IOSession session) {
- NHttpServerIOTarget conn =
+ NHttpServerIOTarget conn =
(NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
- SSLIOSession sslSession =
+ SSLIOSession sslSession =
(SSLIOSession) session.getAttribute(SSL_SESSION);
try {
@@ -235,9 +235,9 @@ public class SSLServerIOEventDispatch im
}
public void outputReady(final IOSession session) {
- NHttpServerIOTarget conn =
+ NHttpServerIOTarget conn =
(NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
- SSLIOSession sslSession =
+ SSLIOSession sslSession =
(SSLIOSession) session.getAttribute(SSL_SESSION);
try {
@@ -252,9 +252,9 @@ public class SSLServerIOEventDispatch im
}
public void timeout(final IOSession session) {
- NHttpServerIOTarget conn =
+ NHttpServerIOTarget conn =
(NHttpServerIOTarget) session.getAttribute(ExecutionContext.HTTP_CONNECTION);
- SSLIOSession sslSession =
+ SSLIOSession sslSession =
(SSLIOSession) session.getAttribute(SSL_SESSION);
this.handler.timeout(conn);
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoder.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoder.java Fri Apr 23 19:11:53 2010
@@ -41,21 +41,21 @@ public interface ContentDecoder {
/**
* Reads a portion of content from the underlying channel
- *
+ *
* @param dst The buffer into which entity content is to be transferred
- * @return The number of bytes read, possibly zero, or -1 if the
+ * @return The number of bytes read, possibly zero, or -1 if the
* channel has reached end-of-stream
* @throws IOException if I/O error occurs while reading content
*/
int read(ByteBuffer dst) throws IOException;
-
+
/**
* Returns <code>true</code> if the entity has been received in its
* entirety.
- *
- * @return <code>true</code> if all the content has been consumed,
+ *
+ * @return <code>true</code> if all the content has been consumed,
* <code>false</code> otherwise.
*/
boolean isCompleted();
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoderChannel.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoderChannel.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoderChannel.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentDecoderChannel.java Fri Apr 23 19:11:53 2010
@@ -33,7 +33,7 @@ import java.nio.channels.ReadableByteCha
/**
* A {@link ReadableByteChannel} that delegates to a {@link ContentDecoder}.
- * Attempts to close this channel are ignored, and {@link #isOpen} always
+ * Attempts to close this channel are ignored, and {@link #isOpen} always
* returns <code>true</code>.
*
* @since 4.0
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoder.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoder.java Fri Apr 23 19:11:53 2010
@@ -32,7 +32,7 @@ import java.nio.ByteBuffer;
/**
* Abstract HTTP content encoder. HTTP content encoders can be used
- * to apply the required coding transformation and write entity
+ * to apply the required coding transformation and write entity
* content to the underlying channel in small chunks.
*
* @since 4.0
@@ -41,7 +41,7 @@ public interface ContentEncoder {
/**
* Writes a portion of entity content to the underlying channel.
- *
+ *
* @param src The buffer from which content is to be retrieved
* @return The number of bytes read, possibly zero
* @throws IOException if I/O error occurs while writing content
@@ -50,18 +50,18 @@ public interface ContentEncoder {
/**
* Terminates the content stream.
- *
+ *
* @throws IOException if I/O error occurs while writing content
*/
void complete() throws IOException;
-
+
/**
* Returns <code>true</code> if the entity has been transferred in its
* entirety.
- *
- * @return <code>true</code> if all the content has been produced,
+ *
+ * @return <code>true</code> if all the content has been produced,
* <code>false</code> otherwise.
*/
boolean isCompleted();
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoderChannel.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoderChannel.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoderChannel.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/ContentEncoderChannel.java Fri Apr 23 19:11:53 2010
@@ -35,7 +35,7 @@ import org.apache.http.nio.ContentEncode
/**
* A {@link WritableByteChannel} that delegates to a {@link ContentEncoder}.
- * Attempts to close this channel are ignored, and {@link #isOpen} always
+ * Attempts to close this channel are ignored, and {@link #isOpen} always
* returns <code>true</code>.
*
* @since 4.0
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentDecoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentDecoder.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentDecoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentDecoder.java Fri Apr 23 19:11:53 2010
@@ -36,15 +36,15 @@ import java.nio.channels.FileChannel;
* @since 4.0
*/
public interface FileContentDecoder extends ContentDecoder {
-
+
/**
* Transfers a portion of entity content from the underlying network channel
* into the given file channel.<br>
- *
+ *
* <b>Warning</b>: Many implementations cannot write beyond the length of the file.
* If the position exceeds the channel's size, some implementations
* may throw an IOException.
- *
+ *
* @param dst the target FileChannel to transfer data into.
* @param position
* The position within the file at which the transfer is to begin;
@@ -58,5 +58,5 @@ public interface FileContentDecoder exte
* that were actually transferred
*/
long transfer(FileChannel dst, long position, long count) throws IOException;
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentEncoder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentEncoder.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentEncoder.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/FileContentEncoder.java Fri Apr 23 19:11:53 2010
@@ -37,11 +37,11 @@ import org.apache.http.nio.ContentEncode
* @since 4.0
*/
public interface FileContentEncoder extends ContentEncoder {
-
+
/**
- * Transfers a portion of entity content from the given file channel
+ * Transfers a portion of entity content from the given file channel
* to the underlying network channel.
- *
+ *
* @param src the source FileChannel to transfer data from.
* @param position
* The position within the file at which the transfer is to begin;
@@ -54,5 +54,5 @@ public interface FileContentEncoder exte
* that were actually transferred
*/
long transfer(FileChannel src, long position, long count) throws IOException;
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/IOControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/IOControl.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/IOControl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/IOControl.java Fri Apr 23 19:11:53 2010
@@ -30,13 +30,13 @@ package org.apache.http.nio;
import java.io.IOException;
/**
- * Connection input/output control interface. It can be used to control interest
+ * Connection input/output control interface. It can be used to control interest
* in I/O event notifications for non-blocking HTTP connections.
* <p>
- * Implementations of this interface are expected to be threading safe.
- * Therefore it can be used to request / suspend I/O event notifications from
+ * Implementations of this interface are expected to be threading safe.
+ * Therefore it can be used to request / suspend I/O event notifications from
* any thread of execution.
- *
+ *
* @since 4.0
*/
public interface IOControl {
@@ -46,30 +46,30 @@ public interface IOControl {
* channel is ready for input operations.
*/
void requestInput();
-
+
/**
- * Suspends event notifications about the underlying channel being
+ * Suspends event notifications about the underlying channel being
* ready for input operations.
*/
void suspendInput();
-
+
/**
* Requests event notifications to be triggered when the underlying
* channel is ready for output operations.
*/
void requestOutput();
-
+
/**
- * Suspends event notifications about the underlying channel being
+ * Suspends event notifications about the underlying channel being
* ready for output operations.
*/
void suspendOutput();
-
+
/**
* Shuts down the underlying channel.
- *
+ *
* @throws IOException
*/
void shutdown() throws IOException;
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientConnection.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientConnection.java Fri Apr 23 19:11:53 2010
@@ -33,9 +33,9 @@ import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
/**
- * Abstract non-blocking client-side HTTP connection interface. It can be used
- * to submit HTTP requests and asynchronously receive HTTP responses.
- *
+ * Abstract non-blocking client-side HTTP connection interface. It can be used
+ * to submit HTTP requests and asynchronously receive HTTP responses.
+ *
* @see NHttpConnection
*
* @since 4.0
@@ -44,7 +44,7 @@ public interface NHttpClientConnection e
/**
* Submits {@link HttpRequest} to be sent to the target server.
- *
+ *
* @param request HTTP request
* @throws IOException if I/O error occurs while submitting the request
* @throws HttpException if the HTTP request violates the HTTP protocol.
@@ -52,23 +52,23 @@ public interface NHttpClientConnection e
void submitRequest(HttpRequest request) throws IOException, HttpException;
/**
- * Returns <code>true</code> if an HTTP request has been submitted to the
+ * Returns <code>true</code> if an HTTP request has been submitted to the
* target server.
- *
- * @return <code>true</code> if an HTTP request has been submitted,
- * <code>false</code> otherwise.
+ *
+ * @return <code>true</code> if an HTTP request has been submitted,
+ * <code>false</code> otherwise.
*/
boolean isRequestSubmitted();
-
+
/**
- * Resets input state. This method can be used to prematurely terminate
+ * Resets input state. This method can be used to prematurely terminate
* processing of the outgoing HTTP request.
*/
void resetOutput();
-
+
/**
* Resets output state. This method can be used to prematurely terminate
- * processing of the incoming HTTP response.
+ * processing of the incoming HTTP response.
*/
void resetInput();
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientHandler.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientHandler.java Fri Apr 23 19:11:53 2010
@@ -32,7 +32,7 @@ import java.io.IOException;
import org.apache.http.HttpException;
/**
- * Abstract client-side HTTP protocol handler.
+ * Abstract client-side HTTP protocol handler.
*
* @since 4.0
*/
@@ -40,19 +40,19 @@ public interface NHttpClientHandler {
/**
* Triggered when a new outgoing connection is created.
- *
+ *
* @param conn new outgoing HTTP connection.
* @param attachment an object that was attached to the session request
*/
void connected(NHttpClientConnection conn, Object attachment);
-
+
/**
- * Triggered when the connection is ready to accept a new HTTP request.
- * The protocol handler does not have to submit a request if it is not
+ * Triggered when the connection is ready to accept a new HTTP request.
+ * The protocol handler does not have to submit a request if it is not
* ready.
- *
+ *
* @see NHttpClientConnection
- *
+ *
* @param conn HTTP connection that is ready to accept a new HTTP request.
*/
void requestReady(NHttpClientConnection conn);
@@ -62,85 +62,85 @@ public interface NHttpClientHandler {
* passed as a parameter to this method is guaranteed to return
* a valid HTTP response object.
* <p/>
- * If the response received encloses a response entity this method will
- * be followed by a series of
+ * If the response received encloses a response entity this method will
+ * be followed by a series of
* {@link #inputReady(NHttpClientConnection, ContentDecoder)} calls
* to transfer the response content.
- *
+ *
* @see NHttpClientConnection
- *
+ *
* @param conn HTTP connection that contains an HTTP response
*/
void responseReceived(NHttpClientConnection conn);
-
+
/**
* Triggered when the underlying channel is ready for reading a
- * new portion of the response entity through the corresponding
- * content decoder.
+ * new portion of the response entity through the corresponding
+ * content decoder.
* <p/>
* If the content consumer is unable to process the incoming content,
- * input event notifications can be temporarily suspended using
+ * input event notifications can be temporarily suspended using
* {@link IOControl} interface.
- *
+ *
* @see NHttpClientConnection
* @see ContentDecoder
* @see IOControl
- *
+ *
* @param conn HTTP connection that can produce a new portion of the
* incoming response content.
* @param decoder The content decoder to use to read content.
*/
void inputReady(NHttpClientConnection conn, ContentDecoder decoder);
-
+
/**
- * Triggered when the underlying channel is ready for writing a next portion
- * of the request entity through the corresponding content encoder.
+ * Triggered when the underlying channel is ready for writing a next portion
+ * of the request entity through the corresponding content encoder.
* <p>
- * If the content producer is unable to generate the outgoing content,
- * output event notifications can be temporarily suspended using
- * {@link IOControl} interface.
- *
+ * If the content producer is unable to generate the outgoing content,
+ * output event notifications can be temporarily suspended using
+ * {@link IOControl} interface.
+ *
* @see NHttpClientConnection
* @see ContentEncoder
* @see IOControl
- *
- * @param conn HTTP connection that can accommodate a new portion
+ *
+ * @param conn HTTP connection that can accommodate a new portion
* of the outgoing request content.
* @param encoder The content encoder to use to write content.
*/
void outputReady(NHttpClientConnection conn, ContentEncoder encoder);
-
+
/**
* Triggered when an I/O error occurs while reading from or writing
* to the underlying channel.
- *
+ *
* @param conn HTTP connection that caused an I/O error
* @param ex I/O exception
*/
void exception(NHttpClientConnection conn, IOException ex);
-
+
/**
- * Triggered when an HTTP protocol violation occurs while receiving
+ * Triggered when an HTTP protocol violation occurs while receiving
* an HTTP response.
- *
+ *
* @param conn HTTP connection that caused an HTTP protocol violation
* @param ex HTTP protocol violation exception
*/
void exception(NHttpClientConnection conn, HttpException ex);
-
+
/**
* Triggered when no input is detected on this connection over the
* maximum period of inactivity.
- *
+ *
* @param conn HTTP connection that caused timeout condition.
*/
void timeout(NHttpClientConnection conn);
-
+
/**
* Triggered when the connection is closed.
- *
+ *
* @param conn closed HTTP connection.
*/
void closed(NHttpClientConnection conn);
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientIOTarget.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientIOTarget.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientIOTarget.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpClientIOTarget.java Fri Apr 23 19:11:53 2010
@@ -30,26 +30,26 @@ package org.apache.http.nio;
import org.apache.http.nio.reactor.IOEventDispatch;
/**
- * Extended version of the {@link NHttpClientConnection} used by
- * {@link IOEventDispatch} implementations to inform client-side connection
+ * Extended version of the {@link NHttpClientConnection} used by
+ * {@link IOEventDispatch} implementations to inform client-side connection
* objects of I/O events.
- *
+ *
* @since 4.0
*/
public interface NHttpClientIOTarget extends NHttpClientConnection {
-
+
/**
* Triggered when the connection is ready to consume input.
- *
+ *
* @param handler the client protocol handler.
*/
void consumeInput(NHttpClientHandler handler);
-
+
/**
* Triggered when the connection is ready to produce output.
- *
+ *
* @param handler the client protocol handler.
*/
- void produceOutput(NHttpClientHandler handler);
+ void produceOutput(NHttpClientHandler handler);
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpConnection.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpConnection.java Fri Apr 23 19:11:53 2010
@@ -33,17 +33,17 @@ import org.apache.http.HttpResponse;
import org.apache.http.protocol.HttpContext;
/**
- * Abstract non-blocking HTTP connection interface. Each connection contains an
- * HTTP execution context, which can be used to maintain a processing state,
- * as well as the actual {@link HttpRequest} and {@link HttpResponse} that are
- * being transmitted over this connection. Both the request and
- * the response objects can be <code>null</code> if there is no incoming or
+ * Abstract non-blocking HTTP connection interface. Each connection contains an
+ * HTTP execution context, which can be used to maintain a processing state,
+ * as well as the actual {@link HttpRequest} and {@link HttpResponse} that are
+ * being transmitted over this connection. Both the request and
+ * the response objects can be <code>null</code> if there is no incoming or
* outgoing message currently being transferred.
* <p>
- * Please note non-blocking HTTP connections are stateful and not thread safe.
- * Input / output operations on non-blocking HTTP connections should be
+ * Please note non-blocking HTTP connections are stateful and not thread safe.
+ * Input / output operations on non-blocking HTTP connections should be
* restricted to the dispatch events triggered by the I/O event dispatch thread.
- * However, the {@link IOControl} interface is fully threading safe and can be
+ * However, the {@link IOControl} interface is fully threading safe and can be
* manipulated from any thread.
*
* @since 4.0
@@ -53,40 +53,40 @@ public interface NHttpConnection extends
public static final int ACTIVE = 0;
public static final int CLOSING = 1;
public static final int CLOSED = 2;
-
+
/**
* Returns status of the connection:
* <p>
* {@link #ACTIVE}: connection is active.
- * <p>
+ * <p>
* {@link #CLOSING}: connection is being closed.
- * <p>
+ * <p>
* {@link #CLOSED}: connection has been closed.
- *
+ *
* @return connection status.
*/
int getStatus();
-
- /**
+
+ /**
* Returns the current HTTP request if one is being received / transmitted.
* Otherwise returns <code>null</code>.
- *
+ *
* @return HTTP request, if available, <code>null</code> otherwise.
*/
HttpRequest getHttpRequest();
- /**
- * Returns the current HTTP response if one is being received / transmitted.
+ /**
+ * Returns the current HTTP response if one is being received / transmitted.
* Otherwise returns <tt>null</tt>.
- *
+ *
* @return HTTP response, if available, <code>null</code> otherwise.
*/
HttpResponse getHttpResponse();
-
+
/**
* Returns an HTTP execution context associated with this connection.
* @return HTTP context
*/
HttpContext getContext();
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageParser.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageParser.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageParser.java Fri Apr 23 19:11:53 2010
@@ -35,33 +35,33 @@ import org.apache.http.HttpMessage;
/**
* Abstract HTTP message parser for non-blocking connections.
- *
+ *
* @since 4.0
*/
public interface NHttpMessageParser<T extends HttpMessage> {
-
+
/**
- * Resets the parser. The parser will be ready to start parsing another
+ * Resets the parser. The parser will be ready to start parsing another
* HTTP message.
*/
void reset();
-
+
/**
- * Fills the internal buffer of the parser with input data from the
+ * Fills the internal buffer of the parser with input data from the
* given {@link ReadableByteChannel}.
- *
+ *
* @param channel the input channel
* @return number of bytes read.
* @throws IOException in case of an I/O error.
*/
- int fillBuffer(ReadableByteChannel channel)
- throws IOException;
+ int fillBuffer(ReadableByteChannel channel)
+ throws IOException;
/**
- * Attempts to parse a complete message head from the content of the
+ * Attempts to parse a complete message head from the content of the
* internal buffer. If the message in the input buffer is incomplete
- * this method will return <code>null</code>.
- *
+ * this method will return <code>null</code>.
+ *
* @return HTTP message head, if available, <code>null</code> otherwise.
* @throws IOException in case of an I/O error.
* @throws HttpException in case the HTTP message is malformed or
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageWriter.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageWriter.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageWriter.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpMessageWriter.java Fri Apr 23 19:11:53 2010
@@ -34,25 +34,25 @@ import org.apache.http.HttpMessage;
/**
* Abstract HTTP message writer for non-blocking connections.
- *
+ *
* @since 4.0
*/
public interface NHttpMessageWriter<T extends HttpMessage> {
-
+
/**
- * Resets the writer. The writer will be ready to start serializing another
+ * Resets the writer. The writer will be ready to start serializing another
* HTTP message.
*/
void reset();
-
+
/**
* Serializes out the HTTP message head.
- *
+ *
* @param message HTTP message.
* @throws IOException in case of an I/O error.
* @throws HttpException in case the HTTP message is malformed or
* violates the HTTP protocol.
*/
void write(T message) throws IOException, HttpException;
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerConnection.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerConnection.java Fri Apr 23 19:11:53 2010
@@ -33,9 +33,9 @@ import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
/**
- * Abstract non-blocking server-side HTTP connection interface. It can be used
- * to receive HTTP requests and asynchronously submit HTTP responses.
- *
+ * Abstract non-blocking server-side HTTP connection interface. It can be used
+ * to receive HTTP requests and asynchronously submit HTTP responses.
+ *
* @see NHttpConnection
*
* @since 4.0
@@ -44,33 +44,33 @@ public interface NHttpServerConnection e
/**
* Submits {link @HttpResponse} to be sent to the client.
- *
+ *
* @param response HTTP response
- *
+ *
* @throws IOException if I/O error occurs while submitting the response
* @throws HttpException if the HTTP response violates the HTTP protocol.
*/
void submitResponse(HttpResponse response) throws IOException, HttpException;
/**
- * Returns <code>true</code> if an HTTP response has been submitted to the
+ * Returns <code>true</code> if an HTTP response has been submitted to the
* client.
- *
- * @return <code>true</code> if an HTTP response has been submitted,
- * <code>false</code> otherwise.
+ *
+ * @return <code>true</code> if an HTTP response has been submitted,
+ * <code>false</code> otherwise.
*/
boolean isResponseSubmitted();
-
+
/**
* Resets output state. This method can be used to prematurely terminate
- * processing of the incoming HTTP request.
+ * processing of the incoming HTTP request.
*/
void resetInput();
-
+
/**
- * Resets input state. This method can be used to prematurely terminate
+ * Resets input state. This method can be used to prematurely terminate
* processing of the outgoing HTTP response.
*/
void resetOutput();
-
+
}
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerIOTarget.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerIOTarget.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerIOTarget.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/NHttpServerIOTarget.java Fri Apr 23 19:11:53 2010
@@ -30,26 +30,26 @@ package org.apache.http.nio;
import org.apache.http.nio.reactor.IOEventDispatch;
/**
- * Extended version of the {@link NHttpServerConnection} used by
- * {@link IOEventDispatch} implementations to inform server-side connection
+ * Extended version of the {@link NHttpServerConnection} used by
+ * {@link IOEventDispatch} implementations to inform server-side connection
* objects of I/O events.
- *
+ *
* @since 4.0
*/
public interface NHttpServerIOTarget extends NHttpServerConnection {
-
+
/**
* Triggered when the connection is ready to consume input.
- *
+ *
* @param handler the server protocol handler.
*/
void consumeInput(NHttpServiceHandler handler);
-
+
/**
* Triggered when the connection is ready to produce output.
- *
+ *
* @param handler the server protocol handler.
*/
- void produceOutput(NHttpServiceHandler handler);
+ void produceOutput(NHttpServiceHandler handler);
}