Author: remy.maucherat(a)jboss.com
Date: 2009-04-07 17:39:25 -0400 (Tue, 07 Apr 2009)
New Revision: 991
Modified:
trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/RequestFacade.java
Log:
- Timeout and login.
Modified: trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java 2009-04-07
17:21:32 UTC (rev 990)
+++ trunk/java/org/apache/catalina/authenticator/AuthenticatorBase.java 2009-04-07
21:39:25 UTC (rev 991)
@@ -397,8 +397,8 @@
*/
public boolean login(Request request, HttpServletResponse response)
throws IOException, ServletException {
- // FIXME
- return false;
+ // FIXME: use the wrapper
+ return login(request, request.getResponse());
}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-04-07 17:21:32 UTC (rev
990)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-04-07 21:39:25 UTC (rev
991)
@@ -123,6 +123,11 @@
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.SESSION_ID_CHECK",
"false")).booleanValue();
+ protected static final boolean WRAPPED_RESPONSE_IN_LOGIN =
+ Globals.STRICT_SERVLET_COMPLIANCE
+ ||
Boolean.valueOf(System.getProperty("org.apache.catalina.connector.Request.WRAPPED_RESPONSE_IN_LOGIN",
"false")).booleanValue();
+
+
// ----------------------------------------------------------- Constructors
@@ -2855,19 +2860,25 @@
return true;
}
- public void setAsyncTimeout(long timeout) {
- this.asyncTimeout = timeout;
+ public long getAsyncTimeout() {
+ return this.asyncTimeout;
}
+ public void setAsyncTimeout(long asyncTimeout) {
+ this.asyncTimeout = asyncTimeout;
+ }
+
public AsyncContext startAsync() throws IllegalStateException {
return startAsync(getRequest(), response.getResponse());
}
public AsyncContext startAsync(ServletRequest servletRequest,
ServletResponse servletResponse) throws IllegalStateException {
- // FIXME: check isAsyncSupported
- // FIXME: get async timeout according to what was configured in the filter
chains
- setTimeout((asyncTimeout > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)
asyncTimeout);
+ int timeout = (asyncTimeout > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int)
asyncTimeout;
+ if (timeout <= 0) {
+ timeout = Integer.MAX_VALUE;
+ }
+ setTimeout(timeout);
asyncContext = new AsyncContextImpl(servletRequest, servletResponse);
eventMode = true;
return asyncContext;
@@ -2875,9 +2886,12 @@
public boolean login(HttpServletResponse response) throws IOException,
ServletException {
- // FIXME: Ignoring the response param, which will hopefully go away
if (context.getAuthenticator() != null) {
- return context.getAuthenticator().login(this, this.response);
+ if (!WRAPPED_RESPONSE_IN_LOGIN || response instanceof ResponseFacade) {
+ return context.getAuthenticator().login(this, this.response);
+ } else {
+ return context.getAuthenticator().login(this, response);
+ }
} else {
// FIXME: error message for no available authenticator
throw new ServletException();
@@ -2890,8 +2904,7 @@
if (userPrincipal == null) {
throw new ServletException();
}
- // FIXME: authType value
- authType = "LOGIN";
+ authType = context.getLoginConfig().getAuthMethod();
}
public void logout() throws ServletException {
@@ -2922,11 +2935,7 @@
throw new IllegalStateException();
}
- public ServletResponse getServletResponse() {
- return response;
- }
-
// ------------------------------------------ AsyncContextImpl Inner Class
Modified: trunk/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-04-07 17:21:32 UTC
(rev 990)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-04-07 21:39:25 UTC
(rev 991)
@@ -1001,16 +1001,26 @@
}
- public void setAsyncTimeout(long timeout) {
+ public void setAsyncTimeout(long timeout) {
if (request == null) {
throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
+ sm.getString("requestFacade.nullRequest"));
}
request.setAsyncTimeout(timeout);
}
+ public long getAsyncTimeout() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.getAsyncTimeout();
+ }
+
+
public AsyncContext startAsync() throws IllegalStateException {
if (request == null) {
throw new IllegalStateException(
@@ -1080,16 +1090,6 @@
}
- public ServletResponse getServletResponse() {
- if (request == null) {
- throw new IllegalStateException(
- sm.getString("requestFacade.nullRequest"));
- }
-
- return request.getResponse().getResponse();
- }
-
-
public boolean login(HttpServletResponse response) throws IOException,
ServletException {
if (request == null) {
Show replies by date