Author: markt Date: Wed Jun 12 10:31:29 2013 New Revision: 1492136 URL: http://svn.apache.org/r1492136 Log: Add some Javadoc for non-blocking IO on the request.
Modified: tomcat/trunk/java/javax/servlet/ReadListener.java tomcat/trunk/java/javax/servlet/ServletInputStream.java Modified: tomcat/trunk/java/javax/servlet/ReadListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ReadListener.java?rev=1492136&r1=1492135&r2=1492136&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/ReadListener.java (original) +++ tomcat/trunk/java/javax/servlet/ReadListener.java Wed Jun 12 10:31:29 2013 @@ -19,11 +19,34 @@ package javax.servlet; import java.io.IOException; /** - * TODO SERVLET 3.1 + * Receives notification of read events when using the non-blocking IO. * + * @since Servlet 3.1 */ public interface ReadListener extends java.util.EventListener{ + + /** + * Invoked when data is available to read. The container will invoke this + * method the first time for a request as soon as there is data to read. + * Subsequent invocations will only if a call to + * {@link ServletInputStream#isReady()} has returned false and data has + * subsequently become available to read. + * + * @throws IOException + */ public abstract void onDataAvailable() throws IOException; + + /** + * Invoked when the request bdy has been fully read. + * + * @throws IOException + */ public abstract void onAllDataRead() throws IOException; + + /** + * Invoked if an error occurs while reading the request body. + * + * @param throwable The exception that occurred + */ public abstract void onError(java.lang.Throwable throwable); } Modified: tomcat/trunk/java/javax/servlet/ServletInputStream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletInputStream.java?rev=1492136&r1=1492135&r2=1492136&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/ServletInputStream.java (original) +++ tomcat/trunk/java/javax/servlet/ServletInputStream.java Wed Jun 12 10:31:29 2013 @@ -85,6 +85,8 @@ public abstract class ServletInputStream /** * Returns <code>true</code> if all the data has been read from the stream, * else <code>false</code>. + * + * @since Servlet 3.1 */ public abstract boolean isFinished(); @@ -93,6 +95,8 @@ public abstract class ServletInputStream * <code>false</code>. If this method is called and returns false, the * container will invoke {@link ReadListener#onDataAvailable()} when data is * available. + * + * @since Servlet 3.1 */ public abstract boolean isReady(); @@ -108,6 +112,8 @@ public abstract class ServletInputStream * if the {@link ReadListener} has already * been set * @throws NullPointerException If listener is null + * + * @since Servlet 3.1 */ public abstract void setReadListener(ReadListener listener); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org