This is an automated email from the ASF dual-hosted git repository. isapir pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new d6e5d83 Added Javadoc comments for Java 15 d6e5d83 is described below commit d6e5d838a9565c0c4bfeca4396e6266d21a80288 Author: Igal Sapir <isa...@apache.org> AuthorDate: Sat Oct 10 21:19:03 2020 -0700 Added Javadoc comments for Java 15 --- java/jakarta/servlet/AsyncContext.java | 64 ++++++++++++++++++++++++++++++- java/jakarta/servlet/GenericFilter.java | 2 +- java/jakarta/servlet/http/HttpFilter.java | 5 +++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/java/jakarta/servlet/AsyncContext.java b/java/jakarta/servlet/AsyncContext.java index 31d5ca5..252dd96 100644 --- a/java/jakarta/servlet/AsyncContext.java +++ b/java/jakarta/servlet/AsyncContext.java @@ -17,27 +17,61 @@ package jakarta.servlet; /** - * TODO SERVLET3 - Add comments + * Provides the context for asynchronous request handling + * * @since Servlet 3.0 */ public interface AsyncContext { + + /** + * The attribute name for the URI of the async request + */ public static final String ASYNC_REQUEST_URI = "jakarta.servlet.async.request_uri"; + + /** + * The attribute name for the Context Path of the async request + */ public static final String ASYNC_CONTEXT_PATH = "jakarta.servlet.async.context_path"; + + /** + * The attribute name for the Mapping of the async request + */ public static final String ASYNC_MAPPING = "jakarta.servlet.async.mapping"; + + /** + * The attribute name for the Path Info of the async request + */ public static final String ASYNC_PATH_INFO = "jakarta.servlet.async.path_info"; + + /** + * The attribute name for the Servlet Path of the async request + */ public static final String ASYNC_SERVLET_PATH = "jakarta.servlet.async.servlet_path"; + + /** + * The attribute name for the Query String of the async request + */ public static final String ASYNC_QUERY_STRING = "jakarta.servlet.async.query_string"; + /** + * @return a reference to the ServletRequest object + */ ServletRequest getRequest(); + /** + * @return a reference to the ServletResponse object + */ ServletResponse getResponse(); + /** + * @return true if the Request and Response are the original ones + */ boolean hasOriginalRequestAndResponse(); /** @@ -79,15 +113,43 @@ public interface AsyncContext { */ void dispatch(ServletContext context, String path); + /** + * Completes the async request processing and closes the response stream + */ void complete(); + /** + * Starts a new thread to process the asynchronous request + * + * @param run a Runnable that the new thread will run + */ void start(Runnable run); + /** + * Adds an event listener that will be called for different AsyncEvents fire + * + * @param listener an AsyncListener that will be called with AsyncEvent objects + */ void addListener(AsyncListener listener); + /** + * Adds an event listener that will be called when different AsyncEvents fire + * + * @param listener an AsyncListener that will be called with AsyncEvent objects + * @param request the ServletRequest that will be passed with the AsyncEvent + * @param response the ServletResponse that will be passed with the AsyncEvent + */ void addListener(AsyncListener listener, ServletRequest request, ServletResponse response); + /** + * Creates and returns an AsyncListener object + * + * @param <T> + * @param clazz + * @return the newly created AsyncListener object + * @throws ServletException + */ <T extends AsyncListener> T createListener(Class<T> clazz) throws ServletException; diff --git a/java/jakarta/servlet/GenericFilter.java b/java/jakarta/servlet/GenericFilter.java index f2585d0..210c225 100644 --- a/java/jakarta/servlet/GenericFilter.java +++ b/java/jakarta/servlet/GenericFilter.java @@ -20,7 +20,7 @@ import java.io.Serializable; import java.util.Enumeration; /** - * Provides a base class the implements the Filter and FilterConfig interfaces + * Provides a base class that implements the Filter and FilterConfig interfaces * to reduce boilerplate when writing new filters. * * @see jakarta.servlet.Filter diff --git a/java/jakarta/servlet/http/HttpFilter.java b/java/jakarta/servlet/http/HttpFilter.java index 2cc08df..7124cd6 100644 --- a/java/jakarta/servlet/http/HttpFilter.java +++ b/java/jakarta/servlet/http/HttpFilter.java @@ -24,6 +24,11 @@ import jakarta.servlet.ServletException; import jakarta.servlet.ServletRequest; import jakarta.servlet.ServletResponse; +/** + * Provides a base class that implements the Filter interface and ensures + * that the Request and Response are of type HttpServletRequest and + * HttpServletResponse respectively. + */ public abstract class HttpFilter extends GenericFilter { private static final long serialVersionUID = 1L; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org