tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r827435 - in /tomcat/trunk: java/javax/servlet/ java/javax/servlet/annotation/ java/javax/servlet/descriptor/ java/javax/servlet/http/ java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/jasper/servlet/ webapp...
Date Tue, 20 Oct 2009 13:42:01 GMT
Author: markt
Date: Tue Oct 20 13:41:59 2009
New Revision: 827435

URL: http://svn.apache.org/viewvc?rev=827435&view=rev
Log:
Update spec classes for latest Servlet 3.0 API as of 2009-10-15.
Update internals so Tomcat builds with the updated spec. Lots if stubbed impl marked with TODO.

Added:
    tomcat/trunk/java/javax/servlet/HttpConstraintElement.java
    tomcat/trunk/java/javax/servlet/HttpMethodConstraintElement.java
    tomcat/trunk/java/javax/servlet/MultipartConfigElement.java
    tomcat/trunk/java/javax/servlet/ServletSecurityElement.java
    tomcat/trunk/java/javax/servlet/annotation/HttpConstraint.java
    tomcat/trunk/java/javax/servlet/annotation/HttpMethodConstraint.java
    tomcat/trunk/java/javax/servlet/annotation/ServletSecurity.java
    tomcat/trunk/java/javax/servlet/descriptor/
    tomcat/trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java
    tomcat/trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java
    tomcat/trunk/java/javax/servlet/descriptor/TaglibDescriptor.java
Modified:
    tomcat/trunk/java/javax/servlet/AsyncContext.java
    tomcat/trunk/java/javax/servlet/AsyncEvent.java
    tomcat/trunk/java/javax/servlet/AsyncListener.java
    tomcat/trunk/java/javax/servlet/DispatcherType.java
    tomcat/trunk/java/javax/servlet/FilterRegistration.java
    tomcat/trunk/java/javax/servlet/LocalStrings.properties
    tomcat/trunk/java/javax/servlet/Registration.java
    tomcat/trunk/java/javax/servlet/ServletContainerInitializer.java
    tomcat/trunk/java/javax/servlet/ServletContext.java
    tomcat/trunk/java/javax/servlet/ServletOutputStream.java
    tomcat/trunk/java/javax/servlet/ServletRegistration.java
    tomcat/trunk/java/javax/servlet/ServletRequest.java
    tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java
    tomcat/trunk/java/javax/servlet/annotation/HandlesTypes.java
    tomcat/trunk/java/javax/servlet/annotation/MultipartConfig.java
    tomcat/trunk/java/javax/servlet/annotation/WebFilter.java
    tomcat/trunk/java/javax/servlet/annotation/WebInitParam.java
    tomcat/trunk/java/javax/servlet/annotation/WebListener.java
    tomcat/trunk/java/javax/servlet/annotation/WebServlet.java
    tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
    tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
    tomcat/trunk/java/javax/servlet/http/HttpServletResponse.java
    tomcat/trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
    tomcat/trunk/java/javax/servlet/http/Part.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
    tomcat/trunk/java/org/apache/catalina/connector/Response.java
    tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
    tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
    tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java
    tomcat/trunk/java/org/apache/catalina/core/DummyResponse.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async1.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async2.java
    tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async3.java

Modified: tomcat/trunk/java/javax/servlet/AsyncContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/AsyncContext.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/AsyncContext.java (original)
+++ tomcat/trunk/java/javax/servlet/AsyncContext.java Tue Oct 20 13:41:59 2009
@@ -64,7 +64,15 @@
     
     void start(Runnable run);
     
-    public long getAsyncTimeout();
+    void addListener(AsyncListener listener);
     
-    public void setAsyncTimeout(long timeout);
+    void addListener(AsyncListener listener, ServletRequest request,
+            ServletResponse response);
+    
+    <T extends AsyncListener> T createListener(Class<T> clazz)
+    throws ServletException;
+    
+    long getTimeout();
+    
+    void setTimeout(long timeout);
 }

Modified: tomcat/trunk/java/javax/servlet/AsyncEvent.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/AsyncEvent.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/AsyncEvent.java (original)
+++ tomcat/trunk/java/javax/servlet/AsyncEvent.java Tue Oct 20 13:41:59 2009
@@ -18,23 +18,51 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 public class AsyncEvent {
+    private AsyncContext context;
     private ServletRequest request;
     private ServletResponse response;
+    private Throwable throwable;
     
-    public AsyncEvent(ServletRequest request, ServletResponse response) {
+    public AsyncEvent(AsyncContext context) {
+        this.context = context;
+    }
+
+    public AsyncEvent(AsyncContext context, ServletRequest request,
+            ServletResponse response) {
+        this.context = context;
+        this.request = request;
+        this.response = response;
+    }
+    
+    public AsyncEvent(AsyncContext context, Throwable throwable) {
+        this.context = context;
+        this.throwable = throwable;
+    }
+
+    public AsyncEvent(AsyncContext context, ServletRequest request,
+            ServletResponse response, Throwable throwable) {
+        this.context = context;
         this.request = request;
         this.response = response;
+        this.throwable = throwable;
     }
     
-    public ServletRequest getRequest() {
+    public AsyncContext getAsyncContext() {
+        return context;
+    }
+
+    public ServletRequest getSuppliedRequest() {
         return request;
     }
     
-    public ServletResponse getResponse() {
+    public ServletResponse getSuppliedResponse() {
         return response;
     }
+    
+    public Throwable getThrowable() {
+        return throwable;
+    }
 }

Modified: tomcat/trunk/java/javax/servlet/AsyncListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/AsyncListener.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/AsyncListener.java (original)
+++ tomcat/trunk/java/javax/servlet/AsyncListener.java Tue Oct 20 13:41:59 2009
@@ -28,4 +28,5 @@
     void onComplete(AsyncEvent event) throws IOException;
     void onTimeout(AsyncEvent event) throws IOException;
     void onError(AsyncEvent event) throws IOException;
+    void onStartAsync(AsyncEvent event) throws IOException;
 }

Modified: tomcat/trunk/java/javax/servlet/DispatcherType.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/DispatcherType.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/DispatcherType.java (original)
+++ tomcat/trunk/java/javax/servlet/DispatcherType.java Tue Oct 20 13:41:59 2009
@@ -18,7 +18,6 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  */
 public enum DispatcherType {
     FORWARD,

Modified: tomcat/trunk/java/javax/servlet/FilterRegistration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/FilterRegistration.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/FilterRegistration.java (original)
+++ tomcat/trunk/java/javax/servlet/FilterRegistration.java Tue Oct 20 13:41:59 2009
@@ -16,11 +16,11 @@
 */
 package javax.servlet;
 
+import java.util.Collection;
 import java.util.EnumSet;
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 public interface FilterRegistration extends Registration {
@@ -36,6 +36,11 @@
     public void addMappingForServletNames(
             EnumSet<DispatcherType> dispatcherTypes,
             boolean isMatchAfter, String... servletNames);
+    /**
+     * 
+     * @return
+     */
+    public Collection<String> getServletNameMappings();
     
     /**
      * 
@@ -49,7 +54,14 @@
             EnumSet<DispatcherType> dispatcherTypes,
             boolean isMatchAfter, String... urlPatterns);
 
+    /**
+     * 
+     * @return
+     */
+    public Collection<String> getUrlPatternMappings();
+    
     public static interface Dynamic
     extends FilterRegistration, Registration.Dynamic {
+        // No additional methods
     }
 }

Added: tomcat/trunk/java/javax/servlet/HttpConstraintElement.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/HttpConstraintElement.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/HttpConstraintElement.java (added)
+++ tomcat/trunk/java/javax/servlet/HttpConstraintElement.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,92 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.servlet;
+
+import java.util.ResourceBundle;
+
+import javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic;
+import javax.servlet.annotation.ServletSecurity.TransportGuarantee;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public class HttpConstraintElement {
+    
+    private static final String LSTRING_FILE = "javax.servlet.LocalStrings";
+    protected static final ResourceBundle lStrings =
+        ResourceBundle.getBundle(LSTRING_FILE);
+
+    private EmptyRoleSemantic emptyRoleSemantic = EmptyRoleSemantic.PERMIT;
+    private TransportGuarantee transportGuarantee = TransportGuarantee.NONE;
+    private String[] rolesAllowed = new String[0];
+    
+    /**
+     * Default constraint is permit with no transport guarantee.
+     */
+    public HttpConstraintElement() {
+        // Default constructor
+    }
+    
+    /**
+     * Convenience constructor for {@link EmptyRoleSemantic.DENY}.
+     * 
+     */
+    public HttpConstraintElement(EmptyRoleSemantic emptyRoleSemantic) {
+        this.emptyRoleSemantic = emptyRoleSemantic;
+    }
+    
+    /**
+     * Convenience constructor to specify transport guarantee and/or roles.
+     */
+    public HttpConstraintElement(TransportGuarantee transportGuarantee,
+            String... rolesAllowed) {
+        this.transportGuarantee = transportGuarantee;
+        this.rolesAllowed = rolesAllowed;
+    }
+
+    /**
+     * 
+     * @param emptyRoleSemantic
+     * @param transportGuarantee
+     * @param rolesAllowed
+     * @throws IllegalArgumentException if roles are specified when DENY is used
+     */
+    public HttpConstraintElement(EmptyRoleSemantic emptyRoleSemantic,
+            TransportGuarantee transportGuarantee, String... rolesAllowed) {
+        if (rolesAllowed != null && rolesAllowed.length > 0 &&
+                EmptyRoleSemantic.DENY.equals(emptyRoleSemantic)) {
+            throw new IllegalArgumentException(lStrings.getString(
+                    "httpConstraintElement.invalidRolesDeny"));
+        }
+        this.emptyRoleSemantic = emptyRoleSemantic;
+        this.transportGuarantee = transportGuarantee;
+        this.rolesAllowed = rolesAllowed;
+    }
+    
+    public EmptyRoleSemantic getEmptyRoleSemantic() {
+        return emptyRoleSemantic;
+    }
+    
+    public TransportGuarantee getTransportGuarantee() {
+        return transportGuarantee;
+    }
+    
+    public String[] getRolesAllowed() {
+        return rolesAllowed;
+    }
+}
\ No newline at end of file

Added: tomcat/trunk/java/javax/servlet/HttpMethodConstraintElement.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/HttpMethodConstraintElement.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/HttpMethodConstraintElement.java (added)
+++ tomcat/trunk/java/javax/servlet/HttpMethodConstraintElement.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,50 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.servlet;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public class HttpMethodConstraintElement extends HttpConstraintElement {
+    
+    private String methodName;
+
+    public HttpMethodConstraintElement(String methodName) {
+        if (methodName == null || methodName.length() == 0) {
+            throw new IllegalArgumentException(lStrings.getString(
+                    "httpMethodConstraintElement.invalidMethod"));
+        }
+        this.methodName = methodName;
+    }
+    
+    public HttpMethodConstraintElement(String methodName,
+            HttpConstraintElement constraint) {
+        super(constraint.getEmptyRoleSemantic(),
+                constraint.getTransportGuarantee(),
+                constraint.getRolesAllowed());
+        if (methodName == null || methodName.length() == 0) {
+            throw new IllegalArgumentException(lStrings.getString(
+                    "httpMethodConstraintElement.invalidMethod"));
+        }
+        this.methodName = methodName;
+    }
+    
+    public String getMethodName() {
+        return methodName;
+    }
+}
\ No newline at end of file

Modified: tomcat/trunk/java/javax/servlet/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/LocalStrings.properties?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/LocalStrings.properties (original)
+++ tomcat/trunk/java/javax/servlet/LocalStrings.properties Tue Oct 20 13:41:59 2009
@@ -19,3 +19,6 @@
 err.not_iso8859_1=Not an ISO 8859-1 character: {0}
 value.true=true
 value.false=false
+
+httpConstraintElement.invalidRolesDeny=Roles may not be specified when using DENY
+httpMethodConstraintElement.invalidMethod=Invalid HTTP method
\ No newline at end of file

Added: tomcat/trunk/java/javax/servlet/MultipartConfigElement.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/MultipartConfigElement.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/MultipartConfigElement.java (added)
+++ tomcat/trunk/java/javax/servlet/MultipartConfigElement.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,72 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package javax.servlet;
+
+import javax.servlet.annotation.MultipartConfig;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public class MultipartConfigElement {
+    
+    private String location = "";
+    private long maxFileSize = -1;
+    private long maxRequestSize = -1;
+    private int fileSizeThreshold = 0;
+    
+    public MultipartConfigElement(String location) {
+        // Keep empty string default if location is null
+        if (location != null) {
+            this.location = location;
+        }
+    }
+    
+    public MultipartConfigElement(String location, long maxFileSize,
+            long maxRequestSize, int fileSizeThreshold) {
+        // Keep empty string default if location is null
+        if (location != null) {
+            this.location = location;
+        }
+        this.maxFileSize = maxFileSize;
+        this.maxRequestSize = maxRequestSize;
+        this.fileSizeThreshold = fileSizeThreshold;
+    }
+    
+    public MultipartConfigElement(MultipartConfig annotation) {
+        location = annotation.location();
+        maxFileSize = annotation.maxFileSize();
+        maxRequestSize = annotation.maxRequestSize();
+        fileSizeThreshold = annotation.fileSizeThreshold();
+    }
+    
+    public String getLocation() {
+        return location;
+    }
+    
+    public long getMaxFileSize() {
+        return maxFileSize;
+    }
+    
+    public long getMaxRequestSize() {
+        return maxRequestSize;
+    }
+    
+    public int getFileSizeThreshold() {
+        return fileSizeThreshold;
+    }
+}
\ No newline at end of file

Modified: tomcat/trunk/java/javax/servlet/Registration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/Registration.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/Registration.java (original)
+++ tomcat/trunk/java/javax/servlet/Registration.java Tue Oct 20 13:41:59 2009
@@ -26,18 +26,40 @@
  */
 public interface Registration {
     
-    public boolean setInitParameter(String name, String value)
-    throws IllegalArgumentException, IllegalStateException;
+    public String getName();
+    
+    public String getClassName();
 
-    public Set<String> setInitParameters(Map<String,String> initParameters)
-    throws IllegalArgumentException, IllegalStateException;
+    /**
+     * 
+     * @param name
+     * @param value
+     * @return
+     * @throws IllegalArgumentException
+     * @throws IllegalStateException
+     */
+    public boolean setInitParameter(String name, String value);
 
-    public interface Dynamic {
-        
-        public void setDescription(String description)
-        throws IllegalStateException;
+    public String getInitParameter(String name);
+    
+    /**
+     * 
+     * @param initParameters
+     * @return
+     * @throws IllegalArgumentException
+     * @throws IllegalStateException
+     */
+    public Set<String> setInitParameters(Map<String,String> initParameters);
+
+    public Map<String, String> getInitParameters();
+
+    public interface Dynamic extends Registration {
         
-        public void setAsyncSupported(boolean isAsyncSupported)
-        throws IllegalStateException;
+        /**
+         * 
+         * @param isAsyncSupported
+         * @throws IllegalStateException
+         */
+        public void setAsyncSupported(boolean isAsyncSupported);
     }
 }

Modified: tomcat/trunk/java/javax/servlet/ServletContainerInitializer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletContainerInitializer.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletContainerInitializer.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletContainerInitializer.java Tue Oct 20 13:41:59 2009
@@ -16,12 +16,21 @@
 */
 package javax.servlet;
 
+import java.util.Set;
+
 /**
  * @since Servlet 3.0
  * $Id$
  * TODO SERVLET3 - Add comments
  */
 public interface ServletContainerInitializer {
-    public void onStartup(java.util.Set<java.lang.Class<?>> c,
-            ServletContext ctx);
+    
+    /**
+     * 
+     * @param c
+     * @param ctx
+     * @throws ServletException
+     */
+    public void onStartup(Set<java.lang.Class<?>> c, ServletContext ctx)
+    throws ServletException;
 }

Modified: tomcat/trunk/java/javax/servlet/ServletContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletContext.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletContext.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletContext.java Tue Oct 20 13:41:59 2009
@@ -21,8 +21,12 @@
 import java.net.URL;
 import java.util.EnumSet;
 import java.util.Enumeration;
+import java.util.EventListener;
+import java.util.Map;
 import java.util.Set;
 
+import javax.servlet.descriptor.JspConfigDescriptor;
+
 /**
  * 
  * Defines a set of methods that a servlet uses to communicate with its
@@ -56,6 +60,12 @@
 public interface ServletContext {
 
     public static final String TEMPDIR = "javax.servlet.context.tempdir";
+    
+    /**
+     * @since Servlet 3.0
+     */
+    public static final String ORDERED_LIBS =
+        "javax.servlet.context.orderedLibs";
 
     /**
      * Returns a <code>ServletContext</code> object that 
@@ -114,7 +124,23 @@
 
     public int getMinorVersion();
     
+    /**
+     * 
+     * @return
+     * @throws UnsupportedOperationException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public int getEffectiveMajorVersion();
     
+    /**
+     * 
+     * @return
+     * @throws UnsupportedOperationException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public int getEffectiveMinorVersion();
 
     /**
      * Returns the MIME type of the specified file, or <code>null</code> if 
@@ -532,6 +558,7 @@
      * @param value
      * @return
      * @throws IllegalStateException
+     * @throws UnsupportedOperationException
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
@@ -710,10 +737,21 @@
      * 
      * @param servletName
      * @return
+     * @throws UnsupportedOperationException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public ServletRegistration getServletRegistration(String servletName);
+    
+    
+    /**
+     * 
+     * @return
+     * @throws UnsupportedOperationException
      * @since Servlet 3.0 
      * TODO SERVLET3 - Add comments
      */
-    public ServletRegistration findServletRegistration(String servletName);
+    public Map<String, ? extends ServletRegistration> getServletRegistrations();
 
 
     /**
@@ -774,15 +812,25 @@
      * 
      * @param filterName
      * @return
+     * @throws UnsupportedOperationException
      * @since Servlet 3.0 
      * TODO SERVLET3 - Add comments
      */
-    public FilterRegistration findFilterRegistration(String filterName);
+    public FilterRegistration getFilterRegistration(String filterName);
 
+    /**
+     * 
+     * @return
+     * @throws UnsupportedOperationException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations();
 
     /**
      * 
      * @return
+     * @throws UnsupportedOperationException
      * @since Servlet 3.0 
      * TODO SERVLET3 - Add comments
      */
@@ -797,6 +845,7 @@
      *                                  {@link SessionTrackingMode}
      * @throws IllegalStateException    If the context has already been
      *                                  initialised
+     * @throws UnsupportedOperationException
      * @since Servlet 3.0 
      * TODO SERVLET3 - Add comments
      */
@@ -810,14 +859,80 @@
      * @since Servlet 3.0 
      * TODO SERVLET3 - Add comments
      */
-    public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes();
+    public Set<SessionTrackingMode> getDefaultSessionTrackingModes();
+    
+    /**
+     * 
+     * @return
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public Set<SessionTrackingMode> getEffectiveSessionTrackingModes();
+    
+    /**
+     * 
+     * @param listenerClass
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public void addListener(Class <? extends EventListener> listenerClass);
+    
+    /**
+     * 
+     * @param className
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public void addListener(String className);
+
+    /**
+     * 
+     * @param <T>
+     * @param t
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public <T extends EventListener> void addListener(T t);
+    
+    /**
+     * 
+     * @param <T>
+     * @param c
+     * @return
+     * @throws ServletException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public <T extends EventListener> T createListener(Class<T> c)
+    throws ServletException;
+    
+    /**
+     * 
+     * @param roleNames
+     * @throws UnsupportedOperationException
+     * @throws IllegalArgumentException
+     * @throws IllegalStateException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public void declareRoles(String... roleNames);
     
     /**
      * 
      * @return
+     * @throws UnsupportedOperationException
+     * @throws SecurityException
      * @since Servlet 3.0 
      * TODO SERVLET3 - Add comments
      */
-    public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes();
+    public ClassLoader getClassLoader();
     
+    /**
+     * 
+     * @return
+     * @throws UnsupportedOperationException
+     * @since Servlet 3.0 
+     * TODO SERVLET3 - Add comments
+     */
+    public JspConfigDescriptor getJspConfigDescriptor();
 }

Modified: tomcat/trunk/java/javax/servlet/ServletOutputStream.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletOutputStream.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletOutputStream.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletOutputStream.java Tue Oct 20 13:41:59 2009
@@ -43,8 +43,8 @@
 public abstract class ServletOutputStream extends OutputStream {
 
     private static final String LSTRING_FILE = "javax.servlet.LocalStrings";
-    private static ResourceBundle lStrings =
-	ResourceBundle.getBundle(LSTRING_FILE);
+    private static final ResourceBundle lStrings =
+        ResourceBundle.getBundle(LSTRING_FILE);
 
 
     

Modified: tomcat/trunk/java/javax/servlet/ServletRegistration.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRegistration.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletRegistration.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletRegistration.java Tue Oct 20 13:41:59 2009
@@ -16,6 +16,7 @@
 */
 package javax.servlet;
 
+import java.util.Collection;
 import java.util.Set;
 
 /**
@@ -33,10 +34,17 @@
      * @throws IllegalStateException if the associated ServletContext has
      *                                  already been initialised
      */
-    public Set<String> addMapping(String... urlPatterns); 
+    public Set<String> addMapping(String... urlPatterns);
+    
+    public Collection<String> getMappings();
+    
+    public String getRunAsRole();
     
     public static interface Dynamic
     extends ServletRegistration, Registration.Dynamic {
-        
+        public void setLoadOnStartup(int loadOnStartup);
+        public void setMultipartConfig(MultipartConfigElement multipartConfig);
+        public void setRunAsRole(String roleName);
+        public Set<String> setServletSecurity(ServletSecurityElement constraint);
     }
 }

Modified: tomcat/trunk/java/javax/servlet/ServletRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequest.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletRequest.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletRequest.java Tue Oct 20 13:41:59 2009
@@ -651,44 +651,6 @@
 
     /**
      * 
-     * @param listener
-     * @since Servlet 3.0
-     * TODO SERVLET3 - Add comments
-     */
-    public void addAsyncListener(AsyncListener listener);
-
-    /**
-     * 
-     * @param listener
-     * @param servletRequest
-     * @param servletResponse
-     * @since Servlet 3.0
-     * TODO SERVLET3 - Add comments
-     */
-    public void addAsyncListener(AsyncListener listener,
-            ServletRequest servletRequest, ServletResponse servletResponse);
-    
-    /**
-     * 
-     * @param timeout
-     * @throws java.lang.IllegalStateException
-     * @since Servlet 3.0
-     * TODO SERVLET3 - Add comments
-     */
-    public void setAsyncTimeout(long timeout);
-    
-    
-    /**
-     * 
-     * @return
-     * @since Servlet 3.0
-     * TODO SERVLET3 - Add comments
-     */
-    public long getAsyncTimeout();
-
-    
-    /**
-     * 
      * @return
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments

Modified: tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java Tue Oct 20 13:41:59 2009
@@ -471,53 +471,6 @@
     }
 
     /**
-     * The default behavior of this method is to call
-     * addAsyncListener(AsyncListener) on the wrapped request object.
-     * 
-     * @param listener
-     * @since Servlet 3.0
-     */
-    public void addAsyncListener(AsyncListener listener) {
-        request.addAsyncListener(listener);
-    }
-    
-    /**
-     * The default behavior of this method is to call
-     * addAsyncListener(AsyncListener, ServletRequest, ServletResponse) on the
-     * wrapped request object.
-     * 
-     * @param listener
-     * @param servletRequest
-     * @param servletResponse
-     * @since Servlet 3.0
-     */
-    public void addAsyncListener(AsyncListener listener,
-            ServletRequest servletRequest, ServletResponse servletResponse) {
-        request.addAsyncListener(listener, servletRequest, servletResponse);
-    }
-    
-    /**
-     * The default behavior of this method is to call
-     * setAsyncTimeout(long) on the wrapped request object.
-     * 
-     * @param listener
-     * @since Servlet 3.0
-     */
-    public void setAsyncTimeout(long timeout) {
-        request.setAsyncTimeout(timeout);
-    }
-    
-    /**
-     * The default behavior of this method is to call
-     * getAsyncTimeout() on the wrapped request object.
-     * 
-     * @since Servlet 3.0
-     */
-    public long getAsyncTimeout() {
-        return request.getAsyncTimeout();
-    }
-    
-    /**
      * 
      * @param wrapped
      * @since Servlet 3.0

Added: tomcat/trunk/java/javax/servlet/ServletSecurityElement.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletSecurityElement.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/ServletSecurityElement.java (added)
+++ tomcat/trunk/java/javax/servlet/ServletSecurityElement.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.annotation.HttpMethodConstraint;
+import javax.servlet.annotation.ServletSecurity;
+
+/**
+ * 
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public class ServletSecurityElement extends HttpConstraintElement {
+    
+    private Map<String,HttpMethodConstraintElement> methodConstraints =
+        new HashMap<String,HttpMethodConstraintElement>();
+
+    /**
+     * Use default HttpConstraint.
+     */
+    public ServletSecurityElement() {
+        super();
+    }
+    
+    
+    /**
+     * Use specific constraints for specified methods and default
+     * HttpConstraintElement for all other methods.
+     * @param httpMethodConstraints
+     * @throws IllegalArgumentException if a method name is specified more than
+     * once
+     */
+    public ServletSecurityElement(
+            Collection<HttpMethodConstraintElement> httpMethodConstraints) {
+        super();
+        addHttpMethodConstraints(httpMethodConstraints);
+    }
+    
+    /**
+     * Use specified HttpConstraintElement.
+     * @param httpConstraintElement
+     */
+    public ServletSecurityElement(HttpConstraintElement httpConstraintElement) {
+        this (httpConstraintElement, null);
+    }
+    
+    /**
+     * Use specified HttpConstraintElement as default and specific constraints
+     * for specified methods.
+     * @param httpConstraintElement
+     * @param httpMethodConstraints
+     * @throws IllegalArgumentException if a method name is specified more than
+     */
+    public ServletSecurityElement(HttpConstraintElement httpConstraintElement,
+            Collection<HttpMethodConstraintElement> httpMethodConstraints) {
+        super(httpConstraintElement.getEmptyRoleSemantic(),
+                httpConstraintElement.getTransportGuarantee(),
+                httpConstraintElement.getRolesAllowed());
+        addHttpMethodConstraints(httpMethodConstraints);
+    }
+    
+    /**
+     * Create from an annotation.
+     * @param annotation
+     * @throws IllegalArgumentException if a method name is specified more than
+     */
+    public ServletSecurityElement(ServletSecurity annotation) {
+        this(new HttpConstraintElement(annotation.value().value(),
+                annotation.value().transportGuarantee(),
+                annotation.value().rolesAllowed()));
+        
+        List<HttpMethodConstraintElement> l =
+            new ArrayList<HttpMethodConstraintElement>();
+        HttpMethodConstraint[] constraints = annotation.httpMethodConstraints();
+        if (constraints != null) {
+            for (int i = 0; i < constraints.length; i++) {
+                HttpMethodConstraintElement e =
+                    new HttpMethodConstraintElement(constraints[i].value(),
+                            new HttpConstraintElement(
+                                    constraints[i].emptyRoleSemantic(),
+                                    constraints[i].transportGuarantee(),
+                                    constraints[i].rolesAllowed()));
+                l.add(e);
+            }
+        }
+        addHttpMethodConstraints(l);
+    }
+    
+    public Collection<HttpMethodConstraintElement> getHttpMethodConstraints() {
+        return methodConstraints.values();
+    }
+    
+    public Collection<String> getMethodNames() {
+        return methodConstraints.keySet();
+    }
+    
+    private void addHttpMethodConstraints(
+            Collection<HttpMethodConstraintElement> httpMethodConstraints) {
+        if (httpMethodConstraints == null) {
+            return;
+        }
+        for (HttpMethodConstraintElement constraint : httpMethodConstraints) {
+            String method = constraint.getMethodName();
+            if (methodConstraints.containsKey(method)) {
+                throw new IllegalArgumentException(
+                        "Duplicate method name: " + method);
+            }
+            methodConstraints.put(method, constraint);
+        }
+    }
+}

Modified: tomcat/trunk/java/javax/servlet/annotation/HandlesTypes.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/HandlesTypes.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/HandlesTypes.java (original)
+++ tomcat/trunk/java/javax/servlet/annotation/HandlesTypes.java Tue Oct 20 13:41:59 2009
@@ -24,7 +24,6 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 @Target({ElementType.TYPE})

Added: tomcat/trunk/java/javax/servlet/annotation/HttpConstraint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/HttpConstraint.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/HttpConstraint.java (added)
+++ tomcat/trunk/java/javax/servlet/annotation/HttpConstraint.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic;
+import javax.servlet.annotation.ServletSecurity.TransportGuarantee;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface HttpConstraint {
+    EmptyRoleSemantic value() default EmptyRoleSemantic.PERMIT;
+    TransportGuarantee transportGuarantee() default TransportGuarantee.NONE;
+    String[] rolesAllowed() default {};
+}

Added: tomcat/trunk/java/javax/servlet/annotation/HttpMethodConstraint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/HttpMethodConstraint.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/HttpMethodConstraint.java (added)
+++ tomcat/trunk/java/javax/servlet/annotation/HttpMethodConstraint.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.servlet.annotation.ServletSecurity.EmptyRoleSemantic;
+import javax.servlet.annotation.ServletSecurity.TransportGuarantee;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface HttpMethodConstraint {
+    String value();
+    EmptyRoleSemantic emptyRoleSemantic() default EmptyRoleSemantic.PERMIT;
+    TransportGuarantee transportGuarantee() default TransportGuarantee.NONE;
+    String[] rolesAllowed() default {};
+}

Modified: tomcat/trunk/java/javax/servlet/annotation/MultipartConfig.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/MultipartConfig.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/MultipartConfig.java (original)
+++ tomcat/trunk/java/javax/servlet/annotation/MultipartConfig.java Tue Oct 20 13:41:59 2009
@@ -24,7 +24,6 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 @Target({ElementType.TYPE})
@@ -32,7 +31,7 @@
 @Documented
 public @interface MultipartConfig {
     String location() default "";
-    long maxFileSize() default 0L;
-    long maxRequestSize() default 0L;
+    long maxFileSize() default -1L;
+    long maxRequestSize() default -1L;
     int fileSizeThreshold() default 0;
 }

Added: tomcat/trunk/java/javax/servlet/annotation/ServletSecurity.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/ServletSecurity.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/ServletSecurity.java (added)
+++ tomcat/trunk/java/javax/servlet/annotation/ServletSecurity.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+@Inherited
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ServletSecurity {
+    enum EmptyRoleSemantic {
+        PERMIT,
+        DENY
+    }
+    enum TransportGuarantee {
+        NONE,
+        CONFIDENTIAL
+    }
+    HttpConstraint value() default @HttpConstraint;
+    HttpMethodConstraint[] httpMethodConstraints() default {};
+}

Modified: tomcat/trunk/java/javax/servlet/annotation/WebFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/WebFilter.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/WebFilter.java (original)
+++ tomcat/trunk/java/javax/servlet/annotation/WebFilter.java Tue Oct 20 13:41:59 2009
@@ -26,7 +26,6 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 @Target({ElementType.TYPE})

Modified: tomcat/trunk/java/javax/servlet/annotation/WebInitParam.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/WebInitParam.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/WebInitParam.java (original)
+++ tomcat/trunk/java/javax/servlet/annotation/WebInitParam.java Tue Oct 20 13:41:59 2009
@@ -24,7 +24,6 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 @Target({ElementType.TYPE})

Modified: tomcat/trunk/java/javax/servlet/annotation/WebListener.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/WebListener.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/WebListener.java (original)
+++ tomcat/trunk/java/javax/servlet/annotation/WebListener.java Tue Oct 20 13:41:59 2009
@@ -24,12 +24,11 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 @Target({ElementType.TYPE})
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
 public @interface WebListener {
-    String description() default "";
+    String value() default "";
 }

Modified: tomcat/trunk/java/javax/servlet/annotation/WebServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/WebServlet.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/annotation/WebServlet.java (original)
+++ tomcat/trunk/java/javax/servlet/annotation/WebServlet.java Tue Oct 20 13:41:59 2009
@@ -24,7 +24,6 @@
 
 /**
  * @since Servlet 3.0
- * $Id$
  * TODO SERVLET3 - Add comments
  */
 @Target({ElementType.TYPE})

Added: tomcat/trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java (added)
+++ tomcat/trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet.descriptor;
+
+import java.util.Collection;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public interface JspConfigDescriptor {
+    public Collection<TaglibDescriptor> getTaglibs();
+    public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups();
+}

Added: tomcat/trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java (added)
+++ tomcat/trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet.descriptor;
+
+import java.util.Collection;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public interface JspPropertyGroupDescriptor {
+    public Collection<String> getUrlPatterns();
+    public String getElIgnored();
+    public String getPageEncoding();
+    public String getScriptingInvalid();
+    public String getIsXml();
+    public Collection<String> getIncludePreludes();
+    public Collection<String> getIncludeCodas();
+    public String getDeferredSyntaxAllowedAsLiteral();
+    public String getTrimDirectiveWhitespaces();
+    public String getDefaultContentType();
+    public String getBuffer();
+    public String getErrorOnUndeclaredNamespace();
+}

Added: tomcat/trunk/java/javax/servlet/descriptor/TaglibDescriptor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/descriptor/TaglibDescriptor.java?rev=827435&view=auto
==============================================================================
--- tomcat/trunk/java/javax/servlet/descriptor/TaglibDescriptor.java (added)
+++ tomcat/trunk/java/javax/servlet/descriptor/TaglibDescriptor.java Tue Oct 20 13:41:59 2009
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.servlet.descriptor;
+
+/**
+ * @since Servlet 3.0
+ * TODO SERVLET3 - Add comments
+ */
+public interface TaglibDescriptor {
+    public String getTaglidURI();
+    public String getTaglibLocation();
+}

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequest.java Tue Oct 20 13:41:59 2009
@@ -21,6 +21,7 @@
 import javax.servlet.ServletRequest;
 
 import java.io.IOException;
+import java.util.Collection;
 import java.util.Enumeration;
 
 /**
@@ -681,7 +682,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public void login(java.lang.String username, String password)
+    public void login(String username, String password)
     throws ServletException;
     
     
@@ -700,7 +701,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Iterable<Part> getParts();
+    public Collection<Part> getParts() throws IOException, ServletException;
     
     
     /**
@@ -711,5 +712,5 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Part getPart(java.lang.String name);
+    public Part getPart(String name);
 }

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletRequestWrapper.java Tue Oct 20 13:41:59 2009
@@ -20,6 +20,7 @@
 import javax.servlet.ServletRequestWrapper;
 
 import java.io.IOException;
+import java.util.Collection;
 import java.util.Enumeration;
 
 /**
@@ -292,7 +293,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Iterable<Part> getParts() {
+    public Collection<Part> getParts() throws IOException, ServletException {
         return this._getHttpServletRequest().getParts();
     }
 

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletResponse.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletResponse.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletResponse.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletResponse.java Tue Oct 20 13:41:59 2009
@@ -17,6 +17,7 @@
 package javax.servlet.http;
 
 import java.io.IOException;
+import java.util.Collection;
 
 import javax.servlet.ServletResponse;
 
@@ -348,7 +349,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Iterable<String> getHeaders(String name);
+    public Collection<String> getHeaders(String name);
 
     
     /**
@@ -357,7 +358,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Iterable<String> getHeaderNames();
+    public Collection<String> getHeaderNames();
 
     
     /*

Modified: tomcat/trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/HttpServletResponseWrapper.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/HttpServletResponseWrapper.java (original)
+++ tomcat/trunk/java/javax/servlet/http/HttpServletResponseWrapper.java Tue Oct 20 13:41:59 2009
@@ -17,6 +17,7 @@
 package javax.servlet.http;
 
 import java.io.IOException;
+import java.util.Collection;
 
 import javax.servlet.ServletResponseWrapper;
 
@@ -218,7 +219,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Iterable<String> getHeaders(String name) {
+    public Collection<String> getHeaders(String name) {
         return this._getHttpServletResponse().getHeaders(name);
     }
 
@@ -226,7 +227,7 @@
      * @since Servlet 3.0
      * TODO SERVLET3 - Add comments
      */
-    public Iterable<String> getHeaderNames() {
+    public Collection<String> getHeaderNames() {
         return this._getHttpServletResponse().getHeaderNames();
     }
 

Modified: tomcat/trunk/java/javax/servlet/http/Part.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/Part.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/http/Part.java (original)
+++ tomcat/trunk/java/javax/servlet/http/Part.java Tue Oct 20 13:41:59 2009
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Collection;
 
 /**
  * @since Servlet 3.0
@@ -31,6 +32,6 @@
     public void write(String fileName) throws IOException;
     public void delete() throws IOException;
     public String getHeader(String name);
-    public Iterable<String> getHeaders(String name);
-    public Iterable<String> getHeaderNames();
+    public Collection<String> getHeaders(String name);
+    public Collection<String> getHeaderNames();
 }

Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Tue Oct 20 13:41:59 2009
@@ -26,6 +26,7 @@
 import java.security.Principal;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -36,7 +37,6 @@
 
 import javax.security.auth.Subject;
 import javax.servlet.AsyncContext;
-import javax.servlet.AsyncListener;
 import javax.servlet.DispatcherType;
 import javax.servlet.FilterChain;
 import javax.servlet.RequestDispatcher;
@@ -391,11 +391,6 @@
      */
     protected volatile AsyncContextImpl asyncContext = null;
     
-    /**
-     * async timeout
-     */
-    protected long asyncTimeout = 0;
-    
     protected Boolean asyncSupported = null;
     
     
@@ -1501,37 +1496,6 @@
         return this.asyncContext;
     }
 
-    public void addAsyncListener(AsyncListener listener) {
-        // TODO SERVLET3 - async
-        if (isAsyncSupported() && isAsyncStarted()) {
-            this.asyncContext.addAsyncListener(listener);
-        } else {
-            throw new IllegalStateException("Async [Supported:"+isAsyncSupported()+"; Started:"+isAsyncStarted()+"]");
-        }
-    }
-
-    public void addAsyncListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse) {
-        // TODO SERVLET3 - async
-        if (isAsyncSupported() && isAsyncStarted()) {
-            this.asyncContext.addAsyncListener(listener,servletRequest,servletResponse);
-        } else {
-            throw new IllegalStateException("Async [Supported:"+isAsyncSupported()+"; Started:"+isAsyncStarted()+"]");
-        }
-    }
-
-    public void setAsyncTimeout(long timeout) {
-        // TODO SERVLET3 - async
-        if (this.asyncTimeout!=timeout) {
-            this.asyncTimeout = timeout;
-            coyoteRequest.action(ActionCode.ACTION_ASYNC_SETTIMEOUT,new Long(timeout));
-        }
-    }
-    
-    public long getAsyncTimeout() {
-        // TODO SERVLET3 - async
-        return asyncTimeout;
-    }
-    
     public DispatcherType getDispatcherType() {
         // TODO SERVLET3 - dispatcher
         if (internalDispatcherType==null) { 
@@ -2311,8 +2275,8 @@
         // TODO Servlet 3 - authentication
     }
     
-    public Iterable<Part> getParts() {
-        // TODO Servlet 3 - authentication
+    public Collection<Part> getParts() {
+        // TODO Servlet 3 - file upload
         return null;
     }
     

Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Tue Oct 20 13:41:59 2009
@@ -22,12 +22,12 @@
 import java.io.IOException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
 import javax.servlet.AsyncContext;
-import javax.servlet.AsyncListener;
 import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
@@ -973,27 +973,10 @@
     }
 
     
-    public void addAsyncListener(AsyncListener listener) {
-        request.addAsyncListener(listener);
-    }
-
-    
-    public void addAsyncListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse) {
-        request.addAsyncListener(listener,servletRequest,servletResponse);
-    }
-
     public AsyncContext getAsyncContext() {
         return request.getAsyncContext();
     }
 
-    public long getAsyncTimeout() {
-        return request.getAsyncTimeout();
-    }
-    
-    public void setAsyncTimeout(long timeout) {
-        request.setAsyncTimeout(timeout);
-    }
-    
     public DispatcherType getDispatcherType() {
         return request.getDispatcherType();
     }
@@ -1011,7 +994,7 @@
         request.logout();
     }
     
-    public Iterable<Part> getParts() {
+    public Collection<Part> getParts() {
         return request.getParts();
     }
     

Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Tue Oct 20 13:41:59 2009
@@ -29,6 +29,7 @@
 import java.security.PrivilegedExceptionAction;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Locale;
@@ -876,7 +877,7 @@
     /**
      * Return an Iterable of all the header names set for this response.
      */
-    public Iterable<String> getHeaderNames() {
+    public Collection<String> getHeaderNames() {
 
         MimeHeaders headers = coyoteResponse.getMimeHeaders();
         int n = headers.size();
@@ -895,7 +896,7 @@
      *
      * @param name Header name to look up
      */
-    public Iterable<String> getHeaders(String name) {
+    public Collection<String> getHeaders(String name) {
 
         Enumeration<String> enumeration =
             coyoteResponse.getMimeHeaders().values(name);

Modified: tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/ResponseFacade.java Tue Oct 20 13:41:59 2009
@@ -24,6 +24,7 @@
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
+import java.util.Collection;
 import java.util.Locale;
 
 import javax.servlet.ServletOutputStream;
@@ -561,11 +562,11 @@
         return response.getHeader(name);
     }
     
-    public Iterable<String> getHeaderNames() {
+    public Collection<String> getHeaderNames() {
         return response.getHeaderNames();
     }
     
-    public Iterable<String> getHeaders(String name) {
+    public Collection<String> getHeaders(String name) {
         return response.getHeaders(name);
     }
 }

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Tue Oct 20 13:41:59 2009
@@ -26,6 +26,7 @@
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.Enumeration;
+import java.util.EventListener;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
@@ -45,6 +46,7 @@
 import javax.servlet.ServletRegistration;
 import javax.servlet.SessionCookieConfig;
 import javax.servlet.SessionTrackingMode;
+import javax.servlet.descriptor.JspConfigDescriptor;
 
 import org.apache.catalina.Context;
 import org.apache.catalina.Engine;
@@ -897,7 +899,7 @@
     }
 
 
-    public FilterRegistration findFilterRegistration(String filterName) {
+    public FilterRegistration getFilterRegistration(String filterName) {
         // TODO Servlet 3.0
         return null;
     }
@@ -967,7 +969,7 @@
     }
 
 
-    public ServletRegistration findServletRegistration(String servletName) {
+    public ServletRegistration getServletRegistration(String servletName) {
         // TODO Servlet 3.0
         return null;
     }
@@ -1062,12 +1064,87 @@
     }
 
 
+    @Override
     public boolean setInitParameter(String name, String value) {
         // TODO Servlet 3
         return false;
     }
     
     
+    @Override
+    public void addListener(Class<? extends EventListener> listenerClass) {
+        // TODO Servlet 3
+    }
+
+
+    @Override
+    public void addListener(String className) {
+        // TODO Servlet 3
+    }
+
+
+    @Override
+    public <T extends EventListener> void addListener(T t) {
+        // TODO Servlet 3
+    }
+
+
+    @Override
+    public <T extends EventListener> T createListener(Class<T> c)
+            throws ServletException {
+        // TODO Servlet 3
+        return null;
+    }
+
+
+    @Override
+    public void declareRoles(String... roleNames) {
+        // TODO Servlet 3
+    }
+
+
+    @Override
+    public ClassLoader getClassLoader() {
+        // TODO Servlet 3
+        return null;
+    }
+
+
+    @Override
+    public int getEffectiveMajorVersion() {
+        // TODO Servlet 3
+        return 0;
+    }
+
+
+    @Override
+    public int getEffectiveMinorVersion() {
+        // TODO Servlet 3
+        return 0;
+    }
+
+
+    @Override
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+        // TODO Servlet 3
+        return null;
+    }
+
+
+    @Override
+    public JspConfigDescriptor getJspConfigDescriptor() {
+        // TODO Servlet 3
+        return null;
+    }
+
+
+    @Override
+    public Map<String, ? extends ServletRegistration> getServletRegistrations() {
+        // TODO Servlet 3
+        return null;
+    }
+
+    
     // -------------------------------------------------------- Package Methods
     protected StandardContext getContext() {
         return this.context;

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java Tue Oct 20 13:41:59 2009
@@ -29,7 +29,9 @@
 import java.security.PrivilegedExceptionAction;
 import java.util.EnumSet;
 import java.util.Enumeration;
+import java.util.EventListener;
 import java.util.HashMap;
+import java.util.Map;
 import java.util.Set;
 
 import javax.servlet.Filter;
@@ -41,6 +43,7 @@
 import javax.servlet.ServletRegistration;
 import javax.servlet.SessionCookieConfig;
 import javax.servlet.SessionTrackingMode;
+import javax.servlet.descriptor.JspConfigDescriptor;
 
 import org.apache.catalina.Globals;
 import org.apache.catalina.security.SecurityUtil;
@@ -432,12 +435,12 @@
     }
 
 
-    public FilterRegistration findFilterRegistration(String filterName) {
+    public FilterRegistration getFilterRegistration(String filterName) {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             return (FilterRegistration) doPrivileged(
                     "findFilterRegistration", new Object[]{filterName});
         } else {
-            return context.findFilterRegistration(filterName);
+            return context.getFilterRegistration(filterName);
         }
     }
     
@@ -486,12 +489,12 @@
     }
 
     
-    public ServletRegistration findServletRegistration(String servletName) {
+    public ServletRegistration getServletRegistration(String servletName) {
         if (SecurityUtil.isPackageProtectionEnabled()) {
             return (ServletRegistration) doPrivileged(
                     "findServletRegistration", new Object[]{servletName});
         } else {
-            return context.findServletRegistration(servletName);
+            return context.getServletRegistration(servletName);
         }
     }
     
@@ -545,8 +548,127 @@
             return context.setInitParameter(name, value);
         }
     }
-    
-    
+
+
+    @Override
+    public void addListener(Class<? extends EventListener> listenerClass) {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            doPrivileged("addListener",
+                    new Object[]{listenerClass});
+        } else {
+            context.addListener(listenerClass);
+        }
+    }
+
+
+    @Override
+    public void addListener(String className) {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            doPrivileged("addListener",
+                    new Object[]{className});
+        } else {
+            context.addListener(className);
+        }
+    }
+
+
+    @Override
+    public <T extends EventListener> void addListener(T t) {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            doPrivileged("addListener",
+                    new Object[]{t});
+        } else {
+            context.addListener(t);
+        }
+    }
+
+
+    @Override
+    public <T extends EventListener> T createListener(Class<T> c)
+            throws ServletException {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return (T) doPrivileged("createListener", new Object[]{c});
+        } else {
+            return context.createListener(c);
+        }
+    }
+
+
+    @Override
+    public void declareRoles(String... roleNames) {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            doPrivileged("declareRoles",
+                    new Object[]{roleNames});
+        } else {
+            context.declareRoles(roleNames);
+        }
+    }
+
+
+    @Override
+    public ClassLoader getClassLoader() {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return (ClassLoader) doPrivileged("getClassLoader", null);
+        } else {
+            return context.getClassLoader();
+        }
+    }
+
+
+    @Override
+    public int getEffectiveMajorVersion() {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return ((Integer) doPrivileged("getEffectiveMajorVersion",
+                    null)).intValue();
+        } else  {
+            return context.getEffectiveMajorVersion();
+        }
+    }
+
+
+    @Override
+    public int getEffectiveMinorVersion() {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return ((Integer) doPrivileged("getEffectiveMinorVersion",
+                    null)).intValue();
+        } else  {
+            return context.getEffectiveMinorVersion();
+        }
+    }
+
+
+    @Override
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return (Map<String, ? extends FilterRegistration>) doPrivileged(
+                    "getFilterRegistrations", null);
+        } else {
+            return context.getFilterRegistrations();
+        }
+    }
+
+
+    @Override
+    public JspConfigDescriptor getJspConfigDescriptor() {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return (JspConfigDescriptor) doPrivileged("getJspConfigDescriptor",
+                    null);
+        } else {
+            return context.getJspConfigDescriptor();
+        }
+    }
+
+
+    @Override
+    public Map<String, ? extends ServletRegistration> getServletRegistrations() {
+        if (SecurityUtil.isPackageProtectionEnabled()) {
+            return (Map<String, ? extends ServletRegistration>) doPrivileged(
+                    "getServletRegistrations", null);
+        } else {
+            return context.getServletRegistrations();
+        }
+    }
+
     /**
      * Use reflection to invoke the requested method. Cache the method object 
      * to speed up the process
@@ -669,4 +791,5 @@
         
         throw realException;
     }
+
 }

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Tue Oct 20 13:41:59 2009
@@ -194,18 +194,36 @@
         }
     }
     
-    public void addAsyncListener(AsyncListener listener) {
+    @Override
+    public void addListener(AsyncListener listener) {
         AsyncListenerWrapper wrapper = new AsyncListenerWrapper();
         wrapper.setListener(listener);
         listeners.add(wrapper);
     }
 
-    public void addAsyncListener(AsyncListener listener, ServletRequest servletRequest, ServletResponse servletResponse) {
+    @Override
+    public void addListener(AsyncListener listener, ServletRequest servletRequest,
+            ServletResponse servletResponse) {
         AsyncListenerWrapper wrapper = new AsyncListenerWrapper();
         wrapper.setListener(listener);
         listeners.add(wrapper);
     }
-    
+
+    @Override
+    public <T extends AsyncListener> T createListener(Class<T> clazz)
+            throws ServletException {
+        T listener = null;
+        try {
+             listener = clazz.newInstance();
+        } catch (InstantiationException e) {
+            ServletException se = new ServletException(e);
+            throw se;
+        } catch (IllegalAccessException e) {
+            ServletException se = new ServletException(e);
+            throw se;
+        }
+        return listener;
+    }
     
     public void recycle() {
         servletRequest = null;
@@ -341,11 +359,11 @@
         state.set(st);
     }
     
-    public long getAsyncTimeout() {
+    public long getTimeout() {
         return timeout;
     }
     
-    public void setAsyncTimeout(long timeout) {
+    public void setTimeout(long timeout) {
         this.timeout = timeout;
         request.getCoyoteRequest().action(ActionCode.ACTION_ASYNC_SETTIMEOUT,new Long(timeout));
     }
@@ -361,7 +379,7 @@
     public void init(ServletRequest request, ServletResponse response) {
         this.servletRequest = request;
         this.servletResponse = response;
-        event = new AsyncEvent(request,response); 
+        event = new AsyncEvent(this, request, response); 
     }
 
 }

Modified: tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java Tue Oct 20 13:41:59 2009
@@ -25,13 +25,13 @@
 import java.io.UnsupportedEncodingException;
 import java.net.Socket;
 import java.security.Principal;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
 
 import javax.servlet.AsyncContext;
-import javax.servlet.AsyncListener;
 import javax.servlet.DispatcherType;
 import javax.servlet.FilterChain;
 import javax.servlet.RequestDispatcher;
@@ -282,8 +282,6 @@
     public String getLocalName() { return null; }
     public int getLocalPort() { return -1; }
     public int getRemotePort() { return -1; }
-    public void addAsyncListener(AsyncListener listener, ServletRequest req,
-            ServletResponse res) {}
     public ServletContext getServletContext() { return null; }
     public boolean isAsyncStarted() { return false; }
     public boolean isAsyncSupported() { return false; }
@@ -291,17 +289,14 @@
         return null;
     }
     public Part getPart(String name) { return null; }
-    public Iterable<Part> getParts() { return null; }
+    public Collection<Part> getParts() { return null; }
     public boolean authenticate(HttpServletResponse response)
     throws IOException, ServletException { return false; }
     public void login(String username, String password)
     throws ServletException {}
     public void logout() throws ServletException {}
-    public void addAsyncListener(AsyncListener listener) {}
     public AsyncContext getAsyncContext() { return null; }
-    public long getAsyncTimeout() { return 0; }
     public DispatcherType getDispatcherType() { return null; }
-    public void setAsyncTimeout(long timeout) {}
     public AsyncContext startAsync(ServletRequest servletRequest,
             ServletResponse servletResponse) { return null; }
 }

Modified: tomcat/trunk/java/org/apache/catalina/core/DummyResponse.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DummyResponse.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/DummyResponse.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/DummyResponse.java Tue Oct 20 13:41:59 2009
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.PrintWriter;
+import java.util.Collection;
 import java.util.Locale;
 
 import javax.servlet.ServletOutputStream;
@@ -101,7 +102,7 @@
 
     public Cookie[] getCookies() { return null; }
     public String getHeader(String name) { return null; }
-    public Iterable<String> getHeaderNames() { return null; }
+    public Collection<String> getHeaderNames() { return null; }
     public String[] getHeaderValues(@SuppressWarnings("unused") String name) {
         return null;
     }
@@ -130,5 +131,5 @@
     public void setStatus(int status) {}
     /** @deprecated */
     public void setStatus(int status, String message) {}
-    public Iterable<String> getHeaders(String name) { return null; }
+    public Collection<String> getHeaders(String name) { return null; }
 }

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Tue Oct 20 13:41:59 2009
@@ -25,8 +25,10 @@
 import java.net.URL;
 import java.util.EnumSet;
 import java.util.Enumeration;
+import java.util.EventListener;
 import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.Map;
 import java.util.Set;
 import java.util.Vector;
 
@@ -40,6 +42,7 @@
 import javax.servlet.SessionCookieConfig;
 import javax.servlet.SessionTrackingMode;
 import javax.servlet.FilterRegistration.Dynamic;
+import javax.servlet.descriptor.JspConfigDescriptor;
 
 
 /**
@@ -512,12 +515,12 @@
     }
 
 
-    public FilterRegistration findFilterRegistration(String filterName) {
+    public FilterRegistration getFilterRegistration(String filterName) {
         return null;
     }
 
 
-    public ServletRegistration findServletRegistration(String servletName) {
+    public ServletRegistration getServletRegistration(String servletName) {
         return null;
     }
 
@@ -526,4 +529,71 @@
         return false;
     }
 
+
+    @Override
+    public void addListener(Class<? extends EventListener> listenerClass) {
+        // NOOP
+    }
+
+
+    @Override
+    public void addListener(String className) {
+        // NOOP
+    }
+
+
+    @Override
+    public <T extends EventListener> void addListener(T t) {
+        // NOOP
+    }
+
+
+    @Override
+    public <T extends EventListener> T createListener(Class<T> c)
+            throws ServletException {
+        return null;
+    }
+
+
+    @Override
+    public void declareRoles(String... roleNames) {
+        // NOOP
+    }
+
+
+    @Override
+    public ClassLoader getClassLoader() {
+        return null;
+    }
+
+
+    @Override
+    public int getEffectiveMajorVersion() {
+        return 3;
+    }
+
+
+    @Override
+    public int getEffectiveMinorVersion() {
+        return 0;
+    }
+
+
+    @Override
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+        return null;
+    }
+
+
+    @Override
+    public JspConfigDescriptor getJspConfigDescriptor() {
+        return null;
+    }
+
+
+    @Override
+    public Map<String, ? extends ServletRegistration> getServletRegistrations() {
+        return null;
+    }
+
 }

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async0.java Tue Oct 20 13:41:59 2009
@@ -42,7 +42,7 @@
         } else {
             resp.setContentType("text/plain");
             final AsyncContext actx = req.startAsync();
-            actx.setAsyncTimeout(Long.MAX_VALUE);
+            actx.setTimeout(Long.MAX_VALUE);
             Runnable run = new Runnable() {
                 public void run() {
                     try {

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async1.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async1.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async1.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async1.java Tue Oct 20 13:41:59 2009
@@ -35,7 +35,7 @@
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
         final AsyncContext actx = req.startAsync();
-        actx.setAsyncTimeout(30*1000);
+        actx.setTimeout(30*1000);
         Runnable run = new Runnable() {
             public void run() {
                 try {

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async2.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async2.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async2.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async2.java Tue Oct 20 13:41:59 2009
@@ -35,7 +35,7 @@
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
         final AsyncContext actx = req.startAsync();
-        actx.setAsyncTimeout(30*1000);
+        actx.setTimeout(30*1000);
         Runnable run = new Runnable() {
             public void run() {
                 try {

Modified: tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async3.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async3.java?rev=827435&r1=827434&r2=827435&view=diff
==============================================================================
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async3.java (original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/Async3.java Tue Oct 20 13:41:59 2009
@@ -35,7 +35,7 @@
     @Override
     protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
         final AsyncContext actx = req.startAsync();
-        actx.setAsyncTimeout(30*1000);
+        actx.setTimeout(30*1000);
         actx.dispatch("/jsp/async/async3.jsp");
         actx.complete();
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message