JBossWeb SVN: r233 - in tags: JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2007-08-22 04:38:46 -0400 (Wed, 22 Aug 2007)
New Revision: 233
Added:
tags/JBOSSWEB_2_0_0_GA_CP01/
Modified:
tags/JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http/Cookies.java
tags/JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java
Log:
Fix CVE-2007-3382 and CVE-2007-3385.
Copied: tags/JBOSSWEB_2_0_0_GA_CP01 (from rev 226, tags/JBOSSWEB_2_0_0_GA)
Modified: tags/JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- tags/JBOSSWEB_2_0_0_GA/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2007-08-15 15:50:29 UTC (rev 226)
+++ tags/JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2007-08-22 08:38:46 UTC (rev 233)
@@ -249,9 +249,11 @@
int endValue=startValue;
cc=bytes[pos];
- if( cc== '\'' || cc=='"' ) {
- startValue++;
- endValue=indexOf( bytes, startValue, end, cc );
+ if( cc=='"' ) {
+ endValue=findDelim3( bytes, startValue+1, end, cc );
+ if (endValue == -1) {
+ endValue=findDelim2( bytes, startValue+1, end );
+ } else startValue++;
pos=endValue+1; // to skip to next cookie
} else {
endValue=findDelim2( bytes, startValue, end );
@@ -335,28 +337,26 @@
return off;
}
- public static int indexOf( byte bytes[], int off, int end, byte qq )
+ /*
+ * search for cc but skip \cc as required by rfc2616
+ * (according to rfc2616 cc should be ")
+ */
+ public static int findDelim3( byte bytes[], int off, int end, byte cc )
{
while( off < end ) {
byte b=bytes[off];
- if( b==qq )
+ if ( b== '\\' ) {
+ off++;
+ off++;
+ continue;
+ }
+ if( b==cc )
return off;
off++;
}
- return off;
+ return -1;
}
- public static int indexOf( byte bytes[], int off, int end, char qq )
- {
- while( off < end ) {
- byte b=bytes[off];
- if( b==qq )
- return off;
- off++;
- }
- return off;
- }
-
// XXX will be refactored soon!
public static boolean equals( String s, byte b[], int start, int end) {
int blen = end-start;
@@ -412,7 +412,7 @@
/**
*
* Strips quotes from the start and end of the cookie string
- * This conforms to RFC 2109
+ * This conforms to RFC 2965
*
* @param value a <code>String</code> specifying the cookie
* value (possibly quoted).
@@ -423,8 +423,7 @@
private static String stripQuote( String value )
{
// log("Strip quote from " + value );
- if (((value.startsWith("\"")) && (value.endsWith("\""))) ||
- ((value.startsWith("'") && (value.endsWith("'"))))) {
+ if (value.startsWith("\"") && value.endsWith("\"")) {
try {
return value.substring(1,value.length()-1);
} catch (Exception ex) {
Modified: tags/JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java
===================================================================
--- tags/JBOSSWEB_2_0_0_GA/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java 2007-08-15 15:50:29 UTC (rev 226)
+++ tags/JBOSSWEB_2_0_0_GA_CP01/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java 2007-08-22 08:38:46 UTC (rev 233)
@@ -130,6 +130,7 @@
//
// private static final String tspecials = "()<>@,;:\\\"/[]?={} \t";
private static final String tspecials = ",; ";
+ private static final String tspecials2 = ",; \"";
/*
* Tests a string and returns true if the string counts as a
@@ -154,6 +155,19 @@
return true;
}
+ public static boolean isToken2(String value) {
+ if( value==null) return true;
+ int len = value.length();
+
+ for (int i = 0; i < len; i++) {
+ char c = value.charAt(i);
+
+ if (c < 0x20 || c >= 0x7f || tspecials2.indexOf(c) != -1)
+ return false;
+ }
+ return true;
+ }
+
public static boolean checkName( String name ) {
if (!isToken(name)
|| name.equalsIgnoreCase("Comment") // rfc2019
@@ -213,7 +227,7 @@
// this part is the same for all cookies
buf.append( name );
buf.append("=");
- maybeQuote(version, buf, value);
+ maybeQuote2(version, buf, value);
// XXX Netscape cookie: "; "
// add version 1 specific information
@@ -283,6 +297,17 @@
buf.append('"');
}
}
+ public static void maybeQuote2 (int version, StringBuffer buf,
+ String value) {
+ // special case - a \n or \r shouldn't happen in any case
+ if (isToken2(value)) {
+ buf.append(value);
+ } else {
+ buf.append('"');
+ buf.append(escapeDoubleQuotes(value));
+ buf.append('"');
+ }
+ }
// log
static final int dbg=1;
@@ -306,12 +331,14 @@
}
StringBuffer b = new StringBuffer();
+ char p = s.charAt(0);
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
- if (c == '"')
+ if (c == '"' && p != '\\')
b.append('\\').append('"');
else
b.append(c);
+ p = c;
}
return b.toString();
17 years, 6 months
JBossWeb SVN: r232 - tags.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-21 07:26:56 -0400 (Tue, 21 Aug 2007)
New Revision: 232
Added:
tags/JBOSSWEB_2_0_1_CR6/
Log:
- JBoss Web 2.0.1 CR 6 (migrate to JBoss Logging).
Copied: tags/JBOSSWEB_2_0_1_CR6 (from rev 231, branches/2.0.x)
17 years, 6 months
JBossWeb SVN: r231 - branches/2.0.x/lib.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-20 19:48:35 -0400 (Mon, 20 Aug 2007)
New Revision: 231
Removed:
branches/2.0.x/lib/commons-logging.jar
Log:
- Remove commons-logging.
Deleted: branches/2.0.x/lib/commons-logging.jar
===================================================================
(Binary files differ)
17 years, 6 months
JBossWeb SVN: r230 - in branches/2.0.x/src/share/classes/org: apache/catalina/authenticator and 37 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-20 19:47:37 -0400 (Mon, 20 Aug 2007)
New Revision: 230
Added:
branches/2.0.x/src/share/classes/org/jboss/logging/
branches/2.0.x/src/share/classes/org/jboss/logging/DynamicLogger.java
branches/2.0.x/src/share/classes/org/jboss/logging/Logger.java
branches/2.0.x/src/share/classes/org/jboss/logging/LoggerPlugin.java
branches/2.0.x/src/share/classes/org/jboss/logging/MDC.java
branches/2.0.x/src/share/classes/org/jboss/logging/MDCProvider.java
branches/2.0.x/src/share/classes/org/jboss/logging/MDCSupport.java
branches/2.0.x/src/share/classes/org/jboss/logging/NDC.java
branches/2.0.x/src/share/classes/org/jboss/logging/NDCProvider.java
branches/2.0.x/src/share/classes/org/jboss/logging/NDCSupport.java
branches/2.0.x/src/share/classes/org/jboss/logging/NullLoggerPlugin.java
branches/2.0.x/src/share/classes/org/jboss/logging/NullMDCProvider.java
branches/2.0.x/src/share/classes/org/jboss/logging/NullNDCProvider.java
branches/2.0.x/src/share/classes/org/jboss/logging/jdk/
branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDK14LoggerPlugin.java
branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKMDCProvider.java
branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKNDCProvider.java
Modified:
branches/2.0.x/src/share/classes/org/apache/catalina/Container.java
branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java
branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/BasicAuthenticator.java
branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/DigestAuthenticator.java
branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java
branches/2.0.x/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java
branches/2.0.x/src/share/classes/org/apache/catalina/connector/MapperListener.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/AprLifecycleListener.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/ContainerBase.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/JasperListener.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/NamingContextListener.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardContext.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardEngine.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHost.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHostValve.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardPipeline.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardServer.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardService.java
branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardWrapper.java
branches/2.0.x/src/share/classes/org/apache/catalina/deploy/SecurityCollection.java
branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappLoader.java
branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanFactory.java
branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanUtils.java
branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/ServerLifecycleListener.java
branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASMemoryLoginModule.java
branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASRealm.java
branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java
branches/2.0.x/src/share/classes/org/apache/catalina/realm/RealmBase.java
branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityConfig.java
branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityUtil.java
branches/2.0.x/src/share/classes/org/apache/catalina/session/ManagerBase.java
branches/2.0.x/src/share/classes/org/apache/catalina/session/PersistentManagerBase.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/Bootstrap.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/CatalinaProperties.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClassLoaderFactory.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClusterRuleSetFactory.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/ContextConfig.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/DigesterFactory.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/EngineConfig.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/ExpandWar.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/HostConfig.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/TldConfig.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/Tool.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/UserConfig.java
branches/2.0.x/src/share/classes/org/apache/catalina/users/MemoryUserDatabase.java
branches/2.0.x/src/share/classes/org/apache/catalina/util/ExtensionValidator.java
branches/2.0.x/src/share/classes/org/apache/catalina/util/StringManager.java
branches/2.0.x/src/share/classes/org/apache/catalina/valves/AccessLogValve.java
branches/2.0.x/src/share/classes/org/apache/catalina/valves/ExtendedAccessLogValve.java
branches/2.0.x/src/share/classes/org/apache/catalina/valves/RequestDumperValve.java
branches/2.0.x/src/share/classes/org/apache/catalina/valves/ValveBase.java
branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java
branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpMessage.java
branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProcessor.java
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProtocol.java
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Processor.java
branches/2.0.x/src/share/classes/org/apache/jasper/EmbeddedServletOptions.java
branches/2.0.x/src/share/classes/org/apache/jasper/JspC.java
branches/2.0.x/src/share/classes/org/apache/jasper/JspCompilationContext.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/Compiler.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspConfig.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspReader.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspRuntimeContext.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/SmapUtil.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TagLibraryInfoImpl.java
branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TldLocationsCache.java
branches/2.0.x/src/share/classes/org/apache/jasper/runtime/JspFactoryImpl.java
branches/2.0.x/src/share/classes/org/apache/jasper/runtime/TagHandlerPool.java
branches/2.0.x/src/share/classes/org/apache/jasper/security/SecurityClassLoad.java
branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java
branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java
branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/ParserUtils.java
branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UCSReader.java
branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UTF8Reader.java
branches/2.0.x/src/share/classes/org/apache/naming/NamingContext.java
branches/2.0.x/src/share/classes/org/apache/naming/resources/FileDirContext.java
branches/2.0.x/src/share/classes/org/apache/naming/resources/WARDirContext.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/DomUtil.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/Base64.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/C2BConverter.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/StringCache.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UDecoder.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UEncoder.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UTF8Decoder.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimpleHashtable.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimplePool.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/GenericParser.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/XercesParser.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Cookies.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Parameters.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/mapper/Mapper.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/BaseModelMBean.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/Registry.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansSource.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/BaseEndpoint.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/JIoEndpoint.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioEndpoint.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioSelectorPool.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/PoolTcpEndpoint.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/SSLImplementation.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSEImplementation.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESupport.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/threads/ThreadPool.java
branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java
branches/2.0.x/src/share/classes/org/jboss/web/php/ScriptEnvironment.java
Log:
- Switch to JBoss logging.
- The JBoss Logging classes could be replaced with a JBoss Logging JAR in that branch (it does not need any custom
runtime behavior since there's no standalone build).
- Needs testing.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/Container.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/Container.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/Container.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -26,7 +26,7 @@
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
-import org.apache.commons.logging.Log;
+import org.jboss.logging.Logger;
/**
@@ -161,7 +161,7 @@
* no associated Logger, return the Logger associated with our parent
* Container (if any); otherwise return <code>null</code>.
*/
- public Log getLogger();
+ public Logger getLogger();
/**
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/AuthenticatorBase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -49,8 +49,7 @@
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
import org.apache.catalina.valves.ValveBase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -77,7 +76,7 @@
public abstract class AuthenticatorBase
extends ValveBase
implements Authenticator, Lifecycle {
- private static Log log = LogFactory.getLog(AuthenticatorBase.class);
+ private static Logger log = Logger.getLogger(AuthenticatorBase.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/BasicAuthenticator.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/BasicAuthenticator.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/BasicAuthenticator.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,11 +28,10 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.LoginConfig;
import org.apache.catalina.util.Base64;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.CharChunk;
import org.apache.tomcat.util.buf.MessageBytes;
+import org.jboss.logging.Logger;
@@ -47,7 +46,7 @@
public class BasicAuthenticator
extends AuthenticatorBase {
- private static Log log = LogFactory.getLog(BasicAuthenticator.class);
+ private static Logger log = Logger.getLogger(BasicAuthenticator.class);
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/DigestAuthenticator.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/DigestAuthenticator.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/DigestAuthenticator.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -33,8 +33,7 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.LoginConfig;
import org.apache.catalina.util.MD5Encoder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
@@ -49,7 +48,7 @@
public class DigestAuthenticator
extends AuthenticatorBase {
- private static Log log = LogFactory.getLog(DigestAuthenticator.class);
+ private static Logger log = Logger.getLogger(DigestAuthenticator.class);
// -------------------------------------------------------------- Constants
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/authenticator/FormAuthenticator.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -35,13 +35,12 @@
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.deploy.LoginConfig;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.coyote.ActionCode;
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.CharChunk;
import org.apache.tomcat.util.buf.MessageBytes;
import org.apache.tomcat.util.http.MimeHeaders;
+import org.jboss.logging.Logger;
/**
@@ -56,7 +55,7 @@
public class FormAuthenticator
extends AuthenticatorBase {
- private static Log log = LogFactory.getLog(FormAuthenticator.class);
+ private static Logger log = Logger.getLogger(FormAuthenticator.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/connector/CoyoteAdapter.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -25,8 +25,6 @@
import org.apache.catalina.Globals;
import org.apache.catalina.Wrapper;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.coyote.ActionCode;
import org.apache.coyote.Adapter;
import org.apache.tomcat.util.buf.B2CConverter;
@@ -36,6 +34,7 @@
import org.apache.tomcat.util.http.Cookies;
import org.apache.tomcat.util.http.ServerCookie;
import org.apache.tomcat.util.net.SocketStatus;
+import org.jboss.logging.Logger;
/**
@@ -50,7 +49,7 @@
public class CoyoteAdapter
implements Adapter
{
- private static Log log = LogFactory.getLog(CoyoteAdapter.class);
+ private static Logger log = Logger.getLogger(CoyoteAdapter.class);
// -------------------------------------------------------------- Constants
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/connector/MapperListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/connector/MapperListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/connector/MapperListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -26,14 +26,13 @@
import javax.management.ObjectInstance;
import javax.management.ObjectName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.http.mapper.Mapper;
import org.apache.tomcat.util.modeler.Registry;
import org.apache.tomcat.util.res.StringManager;
+import org.jboss.logging.Logger;
/**
@@ -45,7 +44,7 @@
public class MapperListener
implements NotificationListener
{
- private static Log log = LogFactory.getLog(MapperListener.class);
+ private static Logger log = Logger.getLogger(MapperListener.class);
// ----------------------------------------------------- Instance Variables
@@ -290,7 +289,7 @@
}
}
- if (!isRegisteredWithAlias && log.isWarnEnabled())
+ if (!isRegisteredWithAlias)
log.warn(sm.getString("mapperListener.unknownDefaultHost", defaultHost));
}
// This should probablt be called later
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/AprLifecycleListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/AprLifecycleListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/AprLifecycleListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -25,9 +25,8 @@
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.jni.Library;
+import org.jboss.logging.Logger;
@@ -44,7 +43,7 @@
public class AprLifecycleListener
implements LifecycleListener {
- private static Log log = LogFactory.getLog(AprLifecycleListener.class);
+ private static Logger log = Logger.getLogger(AprLifecycleListener.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/ContainerBase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/ContainerBase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/ContainerBase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -54,10 +54,9 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.naming.resources.ProxyDirContext;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
@@ -123,8 +122,8 @@
public abstract class ContainerBase
implements Container, Lifecycle, Pipeline, MBeanRegistration, Serializable {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( ContainerBase.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( ContainerBase.class );
/**
* Perform addChild with the permissions of this class.
@@ -185,7 +184,7 @@
/**
* The Logger implementation with which this Container is associated.
*/
- protected Log logger = null;
+ protected Logger logger = null;
/**
@@ -380,11 +379,11 @@
* no associated Logger, return the Logger associated with our parent
* Container (if any); otherwise return <code>null</code>.
*/
- public Log getLogger() {
+ public Logger getLogger() {
if (logger != null)
return (logger);
- logger = LogFactory.getLog(logName());
+ logger = Logger.getLogger(logName());
return (logger);
}
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/JasperListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/JasperListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/JasperListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -22,8 +22,7 @@
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -38,7 +37,7 @@
public class JasperListener
implements LifecycleListener {
- private static Log log = LogFactory.getLog(JasperListener.class);
+ private static Logger log = Logger.getLogger(JasperListener.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/NamingContextListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/NamingContextListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/NamingContextListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -57,8 +57,6 @@
import org.apache.catalina.deploy.ContextTransaction;
import org.apache.catalina.deploy.NamingResources;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.naming.ContextAccessController;
import org.apache.naming.ContextBindings;
import org.apache.naming.EjbRef;
@@ -70,6 +68,7 @@
import org.apache.naming.ServiceRef;
import org.apache.naming.TransactionRef;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
@@ -83,13 +82,13 @@
public class NamingContextListener
implements LifecycleListener, ContainerListener, PropertyChangeListener {
- private static Log log = LogFactory.getLog(NamingContextListener.class);
+ private static Logger log = Logger.getLogger(NamingContextListener.class);
// ----------------------------------------------------- Instance Variables
- protected Log logger = log;
+ protected Logger logger = log;
/**
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardContext.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardContext.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardContext.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -92,8 +92,6 @@
import org.apache.catalina.util.ExtensionValidator;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.URLEncoder;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.naming.ContextBindings;
import org.apache.naming.resources.BaseDirContext;
import org.apache.naming.resources.DirContextURLStreamHandler;
@@ -101,6 +99,7 @@
import org.apache.naming.resources.ProxyDirContext;
import org.apache.naming.resources.WARDirContext;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
* Standard implementation of the <b>Context</b> interface. Each
@@ -116,7 +115,7 @@
extends ContainerBase
implements Context, Serializable, NotificationEmitter
{
- private static transient Log log = LogFactory.getLog(StandardContext.class);
+ private static transient Logger log = Logger.getLogger(StandardContext.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardEngine.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardEngine.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardEngine.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,10 +34,9 @@
import org.apache.catalina.Service;
import org.apache.catalina.realm.JAASRealm;
import org.apache.catalina.util.ServerInfo;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
import org.apache.tomcat.util.modeler.modules.MbeansSource;
+import org.jboss.logging.Logger;
/**
* Standard implementation of the <b>Engine</b> interface. Each
@@ -53,7 +52,7 @@
extends ContainerBase
implements Engine {
- private static Log log = LogFactory.getLog(StandardEngine.class);
+ private static Logger log = Logger.getLogger(StandardEngine.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHost.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHost.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHost.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -48,8 +48,8 @@
{
/* Why do we implement deployer and delegate to deployer ??? */
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( StandardHost.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( StandardHost.class );
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHostValve.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardHostValve.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -37,8 +37,7 @@
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.StringManager;
import org.apache.catalina.valves.ValveBase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -57,7 +56,7 @@
extends ValveBase {
- private static Log log = LogFactory.getLog(StandardHostValve.class);
+ private static Logger log = Logger.getLogger(StandardHostValve.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardPipeline.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardPipeline.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardPipeline.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -33,9 +33,8 @@
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
import org.apache.catalina.valves.ValveBase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
@@ -55,7 +54,7 @@
implements Pipeline, Contained, Lifecycle
{
- private static Log log = LogFactory.getLog(StandardPipeline.class);
+ private static Logger log = Logger.getLogger(StandardPipeline.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardServer.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardServer.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardServer.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -44,10 +44,9 @@
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
import org.apache.catalina.util.ServerInfo;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.buf.StringCache;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
@@ -61,7 +60,7 @@
public final class StandardServer
implements Lifecycle, Server, MBeanRegistration
{
- private static Log log = LogFactory.getLog(StandardServer.class);
+ private static Logger log = Logger.getLogger(StandardServer.class);
// -------------------------------------------------------------- Constants
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardService.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardService.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardService.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -35,11 +35,10 @@
import org.apache.catalina.connector.Connector;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
import java.util.ArrayList;
import org.apache.catalina.Executor;
+import org.jboss.logging.Logger;
/**
@@ -53,7 +52,7 @@
public class StandardService
implements Lifecycle, Service, MBeanRegistration
{
- private static Log log = LogFactory.getLog(StandardService.class);
+ private static Logger log = Logger.getLogger(StandardService.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardWrapper.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardWrapper.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/core/StandardWrapper.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -77,8 +77,8 @@
extends ContainerBase
implements ServletConfig, Wrapper, NotificationEmitter {
- protected static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( StandardWrapper.class );
+ protected static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( StandardWrapper.class );
protected static final String[] DEFAULT_SERVLET_METHODS = new String[] {
"GET", "HEAD", "POST" };
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/deploy/SecurityCollection.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/deploy/SecurityCollection.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/deploy/SecurityCollection.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -20,8 +20,7 @@
import org.apache.catalina.util.RequestUtil;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
import java.io.Serializable;
@@ -44,7 +43,7 @@
public class SecurityCollection implements Serializable {
- private static Log log = LogFactory.getLog(SecurityCollection.class);
+ private static Logger log = Logger.getLogger(SecurityCollection.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappClassLoader.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -106,8 +106,8 @@
implements Reloader, Lifecycle
{
- protected static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( WebappClassLoader.class );
+ protected static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( WebappClassLoader.class );
public static final boolean ENABLE_CLEAR_REFERENCES =
Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES", "true")).booleanValue();
@@ -1638,9 +1638,6 @@
// Clear the IntrospectionUtils cache.
IntrospectionUtils.clear();
- // Clear the classloader reference in common-logging
- org.apache.commons.logging.LogFactory.release(this);
-
// Clear the classloader reference in the VM's bean introspector
java.beans.Introspector.flushCaches();
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappLoader.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappLoader.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/loader/WebappLoader.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -1191,8 +1191,8 @@
}
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( WebappLoader.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( WebappLoader.class );
private ObjectName oname;
private MBeanServer mserver;
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -32,9 +32,8 @@
import org.apache.catalina.Role;
import org.apache.catalina.User;
import org.apache.catalina.UserDatabase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
@@ -49,7 +48,7 @@
public class GlobalResourcesLifecycleListener
implements LifecycleListener {
- private static Log log = LogFactory.getLog(GlobalResourcesLifecycleListener.class);
+ private static Logger log = Logger.getLogger(GlobalResourcesLifecycleListener.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanFactory.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanFactory.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanFactory.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -67,8 +67,8 @@
public class MBeanFactory extends BaseModelMBean {
- private static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(MBeanFactory.class);
+ private static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(MBeanFactory.class);
/**
* The <code>MBeanServer</code> for this application.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanUtils.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanUtils.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/MBeanUtils.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -47,11 +47,10 @@
import org.apache.catalina.deploy.ContextResourceLink;
import org.apache.catalina.deploy.NamingResources;
import org.apache.catalina.valves.ValveBase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.modeler.ManagedBean;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
@@ -63,7 +62,7 @@
*/
public class MBeanUtils {
- private static Log log = LogFactory.getLog(MBeanUtils.class);
+ private static Logger log = Logger.getLogger(MBeanUtils.class);
// ------------------------------------------------------- Static Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/ServerLifecycleListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/ServerLifecycleListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/mbeans/ServerLifecycleListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -48,8 +48,7 @@
import org.apache.catalina.deploy.ContextResource;
import org.apache.catalina.deploy.ContextResourceLink;
import org.apache.catalina.deploy.NamingResources;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -65,7 +64,7 @@
public class ServerLifecycleListener
implements ContainerListener, LifecycleListener, PropertyChangeListener {
- private static Log log = LogFactory.getLog(ServerLifecycleListener.class);
+ private static Logger log = Logger.getLogger(ServerLifecycleListener.class);
// ------------------------------------------------------------- Properties
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASMemoryLoginModule.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASMemoryLoginModule.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASMemoryLoginModule.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -42,9 +42,8 @@
import org.apache.catalina.deploy.SecurityConstraint;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.digester.Digester;
+import org.jboss.logging.Logger;
/**
@@ -79,7 +78,7 @@
public class JAASMemoryLoginModule extends MemoryRealm implements LoginModule, Realm {
// We need to extend MemoryRealm to avoid class cast
- private static Log log = LogFactory.getLog(JAASMemoryLoginModule.class);
+ private static Logger log = Logger.getLogger(JAASMemoryLoginModule.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASRealm.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASRealm.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/JAASRealm.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,8 +34,7 @@
import org.apache.catalina.Container;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -126,7 +125,7 @@
public class JAASRealm
extends RealmBase
{
- private static Log log = LogFactory.getLog(JAASRealm.class);
+ private static Logger log = Logger.getLogger(JAASRealm.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/MemoryRealm.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -26,9 +26,8 @@
import java.util.Map;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.digester.Digester;
+import org.jboss.logging.Logger;
/**
@@ -47,7 +46,7 @@
public class MemoryRealm extends RealmBase {
- private static Log log = LogFactory.getLog(MemoryRealm.class);
+ private static Logger log = Logger.getLogger(MemoryRealm.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/realm/RealmBase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/realm/RealmBase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/realm/RealmBase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -51,9 +51,8 @@
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.MD5Encoder;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
* Simple implementation of <b>Realm</b> that reads an XML file to configure
@@ -67,7 +66,7 @@
public abstract class RealmBase
implements Lifecycle, Realm, MBeanRegistration {
- private static Log log = LogFactory.getLog(RealmBase.class);
+ private static Logger log = Logger.getLogger(RealmBase.class);
// ----------------------------------------------------- Instance Variables
@@ -81,7 +80,7 @@
/**
* Container log
*/
- protected Log containerLog = null;
+ protected Logger containerLog = null;
/**
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,8 +28,8 @@
public final class SecurityConfig{
private static SecurityConfig singleton = null;
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( SecurityConfig.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( SecurityConfig.class );
private final static String PACKAGE_ACCESS = "sun.,"
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityUtil.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityUtil.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/security/SecurityUtil.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -64,8 +64,8 @@
*/
private static HashMap objectCache = new HashMap();
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( SecurityUtil.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( SecurityUtil.class );
private static String PACKAGE = "org.apache.catalina.security";
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/session/ManagerBase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/session/ManagerBase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/session/ManagerBase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -50,9 +50,8 @@
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardHost;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
/**
@@ -65,7 +64,7 @@
*/
public abstract class ManagerBase implements Manager, MBeanRegistration {
- protected Log log = LogFactory.getLog(ManagerBase.class);
+ protected Logger log = Logger.getLogger(ManagerBase.class);
// ----------------------------------------------------- Instance Variables
@@ -701,7 +700,7 @@
if( initialized ) return;
initialized=true;
- log = LogFactory.getLog(ManagerBase.class);
+ log = Logger.getLogger(ManagerBase.class);
if( oname==null ) {
try {
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/session/PersistentManagerBase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/session/PersistentManagerBase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/session/PersistentManagerBase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,8 +34,7 @@
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.security.SecurityUtil;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
* Extends the <b>ManagerBase</b> class to implement most of the
* functionality required by a Manager which supports any kind of
@@ -54,7 +53,7 @@
extends ManagerBase
implements Lifecycle, PropertyChangeListener {
- private static Log log = LogFactory.getLog(PersistentManagerBase.class);
+ private static Logger log = Logger.getLogger(PersistentManagerBase.class);
// ---------------------------------------------------- Security Classes
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/Bootstrap.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/Bootstrap.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/Bootstrap.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -31,8 +31,7 @@
import javax.management.ObjectName;
import org.apache.catalina.security.SecurityClassLoad;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -51,7 +50,7 @@
public final class Bootstrap {
- private static Log log = LogFactory.getLog(Bootstrap.class);
+ private static Logger log = Logger.getLogger(Bootstrap.class);
// -------------------------------------------------------------- Constants
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/CatalinaProperties.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/CatalinaProperties.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/CatalinaProperties.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -38,8 +38,8 @@
// ------------------------------------------------------- Static Variables
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( CatalinaProperties.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( CatalinaProperties.class );
private static Properties properties = null;
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClassLoaderFactory.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClassLoaderFactory.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClassLoaderFactory.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -24,8 +24,7 @@
import java.util.ArrayList;
import org.apache.catalina.loader.StandardClassLoader;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -50,7 +49,7 @@
public final class ClassLoaderFactory {
- private static Log log = LogFactory.getLog(ClassLoaderFactory.class);
+ private static Logger log = Logger.getLogger(ClassLoaderFactory.class);
protected static final Integer IS_DIR = new Integer(0);
protected static final Integer IS_JAR = new Integer(1);
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClusterRuleSetFactory.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClusterRuleSetFactory.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/ClusterRuleSetFactory.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -23,14 +23,13 @@
import org.apache.tomcat.util.digester.RuleSetBase;
import java.lang.reflect.Constructor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
import java.lang.reflect.InvocationTargetException;
public class ClusterRuleSetFactory {
- public static Log log = LogFactory.getLog(ClusterRuleSetFactory.class);
+ public static Logger log = Logger.getLogger(ClusterRuleSetFactory.class);
public static RuleSetBase getClusterRuleSet(String prefix) {
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/ContextConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/ContextConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -70,8 +70,8 @@
public class ContextConfig
implements LifecycleListener {
- protected static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( ContextConfig.class );
+ protected static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( ContextConfig.class );
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/DigesterFactory.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/DigesterFactory.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/DigesterFactory.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -33,8 +33,8 @@
/**
* The log.
*/
- protected static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(DigesterFactory.class);
+ protected static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(DigesterFactory.class);
/**
* The XML entiry resolver used by the Digester.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/EngineConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/EngineConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/EngineConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -38,8 +38,8 @@
implements LifecycleListener {
- protected static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( EngineConfig.class );
+ protected static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( EngineConfig.class );
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/ExpandWar.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/ExpandWar.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/ExpandWar.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -33,8 +33,7 @@
import org.apache.catalina.Host;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
* Expand out a WAR in a Host's appBase.
@@ -47,7 +46,7 @@
public class ExpandWar {
- private static Log log = LogFactory.getLog(ExpandWar.class);
+ private static Logger log = Logger.getLogger(ExpandWar.class);
/**
* The string resources for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/HostConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/HostConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/HostConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -57,8 +57,8 @@
public class HostConfig
implements LifecycleListener {
- protected static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( HostConfig.class );
+ protected static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( HostConfig.class );
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/TldConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/TldConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/TldConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -66,8 +66,8 @@
// Names of JARs that are known not to contain any TLDs
private static HashSet<String> noTldJars;
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( TldConfig.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( TldConfig.class );
/*
* Initializes the set of JARs that are known not to contain any TLDs
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/Tool.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/Tool.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/Tool.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -23,8 +23,7 @@
import java.lang.reflect.Method;
import java.util.ArrayList;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -73,7 +72,7 @@
public final class Tool {
- private static Log log = LogFactory.getLog(Tool.class);
+ private static Logger log = Logger.getLogger(Tool.class);
// ------------------------------------------------------- Static Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/UserConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/UserConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/UserConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -45,8 +45,8 @@
implements LifecycleListener {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( UserConfig.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( UserConfig.class );
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/users/MemoryUserDatabase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/users/MemoryUserDatabase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/users/MemoryUserDatabase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -32,10 +32,9 @@
import org.apache.catalina.User;
import org.apache.catalina.UserDatabase;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.digester.Digester;
import org.apache.tomcat.util.digester.ObjectCreationFactory;
+import org.jboss.logging.Logger;
import org.xml.sax.Attributes;
@@ -52,7 +51,7 @@
public class MemoryUserDatabase implements UserDatabase {
- private static Log log = LogFactory.getLog(MemoryUserDatabase.class);
+ private static Logger log = Logger.getLogger(MemoryUserDatabase.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/util/ExtensionValidator.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/util/ExtensionValidator.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/util/ExtensionValidator.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -52,8 +52,8 @@
*/
public final class ExtensionValidator {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(ExtensionValidator.class);
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(ExtensionValidator.class);
/**
* The string resources for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/util/StringManager.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/util/StringManager.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/util/StringManager.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -56,8 +56,8 @@
private ResourceBundle bundle;
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( StringManager.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( StringManager.class );
/**
* Creates a new StringManager for a given package. This is a
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/valves/AccessLogValve.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/valves/AccessLogValve.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/valves/AccessLogValve.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -43,8 +43,7 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -118,7 +117,7 @@
extends ValveBase
implements Lifecycle {
- private static Log log = LogFactory.getLog(AccessLogValve.class);
+ private static Logger log = Logger.getLogger(AccessLogValve.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/valves/ExtendedAccessLogValve.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/valves/ExtendedAccessLogValve.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/valves/ExtendedAccessLogValve.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -36,8 +36,7 @@
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.ServerInfo;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
@@ -129,7 +128,7 @@
extends AccessLogValve
implements Lifecycle {
- private static Log log = LogFactory.getLog(ExtendedAccessLogValve.class);
+ private static Logger log = Logger.getLogger(ExtendedAccessLogValve.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/valves/RequestDumperValve.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/valves/RequestDumperValve.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/valves/RequestDumperValve.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,7 +28,7 @@
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
+import org.jboss.logging.Logger;
/**
@@ -94,7 +94,7 @@
public void invoke(Request request, Response response)
throws IOException, ServletException {
- Log log = container.getLogger();
+ Logger log = container.getLogger();
// Log pre-service information
log.info("REQUEST URI =" + request.getRequestURI());
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/valves/ValveBase.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/valves/ValveBase.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/valves/ValveBase.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -40,8 +40,7 @@
import org.apache.catalina.connector.Response;
import org.apache.catalina.core.ContainerBase;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -57,7 +56,7 @@
public abstract class ValveBase
implements Contained, Valve, MBeanRegistration {
- private static Log log = LogFactory.getLog(ValveBase.class);
+ private static Logger log = Logger.getLogger(ValveBase.class);
//------------------------------------------------------ Instance Variables
@@ -71,7 +70,7 @@
/**
* Container log
*/
- protected Log containerLog = null;
+ protected Logger containerLog = null;
/**
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProcessor.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -61,8 +61,8 @@
/**
* Logger.
*/
- protected static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(AjpAprProcessor.class);
+ protected static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(AjpAprProcessor.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpMessage.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpMessage.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpMessage.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -38,8 +38,8 @@
public class AjpMessage {
- protected static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(AjpMessage.class);
+ protected static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(AjpMessage.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProcessor.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -61,8 +61,8 @@
/**
* Logger.
*/
- protected static org.apache.commons.logging.Log log
- = org.apache.commons.logging.LogFactory.getLog(AjpProcessor.class);
+ protected static org.jboss.logging.Logger log
+ = org.jboss.logging.Logger.getLogger(AjpProcessor.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -69,8 +69,8 @@
/**
* Logger.
*/
- protected static org.apache.commons.logging.Log log
- = org.apache.commons.logging.LogFactory.getLog(Http11AprProcessor.class);
+ protected static org.jboss.logging.Logger log
+ = org.jboss.logging.Logger.getLogger(Http11AprProcessor.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProcessor.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProcessor.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProcessor.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -67,8 +67,8 @@
/**
* Logger.
*/
- protected static org.apache.commons.logging.Log log
- = org.apache.commons.logging.LogFactory.getLog(Http11NioProcessor.class);
+ protected static org.jboss.logging.Logger log
+ = org.jboss.logging.Logger.getLogger(Http11NioProcessor.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProtocol.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProtocol.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11NioProtocol.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -794,8 +794,8 @@
}
- protected static org.apache.commons.logging.Log log
- = org.apache.commons.logging.LogFactory.getLog(Http11NioProtocol.class);
+ protected static org.jboss.logging.Logger log
+ = org.jboss.logging.Logger.getLogger(Http11NioProtocol.class);
// -------------------- Various implementation classes --------------------
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Processor.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Processor.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Processor.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -64,8 +64,8 @@
/**
* Logger.
*/
- protected static org.apache.commons.logging.Log log
- = org.apache.commons.logging.LogFactory.getLog(Http11Processor.class);
+ protected static org.jboss.logging.Logger log
+ = org.jboss.logging.Logger.getLogger(Http11Processor.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/EmbeddedServletOptions.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/EmbeddedServletOptions.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/EmbeddedServletOptions.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -23,13 +23,12 @@
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.compiler.TldLocationsCache;
import org.apache.jasper.compiler.JspConfig;
import org.apache.jasper.compiler.TagPluginManager;
import org.apache.jasper.compiler.Localizer;
import org.apache.jasper.xmlparser.ParserUtils;
+import org.jboss.logging.Logger;
/**
* A class to hold all init parameters specific to the JSP engine.
@@ -41,7 +40,7 @@
public final class EmbeddedServletOptions implements Options {
// Logger
- private Log log = LogFactory.getLog(EmbeddedServletOptions.class);
+ private Logger log = Logger.getLogger(EmbeddedServletOptions.class);
private Properties settings = new Properties();
@@ -419,9 +418,7 @@
} else if (keepgen.equalsIgnoreCase("false")) {
this.keepGenerated = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.keepgen"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.keepgen"));
}
}
@@ -433,23 +430,18 @@
} else if (trimsp.equalsIgnoreCase("false")) {
trimSpaces = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.trimspaces"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.trimspaces"));
}
}
this.isPoolingEnabled = true;
- String poolingEnabledParam
- = config.getInitParameter("enablePooling");
+ String poolingEnabledParam = config.getInitParameter("enablePooling");
if (poolingEnabledParam != null
&& !poolingEnabledParam.equalsIgnoreCase("true")) {
if (poolingEnabledParam.equalsIgnoreCase("false")) {
this.isPoolingEnabled = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.enablePooling"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.enablePooling"));
}
}
@@ -460,9 +452,7 @@
} else if (mapFile.equalsIgnoreCase("false")) {
this.mappedFile = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.mappedFile"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.mappedFile"));
}
}
@@ -473,9 +463,7 @@
} else if (senderr.equalsIgnoreCase("false")) {
this.sendErrorToClient = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.sendErrToClient"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.sendErrToClient"));
}
}
@@ -486,9 +474,7 @@
} else if (debugInfo.equalsIgnoreCase("false")) {
this.classDebugInfo = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.classDebugInfo"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.classDebugInfo"));
}
}
@@ -497,9 +483,7 @@
try {
this.checkInterval = Integer.parseInt(checkInterval);
} catch(NumberFormatException ex) {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.checkInterval"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.checkInterval"));
}
}
@@ -508,9 +492,7 @@
try {
this.modificationTestInterval = Integer.parseInt(modificationTestInterval);
} catch(NumberFormatException ex) {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.modificationTestInterval"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.modificationTestInterval"));
}
}
@@ -521,9 +503,7 @@
} else if (development.equalsIgnoreCase("false")) {
this.development = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.development"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.development"));
}
}
@@ -534,9 +514,7 @@
} else if (suppressSmap.equalsIgnoreCase("false")) {
isSmapSuppressed = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.suppressSmap"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.suppressSmap"));
}
}
@@ -547,9 +525,7 @@
} else if (dumpSmap.equalsIgnoreCase("false")) {
isSmapDumped = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.dumpSmap"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.dumpSmap"));
}
}
@@ -560,9 +536,7 @@
} else if (genCharArray.equalsIgnoreCase("false")) {
genStringAsCharArray = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.genchararray"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.genchararray"));
}
}
@@ -574,9 +548,7 @@
} else if (errBeanClass.equalsIgnoreCase("false")) {
errorOnUseBeanInvalidClassAttribute = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.errBean"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.errBean"));
}
}
@@ -644,9 +616,7 @@
} else if (fork.equalsIgnoreCase("false")) {
this.fork = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.fork"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.fork"));
}
}
@@ -657,9 +627,7 @@
} else if (xpoweredBy.equalsIgnoreCase("false")) {
this.xpoweredBy = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.xpoweredBy"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.xpoweredBy"));
}
}
@@ -670,9 +638,7 @@
} else if (displaySourceFragment.equalsIgnoreCase("false")) {
this.displaySourceFragment = false;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage("jsp.warning.displaySourceFragment"));
- }
+ log.warn(Localizer.getMessage("jsp.warning.displaySourceFragment"));
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/JspC.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/JspC.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/JspC.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -40,8 +40,6 @@
import java.util.StringTokenizer;
import java.util.Vector;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.compiler.Compiler;
import org.apache.jasper.compiler.JspConfig;
import org.apache.jasper.compiler.JspRuntimeContext;
@@ -53,6 +51,7 @@
import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.FileUtils;
+import org.jboss.logging.Logger;
/**
* Shell for the jspc compiler. Handles all options associated with the
@@ -95,7 +94,7 @@
"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93";
// Logger
- protected static Log log = LogFactory.getLog(JspC.class);
+ protected static Logger log = Logger.getLogger(JspC.class);
protected static final String SWITCH_VERBOSE = "-v";
protected static final String SWITCH_HELP = "-help";
@@ -1033,7 +1032,7 @@
}
} catch (Exception e) {
- if ((e instanceof FileNotFoundException) && log.isWarnEnabled()) {
+ if (e instanceof FileNotFoundException) {
log.warn(Localizer.getMessage("jspc.error.fileDoesNotExist",
e.getMessage()));
}
@@ -1139,11 +1138,9 @@
fjsp = new File(uriRootF, nextjsp);
}
if (!fjsp.exists()) {
- if (log.isWarnEnabled()) {
- log.warn
+ log.warn
(Localizer.getMessage
("jspc.error.fileDoesNotExist", fjsp.toString()));
- }
continue;
}
String s = fjsp.getAbsolutePath();
@@ -1176,9 +1173,9 @@
}
throw je;
} finally {
- if (loader != null) {
- LogFactory.release(loader);
- }
+ /*if (loader != null) {
+ Logger.release(loader);
+ }*/
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/JspCompilationContext.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/JspCompilationContext.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/JspCompilationContext.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -53,8 +53,8 @@
*/
public class JspCompilationContext {
- protected org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(JspCompilationContext.class);
+ protected org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(JspCompilationContext.class);
protected Map<String, URL> tagFileJarUrls;
protected boolean isPackagedTagFile;
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/Compiler.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/Compiler.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/Compiler.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -45,8 +45,8 @@
*/
public abstract class Compiler {
- protected org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
- .getLog(Compiler.class);
+ protected org.jboss.logging.Logger log = org.jboss.logging.Logger
+ .getLogger(Compiler.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspConfig.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspConfig.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspConfig.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -24,11 +24,10 @@
import javax.servlet.ServletContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.JasperException;
import org.apache.jasper.xmlparser.ParserUtils;
import org.apache.jasper.xmlparser.TreeNode;
+import org.jboss.logging.Logger;
import org.xml.sax.InputSource;
/**
@@ -44,7 +43,7 @@
private static final String WEB_XML = "/WEB-INF/web.xml";
// Logger
- private Log log = LogFactory.getLog(JspConfig.class);
+ private Logger log = Logger.getLogger(JspConfig.class);
private Vector jspProperties = null;
private ServletContext ctxt;
@@ -180,11 +179,9 @@
boolean isStar = "*".equals(extension);
if ((path == null && (extension == null || isStar))
|| (path != null && !isStar)) {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.bad.urlpattern.propertygroup",
urlPattern));
- }
continue;
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspReader.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspReader.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspReader.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -27,10 +27,9 @@
import java.net.URL;
import java.net.MalformedURLException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.JasperException;
import org.apache.jasper.JspCompilationContext;
+import org.jboss.logging.Logger;
/**
* JspReader is an input buffer for the JSP parser. It should allow
@@ -53,7 +52,7 @@
/**
* Logger.
*/
- private Log log = LogFactory.getLog(JspReader.class);
+ private Logger log = Logger.getLogger(JspReader.class);
/**
* The current spot in the file.
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspRuntimeContext.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspRuntimeContext.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/JspRuntimeContext.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -33,14 +33,13 @@
import javax.servlet.ServletContext;
import javax.servlet.jsp.JspFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.Constants;
import org.apache.jasper.JspCompilationContext;
import org.apache.jasper.Options;
import org.apache.jasper.runtime.JspFactoryImpl;
import org.apache.jasper.security.SecurityClassLoad;
import org.apache.jasper.servlet.JspServletWrapper;
+import org.jboss.logging.Logger;
/**
* Class for tracking JSP compile time file dependencies when the
@@ -58,7 +57,7 @@
public final class JspRuntimeContext {
// Logger
- private Log log = LogFactory.getLog(JspRuntimeContext.class);
+ private Logger log = Logger.getLogger(JspRuntimeContext.class);
/*
* Counts how many times the webapp's JSPs have been reloaded.
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/SmapUtil.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/SmapUtil.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/SmapUtil.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -44,8 +44,8 @@
*/
public class SmapUtil {
- private org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( SmapUtil.class );
+ private org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( SmapUtil.class );
//*********************************************************************
// Constants
@@ -189,8 +189,8 @@
// Installation logic (from Robert Field, JSR-045 spec lead)
private static class SDEInstaller {
- private org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( SDEInstaller.class );
+ private org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( SDEInstaller.class );
static final String nameSDE = "SourceDebugExtension";
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TagLibraryInfoImpl.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TagLibraryInfoImpl.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TagLibraryInfoImpl.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -45,12 +45,11 @@
import javax.servlet.jsp.tagext.ValidationMessage;
import javax.servlet.jsp.tagext.VariableInfo;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.JasperException;
import org.apache.jasper.JspCompilationContext;
import org.apache.jasper.xmlparser.ParserUtils;
import org.apache.jasper.xmlparser.TreeNode;
+import org.jboss.logging.Logger;
/**
* Implementation of the TagLibraryInfo class from the JSP spec.
@@ -64,7 +63,7 @@
class TagLibraryInfoImpl extends TagLibraryInfo implements TagConstants {
// Logger
- private Log log = LogFactory.getLog(TagLibraryInfoImpl.class);
+ private Logger log = Logger.getLogger(TagLibraryInfoImpl.class);
private JspCompilationContext ctxt;
@@ -268,10 +267,8 @@
} else if ("taglib-extension".equals(tname)) {
// Recognized but ignored
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.taglib", tname));
- }
}
}
@@ -403,10 +400,8 @@
} else if ("tag-extension".equals(tname)) {
// Ignored
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.tag", tname));
- }
}
}
@@ -468,10 +463,8 @@
|| "description".equals(tname)) {
// Ignore these elements: Bugzilla 38015
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.tagfile", tname));
- }
}
}
@@ -555,10 +548,8 @@
false) {
;
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.attribute", tname));
- }
}
}
@@ -621,10 +612,8 @@
} else if ("description".equals(tname) || // Ignored elements
false) {
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.variable", tname));
- }
}
}
return new TagVariableInfo(nameGiven, nameFromAttribute, className,
@@ -649,10 +638,8 @@
} else if ("description".equals(tname) || // Ignored elements
false) {
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.validator", tname));
- }
}
}
@@ -687,10 +674,8 @@
} else if ("description".equals(tname)) {
; // Do nothing
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.initParam", tname));
- }
}
}
return initParam;
@@ -717,10 +702,8 @@
"small-icon".equals(tname) || "large-icon".equals(tname)
|| "description".equals(tname) || "example".equals(tname)) {
} else {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.warning.unknown.element.in.function", tname));
- }
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TldLocationsCache.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TldLocationsCache.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/compiler/TldLocationsCache.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -35,12 +35,11 @@
import javax.servlet.ServletContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.Constants;
import org.apache.jasper.JasperException;
import org.apache.jasper.xmlparser.ParserUtils;
import org.apache.jasper.xmlparser.TreeNode;
+import org.jboss.logging.Logger;
/**
* A container for all tag libraries that are defined "globally"
@@ -78,7 +77,7 @@
public class TldLocationsCache {
// Logger
- private Log log = LogFactory.getLog(TldLocationsCache.class);
+ private Logger log = Logger.getLogger(TldLocationsCache.class);
/**
* The types of URI one may specify for a tag library
@@ -266,15 +265,13 @@
try {
uri = new URL(FILE_PROTOCOL+altDDName.replace('\\', '/'));
} catch (MalformedURLException e) {
- if (log.isWarnEnabled()) {
- log.warn(Localizer.getMessage(
+ log.warn(Localizer.getMessage(
"jsp.error.internal.filenotfound",
altDDName));
- }
}
} else {
uri = ctxt.getResource(WEB_XML);
- if (uri == null && log.isWarnEnabled()) {
+ if (uri == null) {
log.warn(Localizer.getMessage(
"jsp.error.internal.filenotfound",
WEB_XML));
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/runtime/JspFactoryImpl.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/runtime/JspFactoryImpl.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/runtime/JspFactoryImpl.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -29,8 +29,7 @@
import javax.servlet.jsp.PageContext;
import org.apache.jasper.Constants;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
* Implementation of JspFactory.
@@ -40,7 +39,7 @@
public class JspFactoryImpl extends JspFactory {
// Logger
- private Log log = LogFactory.getLog(JspFactoryImpl.class);
+ private Logger log = Logger.getLogger(JspFactoryImpl.class);
private static final String SPEC_VERSION = "2.1";
private static final boolean USE_POOL =
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/runtime/TagHandlerPool.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/runtime/TagHandlerPool.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/runtime/TagHandlerPool.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -22,9 +22,8 @@
import javax.servlet.jsp.tagext.Tag;
import org.apache.AnnotationProcessor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.Constants;
+import org.jboss.logging.Logger;
/**
* Pool of tag handlers that can be reused.
@@ -38,7 +37,7 @@
public static String OPTION_TAGPOOL="tagpoolClassName";
public static String OPTION_MAXSIZE="tagpoolMaxSize";
- private Log log = LogFactory.getLog(TagHandlerPool.class);
+ private Logger log = Logger.getLogger(TagHandlerPool.class);
// index of next available tag handler
private int current;
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/security/SecurityClassLoad.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/security/SecurityClassLoad.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/security/SecurityClassLoad.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,8 +28,8 @@
public final class SecurityClassLoad {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( SecurityClassLoad.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( SecurityClassLoad.class );
public static void securityClassLoad(ClassLoader loader){
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -30,13 +30,12 @@
import org.apache.PeriodicEventListener;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.Constants;
import org.apache.jasper.EmbeddedServletOptions;
import org.apache.jasper.Options;
import org.apache.jasper.compiler.JspRuntimeContext;
import org.apache.jasper.compiler.Localizer;
+import org.jboss.logging.Logger;
/**
* The JSP engine (a.k.a Jasper).
@@ -57,7 +56,7 @@
public class JspServlet extends HttpServlet implements PeriodicEventListener {
// Logger
- private Log log = LogFactory.getLog(JspServlet.class);
+ private Logger log = Logger.getLogger(JspServlet.class);
private ServletContext context;
private ServletConfig config;
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -32,8 +32,6 @@
import javax.servlet.jsp.tagext.TagInfo;
import org.apache.AnnotationProcessor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.JasperException;
import org.apache.jasper.JspCompilationContext;
import org.apache.jasper.Options;
@@ -42,6 +40,7 @@
import org.apache.jasper.compiler.JspRuntimeContext;
import org.apache.jasper.compiler.Localizer;
import org.apache.jasper.runtime.JspSourceDependent;
+import org.jboss.logging.Logger;
/**
* The JSP engine (a.k.a Jasper).
@@ -64,7 +63,7 @@
public class JspServletWrapper {
// Logger
- private Log log = LogFactory.getLog(JspServletWrapper.class);
+ private Logger log = Logger.getLogger(JspServletWrapper.class);
private Servlet theServlet;
private String jspUri;
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/ParserUtils.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/ParserUtils.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/ParserUtils.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -24,11 +24,10 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.jasper.Constants;
import org.apache.jasper.JasperException;
import org.apache.jasper.compiler.Localizer;
+import org.jboss.logging.Logger;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
@@ -192,7 +191,7 @@
class MyEntityResolver implements EntityResolver {
// Logger
- private Log log = LogFactory.getLog(MyEntityResolver.class);
+ private Logger log = Logger.getLogger(MyEntityResolver.class);
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException {
@@ -221,7 +220,7 @@
class MyErrorHandler implements ErrorHandler {
// Logger
- private Log log = LogFactory.getLog(MyErrorHandler.class);
+ private Logger log = Logger.getLogger(MyErrorHandler.class);
public void warning(SAXParseException ex) throws SAXException {
if (log.isDebugEnabled())
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UCSReader.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UCSReader.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UCSReader.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -31,8 +31,8 @@
*/
public class UCSReader extends Reader {
- private org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( UCSReader.class );
+ private org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( UCSReader.class );
//
// Constants
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UTF8Reader.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UTF8Reader.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/xmlparser/UTF8Reader.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -31,8 +31,8 @@
public class UTF8Reader
extends Reader {
- private org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( UTF8Reader.class );
+ private org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( UTF8Reader.class );
//
// Constants
Modified: branches/2.0.x/src/share/classes/org/apache/naming/NamingContext.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/naming/NamingContext.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/naming/NamingContext.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -55,8 +55,8 @@
protected static final NameParser nameParser = new NameParserImpl();
- private static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(NamingContext.class);
+ private static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(NamingContext.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/naming/resources/FileDirContext.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/naming/resources/FileDirContext.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/naming/resources/FileDirContext.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -50,8 +50,8 @@
public class FileDirContext extends BaseDirContext {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( FileDirContext.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( FileDirContext.class );
// -------------------------------------------------------------- Constants
Modified: branches/2.0.x/src/share/classes/org/apache/naming/resources/WARDirContext.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/naming/resources/WARDirContext.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/naming/resources/WARDirContext.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -53,8 +53,8 @@
public class WARDirContext extends BaseDirContext {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( WARDirContext.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( WARDirContext.class );
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/DomUtil.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/DomUtil.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/DomUtil.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -45,8 +45,8 @@
* @author Costin Manolache
*/
public class DomUtil {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( DomUtil.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( DomUtil.class );
// -------------------- DOM utils --------------------
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/B2CConverter.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -37,8 +37,8 @@
public class B2CConverter {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( B2CConverter.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( B2CConverter.class );
private IntermediateInputStream iis;
private ReadConvertor conv;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/Base64.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/Base64.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/Base64.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,8 +34,8 @@
public final class Base64 {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( Base64.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( Base64.class );
static private final int BASELENGTH = 255;
static private final int LOOKUPLENGTH = 63;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/C2BConverter.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/C2BConverter.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/C2BConverter.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -31,8 +31,8 @@
*/
public final class C2BConverter {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(C2BConverter.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(C2BConverter.class );
private IntermediateOutputStream ios;
private WriteConvertor conv;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/StringCache.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/StringCache.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/StringCache.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -30,8 +30,8 @@
public class StringCache {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( StringCache.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( StringCache.class );
// ------------------------------------------------------- Static Variables
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UDecoder.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UDecoder.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UDecoder.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -30,8 +30,8 @@
*/
public final class UDecoder {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(UDecoder.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(UDecoder.class );
protected static final boolean ALLOW_ENCODED_SLASH =
Boolean.valueOf(System.getProperty("org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH", "false")).booleanValue();
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UEncoder.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UEncoder.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UEncoder.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,8 +34,8 @@
*/
public final class UEncoder {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(UEncoder.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(UEncoder.class );
// Not static - the set may differ ( it's better than adding
// an extra check for "/", "+", etc
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UTF8Decoder.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UTF8Decoder.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/buf/UTF8Decoder.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,8 +34,8 @@
public final class UTF8Decoder extends B2CConverter {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(UTF8Decoder.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(UTF8Decoder.class );
// may have state !!
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimpleHashtable.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimpleHashtable.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimpleHashtable.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -59,8 +59,8 @@
public final class SimpleHashtable implements Enumeration
{
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( SimpleHashtable.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( SimpleHashtable.class );
// entries ...
private Entry table[];
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimplePool.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimplePool.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/collections/SimplePool.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,8 +28,8 @@
public final class SimplePool {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(SimplePool.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(SimplePool.class );
/*
* Where the threads are held.
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/GenericParser.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/GenericParser.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/GenericParser.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -25,8 +25,7 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
@@ -41,8 +40,8 @@
/**
* The Log to which all SAX event related logging calls will be made.
*/
- protected static Log log =
- LogFactory.getLog("org.apache.commons.digester.Digester.sax");
+ protected static Logger log =
+ Logger.getLogger("org.apache.commons.digester.Digester.sax");
/**
* The JAXP 1.2 property required to set up the schema location.
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/XercesParser.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/XercesParser.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/XercesParser.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -26,8 +26,7 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
@@ -46,8 +45,8 @@
/**
* The Log to which all SAX event related logging calls will be made.
*/
- protected static Log log =
- LogFactory.getLog("org.apache.commons.digester.Digester.sax");
+ protected static Logger log =
+ Logger.getLogger("org.apache.commons.digester.Digester.sax");
/**
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Cookies.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -35,8 +35,8 @@
*/
public final class Cookies { // extends MultiMap {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(Cookies.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(Cookies.class );
// expected average number of cookies per request
public static final int INITIAL_SIZE=4;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Parameters.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Parameters.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/Parameters.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -34,8 +34,8 @@
public final class Parameters extends MultiMap {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(Parameters.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(Parameters.class );
// Transition: we'll use the same Hashtable( String->String[] )
// for the beginning. When we are sure all accesses happen through
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/ServerCookie.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -37,8 +37,8 @@
public class ServerCookie implements Serializable {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog(ServerCookie.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger(ServerCookie.class );
private MessageBytes name=MessageBytes.newInstance();
private MessageBytes value=MessageBytes.newInstance();
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/mapper/Mapper.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/mapper/Mapper.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/http/mapper/Mapper.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -35,8 +35,8 @@
public final class Mapper {
- private static org.apache.commons.logging.Log logger =
- org.apache.commons.logging.LogFactory.getLog(Mapper.class);
+ private static org.jboss.logging.Logger logger =
+ org.jboss.logging.Logger.getLogger(Mapper.class);
// ----------------------------------------------------- Instance Variables
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/BaseModelMBean.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/BaseModelMBean.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/BaseModelMBean.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -46,8 +46,7 @@
import javax.management.modelmbean.InvalidTargetObjectTypeException;
import javax.management.modelmbean.ModelMBeanNotificationBroadcaster;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/*
* Changes from commons.modeler:
@@ -101,7 +100,7 @@
* @author Costin Manolache
*/
public class BaseModelMBean implements DynamicMBean, MBeanRegistration, ModelMBeanNotificationBroadcaster {
- private static Log log = LogFactory.getLog(BaseModelMBean.class);
+ private static Logger log = Logger.getLogger(BaseModelMBean.class);
// ----------------------------------------------------------- Constructors
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/Registry.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/Registry.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/Registry.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -39,9 +39,8 @@
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.modules.ModelerSource;
+import org.jboss.logging.Logger;
/*
Issues:
@@ -75,7 +74,7 @@
/**
* The Log instance to which we will write our log messages.
*/
- private static Log log = LogFactory.getLog(Registry.class);
+ private static Logger log = Logger.getLogger(Registry.class);
// Support for the factory methods
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDOMSource.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -22,8 +22,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.DomUtil;
import org.apache.tomcat.util.modeler.AttributeInfo;
import org.apache.tomcat.util.modeler.ManagedBean;
@@ -31,13 +29,14 @@
import org.apache.tomcat.util.modeler.OperationInfo;
import org.apache.tomcat.util.modeler.ParameterInfo;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
public class MbeansDescriptorsDOMSource extends ModelerSource
{
- private static Log log = LogFactory.getLog(MbeansDescriptorsDOMSource.class);
+ private static Logger log = Logger.getLogger(MbeansDescriptorsDOMSource.class);
Registry registry;
String location;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsDigesterSource.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -25,13 +25,12 @@
import org.apache.tomcat.util.digester.Digester;
import org.apache.tomcat.util.modeler.Registry;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
public class MbeansDescriptorsDigesterSource extends ModelerSource
{
- private static Log log =
- LogFactory.getLog(MbeansDescriptorsDigesterSource.class);
+ private static Logger log =
+ Logger.getLogger(MbeansDescriptorsDigesterSource.class);
Registry registry;
String location;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsIntrospectionSource.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,17 +28,16 @@
import javax.management.ObjectName;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.AttributeInfo;
import org.apache.tomcat.util.modeler.ManagedBean;
import org.apache.tomcat.util.modeler.OperationInfo;
import org.apache.tomcat.util.modeler.ParameterInfo;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
public class MbeansDescriptorsIntrospectionSource extends ModelerSource
{
- private static Log log = LogFactory.getLog(MbeansDescriptorsIntrospectionSource.class);
+ private static Logger log = Logger.getLogger(MbeansDescriptorsIntrospectionSource.class);
Registry registry;
String location;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansDescriptorsSerSource.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -6,15 +6,14 @@
import java.util.ArrayList;
import java.util.List;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.modeler.ManagedBean;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
public class MbeansDescriptorsSerSource extends ModelerSource
{
- private static Log log = LogFactory.getLog(MbeansDescriptorsSerSource.class);
+ private static Logger log = Logger.getLogger(MbeansDescriptorsSerSource.class);
Registry registry;
String location;
String type;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansSource.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansSource.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/modeler/modules/MbeansSource.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -14,13 +14,12 @@
import javax.management.loading.MLet;
import javax.xml.transform.TransformerException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.DomUtil;
import org.apache.tomcat.util.modeler.AttributeInfo;
import org.apache.tomcat.util.modeler.BaseModelMBean;
import org.apache.tomcat.util.modeler.ManagedBean;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -37,7 +36,7 @@
*/
public class MbeansSource extends ModelerSource implements MbeansSourceMBean
{
- private static Log log = LogFactory.getLog(MbeansSource.class);
+ private static Logger log = Logger.getLogger(MbeansSource.class);
Registry registry;
String type;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -22,8 +22,6 @@
import java.util.HashMap;
import java.util.concurrent.Executor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.jni.Address;
import org.apache.tomcat.jni.Error;
import org.apache.tomcat.jni.File;
@@ -37,6 +35,7 @@
import org.apache.tomcat.jni.Socket;
import org.apache.tomcat.jni.Status;
import org.apache.tomcat.util.res.StringManager;
+import org.jboss.logging.Logger;
/**
* APR tailored thread pool, providing the following services:
@@ -59,7 +58,7 @@
// -------------------------------------------------------------- Constants
- protected static Log log = LogFactory.getLog(AprEndpoint.class);
+ protected static Logger log = Logger.getLogger(AprEndpoint.class);
protected static StringManager sm =
StringManager.getManager("org.apache.tomcat.util.net.res");
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/BaseEndpoint.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/BaseEndpoint.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/BaseEndpoint.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -20,9 +20,8 @@
import java.net.InetAddress;
import java.util.concurrent.Executor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
+import org.jboss.logging.Logger;
/**
* APR tailored thread pool, providing the following services:
@@ -45,7 +44,7 @@
// -------------------------------------------------------------- Constants
- protected static Log log = LogFactory.getLog(BaseEndpoint.class);
+ protected static Logger log = Logger.getLogger(BaseEndpoint.class);
protected static StringManager sm =
StringManager.getManager("org.apache.tomcat.util.net.res");
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/JIoEndpoint.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/JIoEndpoint.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/JIoEndpoint.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -24,9 +24,8 @@
import java.net.Socket;
import java.util.concurrent.Executor;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
+import org.jboss.logging.Logger;
/**
* Handle incoming TCP connections.
@@ -50,7 +49,7 @@
// -------------------------------------------------------------- Constants
- protected static Log log = LogFactory.getLog(JIoEndpoint.class);
+ protected static Logger log = Logger.getLogger(JIoEndpoint.class);
protected StringManager sm =
StringManager.getManager("org.apache.tomcat.util.net.res");
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioEndpoint.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioEndpoint.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioEndpoint.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -49,11 +49,10 @@
import javax.net.ssl.SSLEngine;
import javax.net.ssl.TrustManagerFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.net.SecureNioChannel.ApplicationBufferHandler;
import org.apache.tomcat.util.res.StringManager;
+import org.jboss.logging.Logger;
/**
* NIO tailored thread pool, providing the following services:
@@ -76,7 +75,7 @@
// -------------------------------------------------------------- Constants
- protected static Log log = LogFactory.getLog(NioEndpoint.class);
+ protected static Logger log = Logger.getLogger(NioEndpoint.class);
protected static StringManager sm =
StringManager.getManager("org.apache.tomcat.util.net.res");
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioSelectorPool.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioSelectorPool.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/NioSelectorPool.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -25,9 +25,9 @@
import java.io.EOFException;
import java.net.SocketTimeoutException;
import java.util.concurrent.ConcurrentLinkedQueue;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
+
/**
*
* Thread safe non blocking selector pool
@@ -37,7 +37,7 @@
*/
public class NioSelectorPool {
- protected static Log log = LogFactory.getLog(NioSelectorPool.class);
+ protected static Logger log = Logger.getLogger(NioSelectorPool.class);
protected final static boolean SHARED =
Boolean.valueOf(System.getProperty("org.apache.tomcat.util.net.NioSelectorShared", "true")).booleanValue();
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/PoolTcpEndpoint.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/PoolTcpEndpoint.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/PoolTcpEndpoint.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -28,11 +28,10 @@
import java.util.Stack;
import java.util.Vector;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
import org.apache.tomcat.util.threads.ThreadPool;
import org.apache.tomcat.util.threads.ThreadPoolRunnable;
+import org.jboss.logging.Logger;
/* Similar with MPM module in Apache2.0. Handles all the details related with
"tcp server" functionality - thread management, accept policy, etc.
@@ -59,7 +58,7 @@
*/
public class PoolTcpEndpoint implements Runnable { // implements Endpoint {
- static Log log=LogFactory.getLog(PoolTcpEndpoint.class );
+ static Logger log=Logger.getLogger(PoolTcpEndpoint.class );
private StringManager sm =
StringManager.getManager("org.apache.tomcat.util.net.res");
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/SSLImplementation.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/SSLImplementation.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/SSLImplementation.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -27,8 +27,8 @@
@author EKR
*/
abstract public class SSLImplementation {
- private static org.apache.commons.logging.Log logger =
- org.apache.commons.logging.LogFactory.getLog(SSLImplementation.class);
+ private static org.jboss.logging.Logger logger =
+ org.jboss.logging.Logger.getLogger(SSLImplementation.class);
// The default implementations in our search path
private static final String PureTLSImplementationClass=
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSEImplementation.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSEImplementation.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSEImplementation.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -35,8 +35,8 @@
{
static final String SSLSocketClass = "javax.net.ssl.SSLSocket";
- static org.apache.commons.logging.Log logger =
- org.apache.commons.logging.LogFactory.getLog(JSSEImplementation.class);
+ static org.jboss.logging.Logger logger =
+ org.jboss.logging.Logger.getLogger(JSSEImplementation.class);
private JSSEFactory factory = null;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESocketFactory.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -88,8 +88,8 @@
private static final String defaultKeystoreFile
= System.getProperty("user.home") + "/.keystore";
private static final String defaultKeyPass = "changeit";
- static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(JSSESocketFactory.class);
+ static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(JSSESocketFactory.class);
protected boolean initialized;
protected String clientAuth = "false";
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESupport.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESupport.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/net/jsse/JSSESupport.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -50,8 +50,8 @@
class JSSESupport implements SSLSupport {
- private static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(JSSESupport.class);
+ private static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(JSSESupport.class);
protected SSLSocket ssl;
protected SSLSession session;
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/threads/ThreadPool.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/threads/ThreadPool.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/threads/ThreadPool.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -19,9 +19,8 @@
import java.util.*;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
+import org.jboss.logging.Logger;
/**
* A thread pool that is trying to copy the apache process management.
@@ -33,7 +32,7 @@
*/
public class ThreadPool {
- private static Log log = LogFactory.getLog(ThreadPool.class);
+ private static Logger log = Logger.getLogger(ThreadPool.class);
private static StringManager sm =
StringManager.getManager("org.apache.tomcat.util.threads.res");
@@ -367,7 +366,7 @@
return c;
}
- private static void logFull(Log loghelper, int currentThreadCount,
+ private static void logFull(Logger loghelper, int currentThreadCount,
int maxThreads) {
if( logfull ) {
log.error(sm.getString("threadpool.busy",
Added: branches/2.0.x/src/share/classes/org/jboss/logging/DynamicLogger.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/DynamicLogger.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/DynamicLogger.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,265 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * An extension of the JBoss Logger that adds a log()
+ * primitive that maps to a dynamically defined log level.
+ *
+ * TODO - Make sure serialization works correctly
+ *
+ * @author <a href="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
+ * @version <tt>$Revision: 2081 $</tt>
+ *
+ * @since 4.0.3
+ */
+public class DynamicLogger extends Logger
+{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5963699806863917370L;
+
+ /** No logging */
+ public static final int LOG_LEVEL_NONE = 0;
+
+ /** Fatal level logging */
+ public static final int LOG_LEVEL_FATAL = 1;
+
+ /** Error level logging */
+ public static final int LOG_LEVEL_ERROR = 2;
+
+ /** Warn level logging */
+ public static final int LOG_LEVEL_WARN = 3;
+
+ /** Info level logging */
+ public static final int LOG_LEVEL_INFO = 4;
+
+ /** Debug level logging */
+ public static final int LOG_LEVEL_DEBUG = 5;
+
+ /** Trace level logging */
+ public static final int LOG_LEVEL_TRACE = 6;
+
+ /** The available log level strings */
+ public final static String[] LOG_LEVEL_STRINGS =
+ { "NONE", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" };
+
+ /** The log level to use for the "log" primitive */
+ private int logLevel = LOG_LEVEL_DEBUG;
+
+ /**
+ * Create a DynamicLogger instance given the logger name.
+ *
+ * @param name the logger name
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(String name)
+ {
+ return new DynamicLogger(name);
+ }
+
+ /**
+ * Create a DynamicLogger instance given the logger name with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param name The logger name
+ * @param suffix A suffix to append to the classname.
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(String name, String suffix)
+ {
+ return new DynamicLogger(name + "." + suffix);
+ }
+
+ /**
+ * Create a DynamicLogger instance given the logger class. This simply
+ * calls create(clazz.getName()).
+ *
+ * @param clazz the Class whose name will be used as the logger name
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(Class clazz)
+ {
+ return new DynamicLogger(clazz.getName());
+ }
+
+ /**
+ * Create a DynamicLogger instance given the logger class with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param clazz The Class whose name will be used as the logger name.
+ * @param suffix A suffix to append to the classname.
+ * @return the dynamic logger
+ */
+ public static DynamicLogger getDynamicLogger(Class clazz, String suffix)
+ {
+ return new DynamicLogger(clazz.getName() + "." + suffix);
+ }
+
+ /**
+ * Create a new DynamicLogger.
+ *
+ * @param name the log name
+ */
+ protected DynamicLogger(final String name)
+ {
+ super(name);
+ }
+
+ /**
+ * Sets the logLevel for the log() primitive
+ *
+ * @param logLevel between LOG_LEVEL_NONE and LOG_LEVEL_TRACE
+ */
+ public void setLogLevel(int logLevel)
+ {
+ if (logLevel >= LOG_LEVEL_NONE && logLevel <= LOG_LEVEL_TRACE)
+ {
+ this.logLevel = logLevel;
+ }
+ }
+
+ /**
+ * Gets the logLevel of the log() primitive
+ *
+ * @return the logLevel of the log() primitive
+ */
+ public int getLogLevel()
+ {
+ return logLevel;
+ }
+
+ /**
+ * Sets the logLevel of the log() primitive
+ *
+ * @param logLevelString the log level in String form
+ */
+ public void setLogLevelAsString(String logLevelString)
+ {
+ if (logLevelString != null)
+ {
+ logLevelString = logLevelString.toUpperCase().trim();
+
+ for (int i = 0; i <= LOG_LEVEL_TRACE; i++)
+ {
+ if (logLevelString.equals(LOG_LEVEL_STRINGS[i]))
+ {
+ // match
+ this.logLevel = i;
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets the logLevel of the log() primitive in String form
+ *
+ * @return the logLevel of the log() primitive in String form
+ */
+ public String getLogLevelAsString()
+ {
+ return LOG_LEVEL_STRINGS[logLevel];
+ }
+
+ /**
+ * Logs a message using dynamic log level
+ *
+ * @param message the message to log
+ */
+ public void log(Object message)
+ {
+ switch (logLevel)
+ {
+ case LOG_LEVEL_TRACE:
+ super.trace(message);
+ break;
+
+ case LOG_LEVEL_DEBUG:
+ super.debug(message);
+ break;
+
+ case LOG_LEVEL_INFO:
+ super.info(message);
+ break;
+
+ case LOG_LEVEL_WARN:
+ super.warn(message);
+ break;
+
+ case LOG_LEVEL_ERROR:
+ super.error(message);
+ break;
+
+ case LOG_LEVEL_FATAL:
+ super.fatal(message);
+ break;
+
+ case LOG_LEVEL_NONE:
+ default:
+ // do nothing
+ break;
+ }
+ }
+
+ /**
+ * Logs a message and a throwable using dynamic log level
+ *
+ * @param message the message to log
+ * @param t the throwable to log
+ */
+ public void log(Object message, Throwable t)
+ {
+ switch (logLevel)
+ {
+ case LOG_LEVEL_TRACE:
+ super.trace(message, t);
+ break;
+
+ case LOG_LEVEL_DEBUG:
+ super.debug(message, t);
+ break;
+
+ case LOG_LEVEL_INFO:
+ super.info(message, t);
+ break;
+
+ case LOG_LEVEL_WARN:
+ super.warn(message, t);
+ break;
+
+ case LOG_LEVEL_ERROR:
+ super.error(message, t);
+ break;
+
+ case LOG_LEVEL_FATAL:
+ super.fatal(message, t);
+ break;
+
+ case LOG_LEVEL_NONE:
+ default:
+ // do nothing
+ break;
+ }
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/DynamicLogger.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/Logger.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/Logger.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/Logger.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,434 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+
+/**
+ * Logger wrapper that tries to dynamically load a log4j class to
+ * determine if log4j is available in the VM. If it is the case,
+ * a log4j delegate is built and used. In the contrary, a null
+ * logger is used. This class cannot directly reference log4j
+ * classes otherwise the JVM will try to load it and make it fail.
+ * To set
+ *
+ * <p>Only exposes the relevent factory and logging methods.
+ *
+ * <p>For JBoss the logging should be done as follows:
+ * <ul>
+ * <li>FATAL - JBoss is likely to/will crash
+ * <li>ERROR - A definite problem
+ * <li>WARN - Likely to be a problem, or it could be JBoss
+ * detected a problem it can recover from
+ * <li>INFO - Lifecycle low volume, e.g. "Bound x into jndi",
+ * things that are of interest to a user
+ * <li>DEBUG - Lifecycle low volume but necessarily of interest
+ * to the user, e.g. "Starting listener thread"
+ * <li>TRACE - High volume detailed logging
+ * </ul>
+ *
+ * @see #isTraceEnabled
+ * @see #trace(Object)
+ * @see #trace(Object,Throwable)
+ *
+ * @version <tt>$Revision: 2081 $</tt>
+ * @author Scott.Stark(a)jboss.org
+ * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
+ * @author <a href="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>
+ */
+public class Logger implements Serializable
+{
+ /** Serialization */
+ private static final long serialVersionUID = 4232175575988879434L;
+
+ /** The system property to look for an externalized LoggerPlugin implementation class */
+ protected static String PLUGIN_CLASS_PROP = "org.jboss.logging.Logger.pluginClass";
+
+ /** The default LoggerPlugin implementation is log4j */
+ protected static final String DEFAULT_PLUGIN_CLASS_NAME = "org.jboss.logging.jdk.JDK14LoggerPlugin";
+
+ /** The LoggerPlugin implementation class to use */
+ protected static Class pluginClass = null;
+
+ /** The class name of the LoggerPlugin implementation class to use */
+ protected static String pluginClassName = null;
+
+ static
+ {
+ init();
+ }
+
+ /** The logger name. */
+ private final String name;
+
+ /** The logger plugin delegate */
+ protected transient LoggerPlugin loggerDelegate = null;
+
+ /** The LoggerPlugin implementation class name in use
+ *
+ * @return LoggerPlugin implementation class name
+ */
+ public static String getPluginClassName()
+ {
+ return Logger.pluginClassName;
+ }
+
+ /**
+ * Set the LoggerPlugin implementation class name in use
+ *
+ * @param pluginClassName the LoggerPlugin implementation class name
+ */
+ public static void setPluginClassName(String pluginClassName)
+ {
+ if (pluginClassName.equals(Logger.pluginClassName) == false)
+ {
+ Logger.pluginClassName = pluginClassName;
+ init();
+ }
+ }
+
+ /**
+ * Creates new Logger the given logger name.
+ *
+ * @param name the logger name.
+ */
+ protected Logger(final String name)
+ {
+ this.name = name;
+ this.loggerDelegate = getDelegatePlugin(name);
+ }
+
+ /**
+ * Return the name of this logger.
+ *
+ * @return The name of this logger.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Get the logger plugin delegate
+ *
+ * @return the delegate
+ */
+ public LoggerPlugin getLoggerPlugin()
+ {
+ return this.loggerDelegate;
+ }
+
+ /**
+ * Check to see if the TRACE level is enabled for this logger.
+ *
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ public boolean isTraceEnabled()
+ {
+ return loggerDelegate.isTraceEnabled();
+ }
+
+ /**
+ * Issue a log msg with a level of TRACE.
+ *
+ * @param message the message
+ */
+ public void trace(Object message)
+ {
+ loggerDelegate.trace(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of TRACE.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void trace(Object message, Throwable t)
+ {
+ loggerDelegate.trace(message, t);
+ }
+
+ /**
+ * Check to see if the DEBUG level is enabled for this logger.
+ *
+ * @deprecated DEBUG is for low volume logging, you don't need this
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ public boolean isDebugEnabled()
+ {
+ return loggerDelegate.isDebugEnabled();
+ }
+
+ /**
+ * Issue a log msg with a level of DEBUG.
+ *
+ * @param message the message
+ */
+ public void debug(Object message)
+ {
+ loggerDelegate.debug(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of DEBUG.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void debug(Object message, Throwable t)
+ {
+ loggerDelegate.debug(message, t);
+ }
+
+ /**
+ * Check to see if the INFO level is enabled for this logger.
+ *
+ * @deprecated INFO is for low volume information, you don't need this
+ * @return true if a {@link #info(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ public boolean isInfoEnabled()
+ {
+ return loggerDelegate.isInfoEnabled();
+ }
+
+ /**
+ * Issue a log msg with a level of INFO.
+ *
+ * @param message the message
+ */
+ public void info(Object message)
+ {
+ loggerDelegate.info(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of INFO.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void info(Object message, Throwable t)
+ {
+ loggerDelegate.info(message, t);
+ }
+
+ /**
+ * Issue a log msg with a level of WARN.
+ *
+ * @param message the message
+ */
+ public void warn(Object message)
+ {
+ loggerDelegate.warn(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of WARN.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void warn(Object message, Throwable t)
+ {
+ loggerDelegate.warn(message, t);
+ }
+
+ /**
+ * Issue a log msg with a level of ERROR.
+ *
+ * @param message the message
+ */
+ public void error(Object message)
+ {
+ loggerDelegate.error(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of ERROR.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void error(Object message, Throwable t)
+ {
+ loggerDelegate.error(message, t);
+ }
+
+ /**
+ * Issue a log msg with a level of FATAL.
+ *
+ * @param message the message
+ */
+ public void fatal(Object message)
+ {
+ loggerDelegate.fatal(message);
+ }
+
+ /**
+ * Issue a log msg and throwable with a level of FATAL.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ public void fatal(Object message, Throwable t)
+ {
+ loggerDelegate.fatal(message, t);
+ }
+
+ /**
+ * Custom serialization to reinitalize the delegate
+ *
+ * @param stream the object stream
+ * @throws IOException for any error
+ * @throws ClassNotFoundException if a class is not found during deserialization
+ */
+ private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
+ {
+ // restore non-transient fields (aka name)
+ stream.defaultReadObject();
+
+ // Restore logging
+ if (pluginClass == null)
+ {
+ init();
+ }
+ this.loggerDelegate = getDelegatePlugin(name);
+ }
+
+ /**
+ * Create a Logger instance given the logger name.
+ *
+ * @param name the logger name
+ * @return the logger
+ */
+ public static Logger getLogger(String name)
+ {
+ return new Logger(name);
+ }
+
+ /**
+ * Create a Logger instance given the logger name with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param name the logger name
+ * @param suffix a suffix to append to the classname.
+ * @return the logger
+ */
+ public static Logger getLogger(String name, String suffix)
+ {
+ return new Logger(name + "." + suffix);
+ }
+
+ /**
+ * Create a Logger instance given the logger class. This simply
+ * calls create(clazz.getName()).
+ *
+ * @param clazz the Class whose name will be used as the logger name
+ * @return the logger
+ */
+ public static Logger getLogger(Class clazz)
+ {
+ return new Logger(clazz.getName());
+ }
+
+ /**
+ * Create a Logger instance given the logger class with the given suffix.
+ *
+ * <p>This will include a logger seperator between classname and suffix
+ *
+ * @param clazz the Class whose name will be used as the logger name.
+ * @param suffix a suffix to append to the classname.
+ * @return the logger
+ */
+ public static Logger getLogger(Class clazz, String suffix)
+ {
+ return new Logger(clazz.getName() + "." + suffix);
+ }
+
+ /**
+ * Get the delegate plugin
+ *
+ * @param name the name of the logger
+ * @return the plugin
+ */
+ protected static LoggerPlugin getDelegatePlugin(String name)
+ {
+ LoggerPlugin plugin = null;
+ try
+ {
+ plugin = (LoggerPlugin) pluginClass.newInstance();
+ }
+ catch (Throwable e)
+ {
+ plugin = new NullLoggerPlugin();
+ }
+ try
+ {
+ plugin.init(name);
+ }
+ catch (Throwable e)
+ {
+ String extraInfo = e.getMessage();
+ System.err.println("Failed to initalize plugin: " + plugin
+ + (extraInfo != null ? ", cause: " + extraInfo : ""));
+ plugin = new NullLoggerPlugin();
+ }
+
+ return plugin;
+ }
+
+ /**
+ * Initialize the LoggerPlugin class to use as the delegate to the
+ * logging system. This first checks to see if a pluginClassName has
+ * been specified via the {@link #setPluginClassName(String)} method,
+ * then the PLUGIN_CLASS_PROP system property and finally the
+ * LOG4J_PLUGIN_CLASS_NAME default. If the LoggerPlugin implementation
+ * class cannot be loaded the default NullLoggerPlugin will be used.
+ */
+ protected static void init()
+ {
+ try
+ {
+ // See if there is a PLUGIN_CLASS_PROP specified
+ if (pluginClassName == null)
+ {
+ pluginClassName = System.getProperty(PLUGIN_CLASS_PROP, DEFAULT_PLUGIN_CLASS_NAME);
+ }
+
+ // Try to load the plugin via the TCL
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ pluginClass = cl.loadClass(pluginClassName);
+ }
+ catch (Throwable e)
+ {
+ // The plugin could not be setup, default to a null logger
+ pluginClass = org.jboss.logging.NullLoggerPlugin.class;
+ }
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/Logger.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/LoggerPlugin.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/LoggerPlugin.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/LoggerPlugin.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * Defines a "pluggable" login module. In fact, this is only used to split between
+ * log4j and /dev/null. Choice is made in org.jboss.logging.Logger
+ *
+ * @see org.jboss.logging.Logger
+ * @see org.jboss.logging.NullLoggerPlugin
+ *
+ * @author <a href="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
+ * @version $Revision: 2081 $
+ */
+public interface LoggerPlugin
+{
+ /**
+ * Initialise the logger with the given name
+ *
+ * @param name the name
+ */
+ void init(String name);
+
+ /**
+ * Check to see if the TRACE level is enabled for this logger.
+ *
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ boolean isTraceEnabled();
+
+ /**
+ * Issue a log msg with a level of TRACE.
+ *
+ * @param message the message
+ */
+ void trace(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of TRACE.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void trace(Object message, Throwable t);
+
+ /**
+ * Check to see if the DEBUG level is enabled for this logger.
+ *
+ * @deprecated DEBUG is for low volume logging, you don't need this
+ * @return true if a {@link #trace(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ boolean isDebugEnabled();
+
+ /**
+ * Issue a log msg with a level of DEBUG.
+ *
+ * @param message the message
+ */
+ void debug(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of DEBUG.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void debug(Object message, Throwable t);
+
+ /**
+ * Check to see if the INFO level is enabled for this logger.
+ *
+ * @deprecated INFO is for low volume information, you don't need this
+ * @return true if a {@link #info(Object)} method invocation would pass
+ * the msg to the configured appenders, false otherwise.
+ */
+ boolean isInfoEnabled();
+
+ /**
+ * Issue a log msg with a level of INFO.
+ *
+ * @param message the message
+ */
+ void info(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of INFO.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void info(Object message, Throwable t);
+
+ /**
+ * Issue a log msg with a level of WARN.
+ *
+ * @param message the message
+ */
+ void warn(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of WARN.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void warn(Object message, Throwable t);
+
+ /**
+ * Issue a log msg with a level of ERROR.
+ *
+ * @param message the message
+ */
+ void error(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of ERROR.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void error(Object message, Throwable t);
+
+ /**
+ * Issue a log msg with a level of FATAL.
+ *
+ * @param message the message
+ */
+ void fatal(Object message);
+
+ /**
+ * Issue a log msg and throwable with a level of FATAL.
+ *
+ * @param message the message
+ * @param t the throwable
+ */
+ void fatal(Object message, Throwable t);
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/LoggerPlugin.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/MDC.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/MDC.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/MDC.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Map;
+
+/**
+ * A "Map Diagnostic Context" abstraction.
+ *
+ * @author Jason T. Greene
+ */
+public class MDC
+{
+ private final static MDCProvider mdc;
+
+ static
+ {
+ MDCProvider m = null;
+ if (NDCSupport.class.isAssignableFrom(Logger.pluginClass))
+ {
+
+ try
+ {
+ m = ((MDCSupport) Logger.pluginClass.newInstance()).getMDCProvider();
+ }
+ catch (Throwable t)
+ {
+ // Eat
+ }
+ }
+
+ if (m == null)
+ m = new NullMDCProvider();
+
+ mdc = m;
+ }
+
+ public static void put(String key, Object val)
+ {
+ mdc.put(key, val);
+ }
+
+ public static Object get(String key)
+ {
+ return mdc.get(key);
+ }
+
+ public static void remove(String key)
+ {
+ mdc.remove(key);
+ }
+
+ public static Map<String, Object> getMap()
+ {
+ return mdc.getMap();
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/MDC.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/MDCProvider.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/MDCProvider.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/MDCProvider.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Map;
+
+/**
+ * MDC SPI for the backend logging implementation.
+ *
+ * @author Jason T. Greene
+ */
+public interface MDCProvider
+{
+ public void put(String key, Object value);
+
+ public Object get(String key);
+
+ public void remove(String key);
+
+ public Map<String, Object> getMap();
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/MDCProvider.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/MDCSupport.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/MDCSupport.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/MDCSupport.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * Indicates that a Logger plugin supports MDC.
+ *
+ * @author Jason T. Greene
+ */
+public interface MDCSupport
+{
+ public MDCProvider getMDCProvider();
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/MDCSupport.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/NDC.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/NDC.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/NDC.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,90 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+
+/**
+ * A "Nested Diagnostic Context" abstraction.
+ *
+ * @author Jason T. Greene
+ */
+public class NDC
+{
+ private final static NDCProvider ndc;
+
+ static
+ {
+ NDCProvider n = null;
+ if (NDCSupport.class.isAssignableFrom(Logger.pluginClass))
+ {
+
+ try
+ {
+ n = ((NDCSupport) Logger.pluginClass.newInstance()).getNDCProvider();
+ }
+ catch (Throwable t)
+ {
+ // Eat
+ }
+ }
+
+ if (n == null)
+ n = new NullNDCProvider();
+
+ ndc = n;
+ }
+
+ public static void clear()
+ {
+ ndc.clear();
+ }
+
+ public static String get()
+ {
+ return ndc.get();
+ }
+
+ public static int getDepth()
+ {
+ return ndc.getDepth();
+ }
+
+ public static String pop()
+ {
+ return ndc.pop();
+ }
+
+ public static String peek()
+ {
+ return ndc.peek();
+ }
+
+ public static void push(String message)
+ {
+ ndc.push(message);
+ }
+
+ public static void setMaxDepth(int maxDepth)
+ {
+ ndc.setMaxDepth(maxDepth);
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/NDC.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/NDCProvider.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/NDCProvider.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/NDCProvider.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+
+/**
+ * An NDC SPI for the backend logging implementation.
+ *
+ * @author Jason T. Greene
+ */
+public interface NDCProvider
+{
+ public void clear();
+
+ public String get();
+
+ public int getDepth();
+
+ public String pop();
+
+ public String peek();
+
+ public void push(String message);
+
+ public void setMaxDepth(int maxDepth);
+}
\ No newline at end of file
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/NDCProvider.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/NDCSupport.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/NDCSupport.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/NDCSupport.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * Indicates that a logger plugin supports NDC.
+ *
+ * @author Jason T. Greene
+ */
+public interface NDCSupport
+{
+ public NDCProvider getNDCProvider();
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/NDCSupport.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/NullLoggerPlugin.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/NullLoggerPlugin.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/NullLoggerPlugin.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+/**
+ * LoggerPlugin implementation producing no output at all. Used for client
+ * side logging when no log4j.jar is available on the classpath.
+ *
+ * @see org.jboss.logging.Logger
+ * @see org.jboss.logging.LoggerPlugin
+ *
+ * @author <a href="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
+ * @version $Revision: 2081 $
+ */
+public class NullLoggerPlugin implements LoggerPlugin
+{
+ public void init(String name)
+ {
+ /* don't care */
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return false;
+ }
+
+ public void trace(Object message)
+ {
+ // nothing
+ }
+
+ public void trace(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return false;
+ }
+
+ public void debug(Object message)
+ {
+ // nothing
+ }
+
+ public void debug(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return false;
+ }
+
+ public void info(Object message)
+ {
+ // nothing
+ }
+
+ public void info(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public void error(Object message)
+ {
+ // nothing
+ }
+
+ public void error(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public void fatal(Object message)
+ {
+ // nothing
+ }
+
+ public void fatal(Object message, Throwable t)
+ {
+ // nothing
+ }
+
+ public void warn(Object message)
+ {
+ // nothing
+ }
+
+ public void warn(Object message, Throwable t)
+ {
+ // nothing
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/NullLoggerPlugin.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/NullMDCProvider.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/NullMDCProvider.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/NullMDCProvider.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Map;
+
+/**
+ * An MDC provider which does nothing.
+ *
+ * @author Jason T. Greene
+ */
+public class NullMDCProvider implements MDCProvider
+{
+ public Object get(String key)
+ {
+ return null;
+ }
+
+ public Map<String, Object> getMap()
+ {
+ return null;
+ }
+
+ public void put(String key, Object val)
+ {
+ }
+
+ public void remove(String key)
+ {
+ }
+}
\ No newline at end of file
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/NullMDCProvider.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/NullNDCProvider.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/NullNDCProvider.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/NullNDCProvider.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging;
+
+import java.util.Stack;
+
+/**
+ * An NDC provider which does nothing.
+ *
+ * @author Jason T. Greene
+ */
+public class NullNDCProvider implements NDCProvider
+{
+ public void clear()
+ {
+ }
+
+ public Stack cloneStack()
+ {
+ return null;
+ }
+
+ public String get()
+ {
+ return null;
+ }
+
+ public int getDepth()
+ {
+ return 0;
+ }
+
+ public void inherit(Stack stack)
+ {
+ }
+
+ public String peek()
+ {
+ return null;
+ }
+
+ public String pop()
+ {
+ return null;
+ }
+
+ public void push(String message)
+ {
+ }
+
+ public void remove()
+ {
+ }
+
+ public void setMaxDepth(int maxDepth)
+ {
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/NullNDCProvider.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDK14LoggerPlugin.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDK14LoggerPlugin.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDK14LoggerPlugin.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,154 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.logging.jdk;
+
+import java.util.logging.Logger;
+import java.util.logging.Level;
+
+import org.jboss.logging.LoggerPlugin;
+import org.jboss.logging.MDCProvider;
+import org.jboss.logging.MDCSupport;
+import org.jboss.logging.NDCProvider;
+import org.jboss.logging.NDCSupport;
+
+/** An example LoggerPlugin which uses the JDK java.util.logging framework.
+ *
+ * @author Scott.Stark(a)jboss.org
+ * @version $Revison:$
+ */
+public class JDK14LoggerPlugin implements LoggerPlugin, MDCSupport, NDCSupport
+{
+ private Logger log;
+
+ public void init(String name)
+ {
+ log = Logger.getLogger(name);
+ }
+
+ public boolean isTraceEnabled()
+ {
+ return log.isLoggable(Level.FINER);
+ }
+
+ public void trace(Object message)
+ {
+ log(Level.FINER, String.valueOf(message), null);
+ }
+
+ public void trace(Object message, Throwable t)
+ {
+ log(Level.FINER, String.valueOf(message), t);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return log.isLoggable(Level.FINE);
+ }
+
+ public void debug(Object message)
+ {
+ log(Level.FINE, String.valueOf(message), null);
+ }
+
+ public void debug(Object message, Throwable t)
+ {
+ log(Level.FINE, String.valueOf(message), t);
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return log.isLoggable(Level.INFO);
+ }
+
+ public void info(Object message)
+ {
+ log(Level.INFO, String.valueOf(message), null);
+ }
+
+ public void info(Object message, Throwable t)
+ {
+ log(Level.INFO, String.valueOf(message), t);
+ }
+
+ public void warn(Object message)
+ {
+ log(Level.WARNING, String.valueOf(message), null);
+ }
+
+ public void warn(Object message, Throwable t)
+ {
+ log(Level.WARNING, String.valueOf(message), t);
+ }
+
+ public void error(Object message)
+ {
+ log(Level.SEVERE, String.valueOf(message), null);
+ }
+
+ public void error(Object message, Throwable t)
+ {
+ log(Level.SEVERE, String.valueOf(message), t);
+ }
+
+ public void fatal(Object message)
+ {
+ log(Level.SEVERE, String.valueOf(message), null);
+ }
+
+ public void fatal(Object message, Throwable t)
+ {
+ log(Level.SEVERE, String.valueOf(message), t);
+ }
+
+ // From commons-logging
+ private void log(Level level, String msg, Throwable ex) {
+ if (log.isLoggable(level)) {
+ // Get the stack trace.
+ Throwable dummyException = new Throwable();
+ StackTraceElement locations[] = dummyException.getStackTrace();
+ // Caller will be the third element
+ String cname = "unknown";
+ String method = "unknown";
+ if (locations != null && locations.length > 3) {
+ StackTraceElement caller = locations[3];
+ cname = caller.getClassName();
+ method = caller.getMethodName();
+ }
+ if (ex == null) {
+ log.logp(level, cname, method, msg);
+ } else {
+ log.logp(level, cname, method, msg, ex);
+ }
+ }
+ }
+
+ public NDCProvider getNDCProvider()
+ {
+ return new JDKNDCProvider();
+ }
+
+ public MDCProvider getMDCProvider()
+ {
+ return new JDKMDCProvider();
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDK14LoggerPlugin.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKMDCProvider.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKMDCProvider.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKMDCProvider.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging.jdk;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.logging.MDCProvider;
+
+/**
+ * MDC implementation for JDK logging.
+ *
+ * @author Jason T. Greene
+ */
+public class JDKMDCProvider implements MDCProvider
+{
+ private ThreadLocal<Map<String, Object>> map = new ThreadLocal<Map<String, Object>>();
+
+ public Object get(String key)
+ {
+ return map.get() == null ? null : map.get().get(key);
+ }
+
+ public Map<String, Object> getMap()
+ {
+ return map.get();
+ }
+
+ public void put(String key, Object value)
+ {
+ Map<String, Object> map = this.map.get();
+ if (map == null)
+ {
+ map = new HashMap<String, Object>();
+ this.map.set(map);
+ }
+
+ map.put(key, value);
+ }
+
+ public void remove(String key)
+ {
+ Map<String, Object> map = this.map.get();
+ if (map == null)
+ return;
+
+ map.remove(key);
+ }
+}
\ No newline at end of file
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKMDCProvider.java
___________________________________________________________________
Name: svn:eol-style
+ native
Added: branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKNDCProvider.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKNDCProvider.java (rev 0)
+++ branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKNDCProvider.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.logging.jdk;
+
+import java.util.ArrayList;
+import java.util.EmptyStackException;
+import java.util.Stack;
+
+import org.jboss.logging.NDCProvider;
+
+/**
+ * NDC implementation for JDK logging
+ *
+ * @author Jason T. Greene
+ */
+public class JDKNDCProvider implements NDCProvider
+{
+ private class ArrayStack<E> extends ArrayList<E>
+ {
+ private static final long serialVersionUID = -8520038422243642840L;
+
+ public E pop()
+ {
+ int size = size();
+ if (size == 0)
+ throw new EmptyStackException();
+
+ return remove(size - 1);
+ }
+
+ public E peek()
+ {
+ int size = size();
+ if (size == 0)
+ throw new EmptyStackException();
+
+ return get(size - 1);
+ }
+
+ public void push(E val)
+ {
+ add(val);
+ }
+
+ public void setSize(int newSize)
+ {
+ int size = size();
+ if (newSize >= size || newSize < 0)
+ return;
+
+ removeRange(newSize, size);
+ }
+ }
+
+ private class Entry
+ {
+ private String merged;
+ private String current;
+
+ public Entry(String current)
+ {
+ this.merged = current;
+ this.current = current;
+ }
+
+ public Entry(Entry parent, String current)
+ {
+ this.merged = parent.merged + ' ' + current;
+ this.current = current;
+ }
+ }
+
+ private ThreadLocal<ArrayStack<Entry>> stack = new ThreadLocal<ArrayStack<Entry>>();
+
+ public void clear()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+ if (stack != null)
+ stack.clear();
+ }
+
+ public String get()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null || stack.isEmpty() ? null : stack.peek().merged;
+ }
+
+ public int getDepth()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null ? 0 : stack.size();
+ }
+
+ public String peek()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null || stack.isEmpty() ? "" : stack.peek().current;
+ }
+
+ public String pop()
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ return stack == null || stack.isEmpty() ? "" : stack.pop().current;
+ }
+
+ public void push(String message)
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ if (stack == null)
+ {
+ stack = new ArrayStack<Entry>();
+ this.stack.set(stack);
+ }
+
+ stack.push(stack.isEmpty() ? new Entry(message) : new Entry(stack.peek(), message));
+ }
+
+ public void setMaxDepth(int maxDepth)
+ {
+ ArrayStack<Entry> stack = this.stack.get();
+
+ if (stack != null)
+ stack.setSize(maxDepth);
+ }
+}
Property changes on: branches/2.0.x/src/share/classes/org/jboss/logging/jdk/JDKNDCProvider.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -26,8 +26,7 @@
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
* Implementation of <code>LifecycleListener</code> that will init and
@@ -41,7 +40,7 @@
public class LifecycleListener
implements org.apache.catalina.LifecycleListener {
- private static Log log = LogFactory.getLog(LifecycleListener.class);
+ private static Logger log = Logger.getLogger(LifecycleListener.class);
/**
* The string manager for this package.
Modified: branches/2.0.x/src/share/classes/org/jboss/web/php/ScriptEnvironment.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/web/php/ScriptEnvironment.java 2007-08-20 15:04:17 UTC (rev 229)
+++ branches/2.0.x/src/share/classes/org/jboss/web/php/ScriptEnvironment.java 2007-08-20 23:47:37 UTC (rev 230)
@@ -38,8 +38,7 @@
import org.apache.catalina.Globals;
import org.apache.catalina.util.IOTools;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.jboss.logging.Logger;
/**
@@ -52,7 +51,7 @@
*/
public class ScriptEnvironment {
- private static Log log = LogFactory.getLog(ScriptEnvironment.class);
+ private static Logger log = Logger.getLogger(ScriptEnvironment.class);
/**
* The Request attribute key for the client certificate chain.
17 years, 6 months
JBossWeb SVN: r229 - in branches/2.0.x/src/share/classes/org/apache: catalina/startup and 4 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-20 11:04:17 -0400 (Mon, 20 Aug 2007)
New Revision: 229
Modified:
branches/2.0.x/src/share/classes/org/apache/catalina/connector/Connector.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/Catalina.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/Embedded.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetAllPropertiesRule.java
branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetContextPropertiesRule.java
branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProtocol.java
branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProtocol.java
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProtocol.java
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Protocol.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/IntrospectionUtils.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/Digester.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertiesRule.java
branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertyRule.java
Log:
- Port server.xml validation code.
- Note: will not compile until switching to JBoss Logging (which will be done ASAP).
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/connector/Connector.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/connector/Connector.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/connector/Connector.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -35,13 +35,13 @@
import org.apache.catalina.core.StandardEngine;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.coyote.Adapter;
import org.apache.coyote.ProtocolHandler;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.http.mapper.Mapper;
import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.logging.Logger;
+import org.jboss.logging.Logger;
/**
@@ -56,7 +56,7 @@
public class Connector
implements Lifecycle, MBeanRegistration
{
- private static Log log = LogFactory.getLog(Connector.class);
+ private static Logger log = Logger.getLogger(Connector.class);
/**
@@ -318,6 +318,20 @@
if (replacements.get(name) != null) {
repl = (String) replacements.get(name);
}
+ if (!IntrospectionUtils.setProperty(protocolHandler, repl, value)) {
+ log.warn("Property " + name + " not found on the protocol handler.");
+ }
+ }
+
+
+ /**
+ * Set a configured property.
+ */
+ public void setPropertyInternal(String name, String value) {
+ String repl = name;
+ if (replacements.get(name) != null) {
+ repl = (String) replacements.get(name);
+ }
IntrospectionUtils.setProperty(protocolHandler, repl, value);
}
@@ -388,7 +402,7 @@
public void setAllowTrace(boolean allowTrace) {
this.allowTrace = allowTrace;
- setProperty("allowTrace", String.valueOf(allowTrace));
+ setPropertyInternal("allowTrace", String.valueOf(allowTrace));
}
@@ -466,7 +480,7 @@
public void setEmptySessionPath(boolean emptySessionPath) {
this.emptySessionPath = emptySessionPath;
- setProperty("emptySessionPath", String.valueOf(emptySessionPath));
+ setPropertyInternal("emptySessionPath", String.valueOf(emptySessionPath));
}
@@ -489,7 +503,7 @@
public void setEnableLookups(boolean enableLookups) {
this.enableLookups = enableLookups;
- setProperty("enableLookups", String.valueOf(enableLookups));
+ setPropertyInternal("enableLookups", String.valueOf(enableLookups));
}
@@ -559,7 +573,7 @@
public void setMaxSavePostSize(int maxSavePostSize) {
this.maxSavePostSize = maxSavePostSize;
- setProperty("maxSavePostSize", String.valueOf(maxSavePostSize));
+ setPropertyInternal("maxSavePostSize", String.valueOf(maxSavePostSize));
}
@@ -581,7 +595,7 @@
public void setPort(int port) {
this.port = port;
- setProperty("port", String.valueOf(port));
+ setPropertyInternal("port", String.valueOf(port));
}
@@ -745,7 +759,7 @@
if(proxyName != null && proxyName.length() > 0) {
this.proxyName = proxyName;
- setProperty("proxyName", proxyName);
+ setPropertyInternal("proxyName", proxyName);
} else {
this.proxyName = null;
removeProperty("proxyName");
@@ -772,7 +786,7 @@
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
- setProperty("proxyPort", String.valueOf(proxyPort));
+ setPropertyInternal("proxyPort", String.valueOf(proxyPort));
}
@@ -797,7 +811,7 @@
public void setRedirectPort(int redirectPort) {
this.redirectPort = redirectPort;
- setProperty("redirectPort", String.valueOf(redirectPort));
+ setPropertyInternal("redirectPort", String.valueOf(redirectPort));
}
@@ -846,7 +860,7 @@
public void setSecure(boolean secure) {
this.secure = secure;
- setProperty("secure", Boolean.toString(secure));
+ setPropertyInternal("secure", Boolean.toString(secure));
}
/**
@@ -867,7 +881,7 @@
public void setURIEncoding(String URIEncoding) {
this.URIEncoding = URIEncoding;
- setProperty("uRIEncoding", URIEncoding);
+ setPropertyInternal("uRIEncoding", URIEncoding);
}
@@ -890,7 +904,7 @@
public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI) {
this.useBodyEncodingForURI = useBodyEncodingForURI;
- setProperty
+ setPropertyInternal
("useBodyEncodingForURI", String.valueOf(useBodyEncodingForURI));
}
@@ -918,7 +932,7 @@
*/
public void setXpoweredBy(boolean xpoweredBy) {
this.xpoweredBy = xpoweredBy;
- setProperty("xpoweredBy", String.valueOf(xpoweredBy));
+ setPropertyInternal("xpoweredBy", String.valueOf(xpoweredBy));
}
/**
@@ -929,7 +943,7 @@
*/
public void setUseIPVHosts(boolean useIPVHosts) {
this.useIPVHosts = useIPVHosts;
- setProperty("useIPVHosts", String.valueOf(useIPVHosts));
+ setPropertyInternal("useIPVHosts", String.valueOf(useIPVHosts));
}
/**
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/Catalina.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/Catalina.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/Catalina.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -25,6 +25,10 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
import org.apache.catalina.Container;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleException;
@@ -260,6 +264,12 @@
// Initialize the digester
Digester digester = new Digester();
digester.setValidating(false);
+ digester.setRulesValidation(true);
+ HashMap<Class, List<String>> fakeAttributes = new HashMap<Class, List<String>>();
+ ArrayList<String> attrs = new ArrayList<String>();
+ attrs.add("className");
+ fakeAttributes.put(Object.class, attrs);
+ digester.setFakeAttributes(fakeAttributes);
digester.setClassLoader(StandardServer.class.getClassLoader());
// Configure the actions we will be using
@@ -664,8 +674,8 @@
}
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( Catalina.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( Catalina.class );
}
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/Embedded.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/Embedded.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/Embedded.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -44,10 +44,10 @@
import org.apache.catalina.security.SecurityConfig;
import org.apache.catalina.util.LifecycleSupport;
import org.apache.catalina.util.StringManager;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.log.SystemLogHandler;
+import org.jboss.logging.Logger;
+import org.jboss.logging.Logger;
/**
@@ -102,7 +102,7 @@
*/
public class Embedded extends StandardService implements Lifecycle {
- private static Log log = LogFactory.getLog(Embedded.class);
+ private static Logger log = Logger.getLogger(Embedded.class);
// ----------------------------------------------------------- Constructors
@@ -427,7 +427,7 @@
connector = new Connector();
connector.setScheme("https");
connector.setSecure(true);
- connector.setProperty("SSLEnabled","true");
+ connector.setPropertyInternal("SSLEnabled","true");
// FIXME !!!! SET SSL PROPERTIES
} else {
connector = new Connector(protocol);
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetAllPropertiesRule.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetAllPropertiesRule.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetAllPropertiesRule.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -62,8 +62,15 @@
name = attributes.getQName(i);
}
String value = attributes.getValue(i);
- if ( !excludes.containsKey(name))
- IntrospectionUtils.setProperty(digester.peek(), name, value);
+ if ( !excludes.containsKey(name)) {
+ if (!digester.isFakeAttribute(digester.peek(), name)
+ && !IntrospectionUtils.setProperty(digester.peek(), name, value)
+ && digester.getRulesValidation()) {
+ digester.getLogger().warn("[SetAllPropertiesRule]{" + digester.getMatch() +
+ "} Setting property '" + name + "' to '" +
+ value + "' did not find a matching property.");
+ }
+ }
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetContextPropertiesRule.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetContextPropertiesRule.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/catalina/startup/SetContextPropertiesRule.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -60,7 +60,13 @@
continue;
}
String value = attributes.getValue(i);
- IntrospectionUtils.setProperty(digester.peek(), name, value);
+ if (!digester.isFakeAttribute(digester.peek(), name)
+ && !IntrospectionUtils.setProperty(digester.peek(), name, value)
+ && digester.getRulesValidation()) {
+ digester.getLogger().warn("[SetContextPropertiesRule]{" + digester.getMatch() +
+ "} Setting property '" + name + "' to '" +
+ value + "' did not find a matching property.");
+ }
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProtocol.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpAprProtocol.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -55,8 +55,8 @@
implements ProtocolHandler, MBeanRegistration {
- protected static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(AjpAprProtocol.class);
+ protected static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(AjpAprProtocol.class);
/**
* The string manager for this package.
@@ -137,22 +137,6 @@
/**
- * Set a property.
- */
- public void setProperty(String name, String value) {
- setAttribute(name, value);
- }
-
-
- /**
- * Get a property
- */
- public String getProperty(String name) {
- return (String) getAttribute(name);
- }
-
-
- /**
* The adapter, used to call the connector
*/
public void setAdapter(Adapter adapter) {
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProtocol.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProtocol.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/ajp/AjpProtocol.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -55,8 +55,8 @@
implements ProtocolHandler, MBeanRegistration {
- protected static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(AjpProtocol.class);
+ protected static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(AjpProtocol.class);
/**
* The string manager for this package.
@@ -137,22 +137,6 @@
/**
- * Set a property.
- */
- public void setProperty(String name, String value) {
- setAttribute(name, value);
- }
-
-
- /**
- * Get a property
- */
- public String getProperty(String name) {
- return (String) getAttribute(name);
- }
-
-
- /**
* The adapter, used to call the connector
*/
public void setAdapter(Adapter adapter) {
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProtocol.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProtocol.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -54,8 +54,8 @@
*/
public class Http11AprProtocol implements ProtocolHandler, MBeanRegistration {
- protected static org.apache.commons.logging.Log log =
- org.apache.commons.logging.LogFactory.getLog(Http11AprProtocol.class);
+ protected static org.jboss.logging.Logger log =
+ org.jboss.logging.Logger.getLogger(Http11AprProtocol.class);
/**
* The string manager for this package.
@@ -90,20 +90,6 @@
}
/**
- * Set a property.
- */
- public void setProperty(String name, String value) {
- setAttribute(name, value);
- }
-
- /**
- * Get a property
- */
- public String getProperty(String name) {
- return (String)getAttribute(name);
- }
-
- /**
* The adapter, used to call the connector.
*/
protected Adapter adapter;
@@ -325,15 +311,11 @@
public void setRestrictedUserAgents(String valueS) { restrictedUserAgents = valueS; }
- public String getProtocol() {
- return getProperty("protocol");
- }
+ // HTTP
+ protected String protocol = null;
+ public String getProtocol() { return protocol; }
+ public void setProtocol(String protocol) { setSecure(true); this.protocol = protocol; }
- public void setProtocol( String k ) {
- setSecure(true);
- setAttribute("protocol", k);
- }
-
/**
* Maximum number of requests which can be performed over a keepalive
* connection. The default is the same as for Apache HTTP Server.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Protocol.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Protocol.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11Protocol.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -57,8 +57,8 @@
implements ProtocolHandler, MBeanRegistration {
- protected static org.apache.commons.logging.Log log
- = org.apache.commons.logging.LogFactory.getLog(Http11Protocol.class);
+ protected static org.jboss.logging.Logger log
+ = org.jboss.logging.Logger.getLogger(Http11Protocol.class);
/**
* The string manager for this package.
@@ -103,20 +103,6 @@
/**
- * Set a property.
- */
- public void setProperty(String name, String value) {
- setAttribute(name, value);
- }
-
- /**
- * Get a property
- */
- public String getProperty(String name) {
- return (String)getAttribute(name);
- }
-
- /**
* Pass config info
*/
public void setAttribute(String name, Object value) {
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/IntrospectionUtils.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/IntrospectionUtils.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/IntrospectionUtils.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -38,8 +38,8 @@
public final class IntrospectionUtils {
- private static org.apache.commons.logging.Log log=
- org.apache.commons.logging.LogFactory.getLog( IntrospectionUtils.class );
+ private static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( IntrospectionUtils.class );
/**
* Call execute() - any ant-like task should work
@@ -258,7 +258,7 @@
* int or boolean we'll convert value to the right type before) - that means
* you can have setDebug(1).
*/
- public static void setProperty(Object o, String name, String value) {
+ public static boolean setProperty(Object o, String name, String value) {
if (dbg > 1)
d("setProperty(" + o.getClass() + " " + name + "=" + value + ")");
@@ -275,7 +275,7 @@
&& "java.lang.String".equals(paramT[0].getName())) {
methods[i].invoke(o, new Object[] { value });
- return;
+ return true;
}
}
@@ -328,7 +328,7 @@
if (ok) {
methods[i].invoke(o, params);
- return;
+ return true;
}
}
@@ -344,6 +344,7 @@
params[0] = name;
params[1] = value;
setPropertyMethod.invoke(o, params);
+ return true;
}
} catch (IllegalArgumentException ex2) {
@@ -367,6 +368,7 @@
if (dbg > 1)
ie.printStackTrace();
}
+ return false;
}
public static Object getProperty(Object o, String name) {
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/Digester.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/Digester.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/Digester.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -36,9 +36,9 @@
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.util.IntrospectionUtils;
+import org.jboss.logging.Logger;
+import org.jboss.logging.Logger;
import org.xml.sax.Attributes;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
@@ -313,17 +313,29 @@
/**
+ * Warn on missing attributes and elements.
+ */
+ protected boolean rulesValidation = false;
+
+
+ /**
+ * Fake attributes map (attributes are often used for object creation).
+ */
+ protected Map<Class, List<String>> fakeAttributes = null;
+
+
+ /**
* The Log to which most logging calls will be made.
*/
- protected Log log =
- LogFactory.getLog("org.apache.commons.digester.Digester");
+ protected Logger log =
+ Logger.getLogger("org.apache.commons.digester.Digester");
/**
* The Log to which all SAX event related logging calls will be made.
*/
- protected Log saxLog =
- LogFactory.getLog("org.apache.commons.digester.Digester.sax");
+ protected Logger saxLog =
+ Logger.getLogger("org.apache.commons.digester.Digester.sax");
/**
@@ -550,7 +562,7 @@
/**
* Return the current Logger associated with this instance of the Digester
*/
- public Log getLogger() {
+ public Logger getLogger() {
return log;
@@ -560,7 +572,7 @@
/**
* Set the current logger for this Digester.
*/
- public void setLogger(Log log) {
+ public void setLogger(Logger log) {
this.log = log;
@@ -572,7 +584,7 @@
*
* @since 1.6
*/
- public Log getSAXLogger() {
+ public Logger getSAXLogger() {
return saxLog;
}
@@ -585,7 +597,7 @@
*
* @since 1.6
*/
- public void setSAXLogger(Log saxLog) {
+ public void setSAXLogger(Logger saxLog) {
this.saxLog = saxLog;
}
@@ -889,6 +901,72 @@
/**
+ * Return the rules validation flag.
+ */
+ public boolean getRulesValidation() {
+
+ return (this.rulesValidation);
+
+ }
+
+
+ /**
+ * Set the rules validation flag. This must be called before
+ * <code>parse()</code> is called the first time.
+ *
+ * @param rulesValidation The new rules validation flag.
+ */
+ public void setRulesValidation(boolean rulesValidation) {
+
+ this.rulesValidation = rulesValidation;
+
+ }
+
+
+ /**
+ * Return the fake attributes list.
+ */
+ public Map<Class, List<String>> getFakeAttributes() {
+
+ return (this.fakeAttributes);
+
+ }
+
+
+ /**
+ * Determine if an attribute is a fake attribute.
+ */
+ public boolean isFakeAttribute(Object object, String name) {
+
+ if (fakeAttributes == null) {
+ return false;
+ }
+ List<String> result = fakeAttributes.get(object.getClass());
+ if (result == null) {
+ result = fakeAttributes.get(Object.class);
+ }
+ if (result == null) {
+ return false;
+ } else {
+ return result.contains(name);
+ }
+
+ }
+
+
+ /**
+ * Set the fake attributes.
+ *
+ * @param fakeAttributes The new fake attributes.
+ */
+ public void setFakeAttributes(Map<Class, List<String>> fakeAttributes) {
+
+ this.fakeAttributes = fakeAttributes;
+
+ }
+
+
+ /**
* Return the XMLReader to be used for parsing the input document.
*
* FIX ME: there is a bug in JAXP/XERCES that prevent the use of a
@@ -1286,6 +1364,9 @@
if (debug) {
log.debug(" No rules found matching '" + match + "'.");
}
+ if (rulesValidation) {
+ log.warn(" No rules found matching '" + match + "'.");
+ }
}
}
@@ -2555,8 +2636,8 @@
return;
}
- log = LogFactory.getLog("org.apache.commons.digester.Digester");
- saxLog = LogFactory.getLog("org.apache.commons.digester.Digester.sax");
+ log = Logger.getLogger("org.apache.commons.digester.Digester");
+ saxLog = Logger.getLogger("org.apache.commons.digester.Digester.sax");
// Perform lazy configuration as needed
initialize(); // call hook method for subclasses that want to be initialized once only
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertiesRule.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertiesRule.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertiesRule.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -205,7 +205,13 @@
"} Setting property '" + name + "' to '" +
value + "'");
}
- IntrospectionUtils.setProperty(top, name, value);
+ if (!digester.isFakeAttribute(top, name)
+ && !IntrospectionUtils.setProperty(top, name, value)
+ && digester.getRulesValidation()) {
+ digester.log.warn("[SetPropertiesRule]{" + digester.match +
+ "} Setting property '" + name + "' to '" +
+ value + "' did not find a matching property.");
+ }
}
}
Modified: branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertyRule.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertyRule.java 2007-08-17 13:18:44 UTC (rev 228)
+++ branches/2.0.x/src/share/classes/org/apache/tomcat/util/digester/SetPropertyRule.java 2007-08-20 15:04:17 UTC (rev 229)
@@ -125,8 +125,13 @@
}
// Set the property (with conversion as necessary)
- // FIXME: Exception if property doesn't exist ?
- IntrospectionUtils.setProperty(top, actualName, actualValue);
+ if (!digester.isFakeAttribute(top, actualName)
+ && !IntrospectionUtils.setProperty(top, actualName, actualValue)
+ && digester.getRulesValidation()) {
+ digester.log.warn("[SetPropertyRule]{" + digester.match +
+ "} Setting property '" + name + "' to '" +
+ value + "' did not find a matching property.");
+ }
}
17 years, 6 months
JBossWeb SVN: r228 - sandbox/webapps/src.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2007-08-17 09:18:44 -0400 (Fri, 17 Aug 2007)
New Revision: 228
Modified:
sandbox/webapps/src/TestServlet.java
Log:
Add a test for SESSIONID cookie beeing several times in the response.
Modified: sandbox/webapps/src/TestServlet.java
===================================================================
--- sandbox/webapps/src/TestServlet.java 2007-08-16 11:04:06 UTC (rev 227)
+++ sandbox/webapps/src/TestServlet.java 2007-08-17 13:18:44 UTC (rev 228)
@@ -69,6 +69,12 @@
out.println("<body>");
out.println("<h3>" + title + "</h3>");
+ String createValue = request.getParameter("create");
+ int icreate = 0;
+ if (createValue != null) {
+ Integer iwait = new Integer(createValue);
+ icreate = iwait.intValue();
+ }
HttpSession session = request.getSession(false);
if (session == null) {
@@ -81,6 +87,11 @@
out.println("delete+create");
session = request.getSession(true);
}
+ for (int i=0; i<icreate; i++) {
+ out.println("delete+create more");
+ session.invalidate();
+ session = request.getSession(true);
+ }
out.println("sessions.id " + session.getId());
out.println("<br>");
out.println("sessions.created ");
@@ -123,6 +134,7 @@
out.println("<P>");
out.println("param: countvalue " + countValue + " counted: " + l);
out.println("param: waitvalue " + waitValue);
+ out.println("param: create " + createValue);
out.println("<P>");
out.println("sessions.data<br>");
out.println("<P>");
17 years, 7 months
JBossWeb SVN: r227 - branches/2.0.x/src/share/classes/org/jboss/web/php.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2007-08-16 07:04:06 -0400 (Thu, 16 Aug 2007)
New Revision: 227
Modified:
branches/2.0.x/src/share/classes/org/jboss/web/php/Constants.java
branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java
Log:
Backport the package name changes.
Modified: branches/2.0.x/src/share/classes/org/jboss/web/php/Constants.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/web/php/Constants.java 2007-08-15 15:50:29 UTC (rev 226)
+++ branches/2.0.x/src/share/classes/org/jboss/web/php/Constants.java 2007-08-16 11:04:06 UTC (rev 227)
@@ -32,6 +32,6 @@
*/
public class Constants {
- public static final String Package = "org.apache.catalina.servlets.php";
+ public static final String Package = "org.jboss.web.php";
}
Modified: branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java
===================================================================
--- branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java 2007-08-15 15:50:29 UTC (rev 226)
+++ branches/2.0.x/src/share/classes/org/jboss/web/php/LifecycleListener.java 2007-08-16 11:04:06 UTC (rev 227)
@@ -53,8 +53,8 @@
protected static final int REQUIRED_MAJOR = 5;
- protected static final int REQUIRED_MINOR = 1;
- protected static final int REQUIRED_PATCH = 0;
+ protected static final int REQUIRED_MINOR = 2;
+ protected static final int REQUIRED_PATCH = 3;
// ---------------------------------------------- LifecycleListener Methods
@@ -77,7 +77,7 @@
paramTypes[0] = String.class;
Object paramValues[] = new Object[1];
paramValues[0] = null;
- Class clazz = Class.forName("org.apache.catalina.servlets.php.Library");
+ Class clazz = Class.forName("org.jboss.web.php.Library");
Method method = clazz.getMethod(methodName, paramTypes);
// TODO: Use sm to obtain optional library name.
method.invoke(null, paramValues);
@@ -108,7 +108,7 @@
else if (Lifecycle.AFTER_STOP_EVENT.equals(event.getType())) {
try {
String methodName = "terminate";
- Method method = Class.forName("org.apache.catalina.servlets.php.Library")
+ Method method = Class.forName("org.jboss.php.servlets.php.Library")
.getMethod(methodName, (Class [])null);
method.invoke(null, (Object []) null);
}
17 years, 7 months
JBossWeb SVN: r226 - trunk/java/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-15 11:50:29 -0400 (Wed, 15 Aug 2007)
New Revision: 226
Modified:
trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
Log:
- Fix recycling glitch.
Modified: trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2007-08-15 15:34:42 UTC (rev 225)
+++ trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 2007-08-15 15:50:29 UTC (rev 226)
@@ -781,9 +781,13 @@
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (error) {
+ inputBuffer.nextRequest();
+ outputBuffer.nextRequest();
recycle();
return SocketState.CLOSED;
} else if (!comet) {
+ inputBuffer.nextRequest();
+ outputBuffer.nextRequest();
recycle();
return SocketState.OPEN;
} else {
@@ -936,6 +940,8 @@
if (comet) {
if (error) {
+ inputBuffer.nextRequest();
+ outputBuffer.nextRequest();
recycle();
return SocketState.CLOSED;
} else {
17 years, 7 months
JBossWeb SVN: r225 - branches/2.0.x/src/share/classes/org/apache/jasper/servlet.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-15 11:34:42 -0400 (Wed, 15 Aug 2007)
New Revision: 225
Modified:
branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java
branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java
Log:
- Improve error reporting of missing included resources.
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java 2007-08-15 15:33:52 UTC (rev 224)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServlet.java 2007-08-15 15:34:42 UTC (rev 225)
@@ -305,8 +305,25 @@
// Check if the requested JSP page exists, to avoid
// creating unnecessary directories and files.
if (null == context.getResource(jspUri)) {
- response.sendError(HttpServletResponse.SC_NOT_FOUND,
- request.getRequestURI());
+ String includeRequestUri = (String)
+ request.getAttribute(
+ "javax.servlet.include.request_uri");
+ if (includeRequestUri != null) {
+ // This file was included. Throw an exception as
+ // a response.sendError() will be ignored
+ throw new ServletException(Localizer.getMessage(
+ "jsp.error.file.not.found",jspUri));
+ } else {
+ try {
+ response.sendError(
+ HttpServletResponse.SC_NOT_FOUND,
+ request.getRequestURI());
+ } catch (IllegalStateException ise) {
+ log.error(Localizer.getMessage(
+ "jsp.error.file.not.found",
+ jspUri));
+ }
+ }
return;
}
boolean isErrorPage = exception != null;
Modified: branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java 2007-08-15 15:33:52 UTC (rev 224)
+++ branches/2.0.x/src/share/classes/org/apache/jasper/servlet/JspServletWrapper.java 2007-08-15 15:34:42 UTC (rev 225)
@@ -333,25 +333,6 @@
return;
}
- } catch (FileNotFoundException ex) {
- ctxt.incrementRemoved();
- String includeRequestUri = (String)
- request.getAttribute("javax.servlet.include.request_uri");
- if (includeRequestUri != null) {
- // This file was included. Throw an exception as
- // a response.sendError() will be ignored by the
- // servlet engine.
- throw new ServletException(ex);
- } else {
- try {
- response.sendError(HttpServletResponse.SC_NOT_FOUND,
- ex.getMessage());
- } catch (IllegalStateException ise) {
- log.error(Localizer.getMessage("jsp.error.file.not.found",
- ex.getMessage()),
- ex);
- }
- }
} catch (ServletException ex) {
if (options.getDevelopment()) {
throw handleJspException(ex);
17 years, 7 months
JBossWeb SVN: r224 - branches/2.0.x/src/share/classes/org/apache/coyote/http11.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2007-08-15 11:33:52 -0400 (Wed, 15 Aug 2007)
New Revision: 224
Modified:
branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java
Log:
- Recycling glitch when ending comet processing.
Modified: branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java
===================================================================
--- branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java 2007-08-15 15:33:21 UTC (rev 223)
+++ branches/2.0.x/src/share/classes/org/apache/coyote/http11/Http11AprProcessor.java 2007-08-15 15:33:52 UTC (rev 224)
@@ -750,9 +750,13 @@
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (error) {
+ inputBuffer.nextRequest();
+ outputBuffer.nextRequest();
recycle();
return SocketState.CLOSED;
} else if (!comet) {
+ inputBuffer.nextRequest();
+ outputBuffer.nextRequest();
recycle();
return SocketState.OPEN;
} else {
@@ -905,6 +909,8 @@
if (comet) {
if (error) {
+ inputBuffer.nextRequest();
+ outputBuffer.nextRequest();
recycle();
return SocketState.CLOSED;
} else {
17 years, 7 months