You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2007/10/19 03:30:42 UTC
svn commit: r586205 - in
/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication:
components/ context/
Author: vgritsenko
Date: Thu Oct 18 18:30:41 2007
New Revision: 586205
URL: http://svn.apache.org/viewvc?rev=586205&view=rev
Log:
switching to new AbstractLogEnabled
Modified:
cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java
cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java
Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java?rev=586205&r1=586204&r2=586205&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java (original)
+++ cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java Thu Oct 18 18:30:41 2007
@@ -21,7 +21,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-
import javax.servlet.http.HttpSession;
import org.apache.avalon.framework.activity.Disposable;
@@ -32,17 +31,24 @@
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.context.Contextualizable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.logger.LogEnabled;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.excalibur.source.SourceParameters;
+import org.apache.excalibur.source.SourceResolver;
+import org.apache.excalibur.source.SourceUtil;
+import org.apache.excalibur.xml.xpath.XPathProcessor;
+
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.components.ContextHelper;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.cocoon.util.ClassUtils;
import org.apache.cocoon.util.Deprecation;
+import org.apache.cocoon.util.avalon.CLLoggerWrapper;
import org.apache.cocoon.webapps.authentication.AuthenticationConstants;
import org.apache.cocoon.webapps.authentication.AuthenticationManager;
import org.apache.cocoon.webapps.authentication.configuration.ApplicationConfiguration;
@@ -55,10 +61,7 @@
import org.apache.cocoon.webapps.session.SessionConstants;
import org.apache.cocoon.webapps.session.SessionManager;
import org.apache.cocoon.webapps.session.context.SessionContext;
-import org.apache.excalibur.source.SourceParameters;
-import org.apache.excalibur.source.SourceResolver;
-import org.apache.excalibur.source.SourceUtil;
-import org.apache.excalibur.xml.xpath.XPathProcessor;
+
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
import org.xml.sax.SAXException;
@@ -69,8 +72,7 @@
* @deprecated This block is deprecated and will be removed in future versions.
* @version $Id$
*/
-public class DefaultAuthenticationManager
- extends AbstractLogEnabled
+public class DefaultAuthenticationManager extends AbstractLogEnabled
implements AuthenticationManager,
Serviceable,
Disposable,
@@ -293,7 +295,9 @@
if ( authenticator == null ) {
try {
authenticator = (Authenticator) ClassUtils.newInstance(name);
- ContainerUtil.enableLogging( authenticator, this.getLogger() );
+ if (authenticator instanceof LogEnabled) {
+ ContainerUtil.enableLogging(authenticator, new CLLoggerWrapper(getLogger()));
+ }
ContainerUtil.contextualize( authenticator, this.context);
ContainerUtil.service( authenticator, this.manager );
ContainerUtil.initialize( authenticator );
Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java?rev=586205&r1=586204&r2=586205&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java (original)
+++ cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/PipelineAuthenticator.java Thu Oct 18 18:30:41 2007
@@ -19,22 +19,24 @@
import java.io.IOException;
import org.apache.avalon.framework.activity.Disposable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceException;
+import org.apache.excalibur.source.SourceParameters;
+import org.apache.excalibur.source.SourceResolver;
+
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration;
import org.apache.cocoon.webapps.authentication.user.UserHandler;
import org.apache.cocoon.webapps.session.MediaManager;
import org.apache.cocoon.xml.XMLUtils;
import org.apache.cocoon.xml.dom.DOMUtil;
-import org.apache.excalibur.source.Source;
-import org.apache.excalibur.source.SourceException;
-import org.apache.excalibur.source.SourceParameters;
-import org.apache.excalibur.source.SourceResolver;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -48,9 +50,8 @@
* @deprecated This block is deprecated and will be removed in future versions.
* @version $Id$
*/
-public class PipelineAuthenticator
- extends AbstractLogEnabled
- implements Serviceable, ThreadSafe, Disposable, Authenticator {
+public class PipelineAuthenticator extends AbstractLogEnabled
+ implements Serviceable, ThreadSafe, Disposable, Authenticator {
/** The service manager */
protected ServiceManager manager;
@@ -72,24 +73,24 @@
// authenticationFragment must only have exactly one child with
// the name authentication
- if (authenticationFragment.hasChildNodes() == true
+ if (authenticationFragment.hasChildNodes()
&& authenticationFragment.getChildNodes().getLength() == 1) {
Node child = authenticationFragment.getFirstChild();
if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().equals("authentication") == true) {
+ && child.getNodeName().equals("authentication")) {
// now authentication must have one child ID
- if (child.hasChildNodes() == true) {
+ if (child.hasChildNodes()) {
NodeList children = child.getChildNodes();
boolean found = false;
int i = 0;
int l = children.getLength();
- while (found == false && i < l) {
+ while (!found && i < l) {
child = children.item(i);
if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().equals("ID") == true) {
+ && child.getNodeName().equals("ID")) {
found = true;
} else {
i++;
@@ -97,9 +98,9 @@
}
// now the last check: ID must have a TEXT child
- if (found == true) {
+ if (found) {
child.normalize(); // join text nodes
- if (child.hasChildNodes() == true &&
+ if (child.hasChildNodes() &&
child.getChildNodes().getLength() == 1 &&
child.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE) {
String value = child.getChildNodes().item(0).getNodeValue().trim();
Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java?rev=586205&r1=586204&r2=586205&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java (original)
+++ cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/components/ServletAuthenticator.java Thu Oct 18 18:30:41 2007
@@ -19,18 +19,20 @@
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.framework.context.ContextException;
import org.apache.avalon.framework.context.Contextualizable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.excalibur.source.SourceParameters;
+import org.apache.excalibur.xml.dom.DOMParser;
+
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.components.ContextHelper;
import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.cocoon.webapps.authentication.configuration.HandlerConfiguration;
import org.apache.cocoon.webapps.authentication.user.UserHandler;
-import org.apache.excalibur.source.SourceParameters;
-import org.apache.excalibur.xml.dom.DOMParser;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
Modified: cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java?rev=586205&r1=586204&r2=586205&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java (original)
+++ cocoon/trunk/blocks/cocoon-authentication-fw/cocoon-authentication-fw-impl/src/main/java/org/apache/cocoon/webapps/authentication/context/AuthenticationContextProvider.java Thu Oct 18 18:30:41 2007
@@ -16,12 +16,13 @@
*/
package org.apache.cocoon.webapps.authentication.context;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
import org.apache.avalon.framework.thread.ThreadSafe;
+
import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.util.AbstractLogEnabled;
import org.apache.cocoon.webapps.authentication.AuthenticationConstants;
import org.apache.cocoon.webapps.authentication.AuthenticationManager;
import org.apache.cocoon.webapps.authentication.user.RequestState;
@@ -36,9 +37,8 @@
* @deprecated This block is deprecated and will be removed in future versions.
* @version $Id$
*/
-public final class AuthenticationContextProvider
-extends AbstractLogEnabled
-implements SessionContextProvider, ThreadSafe, Serviceable {
+public final class AuthenticationContextProvider extends AbstractLogEnabled
+ implements SessionContextProvider, ThreadSafe, Serviceable {
protected ServiceManager manager;