Add missing '@Override' annotations.
This commit is contained in:
@@ -73,6 +73,7 @@ public class LogConfigurationException extends RuntimeException {
|
|||||||
/**
|
/**
|
||||||
* Return the underlying cause of this exception (if any).
|
* Return the underlying cause of this exception (if any).
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Throwable getCause() {
|
public Throwable getCause() {
|
||||||
return this.cause;
|
return this.cause;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,6 +296,7 @@ public abstract class LogFactory {
|
|||||||
* and hashtables don't allow null as a key.
|
* and hashtables don't allow null as a key.
|
||||||
* @deprecated since 1.1.2
|
* @deprecated since 1.1.2
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
protected static volatile LogFactory nullClassLoaderFactory;
|
protected static volatile LogFactory nullClassLoaderFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -811,6 +812,7 @@ public abstract class LogFactory {
|
|||||||
private static ClassLoader getContextClassLoaderInternal() throws LogConfigurationException {
|
private static ClassLoader getContextClassLoaderInternal() throws LogConfigurationException {
|
||||||
return (ClassLoader)AccessController.doPrivileged(
|
return (ClassLoader)AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
return directGetContextClassLoader();
|
return directGetContextClassLoader();
|
||||||
}
|
}
|
||||||
@@ -960,6 +962,7 @@ public abstract class LogFactory {
|
|||||||
// ClassCastException can be thrown.
|
// ClassCastException can be thrown.
|
||||||
final Object result = AccessController.doPrivileged(
|
final Object result = AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
return createFactory(factoryClass, classLoader);
|
return createFactory(factoryClass, classLoader);
|
||||||
}
|
}
|
||||||
@@ -1236,6 +1239,7 @@ public abstract class LogFactory {
|
|||||||
private static InputStream getResourceAsStream(final ClassLoader loader, final String name) {
|
private static InputStream getResourceAsStream(final ClassLoader loader, final String name) {
|
||||||
return (InputStream)AccessController.doPrivileged(
|
return (InputStream)AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
if (loader != null) {
|
if (loader != null) {
|
||||||
return loader.getResourceAsStream(name);
|
return loader.getResourceAsStream(name);
|
||||||
@@ -1262,6 +1266,7 @@ public abstract class LogFactory {
|
|||||||
private static Enumeration getResources(final ClassLoader loader, final String name) {
|
private static Enumeration getResources(final ClassLoader loader, final String name) {
|
||||||
final PrivilegedAction action =
|
final PrivilegedAction action =
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
try {
|
try {
|
||||||
if (loader != null) {
|
if (loader != null) {
|
||||||
@@ -1298,6 +1303,7 @@ public abstract class LogFactory {
|
|||||||
private static Properties getProperties(final URL url) {
|
private static Properties getProperties(final URL url) {
|
||||||
final PrivilegedAction action =
|
final PrivilegedAction action =
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
InputStream stream = null;
|
InputStream stream = null;
|
||||||
try {
|
try {
|
||||||
@@ -1445,6 +1451,7 @@ public abstract class LogFactory {
|
|||||||
throws SecurityException {
|
throws SecurityException {
|
||||||
return (String) AccessController.doPrivileged(
|
return (String) AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
return System.getProperty(key, def);
|
return System.getProperty(key, def);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ import org.apache.commons.logging.impl.NoOpLog;
|
|||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public class LogSource {
|
public class LogSource {
|
||||||
|
|
||||||
// ------------------------------------------------------- Class Attributes
|
// ------------------------------------------------------- Class Attributes
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable t) {
|
public void debug(final Object message, final Throwable t) {
|
||||||
if (getLogger().isDebugEnabled()) {
|
if (getLogger().isDebugEnabled()) {
|
||||||
getLogger().debug(String.valueOf(message), t);
|
getLogger().debug(String.valueOf(message), t);
|
||||||
@@ -118,6 +119,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param message to log.
|
* @param message to log.
|
||||||
* @see org.apache.commons.logging.Log#debug(Object)
|
* @see org.apache.commons.logging.Log#debug(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message) {
|
public void debug(final Object message) {
|
||||||
if (getLogger().isDebugEnabled()) {
|
if (getLogger().isDebugEnabled()) {
|
||||||
getLogger().debug(String.valueOf(message));
|
getLogger().debug(String.valueOf(message));
|
||||||
@@ -131,6 +133,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable t) {
|
public void error(final Object message, final Throwable t) {
|
||||||
if (getLogger().isErrorEnabled()) {
|
if (getLogger().isErrorEnabled()) {
|
||||||
getLogger().error(String.valueOf(message), t);
|
getLogger().error(String.valueOf(message), t);
|
||||||
@@ -143,6 +146,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#error(Object)
|
* @see org.apache.commons.logging.Log#error(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message) {
|
public void error(final Object message) {
|
||||||
if (getLogger().isErrorEnabled()) {
|
if (getLogger().isErrorEnabled()) {
|
||||||
getLogger().error(String.valueOf(message));
|
getLogger().error(String.valueOf(message));
|
||||||
@@ -156,6 +160,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param t log this cause.
|
* @param t log this cause.
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable t) {
|
public void fatal(final Object message, final Throwable t) {
|
||||||
if (getLogger().isFatalErrorEnabled()) {
|
if (getLogger().isFatalErrorEnabled()) {
|
||||||
getLogger().fatalError(String.valueOf(message), t);
|
getLogger().fatalError(String.valueOf(message), t);
|
||||||
@@ -168,6 +173,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) {
|
public void fatal(final Object message) {
|
||||||
if (getLogger().isFatalErrorEnabled()) {
|
if (getLogger().isFatalErrorEnabled()) {
|
||||||
getLogger().fatalError(String.valueOf(message));
|
getLogger().fatalError(String.valueOf(message));
|
||||||
@@ -181,6 +187,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable t) {
|
public void info(final Object message, final Throwable t) {
|
||||||
if (getLogger().isInfoEnabled()) {
|
if (getLogger().isInfoEnabled()) {
|
||||||
getLogger().info(String.valueOf(message), t);
|
getLogger().info(String.valueOf(message), t);
|
||||||
@@ -193,6 +200,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#info(Object)
|
* @see org.apache.commons.logging.Log#info(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message) {
|
public void info(final Object message) {
|
||||||
if (getLogger().isInfoEnabled()) {
|
if (getLogger().isInfoEnabled()) {
|
||||||
getLogger().info(String.valueOf(message));
|
getLogger().info(String.valueOf(message));
|
||||||
@@ -203,6 +211,7 @@ public class AvalonLogger implements Log {
|
|||||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.debug</code> enabled?
|
* Is logging to <code>org.apache.avalon.framework.logger.Logger.debug</code> enabled?
|
||||||
* @see org.apache.commons.logging.Log#isDebugEnabled()
|
* @see org.apache.commons.logging.Log#isDebugEnabled()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDebugEnabled() {
|
public boolean isDebugEnabled() {
|
||||||
return getLogger().isDebugEnabled();
|
return getLogger().isDebugEnabled();
|
||||||
}
|
}
|
||||||
@@ -211,6 +220,7 @@ public class AvalonLogger implements Log {
|
|||||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.error</code> enabled?
|
* Is logging to <code>org.apache.avalon.framework.logger.Logger.error</code> enabled?
|
||||||
* @see org.apache.commons.logging.Log#isErrorEnabled()
|
* @see org.apache.commons.logging.Log#isErrorEnabled()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isErrorEnabled() {
|
public boolean isErrorEnabled() {
|
||||||
return getLogger().isErrorEnabled();
|
return getLogger().isErrorEnabled();
|
||||||
}
|
}
|
||||||
@@ -219,6 +229,7 @@ public class AvalonLogger implements Log {
|
|||||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.fatalError</code> enabled?
|
* Is logging to <code>org.apache.avalon.framework.logger.Logger.fatalError</code> enabled?
|
||||||
* @see org.apache.commons.logging.Log#isFatalEnabled()
|
* @see org.apache.commons.logging.Log#isFatalEnabled()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isFatalEnabled() {
|
public boolean isFatalEnabled() {
|
||||||
return getLogger().isFatalErrorEnabled();
|
return getLogger().isFatalErrorEnabled();
|
||||||
}
|
}
|
||||||
@@ -227,6 +238,7 @@ public class AvalonLogger implements Log {
|
|||||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.info</code> enabled?
|
* Is logging to <code>org.apache.avalon.framework.logger.Logger.info</code> enabled?
|
||||||
* @see org.apache.commons.logging.Log#isInfoEnabled()
|
* @see org.apache.commons.logging.Log#isInfoEnabled()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInfoEnabled() {
|
public boolean isInfoEnabled() {
|
||||||
return getLogger().isInfoEnabled();
|
return getLogger().isInfoEnabled();
|
||||||
}
|
}
|
||||||
@@ -235,6 +247,7 @@ public class AvalonLogger implements Log {
|
|||||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.debug</code> enabled?
|
* Is logging to <code>org.apache.avalon.framework.logger.Logger.debug</code> enabled?
|
||||||
* @see org.apache.commons.logging.Log#isTraceEnabled()
|
* @see org.apache.commons.logging.Log#isTraceEnabled()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTraceEnabled() {
|
public boolean isTraceEnabled() {
|
||||||
return getLogger().isDebugEnabled();
|
return getLogger().isDebugEnabled();
|
||||||
}
|
}
|
||||||
@@ -243,6 +256,7 @@ public class AvalonLogger implements Log {
|
|||||||
* Is logging to <code>org.apache.avalon.framework.logger.Logger.warn</code> enabled?
|
* Is logging to <code>org.apache.avalon.framework.logger.Logger.warn</code> enabled?
|
||||||
* @see org.apache.commons.logging.Log#isWarnEnabled()
|
* @see org.apache.commons.logging.Log#isWarnEnabled()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isWarnEnabled() {
|
public boolean isWarnEnabled() {
|
||||||
return getLogger().isWarnEnabled();
|
return getLogger().isWarnEnabled();
|
||||||
}
|
}
|
||||||
@@ -254,6 +268,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param t log this cause.
|
* @param t log this cause.
|
||||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable t) {
|
public void trace(final Object message, final Throwable t) {
|
||||||
if (getLogger().isDebugEnabled()) {
|
if (getLogger().isDebugEnabled()) {
|
||||||
getLogger().debug(String.valueOf(message), t);
|
getLogger().debug(String.valueOf(message), t);
|
||||||
@@ -266,6 +281,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#trace(Object)
|
* @see org.apache.commons.logging.Log#trace(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message) {
|
public void trace(final Object message) {
|
||||||
if (getLogger().isDebugEnabled()) {
|
if (getLogger().isDebugEnabled()) {
|
||||||
getLogger().debug(String.valueOf(message));
|
getLogger().debug(String.valueOf(message));
|
||||||
@@ -279,6 +295,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable t) {
|
public void warn(final Object message, final Throwable t) {
|
||||||
if (getLogger().isWarnEnabled()) {
|
if (getLogger().isWarnEnabled()) {
|
||||||
getLogger().warn(String.valueOf(message), t);
|
getLogger().warn(String.valueOf(message), t);
|
||||||
@@ -291,6 +308,7 @@ public class AvalonLogger implements Log {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#warn(Object)
|
* @see org.apache.commons.logging.Log#warn(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message) {
|
public void warn(final Object message) {
|
||||||
if (getLogger().isWarnEnabled()) {
|
if (getLogger().isWarnEnabled()) {
|
||||||
getLogger().warn(String.valueOf(message));
|
getLogger().warn(String.valueOf(message));
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#debug(Object)
|
* @see org.apache.commons.logging.Log#debug(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message) {
|
public void debug(final Object message) {
|
||||||
log(Level.FINE, String.valueOf(message), null);
|
log(Level.FINE, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -139,6 +140,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable exception) {
|
public void debug(final Object message, final Throwable exception) {
|
||||||
log(Level.FINE, String.valueOf(message), exception);
|
log(Level.FINE, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -149,6 +151,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#error(Object)
|
* @see org.apache.commons.logging.Log#error(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message) {
|
public void error(final Object message) {
|
||||||
log(Level.SEVERE, String.valueOf(message), null);
|
log(Level.SEVERE, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -160,6 +163,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable exception) {
|
public void error(final Object message, final Throwable exception) {
|
||||||
log(Level.SEVERE, String.valueOf(message), exception);
|
log(Level.SEVERE, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -170,6 +174,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) {
|
public void fatal(final Object message) {
|
||||||
log(Level.SEVERE, String.valueOf(message), null);
|
log(Level.SEVERE, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -181,6 +186,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable exception) {
|
public void fatal(final Object message, final Throwable exception) {
|
||||||
log(Level.SEVERE, String.valueOf(message), exception);
|
log(Level.SEVERE, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -201,6 +207,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#info(Object)
|
* @see org.apache.commons.logging.Log#info(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message) {
|
public void info(final Object message) {
|
||||||
log(Level.INFO, String.valueOf(message), null);
|
log(Level.INFO, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -212,6 +219,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable exception) {
|
public void info(final Object message, final Throwable exception) {
|
||||||
log(Level.INFO, String.valueOf(message), exception);
|
log(Level.INFO, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -219,6 +227,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is debug logging currently enabled?
|
* Is debug logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDebugEnabled() {
|
public boolean isDebugEnabled() {
|
||||||
return getLogger().isLoggable(Level.FINE);
|
return getLogger().isLoggable(Level.FINE);
|
||||||
}
|
}
|
||||||
@@ -226,6 +235,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is error logging currently enabled?
|
* Is error logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isErrorEnabled() {
|
public boolean isErrorEnabled() {
|
||||||
return getLogger().isLoggable(Level.SEVERE);
|
return getLogger().isLoggable(Level.SEVERE);
|
||||||
}
|
}
|
||||||
@@ -233,6 +243,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is fatal logging currently enabled?
|
* Is fatal logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isFatalEnabled() {
|
public boolean isFatalEnabled() {
|
||||||
return getLogger().isLoggable(Level.SEVERE);
|
return getLogger().isLoggable(Level.SEVERE);
|
||||||
}
|
}
|
||||||
@@ -240,6 +251,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is info logging currently enabled?
|
* Is info logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInfoEnabled() {
|
public boolean isInfoEnabled() {
|
||||||
return getLogger().isLoggable(Level.INFO);
|
return getLogger().isLoggable(Level.INFO);
|
||||||
}
|
}
|
||||||
@@ -247,6 +259,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is trace logging currently enabled?
|
* Is trace logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTraceEnabled() {
|
public boolean isTraceEnabled() {
|
||||||
return getLogger().isLoggable(Level.FINEST);
|
return getLogger().isLoggable(Level.FINEST);
|
||||||
}
|
}
|
||||||
@@ -254,6 +267,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is warn logging currently enabled?
|
* Is warn logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isWarnEnabled() {
|
public boolean isWarnEnabled() {
|
||||||
return getLogger().isLoggable(Level.WARNING);
|
return getLogger().isLoggable(Level.WARNING);
|
||||||
}
|
}
|
||||||
@@ -264,6 +278,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#trace(Object)
|
* @see org.apache.commons.logging.Log#trace(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message) {
|
public void trace(final Object message) {
|
||||||
log(Level.FINEST, String.valueOf(message), null);
|
log(Level.FINEST, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -275,6 +290,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable exception) {
|
public void trace(final Object message, final Throwable exception) {
|
||||||
log(Level.FINEST, String.valueOf(message), exception);
|
log(Level.FINEST, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -285,6 +301,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#warn(Object)
|
* @see org.apache.commons.logging.Log#warn(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message) {
|
public void warn(final Object message) {
|
||||||
log(Level.WARNING, String.valueOf(message), null);
|
log(Level.WARNING, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -296,6 +313,7 @@ public class Jdk13LumberjackLogger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable exception) {
|
public void warn(final Object message, final Throwable exception) {
|
||||||
log(Level.WARNING, String.valueOf(message), exception);
|
log(Level.WARNING, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#debug(Object)
|
* @see org.apache.commons.logging.Log#debug(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message) {
|
public void debug(final Object message) {
|
||||||
log(Level.FINE, String.valueOf(message), null);
|
log(Level.FINE, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -110,6 +111,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable exception) {
|
public void debug(final Object message, final Throwable exception) {
|
||||||
log(Level.FINE, String.valueOf(message), exception);
|
log(Level.FINE, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -120,6 +122,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#error(Object)
|
* @see org.apache.commons.logging.Log#error(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message) {
|
public void error(final Object message) {
|
||||||
log(Level.SEVERE, String.valueOf(message), null);
|
log(Level.SEVERE, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -131,6 +134,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable exception) {
|
public void error(final Object message, final Throwable exception) {
|
||||||
log(Level.SEVERE, String.valueOf(message), exception);
|
log(Level.SEVERE, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -141,6 +145,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) {
|
public void fatal(final Object message) {
|
||||||
log(Level.SEVERE, String.valueOf(message), null);
|
log(Level.SEVERE, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -152,6 +157,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable exception) {
|
public void fatal(final Object message, final Throwable exception) {
|
||||||
log(Level.SEVERE, String.valueOf(message), exception);
|
log(Level.SEVERE, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -172,6 +178,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#info(Object)
|
* @see org.apache.commons.logging.Log#info(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message) {
|
public void info(final Object message) {
|
||||||
log(Level.INFO, String.valueOf(message), null);
|
log(Level.INFO, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -183,6 +190,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable exception) {
|
public void info(final Object message, final Throwable exception) {
|
||||||
log(Level.INFO, String.valueOf(message), exception);
|
log(Level.INFO, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -190,6 +198,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is debug logging currently enabled?
|
* Is debug logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDebugEnabled() {
|
public boolean isDebugEnabled() {
|
||||||
return getLogger().isLoggable(Level.FINE);
|
return getLogger().isLoggable(Level.FINE);
|
||||||
}
|
}
|
||||||
@@ -197,6 +206,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is error logging currently enabled?
|
* Is error logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isErrorEnabled() {
|
public boolean isErrorEnabled() {
|
||||||
return getLogger().isLoggable(Level.SEVERE);
|
return getLogger().isLoggable(Level.SEVERE);
|
||||||
}
|
}
|
||||||
@@ -204,6 +214,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is fatal logging currently enabled?
|
* Is fatal logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isFatalEnabled() {
|
public boolean isFatalEnabled() {
|
||||||
return getLogger().isLoggable(Level.SEVERE);
|
return getLogger().isLoggable(Level.SEVERE);
|
||||||
}
|
}
|
||||||
@@ -211,6 +222,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is info logging currently enabled?
|
* Is info logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInfoEnabled() {
|
public boolean isInfoEnabled() {
|
||||||
return getLogger().isLoggable(Level.INFO);
|
return getLogger().isLoggable(Level.INFO);
|
||||||
}
|
}
|
||||||
@@ -218,6 +230,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is trace logging currently enabled?
|
* Is trace logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTraceEnabled() {
|
public boolean isTraceEnabled() {
|
||||||
return getLogger().isLoggable(Level.FINEST);
|
return getLogger().isLoggable(Level.FINEST);
|
||||||
}
|
}
|
||||||
@@ -225,6 +238,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Is warn logging currently enabled?
|
* Is warn logging currently enabled?
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isWarnEnabled() {
|
public boolean isWarnEnabled() {
|
||||||
return getLogger().isLoggable(Level.WARNING);
|
return getLogger().isLoggable(Level.WARNING);
|
||||||
}
|
}
|
||||||
@@ -235,6 +249,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#trace(Object)
|
* @see org.apache.commons.logging.Log#trace(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message) {
|
public void trace(final Object message) {
|
||||||
log(Level.FINEST, String.valueOf(message), null);
|
log(Level.FINEST, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -246,6 +261,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable exception) {
|
public void trace(final Object message, final Throwable exception) {
|
||||||
log(Level.FINEST, String.valueOf(message), exception);
|
log(Level.FINEST, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
@@ -256,6 +272,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#warn(Object)
|
* @see org.apache.commons.logging.Log#warn(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message) {
|
public void warn(final Object message) {
|
||||||
log(Level.WARNING, String.valueOf(message), null);
|
log(Level.WARNING, String.valueOf(message), null);
|
||||||
}
|
}
|
||||||
@@ -267,6 +284,7 @@ public class Jdk14Logger implements Log, Serializable {
|
|||||||
* @param exception log this cause
|
* @param exception log this cause
|
||||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable exception) {
|
public void warn(final Object message, final Throwable exception) {
|
||||||
log(Level.WARNING, String.valueOf(message), exception);
|
log(Level.WARNING, String.valueOf(message), exception);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#trace(Object)
|
* @see org.apache.commons.logging.Log#trace(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message) {
|
public void trace(final Object message) {
|
||||||
getLogger().log(FQCN, traceLevel, message, null);
|
getLogger().log(FQCN, traceLevel, message, null);
|
||||||
}
|
}
|
||||||
@@ -141,6 +142,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable t) {
|
public void trace(final Object message, final Throwable t) {
|
||||||
getLogger().log(FQCN, traceLevel, message, t);
|
getLogger().log(FQCN, traceLevel, message, t);
|
||||||
}
|
}
|
||||||
@@ -151,6 +153,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#debug(Object)
|
* @see org.apache.commons.logging.Log#debug(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message) {
|
public void debug(final Object message) {
|
||||||
getLogger().log(FQCN, Level.DEBUG, message, null);
|
getLogger().log(FQCN, Level.DEBUG, message, null);
|
||||||
}
|
}
|
||||||
@@ -162,6 +165,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable t) {
|
public void debug(final Object message, final Throwable t) {
|
||||||
getLogger().log(FQCN, Level.DEBUG, message, t);
|
getLogger().log(FQCN, Level.DEBUG, message, t);
|
||||||
}
|
}
|
||||||
@@ -172,6 +176,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#info(Object)
|
* @see org.apache.commons.logging.Log#info(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message) {
|
public void info(final Object message) {
|
||||||
getLogger().log(FQCN, Level.INFO, message, null);
|
getLogger().log(FQCN, Level.INFO, message, null);
|
||||||
}
|
}
|
||||||
@@ -183,6 +188,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable t) {
|
public void info(final Object message, final Throwable t) {
|
||||||
getLogger().log(FQCN, Level.INFO, message, t);
|
getLogger().log(FQCN, Level.INFO, message, t);
|
||||||
}
|
}
|
||||||
@@ -193,6 +199,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#warn(Object)
|
* @see org.apache.commons.logging.Log#warn(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message) {
|
public void warn(final Object message) {
|
||||||
getLogger().log(FQCN, Level.WARN, message, null);
|
getLogger().log(FQCN, Level.WARN, message, null);
|
||||||
}
|
}
|
||||||
@@ -204,6 +211,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable t) {
|
public void warn(final Object message, final Throwable t) {
|
||||||
getLogger().log(FQCN, Level.WARN, message, t);
|
getLogger().log(FQCN, Level.WARN, message, t);
|
||||||
}
|
}
|
||||||
@@ -214,6 +222,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#error(Object)
|
* @see org.apache.commons.logging.Log#error(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message) {
|
public void error(final Object message) {
|
||||||
getLogger().log(FQCN, Level.ERROR, message, null);
|
getLogger().log(FQCN, Level.ERROR, message, null);
|
||||||
}
|
}
|
||||||
@@ -225,6 +234,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable t) {
|
public void error(final Object message, final Throwable t) {
|
||||||
getLogger().log(FQCN, Level.ERROR, message, t);
|
getLogger().log(FQCN, Level.ERROR, message, t);
|
||||||
}
|
}
|
||||||
@@ -235,6 +245,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) {
|
public void fatal(final Object message) {
|
||||||
getLogger().log(FQCN, Level.FATAL, message, null);
|
getLogger().log(FQCN, Level.FATAL, message, null);
|
||||||
}
|
}
|
||||||
@@ -246,6 +257,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable t) {
|
public void fatal(final Object message, final Throwable t) {
|
||||||
getLogger().log(FQCN, Level.FATAL, message, t);
|
getLogger().log(FQCN, Level.FATAL, message, t);
|
||||||
}
|
}
|
||||||
@@ -269,6 +281,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Check whether the Log4j Logger used is enabled for <code>DEBUG</code> priority.
|
* Check whether the Log4j Logger used is enabled for <code>DEBUG</code> priority.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDebugEnabled() {
|
public boolean isDebugEnabled() {
|
||||||
return getLogger().isDebugEnabled();
|
return getLogger().isDebugEnabled();
|
||||||
}
|
}
|
||||||
@@ -276,6 +289,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Check whether the Log4j Logger used is enabled for <code>ERROR</code> priority.
|
* Check whether the Log4j Logger used is enabled for <code>ERROR</code> priority.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isErrorEnabled() {
|
public boolean isErrorEnabled() {
|
||||||
return getLogger().isEnabledFor(Level.ERROR);
|
return getLogger().isEnabledFor(Level.ERROR);
|
||||||
}
|
}
|
||||||
@@ -283,6 +297,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Check whether the Log4j Logger used is enabled for <code>FATAL</code> priority.
|
* Check whether the Log4j Logger used is enabled for <code>FATAL</code> priority.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isFatalEnabled() {
|
public boolean isFatalEnabled() {
|
||||||
return getLogger().isEnabledFor(Level.FATAL);
|
return getLogger().isEnabledFor(Level.FATAL);
|
||||||
}
|
}
|
||||||
@@ -290,6 +305,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Check whether the Log4j Logger used is enabled for <code>INFO</code> priority.
|
* Check whether the Log4j Logger used is enabled for <code>INFO</code> priority.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInfoEnabled() {
|
public boolean isInfoEnabled() {
|
||||||
return getLogger().isInfoEnabled();
|
return getLogger().isInfoEnabled();
|
||||||
}
|
}
|
||||||
@@ -299,6 +315,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
* When using a log4j version that does not support the TRACE level, this call
|
* When using a log4j version that does not support the TRACE level, this call
|
||||||
* will report whether <code>DEBUG</code> is enabled or not.
|
* will report whether <code>DEBUG</code> is enabled or not.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTraceEnabled() {
|
public boolean isTraceEnabled() {
|
||||||
return getLogger().isEnabledFor(traceLevel);
|
return getLogger().isEnabledFor(traceLevel);
|
||||||
}
|
}
|
||||||
@@ -306,6 +323,7 @@ public class Log4JLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Check whether the Log4j Logger used is enabled for <code>WARN</code> priority.
|
* Check whether the Log4j Logger used is enabled for <code>WARN</code> priority.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isWarnEnabled() {
|
public boolean isWarnEnabled() {
|
||||||
return getLogger().isEnabledFor(Level.WARN);
|
return getLogger().isEnabledFor(Level.WARN);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
*
|
*
|
||||||
* @param name Name of the attribute to return
|
* @param name Name of the attribute to return
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getAttribute(final String name) {
|
public Object getAttribute(final String name) {
|
||||||
return attributes.get(name);
|
return attributes.get(name);
|
||||||
}
|
}
|
||||||
@@ -251,6 +252,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* configuration attributes. If there are no such attributes, a zero
|
* configuration attributes. If there are no such attributes, a zero
|
||||||
* length array is returned.
|
* length array is returned.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String[] getAttributeNames() {
|
public String[] getAttributeNames() {
|
||||||
return (String[]) attributes.keySet().toArray(new String[attributes.size()]);
|
return (String[]) attributes.keySet().toArray(new String[attributes.size()]);
|
||||||
}
|
}
|
||||||
@@ -264,6 +266,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @throws LogConfigurationException if a suitable <code>Log</code>
|
* @throws LogConfigurationException if a suitable <code>Log</code>
|
||||||
* instance cannot be returned
|
* instance cannot be returned
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Log getInstance(final Class clazz) throws LogConfigurationException {
|
public Log getInstance(final Class clazz) throws LogConfigurationException {
|
||||||
return getInstance(clazz.getName());
|
return getInstance(clazz.getName());
|
||||||
}
|
}
|
||||||
@@ -285,6 +288,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @throws LogConfigurationException if a suitable <code>Log</code>
|
* @throws LogConfigurationException if a suitable <code>Log</code>
|
||||||
* instance cannot be returned
|
* instance cannot be returned
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Log getInstance(final String name) throws LogConfigurationException {
|
public Log getInstance(final String name) throws LogConfigurationException {
|
||||||
Log instance = (Log) instances.get(name);
|
Log instance = (Log) instances.get(name);
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
@@ -302,6 +306,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* throwing away a ClassLoader. Dangling references to objects in that
|
* throwing away a ClassLoader. Dangling references to objects in that
|
||||||
* class loader would prevent garbage collection.
|
* class loader would prevent garbage collection.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void release() {
|
public void release() {
|
||||||
|
|
||||||
logDiagnostic("Releasing all known loggers");
|
logDiagnostic("Releasing all known loggers");
|
||||||
@@ -314,6 +319,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
*
|
*
|
||||||
* @param name Name of the attribute to remove
|
* @param name Name of the attribute to remove
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void removeAttribute(final String name) {
|
public void removeAttribute(final String name) {
|
||||||
attributes.remove(name);
|
attributes.remove(name);
|
||||||
}
|
}
|
||||||
@@ -342,6 +348,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @param value Value of the attribute to set, or <code>null</code>
|
* @param value Value of the attribute to set, or <code>null</code>
|
||||||
* to remove any setting for this attribute
|
* to remove any setting for this attribute
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setAttribute(final String name, final Object value) {
|
public void setAttribute(final String name, final Object value) {
|
||||||
if (logConstructor != null) {
|
if (logConstructor != null) {
|
||||||
logDiagnostic("setAttribute: call too late; configuration already performed.");
|
logDiagnostic("setAttribute: call too late; configuration already performed.");
|
||||||
@@ -450,6 +457,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @deprecated Never invoked by this class; subclasses should not assume
|
* @deprecated Never invoked by this class; subclasses should not assume
|
||||||
* it will be.
|
* it will be.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
protected String getLogClassName() {
|
protected String getLogClassName() {
|
||||||
if (logClassName == null) {
|
if (logClassName == null) {
|
||||||
discoverLogImplementation(getClass().getName());
|
discoverLogImplementation(getClass().getName());
|
||||||
@@ -474,6 +482,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @deprecated Never invoked by this class; subclasses should not assume
|
* @deprecated Never invoked by this class; subclasses should not assume
|
||||||
* it will be.
|
* it will be.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
protected Constructor getLogConstructor()
|
protected Constructor getLogConstructor()
|
||||||
throws LogConfigurationException {
|
throws LogConfigurationException {
|
||||||
|
|
||||||
@@ -491,6 +500,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @deprecated Never invoked by this class; subclasses should not assume
|
* @deprecated Never invoked by this class; subclasses should not assume
|
||||||
* it will be.
|
* it will be.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
protected boolean isJdk13LumberjackAvailable() {
|
protected boolean isJdk13LumberjackAvailable() {
|
||||||
return isLogLibraryAvailable(
|
return isLogLibraryAvailable(
|
||||||
"Jdk13Lumberjack",
|
"Jdk13Lumberjack",
|
||||||
@@ -506,6 +516,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @deprecated Never invoked by this class; subclasses should not assume
|
* @deprecated Never invoked by this class; subclasses should not assume
|
||||||
* it will be.
|
* it will be.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
protected boolean isJdk14Available() {
|
protected boolean isJdk14Available() {
|
||||||
return isLogLibraryAvailable(
|
return isLogLibraryAvailable(
|
||||||
"Jdk14",
|
"Jdk14",
|
||||||
@@ -518,6 +529,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
* @deprecated Never invoked by this class; subclasses should not assume
|
* @deprecated Never invoked by this class; subclasses should not assume
|
||||||
* it will be.
|
* it will be.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
protected boolean isLog4JAvailable() {
|
protected boolean isLog4JAvailable() {
|
||||||
return isLogLibraryAvailable(
|
return isLogLibraryAvailable(
|
||||||
"Log4J",
|
"Log4J",
|
||||||
@@ -595,6 +607,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
throws LogConfigurationException {
|
throws LogConfigurationException {
|
||||||
return (ClassLoader)AccessController.doPrivileged(
|
return (ClassLoader)AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
return LogFactory.directGetContextClassLoader();
|
return LogFactory.directGetContextClassLoader();
|
||||||
}
|
}
|
||||||
@@ -614,6 +627,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
throws SecurityException {
|
throws SecurityException {
|
||||||
return (String) AccessController.doPrivileged(
|
return (String) AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
return System.getProperty(key, def);
|
return System.getProperty(key, def);
|
||||||
}
|
}
|
||||||
@@ -631,6 +645,7 @@ public class LogFactoryImpl extends LogFactory {
|
|||||||
try {
|
try {
|
||||||
return (ClassLoader)AccessController.doPrivileged(
|
return (ClassLoader)AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
return cl.getParent();
|
return cl.getParent();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#trace(Object)
|
* @see org.apache.commons.logging.Log#trace(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message) {
|
public void trace(final Object message) {
|
||||||
debug(message);
|
debug(message);
|
||||||
}
|
}
|
||||||
@@ -96,6 +97,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable t) {
|
public void trace(final Object message, final Throwable t) {
|
||||||
debug(message, t);
|
debug(message, t);
|
||||||
}
|
}
|
||||||
@@ -106,6 +108,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#debug(Object)
|
* @see org.apache.commons.logging.Log#debug(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message) {
|
public void debug(final Object message) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().debug(String.valueOf(message));
|
getLogger().debug(String.valueOf(message));
|
||||||
@@ -119,6 +122,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable t) {
|
public void debug(final Object message, final Throwable t) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().debug(String.valueOf(message), t);
|
getLogger().debug(String.valueOf(message), t);
|
||||||
@@ -131,6 +135,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#info(Object)
|
* @see org.apache.commons.logging.Log#info(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message) {
|
public void info(final Object message) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().info(String.valueOf(message));
|
getLogger().info(String.valueOf(message));
|
||||||
@@ -144,6 +149,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable t) {
|
public void info(final Object message, final Throwable t) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().info(String.valueOf(message), t);
|
getLogger().info(String.valueOf(message), t);
|
||||||
@@ -156,6 +162,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#warn(Object)
|
* @see org.apache.commons.logging.Log#warn(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message) {
|
public void warn(final Object message) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().warn(String.valueOf(message));
|
getLogger().warn(String.valueOf(message));
|
||||||
@@ -169,6 +176,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable t) {
|
public void warn(final Object message, final Throwable t) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().warn(String.valueOf(message), t);
|
getLogger().warn(String.valueOf(message), t);
|
||||||
@@ -181,6 +189,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#error(Object)
|
* @see org.apache.commons.logging.Log#error(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message) {
|
public void error(final Object message) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().error(String.valueOf(message));
|
getLogger().error(String.valueOf(message));
|
||||||
@@ -194,6 +203,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable t) {
|
public void error(final Object message, final Throwable t) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().error(String.valueOf(message), t);
|
getLogger().error(String.valueOf(message), t);
|
||||||
@@ -206,6 +216,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) {
|
public void fatal(final Object message) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().fatalError(String.valueOf(message));
|
getLogger().fatalError(String.valueOf(message));
|
||||||
@@ -219,6 +230,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable t) {
|
public void fatal(final Object message, final Throwable t) {
|
||||||
if (message != null) {
|
if (message != null) {
|
||||||
getLogger().fatalError(String.valueOf(message), t);
|
getLogger().fatalError(String.valueOf(message), t);
|
||||||
@@ -228,6 +240,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>.
|
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isDebugEnabled() {
|
public boolean isDebugEnabled() {
|
||||||
return getLogger().isDebugEnabled();
|
return getLogger().isDebugEnabled();
|
||||||
}
|
}
|
||||||
@@ -235,6 +248,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>ERROR</code>.
|
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>ERROR</code>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isErrorEnabled() {
|
public boolean isErrorEnabled() {
|
||||||
return getLogger().isErrorEnabled();
|
return getLogger().isErrorEnabled();
|
||||||
}
|
}
|
||||||
@@ -242,6 +256,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>FATAL_ERROR</code>.
|
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>FATAL_ERROR</code>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isFatalEnabled() {
|
public boolean isFatalEnabled() {
|
||||||
return getLogger().isFatalErrorEnabled();
|
return getLogger().isFatalErrorEnabled();
|
||||||
}
|
}
|
||||||
@@ -249,6 +264,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>INFO</code>.
|
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>INFO</code>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isInfoEnabled() {
|
public boolean isInfoEnabled() {
|
||||||
return getLogger().isInfoEnabled();
|
return getLogger().isInfoEnabled();
|
||||||
}
|
}
|
||||||
@@ -256,6 +272,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>.
|
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isTraceEnabled() {
|
public boolean isTraceEnabled() {
|
||||||
return getLogger().isDebugEnabled();
|
return getLogger().isDebugEnabled();
|
||||||
}
|
}
|
||||||
@@ -263,6 +280,7 @@ public class LogKitLogger implements Log, Serializable {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>WARN</code>.
|
* Checks whether the <code>LogKit</code> logger will log messages of priority <code>WARN</code>.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isWarnEnabled() {
|
public boolean isWarnEnabled() {
|
||||||
return getLogger().isWarnEnabled();
|
return getLogger().isWarnEnabled();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,28 +36,40 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
/** Base constructor */
|
/** Base constructor */
|
||||||
public NoOpLog(final String name) { }
|
public NoOpLog(final String name) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void trace(final Object message) { }
|
public void trace(final Object message) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable t) { }
|
public void trace(final Object message, final Throwable t) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void debug(final Object message) { }
|
public void debug(final Object message) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable t) { }
|
public void debug(final Object message, final Throwable t) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void info(final Object message) { }
|
public void info(final Object message) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable t) { }
|
public void info(final Object message, final Throwable t) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void warn(final Object message) { }
|
public void warn(final Object message) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable t) { }
|
public void warn(final Object message, final Throwable t) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void error(final Object message) { }
|
public void error(final Object message) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable t) { }
|
public void error(final Object message, final Throwable t) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) { }
|
public void fatal(final Object message) { }
|
||||||
/** Do nothing */
|
/** Do nothing */
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable t) { }
|
public void fatal(final Object message, final Throwable t) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,6 +77,7 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
*
|
*
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isDebugEnabled() { return false; }
|
public final boolean isDebugEnabled() { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,6 +85,7 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
*
|
*
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isErrorEnabled() { return false; }
|
public final boolean isErrorEnabled() { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -79,6 +93,7 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
*
|
*
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isFatalEnabled() { return false; }
|
public final boolean isFatalEnabled() { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,6 +101,7 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
*
|
*
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isInfoEnabled() { return false; }
|
public final boolean isInfoEnabled() { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -93,6 +109,7 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
*
|
*
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isTraceEnabled() { return false; }
|
public final boolean isTraceEnabled() { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -100,5 +117,6 @@ public class NoOpLog implements Log, Serializable {
|
|||||||
*
|
*
|
||||||
* @return false
|
* @return false
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isWarnEnabled() { return false; }
|
public final boolean isWarnEnabled() { return false; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public class ServletContextCleaner implements ServletContextListener {
|
|||||||
* class to release any logging information related to the current
|
* class to release any logging information related to the current
|
||||||
* contextClassloader.
|
* contextClassloader.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void contextDestroyed(final ServletContextEvent sce) {
|
public void contextDestroyed(final ServletContextEvent sce) {
|
||||||
final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
|
final ClassLoader tccl = Thread.currentThread().getContextClassLoader();
|
||||||
|
|
||||||
@@ -130,6 +131,7 @@ public class ServletContextCleaner implements ServletContextListener {
|
|||||||
/**
|
/**
|
||||||
* Invoked when a webapp is deployed. Nothing needs to be done here.
|
* Invoked when a webapp is deployed. Nothing needs to be done here.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void contextInitialized(final ServletContextEvent sce) {
|
public void contextInitialized(final ServletContextEvent sce) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,6 +365,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#debug(Object)
|
* @see org.apache.commons.logging.Log#debug(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void debug(final Object message) {
|
public final void debug(final Object message) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
|
||||||
log(SimpleLog.LOG_LEVEL_DEBUG, message, null);
|
log(SimpleLog.LOG_LEVEL_DEBUG, message, null);
|
||||||
@@ -379,6 +380,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
* @see org.apache.commons.logging.Log#debug(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void debug(final Object message, final Throwable t) {
|
public final void debug(final Object message, final Throwable t) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG)) {
|
||||||
log(SimpleLog.LOG_LEVEL_DEBUG, message, t);
|
log(SimpleLog.LOG_LEVEL_DEBUG, message, t);
|
||||||
@@ -391,6 +393,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#trace(Object)
|
* @see org.apache.commons.logging.Log#trace(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void trace(final Object message) {
|
public final void trace(final Object message) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
|
||||||
log(SimpleLog.LOG_LEVEL_TRACE, message, null);
|
log(SimpleLog.LOG_LEVEL_TRACE, message, null);
|
||||||
@@ -404,6 +407,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
* @see org.apache.commons.logging.Log#trace(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void trace(final Object message, final Throwable t) {
|
public final void trace(final Object message, final Throwable t) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE)) {
|
||||||
log(SimpleLog.LOG_LEVEL_TRACE, message, t);
|
log(SimpleLog.LOG_LEVEL_TRACE, message, t);
|
||||||
@@ -416,6 +420,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#info(Object)
|
* @see org.apache.commons.logging.Log#info(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void info(final Object message) {
|
public final void info(final Object message) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
|
||||||
log(SimpleLog.LOG_LEVEL_INFO,message,null);
|
log(SimpleLog.LOG_LEVEL_INFO,message,null);
|
||||||
@@ -429,6 +434,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
* @see org.apache.commons.logging.Log#info(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void info(final Object message, final Throwable t) {
|
public final void info(final Object message, final Throwable t) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_INFO)) {
|
||||||
log(SimpleLog.LOG_LEVEL_INFO, message, t);
|
log(SimpleLog.LOG_LEVEL_INFO, message, t);
|
||||||
@@ -441,6 +447,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#warn(Object)
|
* @see org.apache.commons.logging.Log#warn(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void warn(final Object message) {
|
public final void warn(final Object message) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
|
||||||
log(SimpleLog.LOG_LEVEL_WARN, message, null);
|
log(SimpleLog.LOG_LEVEL_WARN, message, null);
|
||||||
@@ -454,6 +461,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
* @see org.apache.commons.logging.Log#warn(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void warn(final Object message, final Throwable t) {
|
public final void warn(final Object message, final Throwable t) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_WARN)) {
|
||||||
log(SimpleLog.LOG_LEVEL_WARN, message, t);
|
log(SimpleLog.LOG_LEVEL_WARN, message, t);
|
||||||
@@ -466,6 +474,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#error(Object)
|
* @see org.apache.commons.logging.Log#error(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void error(final Object message) {
|
public final void error(final Object message) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
|
||||||
log(SimpleLog.LOG_LEVEL_ERROR, message, null);
|
log(SimpleLog.LOG_LEVEL_ERROR, message, null);
|
||||||
@@ -479,6 +488,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
* @see org.apache.commons.logging.Log#error(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void error(final Object message, final Throwable t) {
|
public final void error(final Object message, final Throwable t) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR)) {
|
||||||
log(SimpleLog.LOG_LEVEL_ERROR, message, t);
|
log(SimpleLog.LOG_LEVEL_ERROR, message, t);
|
||||||
@@ -491,6 +501,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param message to log
|
* @param message to log
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object)
|
* @see org.apache.commons.logging.Log#fatal(Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void fatal(final Object message) {
|
public final void fatal(final Object message) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
|
||||||
log(SimpleLog.LOG_LEVEL_FATAL, message, null);
|
log(SimpleLog.LOG_LEVEL_FATAL, message, null);
|
||||||
@@ -504,6 +515,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* @param t log this cause
|
* @param t log this cause
|
||||||
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
* @see org.apache.commons.logging.Log#fatal(Object, Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final void fatal(final Object message, final Throwable t) {
|
public final void fatal(final Object message, final Throwable t) {
|
||||||
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
|
if (isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL)) {
|
||||||
log(SimpleLog.LOG_LEVEL_FATAL, message, t);
|
log(SimpleLog.LOG_LEVEL_FATAL, message, t);
|
||||||
@@ -517,6 +529,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* concatenation to be avoided when the message will be ignored by the
|
* concatenation to be avoided when the message will be ignored by the
|
||||||
* logger.
|
* logger.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isDebugEnabled() {
|
public final boolean isDebugEnabled() {
|
||||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG);
|
return isLevelEnabled(SimpleLog.LOG_LEVEL_DEBUG);
|
||||||
}
|
}
|
||||||
@@ -528,6 +541,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* concatenation to be avoided when the message will be ignored by the
|
* concatenation to be avoided when the message will be ignored by the
|
||||||
* logger.
|
* logger.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isErrorEnabled() {
|
public final boolean isErrorEnabled() {
|
||||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR);
|
return isLevelEnabled(SimpleLog.LOG_LEVEL_ERROR);
|
||||||
}
|
}
|
||||||
@@ -539,6 +553,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* concatenation to be avoided when the message will be ignored by the
|
* concatenation to be avoided when the message will be ignored by the
|
||||||
* logger.
|
* logger.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isFatalEnabled() {
|
public final boolean isFatalEnabled() {
|
||||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL);
|
return isLevelEnabled(SimpleLog.LOG_LEVEL_FATAL);
|
||||||
}
|
}
|
||||||
@@ -550,6 +565,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* concatenation to be avoided when the message will be ignored by the
|
* concatenation to be avoided when the message will be ignored by the
|
||||||
* logger.
|
* logger.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isInfoEnabled() {
|
public final boolean isInfoEnabled() {
|
||||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_INFO);
|
return isLevelEnabled(SimpleLog.LOG_LEVEL_INFO);
|
||||||
}
|
}
|
||||||
@@ -561,6 +577,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* concatenation to be avoided when the message will be ignored by the
|
* concatenation to be avoided when the message will be ignored by the
|
||||||
* logger.
|
* logger.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isTraceEnabled() {
|
public final boolean isTraceEnabled() {
|
||||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE);
|
return isLevelEnabled(SimpleLog.LOG_LEVEL_TRACE);
|
||||||
}
|
}
|
||||||
@@ -572,6 +589,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
* concatenation to be avoided when the message will be ignored by the
|
* concatenation to be avoided when the message will be ignored by the
|
||||||
* logger.
|
* logger.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final boolean isWarnEnabled() {
|
public final boolean isWarnEnabled() {
|
||||||
return isLevelEnabled(SimpleLog.LOG_LEVEL_WARN);
|
return isLevelEnabled(SimpleLog.LOG_LEVEL_WARN);
|
||||||
}
|
}
|
||||||
@@ -640,6 +658,7 @@ public class SimpleLog implements Log, Serializable {
|
|||||||
private static InputStream getResourceAsStream(final String name) {
|
private static InputStream getResourceAsStream(final String name) {
|
||||||
return (InputStream)AccessController.doPrivileged(
|
return (InputStream)AccessController.doPrivileged(
|
||||||
new PrivilegedAction() {
|
new PrivilegedAction() {
|
||||||
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
final ClassLoader threadCL = getContextClassLoader();
|
final ClassLoader threadCL = getContextClassLoader();
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean containsKey(final Object key) {
|
public boolean containsKey(final Object key) {
|
||||||
// purge should not be required
|
// purge should not be required
|
||||||
final Referenced referenced = new Referenced(key);
|
final Referenced referenced = new Referenced(key);
|
||||||
@@ -147,6 +148,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Enumeration elements() {
|
public Enumeration elements() {
|
||||||
purge();
|
purge();
|
||||||
return super.elements();
|
return super.elements();
|
||||||
@@ -155,6 +157,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Set entrySet() {
|
public Set entrySet() {
|
||||||
purge();
|
purge();
|
||||||
final Set referencedEntries = super.entrySet();
|
final Set referencedEntries = super.entrySet();
|
||||||
@@ -175,6 +178,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object get(final Object key) {
|
public Object get(final Object key) {
|
||||||
// for performance reasons, no purge
|
// for performance reasons, no purge
|
||||||
final Referenced referenceKey = new Referenced(key);
|
final Referenced referenceKey = new Referenced(key);
|
||||||
@@ -184,13 +188,16 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Enumeration keys() {
|
public Enumeration keys() {
|
||||||
purge();
|
purge();
|
||||||
final Enumeration enumer = super.keys();
|
final Enumeration enumer = super.keys();
|
||||||
return new Enumeration() {
|
return new Enumeration() {
|
||||||
|
@Override
|
||||||
public boolean hasMoreElements() {
|
public boolean hasMoreElements() {
|
||||||
return enumer.hasMoreElements();
|
return enumer.hasMoreElements();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public Object nextElement() {
|
public Object nextElement() {
|
||||||
final Referenced nextReference = (Referenced) enumer.nextElement();
|
final Referenced nextReference = (Referenced) enumer.nextElement();
|
||||||
return nextReference.getValue();
|
return nextReference.getValue();
|
||||||
@@ -201,6 +208,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Set keySet() {
|
public Set keySet() {
|
||||||
purge();
|
purge();
|
||||||
final Set referencedKeys = super.keySet();
|
final Set referencedKeys = super.keySet();
|
||||||
@@ -218,6 +226,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public synchronized Object put(final Object key, final Object value) {
|
public synchronized Object put(final Object key, final Object value) {
|
||||||
// check for nulls, ensuring semantics match superclass
|
// check for nulls, ensuring semantics match superclass
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
@@ -245,6 +254,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void putAll(final Map t) {
|
public void putAll(final Map t) {
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
final Set entrySet = t.entrySet();
|
final Set entrySet = t.entrySet();
|
||||||
@@ -258,6 +268,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Collection values() {
|
public Collection values() {
|
||||||
purge();
|
purge();
|
||||||
return super.values();
|
return super.values();
|
||||||
@@ -266,6 +277,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public synchronized Object remove(final Object key) {
|
public synchronized Object remove(final Object key) {
|
||||||
// for performance reasons, only purge every
|
// for performance reasons, only purge every
|
||||||
// MAX_CHANGES_BEFORE_PURGE times
|
// MAX_CHANGES_BEFORE_PURGE times
|
||||||
@@ -283,6 +295,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
purge();
|
purge();
|
||||||
return super.isEmpty();
|
return super.isEmpty();
|
||||||
@@ -291,6 +304,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
purge();
|
purge();
|
||||||
return super.size();
|
return super.size();
|
||||||
@@ -299,6 +313,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
*@see Hashtable
|
*@see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
purge();
|
purge();
|
||||||
return super.toString();
|
return super.toString();
|
||||||
@@ -307,6 +322,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
/**
|
/**
|
||||||
* @see Hashtable
|
* @see Hashtable
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void rehash() {
|
protected void rehash() {
|
||||||
// purge here to save the effort of rehashing dead entries
|
// purge here to save the effort of rehashing dead entries
|
||||||
purge();
|
purge();
|
||||||
@@ -359,6 +375,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (o instanceof Map.Entry) {
|
if (o instanceof Map.Entry) {
|
||||||
@@ -373,19 +390,23 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return (getKey()==null ? 0 : getKey().hashCode()) ^
|
return (getKey()==null ? 0 : getKey().hashCode()) ^
|
||||||
(getValue()==null ? 0 : getValue().hashCode());
|
(getValue()==null ? 0 : getValue().hashCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object setValue(final Object value) {
|
public Object setValue(final Object value) {
|
||||||
throw new UnsupportedOperationException("Entry.setValue is not supported.");
|
throw new UnsupportedOperationException("Entry.setValue is not supported.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getValue() {
|
public Object getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getKey() {
|
public Object getKey() {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
@@ -420,6 +441,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return hashCode;
|
return hashCode;
|
||||||
}
|
}
|
||||||
@@ -428,6 +450,7 @@ public final class WeakHashtable extends Hashtable {
|
|||||||
return reference.get();
|
return reference.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals(final Object o) {
|
public boolean equals(final Object o) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (o instanceof Referenced) {
|
if (o instanceof Referenced) {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class AltHashtable extends Hashtable {
|
|||||||
public static Object lastKey;
|
public static Object lastKey;
|
||||||
public static Object lastValue;
|
public static Object lastValue;
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object put(final Object key, final Object value) {
|
public Object put(final Object key, final Object value) {
|
||||||
lastKey = key;
|
lastKey = key;
|
||||||
lastValue = value;
|
lastValue = value;
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class AltHashtableTestCase extends TestCase {
|
|||||||
* This is true of all JVMs I know of; and if it isn't then this test will
|
* This is true of all JVMs I know of; and if it isn't then this test will
|
||||||
* fail and someone will tell us.
|
* fail and someone will tell us.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
System.setProperty(
|
System.setProperty(
|
||||||
"org.apache.commons.logging.LogFactory.HashtableImpl",
|
"org.apache.commons.logging.LogFactory.HashtableImpl",
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public class LoadTestCase extends TestCase{
|
|||||||
|
|
||||||
// not very trivial to emulate we must implement "findClass",
|
// not very trivial to emulate we must implement "findClass",
|
||||||
// but it will delegete to junit class loder first
|
// but it will delegete to junit class loder first
|
||||||
|
@Override
|
||||||
public Class loadClass(final String name)throws ClassNotFoundException{
|
public Class loadClass(final String name)throws ClassNotFoundException{
|
||||||
|
|
||||||
//isolates all logging classes, application in the same classloader too.
|
//isolates all logging classes, application in the same classloader too.
|
||||||
@@ -211,11 +212,13 @@ public class LoadTestCase extends TestCase{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
// save state before test starts so we can restore it when test ends
|
// save state before test starts so we can restore it when test ends
|
||||||
origContextClassLoader = Thread.currentThread().getContextClassLoader();
|
origContextClassLoader = Thread.currentThread().getContextClassLoader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
// restore original state so a test can't stuff up later tests.
|
// restore original state so a test can't stuff up later tests.
|
||||||
Thread.currentThread().setContextClassLoader(origContextClassLoader);
|
Thread.currentThread().setContextClassLoader(origContextClassLoader);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package org.apache.commons.logging;
|
|||||||
public class LogTestCase extends AbstractLogTest
|
public class LogTestCase extends AbstractLogTest
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
public Log getLogObject()
|
public Log getLogObject()
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* use addLogicalLib instead, then define the location for that logical
|
* use addLogicalLib instead, then define the location for that logical
|
||||||
* library in the build.xml file.
|
* library in the build.xml file.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addURL(final URL url) {
|
public void addURL(final URL url) {
|
||||||
super.addURL(url);
|
super.addURL(url);
|
||||||
}
|
}
|
||||||
@@ -291,6 +292,7 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* prefix associated with that entry then attempt to load the class via
|
* prefix associated with that entry then attempt to load the class via
|
||||||
* that entries' classloader.
|
* that entries' classloader.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected Class loadClass(final String name, final boolean resolve)
|
protected Class loadClass(final String name, final boolean resolve)
|
||||||
throws ClassNotFoundException {
|
throws ClassNotFoundException {
|
||||||
// just for performance, check java and javax
|
// just for performance, check java and javax
|
||||||
@@ -340,6 +342,7 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* the resource is looked for in the local classpath before the parent
|
* the resource is looked for in the local classpath before the parent
|
||||||
* loader is consulted.
|
* loader is consulted.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public URL getResource(final String name) {
|
public URL getResource(final String name) {
|
||||||
if (parentFirst) {
|
if (parentFirst) {
|
||||||
return super.getResource(name);
|
return super.getResource(name);
|
||||||
@@ -413,6 +416,7 @@ public class PathableClassLoader extends URLClassLoader {
|
|||||||
* the resource is looked for in the local classpath before the parent
|
* the resource is looked for in the local classpath before the parent
|
||||||
* loader is consulted.
|
* loader is consulted.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public InputStream getResourceAsStream(final String name) {
|
public InputStream getResourceAsStream(final String name) {
|
||||||
if (parentFirst) {
|
if (parentFirst) {
|
||||||
return super.getResourceAsStream(name);
|
return super.getResourceAsStream(name);
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class PathableTestSuite extends TestSuite {
|
|||||||
* The context classloader and system properties are saved before each
|
* The context classloader and system properties are saved before each
|
||||||
* test, and restored after the test completes to better isolate tests.
|
* test, and restored after the test completes to better isolate tests.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void runTest(final Test test, final TestResult result) {
|
public void runTest(final Test test, final TestResult result) {
|
||||||
final ClassLoader origContext = Thread.currentThread().getContextClassLoader();
|
final ClassLoader origContext = Thread.currentThread().getContextClassLoader();
|
||||||
final Properties oldSysProps = (Properties) System.getProperties().clone();
|
final Properties oldSysProps = (Properties) System.getProperties().clone();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import org.apache.commons.logging.impl.SimpleLog;
|
|||||||
|
|
||||||
public class SimpleLogTestCase extends AbstractLogTest
|
public class SimpleLogTestCase extends AbstractLogTest
|
||||||
{
|
{
|
||||||
|
@Override
|
||||||
public Log getLogObject()
|
public Log getLogObject()
|
||||||
{
|
{
|
||||||
return new SimpleLog(this.getClass().getName());
|
return new SimpleLog(this.getClass().getName());
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public class AvalonLoggerTestCase extends AbstractLogTest {
|
|||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Log getLogObject() {
|
public Log getLogObject() {
|
||||||
// Output does not seem to be used, so don't display it.
|
// Output does not seem to be used, so don't display it.
|
||||||
final Log log = new AvalonLogger(new NullLogger());
|
final Log log = new AvalonLogger(new NullLogger());
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class FirstPriorityConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -94,6 +95,7 @@ public class FirstPriorityConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ public class PriorityConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -112,6 +113,7 @@ public class PriorityConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ public class WeakHashtableTestCase extends TestCase {
|
|||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
weakHashtable = new WeakHashtable();
|
weakHashtable = new WeakHashtable();
|
||||||
@@ -273,6 +274,7 @@ public class WeakHashtableTestCase extends TestCase {
|
|||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (int i = 0; i < RUN_LOOPS; i++) {
|
for (int i = 0; i < RUN_LOOPS; i++) {
|
||||||
hashtable.put("key" + ":" + i%10, Boolean.TRUE);
|
hashtable.put("key" + ":" + i%10, Boolean.TRUE);
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
setUpManager
|
setUpManager
|
||||||
("org/apache/commons/logging/jdk14/CustomConfig.properties");
|
("org/apache/commons/logging/jdk14/CustomConfig.properties");
|
||||||
@@ -200,6 +201,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
handlers = null;
|
handlers = null;
|
||||||
@@ -259,6 +261,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
|
|
||||||
|
|
||||||
// Test Serializability of Log instance
|
// Test Serializability of Log instance
|
||||||
|
@Override
|
||||||
public void testSerializable() throws Exception {
|
public void testSerializable() throws Exception {
|
||||||
|
|
||||||
super.testSerializable();
|
super.testSerializable();
|
||||||
@@ -271,6 +274,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
|
|
||||||
|
|
||||||
// Check the log instance
|
// Check the log instance
|
||||||
|
@Override
|
||||||
protected void checkLog() {
|
protected void checkLog() {
|
||||||
|
|
||||||
assertNotNull("Log exists", log);
|
assertNotNull("Log exists", log);
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public class DefaultConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
setUpFactory();
|
setUpFactory();
|
||||||
setUpLog("TestLogger");
|
setUpLog("TestLogger");
|
||||||
@@ -100,6 +101,7 @@ public class DefaultConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
log = null;
|
log = null;
|
||||||
factory = null;
|
factory = null;
|
||||||
|
|||||||
@@ -53,15 +53,18 @@ public class TestHandler extends Handler {
|
|||||||
// -------------------------------------------------------- Handler Methods
|
// -------------------------------------------------------- Handler Methods
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void flush() {
|
public void flush() {
|
||||||
records.clear();
|
records.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void publish(final LogRecord record) {
|
public void publish(final LogRecord record) {
|
||||||
records.add(record);
|
records.add(record);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public abstract class StandardTests extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -65,6 +66,7 @@ public abstract class StandardTests extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import org.apache.log4j.Logger;
|
|||||||
|
|
||||||
public class Log4j12StandardTests extends StandardTests {
|
public class Log4j12StandardTests extends StandardTests {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setUpTestAppender(final List logEvents) {
|
public void setUpTestAppender(final List logEvents) {
|
||||||
final TestAppender appender = new TestAppender(logEvents);
|
final TestAppender appender = new TestAppender(logEvents);
|
||||||
final Logger rootLogger = Logger.getRootLogger();
|
final Logger rootLogger = Logger.getRootLogger();
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ public class TestAppender extends AppenderSkeleton {
|
|||||||
|
|
||||||
// ------------------------------------------------------- Appender Methods
|
// ------------------------------------------------------- Appender Methods
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void append(final LoggingEvent event) {
|
protected void append(final LoggingEvent event) {
|
||||||
final StandardTests.LogEvent lev = new StandardTests.LogEvent();
|
final StandardTests.LogEvent lev = new StandardTests.LogEvent();
|
||||||
|
|
||||||
@@ -70,10 +71,12 @@ public class TestAppender extends AppenderSkeleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean requiresLayout() {
|
public boolean requiresLayout() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class StandardTestCase extends AbstractLogTest {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
|
|
||||||
@@ -90,6 +91,7 @@ public class StandardTestCase extends AbstractLogTest {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
log = null;
|
log = null;
|
||||||
factory = null;
|
factory = null;
|
||||||
@@ -102,6 +104,7 @@ public class StandardTestCase extends AbstractLogTest {
|
|||||||
* Override the abstract method from the parent class so that the
|
* Override the abstract method from the parent class so that the
|
||||||
* inherited tests can access the right Log object type.
|
* inherited tests can access the right Log object type.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Log getLogObject()
|
public Log getLogObject()
|
||||||
{
|
{
|
||||||
return new LogKitLogger(this.getClass().getName());
|
return new LogKitLogger(this.getClass().getName());
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class NoOpLogTestCase extends AbstractLogTest
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ public class NoOpLogTestCase extends AbstractLogTest
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
System.getProperties().remove("org.apache.commons.logging.Log");
|
System.getProperties().remove("org.apache.commons.logging.Log");
|
||||||
@@ -57,6 +59,7 @@ public class NoOpLogTestCase extends AbstractLogTest
|
|||||||
* Override the abstract method from the parent class so that the
|
* Override the abstract method from the parent class so that the
|
||||||
* inherited tests can access the right Log object type.
|
* inherited tests can access the right Log object type.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Log getLogObject()
|
public Log getLogObject()
|
||||||
{
|
{
|
||||||
return new NoOpLog(this.getClass().getName());
|
return new NoOpLog(this.getClass().getName());
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public class MockSecurityManager extends SecurityManager {
|
|||||||
return untrustedCodeCount;
|
return untrustedCodeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void checkPermission(final Permission p) throws SecurityException {
|
public void checkPermission(final Permission p) throws SecurityException {
|
||||||
if (setSecurityManagerPerm.implies(p)) {
|
if (setSecurityManagerPerm.implies(p)) {
|
||||||
// ok, allow this; we don't want to block any calls to setSecurityManager
|
// ok, allow this; we don't want to block any calls to setSecurityManager
|
||||||
|
|||||||
@@ -69,11 +69,13 @@ public class SecurityAllowedTestCase extends TestCase
|
|||||||
return new PathableTestSuite(testClass, parent);
|
return new PathableTestSuite(testClass, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
// save security manager so it can be restored in tearDown
|
// save security manager so it can be restored in tearDown
|
||||||
oldSecMgr = System.getSecurityManager();
|
oldSecMgr = System.getSecurityManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
// Restore, so other tests don't get stuffed up if a test
|
// Restore, so other tests don't get stuffed up if a test
|
||||||
// sets a custom security manager.
|
// sets a custom security manager.
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class SecurityForbiddenTestCase extends TestCase
|
|||||||
return new PathableTestSuite(testClass, parent);
|
return new PathableTestSuite(testClass, parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
// save security manager so it can be restored in tearDown
|
// save security manager so it can be restored in tearDown
|
||||||
oldSecMgr = System.getSecurityManager();
|
oldSecMgr = System.getSecurityManager();
|
||||||
@@ -84,6 +85,7 @@ public class SecurityForbiddenTestCase extends TestCase
|
|||||||
otherClassLoader = classLoader;
|
otherClassLoader = classLoader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
// Restore, so other tests don't get stuffed up if a test
|
// Restore, so other tests don't get stuffed up if a test
|
||||||
// sets a custom security manager.
|
// sets a custom security manager.
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
* when they are created. Subclasses can override this method to
|
* when they are created. Subclasses can override this method to
|
||||||
* define properties that suit them.
|
* define properties that suit them.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setProperties() {
|
public void setProperties() {
|
||||||
System.setProperty(
|
System.setProperty(
|
||||||
"org.apache.commons.logging.Log",
|
"org.apache.commons.logging.Log",
|
||||||
@@ -85,6 +86,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
setProperties();
|
setProperties();
|
||||||
@@ -121,6 +123,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
expected = null;
|
expected = null;
|
||||||
@@ -151,6 +154,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
|
|
||||||
|
|
||||||
// Test Serializability of standard instance
|
// Test Serializability of standard instance
|
||||||
|
@Override
|
||||||
public void testSerializable() throws Exception {
|
public void testSerializable() throws Exception {
|
||||||
|
|
||||||
((DecoratedSimpleLog) log).clearCache();
|
((DecoratedSimpleLog) log).clearCache();
|
||||||
@@ -166,6 +170,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
|
|
||||||
|
|
||||||
// Check the decorated log instance
|
// Check the decorated log instance
|
||||||
|
@Override
|
||||||
protected void checkDecorated() {
|
protected void checkDecorated() {
|
||||||
|
|
||||||
assertNotNull("Log exists", log);
|
assertNotNull("Log exists", log);
|
||||||
@@ -224,6 +229,7 @@ public class CustomConfigTestCase extends DefaultConfigTestCase {
|
|||||||
|
|
||||||
|
|
||||||
// Check the standard log instance
|
// Check the standard log instance
|
||||||
|
@Override
|
||||||
protected void checkStandard() {
|
protected void checkStandard() {
|
||||||
|
|
||||||
checkDecorated();
|
checkDecorated();
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
|||||||
* set up the props defined in the parent class setProperties method,
|
* set up the props defined in the parent class setProperties method,
|
||||||
* and add a few to configure the SimpleLog class date/time output.
|
* and add a few to configure the SimpleLog class date/time output.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setProperties() {
|
public void setProperties() {
|
||||||
super.setProperties();
|
super.setProperties();
|
||||||
|
|
||||||
@@ -78,6 +79,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
}
|
}
|
||||||
@@ -86,6 +88,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
|||||||
// ----------------------------------------------------------- Methods
|
// ----------------------------------------------------------- Methods
|
||||||
|
|
||||||
/** Checks that the date time format has been successfully set */
|
/** Checks that the date time format has been successfully set */
|
||||||
|
@Override
|
||||||
protected void checkDecoratedDateTime() {
|
protected void checkDecoratedDateTime() {
|
||||||
assertEquals("Expected date format to be set", "dd.mm.yyyy",
|
assertEquals("Expected date format to be set", "dd.mm.yyyy",
|
||||||
((DecoratedSimpleLog) log).getDateTimeFormat());
|
((DecoratedSimpleLog) log).getDateTimeFormat());
|
||||||
@@ -98,6 +101,7 @@ public class DateTimeCustomConfigTestCase extends CustomConfigTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Hook for subclassses */
|
/** Hook for subclassses */
|
||||||
|
@Override
|
||||||
protected void checkShowDateTime() {
|
protected void checkShowDateTime() {
|
||||||
assertTrue(((DecoratedSimpleLog) log).getShowDateTime());
|
assertTrue(((DecoratedSimpleLog) log).getShowDateTime());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ public class DecoratedSimpleLog extends SimpleLog {
|
|||||||
|
|
||||||
|
|
||||||
// Cache logged messages
|
// Cache logged messages
|
||||||
|
@Override
|
||||||
protected void log(final int type, final Object message, final Throwable t) {
|
protected void log(final int type, final Object message, final Throwable t) {
|
||||||
|
|
||||||
super.log(type, message, t);
|
super.log(type, message, t);
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ public class DefaultConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
setProperties();
|
setProperties();
|
||||||
@@ -110,6 +111,7 @@ public class DefaultConfigTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
log = null;
|
log = null;
|
||||||
factory = null;
|
factory = null;
|
||||||
|
|||||||
@@ -22,23 +22,41 @@ public class MyLog implements Log {
|
|||||||
|
|
||||||
public MyLog(final String category) {}
|
public MyLog(final String category) {}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isDebugEnabled() { return false; }
|
public boolean isDebugEnabled() { return false; }
|
||||||
|
@Override
|
||||||
public boolean isErrorEnabled() { return false; }
|
public boolean isErrorEnabled() { return false; }
|
||||||
|
@Override
|
||||||
public boolean isFatalEnabled() { return false; }
|
public boolean isFatalEnabled() { return false; }
|
||||||
|
@Override
|
||||||
public boolean isInfoEnabled() { return false; }
|
public boolean isInfoEnabled() { return false; }
|
||||||
|
@Override
|
||||||
public boolean isTraceEnabled() { return false; }
|
public boolean isTraceEnabled() { return false; }
|
||||||
|
@Override
|
||||||
public boolean isWarnEnabled() { return false; }
|
public boolean isWarnEnabled() { return false; }
|
||||||
|
|
||||||
|
@Override
|
||||||
public void trace(final Object message) {}
|
public void trace(final Object message) {}
|
||||||
|
@Override
|
||||||
public void trace(final Object message, final Throwable t) {}
|
public void trace(final Object message, final Throwable t) {}
|
||||||
|
@Override
|
||||||
public void debug(final Object message) {}
|
public void debug(final Object message) {}
|
||||||
|
@Override
|
||||||
public void debug(final Object message, final Throwable t) {}
|
public void debug(final Object message, final Throwable t) {}
|
||||||
|
@Override
|
||||||
public void info(final Object message) {}
|
public void info(final Object message) {}
|
||||||
|
@Override
|
||||||
public void info(final Object message, final Throwable t) {}
|
public void info(final Object message, final Throwable t) {}
|
||||||
|
@Override
|
||||||
public void warn(final Object message) {}
|
public void warn(final Object message) {}
|
||||||
|
@Override
|
||||||
public void warn(final Object message, final Throwable t) {}
|
public void warn(final Object message, final Throwable t) {}
|
||||||
|
@Override
|
||||||
public void error(final Object message) {}
|
public void error(final Object message) {}
|
||||||
|
@Override
|
||||||
public void error(final Object message, final Throwable t) {}
|
public void error(final Object message, final Throwable t) {}
|
||||||
|
@Override
|
||||||
public void fatal(final Object message) {}
|
public void fatal(final Object message) {}
|
||||||
|
@Override
|
||||||
public void fatal(final Object message, final Throwable t) {}
|
public void fatal(final Object message, final Throwable t) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,11 +22,18 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
public class MyLogFactoryImpl extends LogFactory {
|
public class MyLogFactoryImpl extends LogFactory {
|
||||||
|
@Override
|
||||||
public Object getAttribute(final String name) { return null; }
|
public Object getAttribute(final String name) { return null; }
|
||||||
|
@Override
|
||||||
public String[] getAttributeNames() { return null; }
|
public String[] getAttributeNames() { return null; }
|
||||||
|
@Override
|
||||||
public Log getInstance(final Class clazz) { return null; }
|
public Log getInstance(final Class clazz) { return null; }
|
||||||
|
@Override
|
||||||
public Log getInstance(final String name) { return null; }
|
public Log getInstance(final String name) { return null; }
|
||||||
|
@Override
|
||||||
public void release() {}
|
public void release() {}
|
||||||
|
@Override
|
||||||
public void removeAttribute(final String name) {}
|
public void removeAttribute(final String name) {}
|
||||||
|
@Override
|
||||||
public void setAttribute(final String name, final Object value) {}
|
public void setAttribute(final String name, final Object value) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public class TcclDisabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -98,6 +99,7 @@ public class TcclDisabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ public class TcclEnabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -98,6 +99,7 @@ public class TcclEnabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public class TcclDisabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -100,6 +101,7 @@ public class TcclDisabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public class TcclEnabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Set up instance variables required by this test case.
|
* Set up instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
@@ -94,6 +95,7 @@ public class TcclEnabledTestCase extends TestCase {
|
|||||||
/**
|
/**
|
||||||
* Tear down instance variables required by this test case.
|
* Tear down instance variables required by this test case.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void tearDown() {
|
public void tearDown() {
|
||||||
LogFactory.releaseAll();
|
LogFactory.releaseAll();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user