Author: remy.maucherat(a)jboss.com
Date: 2009-03-10 00:02:22 -0400 (Tue, 10 Mar 2009)
New Revision: 947
Modified:
trunk/java/javax/servlet/ServletRegistration.java
trunk/java/org/apache/catalina/core/ApplicationContext.java
trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
trunk/java/org/apache/catalina/deploy/SessionCookie.java
trunk/java/org/apache/jasper/servlet/JspCServletContext.java
Log:
- It should build. The API will change again.
Modified: trunk/java/javax/servlet/ServletRegistration.java
===================================================================
--- trunk/java/javax/servlet/ServletRegistration.java 2009-03-09 14:22:08 UTC (rev 946)
+++ trunk/java/javax/servlet/ServletRegistration.java 2009-03-10 04:02:22 UTC (rev 947)
@@ -28,7 +28,7 @@
*/
public interface ServletRegistration {
- boolean setDescription(String description);
+ void setDescription(String description);
void setAsyncSupported(boolean asyncSupported);
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-03-09 14:22:08 UTC
(rev 946)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-03-10 04:02:22 UTC
(rev 947)
@@ -154,12 +154,6 @@
new ThreadLocal<DispatchData>();
- /**
- * Effective session cookie config.
- */
- private SessionCookieConfig sessionCookieConfig = null;
-
-
// --------------------------------------------------------- Public Methods
@@ -950,22 +944,34 @@
public SessionCookieConfig getSessionCookieConfig() {
- if (sessionCookieConfig != null) {
- return sessionCookieConfig;
- }
- SessionCookie sessionCookie = context.getSessionCookie();
- sessionCookieConfig = new SessionCookieConfig(sessionCookie.getDomain(),
sessionCookie.getPath(),
- sessionCookie.getComment(), sessionCookie.isHttpOnly(),
sessionCookie.isSecure());
- return sessionCookieConfig;
+ return context.getSessionCookie();
}
public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig) {
- // FIXME: do something ...
- this.sessionCookieConfig = sessionCookieConfig;
+ SessionCookie sessionCookie = new SessionCookie();
+ sessionCookie.setComment(sessionCookieConfig.getComment());
+ sessionCookie.setDomain(sessionCookieConfig.getDomain());
+ sessionCookie.setHttpOnly(sessionCookieConfig.isHttpOnly());
+ sessionCookie.setSecure(sessionCookieConfig.isSecure());
+ context.setSessionCookie(sessionCookie);
}
+ public ServletRegistration addServlet(String servletName,
+ Class<? extends Servlet> clazz) throws IllegalArgumentException,
+ IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public boolean setInitParameter(String name, String value) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
/**
* @throws IllegalStateException if the context has already been initialised
* @throws IllegalArgumentException TODO SERVLET3 Something to do with SSL
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-03-09 14:22:08
UTC (rev 946)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-03-10 04:02:22
UTC (rev 947)
@@ -394,6 +394,28 @@
}
+ public ServletRegistration addServlet(String servletName,
+ Class<? extends Servlet> clazz) throws IllegalArgumentException,
+ IllegalStateException {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (ServletRegistration) doPrivileged("addServlet",
+ new Object[]{servletName, clazz});
+ } else {
+ return context.addServlet(servletName, clazz);
+ }
+ }
+
+
+ public boolean setInitParameter(String name, String value) {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (Boolean) doPrivileged("setInitParameter",
+ new Object[]{name, value});
+ } else {
+ return context.setInitParameter(name, value);
+ }
+ }
+
+
public FilterRegistration findFilterRegistration(String filterName) {
if (SecurityUtil.isPackageProtectionEnabled()) {
return (FilterRegistration) doPrivileged("findFilterRegistration",
Modified: trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-03-09 14:22:08 UTC
(rev 946)
+++ trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-03-10 04:02:22 UTC
(rev 947)
@@ -35,8 +35,7 @@
*/
public final class StandardWrapperFacade
- extends ServletRegistration
- implements ServletConfig {
+ implements ServletRegistration, ServletConfig {
// ----------------------------------------------------------- Constructors
@@ -96,45 +95,36 @@
}
- @Override
public void addMapping(String... urlPatterns) {
// TODO Auto-generated method stub
}
- @Override
public void setAsyncSupported(boolean asyncSupported) {
// TODO Auto-generated method stub
- super.setAsyncSupported(asyncSupported);
}
- @Override
public void setDescription(String description) {
// TODO Auto-generated method stub
- super.setDescription(description);
}
- @Override
- public void setInitParameter(String name, String value) {
+ public boolean setInitParameter(String name, String value) {
// TODO Auto-generated method stub
-
+ return false;
}
- @Override
public void setInitParameters(Map<String, String> initParameters) {
// TODO Auto-generated method stub
}
- @Override
public void setLoadOnStartup(int loadOnStartup) {
// TODO Auto-generated method stub
- super.setLoadOnStartup(loadOnStartup);
}
Modified: trunk/java/org/apache/catalina/deploy/SessionCookie.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/SessionCookie.java 2009-03-09 14:22:08 UTC (rev
946)
+++ trunk/java/org/apache/catalina/deploy/SessionCookie.java 2009-03-10 04:02:22 UTC (rev
947)
@@ -19,8 +19,10 @@
import java.io.Serializable;
-public class SessionCookie implements Serializable {
+import javax.servlet.SessionCookieConfig;
+public class SessionCookie implements SessionCookieConfig, Serializable {
+
protected String domain = null;
protected String path = null;
protected String comment = null;
Modified: trunk/java/org/apache/jasper/servlet/JspCServletContext.java
===================================================================
--- trunk/java/org/apache/jasper/servlet/JspCServletContext.java 2009-03-09 14:22:08 UTC
(rev 946)
+++ trunk/java/org/apache/jasper/servlet/JspCServletContext.java 2009-03-10 04:02:22 UTC
(rev 947)
@@ -454,6 +454,18 @@
}
+ public ServletRegistration addServlet(String servletName,
+ Class<? extends Servlet> clazz) throws IllegalArgumentException,
+ IllegalStateException {
+ return null;
+ }
+
+
+ public boolean setInitParameter(String name, String value) {
+ return false;
+ }
+
+
public FilterRegistration findFilterRegistration(String filterName) {
return null;
}
Show replies by date