Author: remy.maucherat(a)jboss.com
Date: 2011-04-13 09:25:47 -0400 (Wed, 13 Apr 2011)
New Revision: 1703
Modified:
trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
trunk/java/org/apache/catalina/authenticator/NonLoginAuthenticator.java
trunk/java/org/apache/catalina/authenticator/SSLAuthenticator.java
trunk/java/org/apache/catalina/valves/ValveBase.java
Log:
- Now that JMX is optional, there's no safe location to initialize the containerLog
field.
- getContainer().getLogger() has to be used instead.
Modified: trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2011-04-07
17:02:12 UTC (rev 1702)
+++ trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2011-04-13
13:25:47 UTC (rev 1703)
@@ -289,8 +289,8 @@
if (session == null)
session = request.getSessionInternal(false);
if (session == null) {
- if (containerLog.isDebugEnabled())
- containerLog.debug
+ if (getContainer().getLogger().isDebugEnabled())
+ getContainer().getLogger().debug
("User took so long to log on the session expired");
if (landingPage == null) {
response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT,
Modified: trunk/java/org/apache/catalina/authenticator/NonLoginAuthenticator.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/NonLoginAuthenticator.java 2011-04-07
17:02:12 UTC (rev 1702)
+++ trunk/java/org/apache/catalina/authenticator/NonLoginAuthenticator.java 2011-04-13
13:25:47 UTC (rev 1703)
@@ -93,8 +93,8 @@
associate(ssoId, getSession(request, true));
*/
- if (containerLog.isDebugEnabled())
- containerLog.debug("User authentication is not required");
+ if (getContainer().getLogger().isDebugEnabled())
+ getContainer().getLogger().debug("User authentication is not
required");
return (true);
Modified: trunk/java/org/apache/catalina/authenticator/SSLAuthenticator.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/SSLAuthenticator.java 2011-04-07 17:02:12
UTC (rev 1702)
+++ trunk/java/org/apache/catalina/authenticator/SSLAuthenticator.java 2011-04-13 13:25:47
UTC (rev 1703)
@@ -26,11 +26,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.catalina.Globals;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Request;
import org.apache.catalina.deploy.LoginConfig;
-import org.apache.coyote.ActionCode;
@@ -90,8 +88,6 @@
Principal principal = request.getUserPrincipal();
//String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
if (principal != null) {
- if (containerLog.isDebugEnabled())
- containerLog.debug("Already authenticated '" +
principal.getName() + "'");
// Associate the session with any existing SSO session in order
// to get coordinated session invalidation at logout
String ssoId = (String) request.getNote(Constants.REQ_SSOID_NOTE);
@@ -126,13 +122,10 @@
*/
// Retrieve the certificate chain for this client
- if (containerLog.isDebugEnabled())
- containerLog.debug(" Looking up certificates");
-
X509Certificate certs[] = request.getCertificateChain();
if ((certs == null) || (certs.length < 1)) {
- if (containerLog.isDebugEnabled())
- containerLog.debug(" No certificates included with this
request");
+ if (getContainer().getLogger().isDebugEnabled())
+ getContainer().getLogger().debug(" No certificates included with
this request");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED,
sm.getString("authenticator.certificates"));
return (false);
@@ -141,8 +134,8 @@
// Authenticate the specified certificate chain
principal = context.getRealm().authenticate(certs);
if (principal == null) {
- if (containerLog.isDebugEnabled())
- containerLog.debug(" Realm.authenticate() returned false");
+ if (getContainer().getLogger().isDebugEnabled())
+ getContainer().getLogger().debug(" Realm.authenticate() returned
false");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED,
sm.getString("authenticator.unauthorized"));
return (false);
Modified: trunk/java/org/apache/catalina/valves/ValveBase.java
===================================================================
--- trunk/java/org/apache/catalina/valves/ValveBase.java 2011-04-07 17:02:12 UTC (rev
1702)
+++ trunk/java/org/apache/catalina/valves/ValveBase.java 2011-04-13 13:25:47 UTC (rev
1703)
@@ -39,7 +39,6 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.core.ContainerBase;
import org.apache.catalina.util.StringManager;
-import org.jboss.logging.Logger;
import org.jboss.servlet.http.HttpEvent;
@@ -68,12 +67,6 @@
/**
- * Container log
- */
- protected Logger containerLog = null;
-
-
- /**
* Descriptive information about this Valve implementation. This value
* should be overridden by subclasses.
*/
@@ -275,7 +268,6 @@
Container container=this.getContainer();
if( container == null || ! (container instanceof ContainerBase) )
return null;
- this.containerLog = container.getLogger();
ContainerBase containerBase=(ContainerBase)container;
Pipeline pipe=containerBase.getPipeline();
Valve valves[]=pipe.getValves();
Show replies by date