Author: remy.maucherat(a)jboss.com
Date: 2009-01-26 15:21:13 -0500 (Mon, 26 Jan 2009)
New Revision: 912
Modified:
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/RequestFacade.java
trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
trunk/java/org/apache/catalina/core/DummyRequest.java
trunk/java/org/apache/jasper/servlet/JspCServletContext.java
trunk/webapps/docs/changelog.xml
Log:
- Add skeleton methods.
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-01-23 18:17:34 UTC (rev
911)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-01-26 20:21:13 UTC (rev
912)
@@ -35,12 +35,16 @@
import java.util.TreeMap;
import javax.security.auth.Subject;
+import javax.servlet.AsyncContext;
+import javax.servlet.AsyncListener;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestAttributeEvent;
import javax.servlet.ServletRequestAttributeListener;
+import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -2050,6 +2054,13 @@
}
+ public ServletContext getServletContext() {
+ if (context == null)
+ return (null);
+ return context.getServletContext();
+ }
+
+
/**
* Return the portion of the request URI used to select the servlet
* that will process this request.
@@ -2719,5 +2730,55 @@
}
return true;
}
+
+ @Override
+ public void addAsyncListener(AsyncListener listener,
+ ServletRequest servletRequest, ServletResponse servletResponse) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void addAsyncListener(AsyncListener listener) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public AsyncContext getAsyncContext() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isAsyncStarted() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean isAsyncSupported() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void setAsyncTimeout(long timeout) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public AsyncContext startAsync() throws IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public AsyncContext startAsync(ServletRequest servletRequest,
+ ServletResponse servletResponse) throws IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: trunk/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-01-23 18:17:34 UTC
(rev 911)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-01-26 20:21:13 UTC
(rev 912)
@@ -26,8 +26,13 @@
import java.util.Locale;
import java.util.Map;
+import javax.servlet.AsyncContext;
+import javax.servlet.AsyncListener;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -932,4 +937,96 @@
return request.getRemotePort();
}
+
+ public void addAsyncListener(AsyncListener listener,
+ ServletRequest servletRequest, ServletResponse servletResponse) {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ request.addAsyncListener(listener, servletRequest, servletResponse);
+ }
+
+
+ public void addAsyncListener(AsyncListener listener) {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ request.addAsyncListener(listener);
+ }
+
+
+ public AsyncContext getAsyncContext() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.getAsyncContext();
+ }
+
+
+ public ServletContext getServletContext() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.getServletContext();
+ }
+
+
+ public boolean isAsyncStarted() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.isAsyncStarted();
+ }
+
+
+ public boolean isAsyncSupported() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.isAsyncSupported();
+ }
+
+
+ public void setAsyncTimeout(long timeout) {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ request.setAsyncTimeout(timeout);
+ }
+
+
+ public AsyncContext startAsync() throws IllegalStateException {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.startAsync();
+ }
+
+
+ public AsyncContext startAsync(ServletRequest servletRequest,
+ ServletResponse servletResponse) throws IllegalStateException {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.startAsync(servletRequest, servletResponse);
+ }
+
}
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-01-23 18:17:34
UTC (rev 911)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-01-26 20:21:13
UTC (rev 912)
@@ -27,14 +27,19 @@
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import java.util.EnumSet;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.Map;
import java.util.Set;
+import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import javax.servlet.SessionCookieConfig;
+import javax.servlet.SessionTrackingMode;
import org.apache.catalina.Globals;
import org.apache.catalina.security.SecurityUtil;
@@ -364,6 +369,109 @@
}
+ public void addFilter(String filterName, String description,
+ String className, Map<String, String> initParameters,
+ boolean isAsyncSupported) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ doPrivileged("addFilter", new Object[]{filterName, description,
+ className, initParameters,
+ Boolean.valueOf(isAsyncSupported)});
+ } else {
+ context.addFilter(filterName, description, className,
+ initParameters, isAsyncSupported);
+ }
+ }
+
+
+ public void addFilterMappingForServletNames(String filterName,
+ EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
+ String... servletNames) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ doPrivileged("addFilterMappingForServletNames",
+ new Object[]{filterName, dispatcherTypes,
+ Boolean.valueOf(isMatchAfter), servletNames});
+ } else {
+ context.addFilterMappingForServletNames(filterName, dispatcherTypes,
+ isMatchAfter, servletNames);
+ }
+ }
+
+
+ public void addFilterMappingForUrlPatterns(String filterName,
+ EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
+ String... urlPatterns) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ doPrivileged("addFilterMappingForUrlPatterns",
+ new Object[]{filterName, dispatcherTypes,
+ Boolean.valueOf(isMatchAfter), urlPatterns});
+ } else {
+ context.addFilterMappingForUrlPatterns(filterName, dispatcherTypes,
+ isMatchAfter, urlPatterns);
+ }
+ }
+
+
+ public void addServletMapping(String servletName, String[] urlPatterns) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ doPrivileged("addServletMapping",
+ new Object[]{servletName, urlPatterns});
+ } else {
+ context.addServletMapping(servletName, urlPatterns);
+ }
+ }
+
+
+ public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (EnumSet<SessionTrackingMode>)
+ doPrivileged("getDefaultSessionTrackingModes", null);
+ } else {
+ return context.getDefaultSessionTrackingModes();
+ }
+ }
+
+
+ public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (EnumSet<SessionTrackingMode>)
+ doPrivileged("getEffectiveSessionTrackingModes", null);
+ } else {
+ return context.getEffectiveSessionTrackingModes();
+ }
+ }
+
+
+ public SessionCookieConfig getSessionCookieConfig() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (SessionCookieConfig)
+ doPrivileged("getSessionCookieConfig", null);
+ } else {
+ return context.getSessionCookieConfig();
+ }
+ }
+
+
+ public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ doPrivileged("setSessionCookieConfig",
+ new Object[]{sessionCookieConfig});
+ } else {
+ context.setSessionCookieConfig(sessionCookieConfig);
+ }
+ }
+
+
+ public void setSessionTrackingModes(
+ EnumSet<SessionTrackingMode> sessionTrackingModes) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ doPrivileged("setSessionTrackingModes",
+ new Object[]{sessionTrackingModes});
+ } else {
+ context.setSessionTrackingModes(sessionTrackingModes);
+ }
+ }
+
+
/**
* Use reflection to invoke the requested method. Cache the method object
* to speed up the process
@@ -507,4 +615,6 @@
throw realException;
}
+
+
}
Modified: trunk/java/org/apache/catalina/core/DummyRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyRequest.java 2009-01-23 18:17:34 UTC (rev
911)
+++ trunk/java/org/apache/catalina/core/DummyRequest.java 2009-01-26 20:21:13 UTC (rev
912)
@@ -30,10 +30,14 @@
import java.util.Locale;
import java.util.Map;
+import javax.servlet.AsyncContext;
+import javax.servlet.AsyncListener;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -263,6 +267,18 @@
public String getLocalName() { return null; }
public int getLocalPort() { return -1; }
public int getRemotePort() { return -1; }
+
+ public void addAsyncListener(AsyncListener listener,
+ ServletRequest servletRequest, ServletResponse servletResponse) {}
+ public void addAsyncListener(AsyncListener listener) {}
+ public AsyncContext getAsyncContext() { return null; }
+ public ServletContext getServletContext() { return null; }
+ public boolean isAsyncStarted() { return false; }
+ public boolean isAsyncSupported() { return false; }
+ public void setAsyncTimeout(long timeout) {}
+ public AsyncContext startAsync() throws IllegalStateException { return null; }
+ public AsyncContext startAsync(ServletRequest servletRequest,
+ ServletResponse servletResponse) throws IllegalStateException { return null;
}
}
Modified: trunk/java/org/apache/jasper/servlet/JspCServletContext.java
===================================================================
--- trunk/java/org/apache/jasper/servlet/JspCServletContext.java 2009-01-23 18:17:34 UTC
(rev 911)
+++ trunk/java/org/apache/jasper/servlet/JspCServletContext.java 2009-01-26 20:21:13 UTC
(rev 912)
@@ -23,16 +23,21 @@
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.EnumSet;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
+import java.util.Map;
import java.util.Set;
import java.util.Vector;
+import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import javax.servlet.SessionCookieConfig;
+import javax.servlet.SessionTrackingMode;
/**
@@ -437,5 +442,56 @@
}
+ public void addFilter(String filterName, String description,
+ String className, Map<String, String> initParameters,
+ boolean isAsyncSupported) {
+ // Do nothing
+ }
+
+ public void addFilterMappingForServletNames(String filterName,
+ EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
+ String... servletNames) {
+ // Do nothing
+ }
+
+
+ public void addFilterMappingForUrlPatterns(String filterName,
+ EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
+ String... urlPatterns) {
+ // Do nothing
+ }
+
+
+ public void addServletMapping(String servletName, String[] urlPatterns) {
+ // Do nothing
+ }
+
+
+ public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes() {
+ return EnumSet.noneOf(SessionTrackingMode.class);
+ }
+
+
+ public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+ return EnumSet.noneOf(SessionTrackingMode.class);
+ }
+
+
+ public SessionCookieConfig getSessionCookieConfig() {
+ return null;
+ }
+
+
+ public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig) {
+ // Do nothing
+ }
+
+
+ public void setSessionTrackingModes(
+ EnumSet<SessionTrackingMode> sessionTrackingModes) {
+ // Do nothing
+ }
+
+
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-01-23 18:17:34 UTC (rev 911)
+++ trunk/webapps/docs/changelog.xml 2009-01-26 20:21:13 UTC (rev 912)
@@ -29,6 +29,9 @@
<update>
Replace TomcatCookie class with the new Cookie API. (remm)
</update>
+ <update>
+ Cookie tracking and Servlet 3.0 cookie configuration. (markt, remm)
+ </update>
</changelog>
</subsection>
<subsection name="Coyote">