[jboss-svn-commits] JBL Code SVN: r30968 - in labs/jbosstm/trunk: common/classes/com/arjuna/common/internal/util/logging and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Jan 7 09:20:03 EST 2010
Author: jhalliday
Date: 2010-01-07 09:20:03 -0500 (Thu, 07 Jan 2010)
New Revision: 30968
Added:
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nDelegatingImpl.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nInterface.java
Modified:
labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogFactory.java
labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogger.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LogFactoryInterface.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nImpl.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/basic/BasicLogFactory.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/JakartaLogFactory.java
Log:
Support delegation to i18n enabled loggers in CLF. JBTM-675
Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogFactory.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogFactory.java 2010-01-07 11:28:14 UTC (rev 30967)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogFactory.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -23,6 +23,7 @@
import com.arjuna.common.internal.util.logging.LogFactoryInterface;
import com.arjuna.common.internal.util.logging.LogInterface;
+import com.arjuna.common.internal.util.logging.Logi18nInterface;
import com.arjuna.common.util.exceptions.LogConfigurationException;
/**
@@ -47,4 +48,33 @@
{
return new JBossLogger(name);
}
+
+ /**
+ * Determine if the underlying logging framework supports i18n or not.
+ *
+ * @return true if i18n is supported, false otherwise.
+ */
+ @Override
+ public boolean isInternationalizationSupported()
+ {
+ return true;
+ }
+
+ /**
+ * Method to return a named logger with a given ResourceBundle associated.
+ *
+ * @param name Logical name of the <code>Log</code> instance to be
+ * returned (the meaning of this name is only known to the underlying
+ * logging implementation that is being wrapped)
+ * @param resourceBundleName The name of the ResourceBundle to associate with the logger
+ * @return an appropriately configured LogInterface implementation
+ * @throws com.arjuna.common.util.exceptions.LogConfigurationException
+ * if a suitable <code>LogInterface</code>
+ * instance cannot be returned, including where the logger does not support i18n.
+ */
+ @Override
+ public Logi18nInterface getLog(String name, String resourceBundleName) throws LogConfigurationException
+ {
+ return new JBossLogger(name, resourceBundleName);
+ }
}
Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogger.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogger.java 2010-01-07 11:28:14 UTC (rev 30967)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/logging/JBossLogger.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -23,19 +23,17 @@
import com.arjuna.common.internal.util.logging.LogInterface;
+import com.arjuna.common.internal.util.logging.Logi18nInterface;
+import org.jboss.logmanager.ExtLogRecord;
import org.jboss.logmanager.Logger;
import org.jboss.logmanager.Level;
/**
* CLF log impl for integration with JBoss log manager.
*
- * Note that although jboss log manager supports i18n, we continue to do the
- * i18n in the CLF and pass already processed literals to the jboss layer
- * for consistency. The jboss layer passes these through verbatim, like jdk14 logging.
- *
* @author Jonathan Halliday (jonathan.halliday at redhat.com) 2009-11
*/
-public final class JBossLogger implements LogInterface
+public final class JBossLogger implements Logi18nInterface
{
private final Logger logger;
private static final String FQCN = JBossLogger.class.getName();
@@ -45,13 +43,17 @@
logger = Logger.getLogger(categoryName);
}
+ public JBossLogger(final String categoryName, final String resourceBundleName) {
+ logger = Logger.getLogger(categoryName, resourceBundleName);
+ }
+
/////////////
/**
* Is DEBUG logging currently enabled?
* <p/>
* Call this method to prevent having to perform expensive operations
- * (for example, <code>String</code> concatination)
+ * (for example, <code>String</code> concatenation)
* when the log level is more than DEBUG.
*
* @return True if the logger is enabled for DEBUG, false otherwise
@@ -66,7 +68,7 @@
* Is INFO logging currently enabled?
* <p/>
* Call this method to prevent having to perform expensive operations
- * (for example, <code>String</code> concatination)
+ * (for example, <code>String</code> concatenation)
* when the log level is more than INFO.
*
* @return True if the logger is enabled for INFO, false otherwise
@@ -81,7 +83,7 @@
* Is WARN logging currently enabled?
* <p/>
* Call this method to prevent having to perform expensive operations
- * (for example, <code>String</code> concatination)
+ * (for example, <code>String</code> concatenation)
* when the log level is more than WARN.
*
* @return True if the logger is enabled for WARN, false otherwise
@@ -96,7 +98,7 @@
* Is ERROR logging currently enabled?
* <p/>
* Call this method to prevent having to perform expensive operations
- * (for example, <code>String</code> concatination)
+ * (for example, <code>String</code> concatenation)
* when the log level is more than ERROR.
*
* @return True if the logger is enabled for ERROR, false otherwise
@@ -111,7 +113,7 @@
* Is FATAL logging currently enabled?
* <p/>
* Call this method to prevent having to perform expensive operations
- * (for example, <code>String</code> concatination)
+ * (for example, <code>String</code> concatenation)
* when the log level is more than FATAL.
*
* @return True if the logger is enabled for FATAL, false otherwise
@@ -126,7 +128,7 @@
* Is TRACE logging currently enabled?
* <p/>
* Call this method to prevent having to perform expensive operations
- * (for example, <code>String</code> concatination)
+ * (for example, <code>String</code> concatenation)
* when the log level is more than TRACE.
*/
@Override
@@ -157,7 +159,6 @@
{
logger.log(FQCN, Level.TRACE, message, t);
}
-
/**
* <p> Log a message with debug log level. </p>
*
@@ -181,6 +182,19 @@
logger.log(FQCN, Level.DEBUG, message, t);
}
+
+ @Override
+ public void debug(String key, Object[] params)
+ {
+ logger.log(FQCN, Level.DEBUG, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, null);
+ }
+
+ @Override
+ public void debug(String key, Object[] params, Throwable throwable)
+ {
+ logger.log(FQCN, Level.DEBUG, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, throwable);
+ }
+
/**
* <p> Log a message with info log level. </p>
*
@@ -204,7 +218,19 @@
logger.log(FQCN, Level.INFO, message, t);
}
- /**
+ @Override
+ public void info(String key, Object[] params)
+ {
+ logger.log(FQCN, Level.INFO, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, null);
+ }
+
+ @Override
+ public void info(String key, Object[] params, Throwable throwable)
+ {
+ logger.log(FQCN, Level.INFO, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, throwable);
+ }
+
+ /**
* <p> Log a message with warn log level. </p>
*
* @param message log this message
@@ -215,6 +241,19 @@
logger.log(FQCN, Level.WARN, message, null);
}
+ @Override
+ public void warn(String key, Object[] params)
+ {
+ logger.log(FQCN, Level.WARN, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, null);
+
+ }
+
+ @Override
+ public void warn(String key, Object[] params, Throwable throwable)
+ {
+ logger.log(FQCN, Level.WARN, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, throwable);
+ }
+
/**
* <p> Log an error with warn log level. </p>
*
@@ -250,6 +289,19 @@
logger.log(FQCN, Level.WARN, message, t);
}
+ @Override
+ public void error(String key, Object[] params)
+ {
+ logger.log(FQCN, Level.ERROR, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, null);
+
+ }
+
+ @Override
+ public void error(String key, Object[] params, Throwable throwable)
+ {
+ logger.log(FQCN, Level.ERROR, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, throwable);
+ }
+
/**
* <p> Log a message with fatal log level. </p>
*
@@ -272,4 +324,17 @@
{
logger.log(FQCN, Level.FATAL, message, t);
}
+
+ @Override
+ public void fatal(String key, Object[] params)
+ {
+ logger.log(FQCN, Level.FATAL, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, null);
+
+ }
+
+ @Override
+ public void fatal(String key, Object[] params, Throwable throwable)
+ {
+ logger.log(FQCN, Level.FATAL, key, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, throwable);
+ }
}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LogFactoryInterface.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LogFactoryInterface.java 2010-01-07 11:28:14 UTC (rev 30967)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LogFactoryInterface.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -42,15 +42,36 @@
*/
public interface LogFactoryInterface
{
- /**
- * Method to return a named logger.
- *
- * @param name Logical name of the <code>Log</code> instance to be
- * returned (the meaning of this name is only known to the underlying
- * logging implementation that is being wrapped)
- *
- * @exception LogConfigurationException if a suitable <code>LogInterface</code>
- * instance cannot be returned
- */
- public LogInterface getLog(String name) throws LogConfigurationException;
+ /**
+ * Method to return a named logger.
+ *
+ * @param name Logical name of the <code>Log</code> instance to be
+ * returned (the meaning of this name is only known to the underlying
+ * logging implementation that is being wrapped)
+ * @return an appropriately configured LogInterface implementation
+ * @throws LogConfigurationException if a suitable <code>LogInterface</code>
+ * instance cannot be returned
+ */
+ public LogInterface getLog(String name) throws LogConfigurationException;
+
+ /**
+ * Determine if the underlying logging framework supports i18n or not.
+ *
+ * @return true if i18n is supported, false otherwise.
+ */
+ public boolean isInternationalizationSupported();
+
+ /**
+ * Method to return a named logger with a given ResourceBundle associated.
+ *
+ * @param name Logical name of the <code>Log</code> instance to be
+ * returned (the meaning of this name is only known to the underlying
+ * logging implementation that is being wrapped)
+ * @param resourceBundleName The name of the ResourceBundle to associate with the logger
+ * @return an appropriately configured Logi18nInterface implementation
+ * @throws LogConfigurationException if a suitable <code>Logi18nInterface</code>
+ * instance cannot be returned, including where the logger does not support i18n.
+ */
+ public Logi18nInterface getLog(String name, String resourceBundleName) throws LogConfigurationException;
+
}
Added: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nDelegatingImpl.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nDelegatingImpl.java (rev 0)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nDelegatingImpl.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -0,0 +1,185 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2010,
+ * @author JBoss, by Red Hat.
+ */
+package com.arjuna.common.internal.util.logging;
+
+/**
+ * Variant of Logi18nImpl that relies on the underlying logging framework to perform i18n on messages.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com), 2010-01
+ */
+public class Logi18nDelegatingImpl extends Logi18nImpl
+{
+ private final Logi18nInterface logi18nInterface;
+
+ public Logi18nDelegatingImpl(Logi18nInterface logi18nInterface, String resBundle, long dl, long vl, long fl)
+ {
+ super(logi18nInterface, resBundle, dl, vl, fl);
+ this.logi18nInterface = logi18nInterface;
+ }
+
+ /**
+ * Log a message with DEBUG Level and with arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ */
+ @Override
+ public void debug(String key, Object[] params)
+ {
+ if (!isDebugEnabled()) return;
+ logi18nInterface.debug(key, params);
+ }
+
+ /**
+ * Log a message with DEBUG Level, with arguments and with a throwable arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ * @param throwable The Throwable to log
+ */
+ @Override
+ public void debug(String key, Object[] params, Throwable throwable)
+ {
+ if (!isDebugEnabled()) return;
+ logi18nInterface.debug(key, params, throwable);
+ }
+
+ /**
+ * Log a message with the INFO Level and with arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ */
+ @Override
+ public void info(String key, Object[] params)
+ {
+ if (!isInfoEnabled()) return;
+ logi18nInterface.info(key, params);
+ }
+
+ /**
+ * Log a message with the INFO Level, with arguments and with a throwable arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ * @param throwable Throwable associated with the logging request
+ */
+ @Override
+ public void info(String key, Object[] params, Throwable throwable)
+ {
+ if (!isInfoEnabled()) return;
+ logi18nInterface.info(key, params, throwable);
+ }
+
+ /**
+ * Log a message with the WARN Level and with arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ */
+ @Override
+ public void warn(String key, Object[] params)
+ {
+ if (!isWarnEnabled()) return;
+ logi18nInterface.warn(key, params);
+ }
+
+ /**
+ * Log a message with the WARN Level, with arguments and with a throwable arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ * @param throwable Throwable associated with the logging request
+ */
+ @Override
+ public void warn(String key, Object[] params, Throwable throwable)
+ {
+ if (!isWarnEnabled()) return;
+ logi18nInterface.warn(key, params, throwable);
+ }
+
+ /**
+ * Log a message with the ERROR Level and with arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ */
+ @Override
+ public void error(String key, Object[] params)
+ {
+ if (!isErrorEnabled()) return;
+ logi18nInterface.error(key, params);
+ }
+
+ /**
+ * Log a message with the ERROR Level, with arguments and with a throwable arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ * @param throwable Throwable associated with the logging request
+ */
+ @Override
+ public void error(String key, Object[] params, Throwable throwable)
+ {
+ if (!isErrorEnabled()) return;
+ logi18nInterface.error(key, params, throwable);
+ }
+
+ /**
+ * Log a message with the FATAL Level and with arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ */
+ @Override
+ public void fatal(String key, Object[] params)
+ {
+ if (!isFatalEnabled()) return;
+ logi18nInterface.fatal(key, params);
+ }
+
+ /**
+ * Log a message with the FATAL Level, with arguments and with a throwable arguments
+ *
+ * @param key resource bundle key for the message to log
+ * @param params parameters passed to the message
+ * @param throwable Throwable associated with the logging request
+ */
+ @Override
+ public void fatal(String key, Object[] params, Throwable throwable)
+ {
+ if (!isFatalEnabled()) return;
+ logi18nInterface.fatal(key, params, throwable);
+ }
+
+ @Override
+ protected String evalResourceBundle(String key)
+ {
+ // postpone key resolution, effectively passing the key verbatim to the delegate, which will then resolve it.
+ return key;
+ }
+
+ @Override
+ protected String evalResourceBundle(String key, Object[] params)
+ {
+ throw new RuntimeException("this should never be called, anything that uses it should be overridden");
+ }
+}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nImpl.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nImpl.java 2010-01-07 11:28:14 UTC (rev 30967)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nImpl.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -640,15 +640,15 @@
}
// -------------------------------------------------------------------------------------
- // private methods
+ // internal methods
// -------------------------------------------------------------------------------------
- private String evalResourceBundle(String key)
+ protected String evalResourceBundle(String key)
{
return getString(key);
}
- private String evalResourceBundle(String key, Object[] params)
+ protected String evalResourceBundle(String key, Object[] params)
{
return getString(key, params);
}
Added: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nInterface.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nInterface.java (rev 0)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nInterface.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and/or its affiliates,
+ * and individual contributors as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2010,
+ * @author JBoss, by Red Hat.
+ */
+package com.arjuna.common.internal.util.logging;
+
+/**
+ * Extension which adds i18n methods to LogInterface.
+ * Note that methods which take a (String message) in the parent
+ * interface are implicitly overridden to have the meaning (String key)
+ * in this version, but don't actually appear in the interface here
+ * as the signature is unchanged.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com), 2010-01
+ */
+public interface Logi18nInterface extends LogInterface
+{
+ public void debug(String key, Object[] params);
+ public void debug(String key, Object[] params, Throwable throwable);
+ public void info(String key, Object[] params);
+ public void info(String key, Object[] params, Throwable throwable);
+ public void warn(String key, Object[] params);
+ public void warn(String key, Object[] params, Throwable throwable);
+ public void error(String key, Object[] params);
+ public void error(String key, Object[] params, Throwable throwable);
+ public void fatal(String key, Object[] params);
+ public void fatal(String key, Object[] params, Throwable throwable);
+}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/basic/BasicLogFactory.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/basic/BasicLogFactory.java 2010-01-07 11:28:14 UTC (rev 30967)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/basic/BasicLogFactory.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -20,6 +20,7 @@
*/
package com.arjuna.common.internal.util.logging.basic;
+import com.arjuna.common.internal.util.logging.Logi18nInterface;
import com.arjuna.common.util.exceptions.LogConfigurationException;
import com.arjuna.common.internal.util.logging.LogFactoryInterface;
import com.arjuna.common.internal.util.logging.LogInterface;
@@ -47,4 +48,33 @@
{
return new BasicLog(name);
}
+
+ /**
+ * Determine if the underlying logging framework supports i18n or not.
+ *
+ * @return true if i18n is supported, false otherwise.
+ */
+ @Override
+ public boolean isInternationalizationSupported()
+ {
+ return false;
+ }
+
+ /**
+ * Method to return a named logger with a given ResourceBundle associated.
+ *
+ * @param name Logical name of the <code>Log</code> instance to be
+ * returned (the meaning of this name is only known to the underlying
+ * logging implementation that is being wrapped)
+ * @param resourceBundleName The name of the ResourceBundle to associate with the logger
+ * @return an appropriately configured LogInterface implementation
+ * @throws com.arjuna.common.util.exceptions.LogConfigurationException
+ * if a suitable <code>LogInterface</code>
+ * instance cannot be returned, including where the logger does not support i18n.
+ */
+ @Override
+ public Logi18nInterface getLog(String name, String resourceBundleName) throws LogConfigurationException
+ {
+ throw new LogConfigurationException("i18n not supported");
+ }
}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/JakartaLogFactory.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/JakartaLogFactory.java 2010-01-07 11:28:14 UTC (rev 30967)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/JakartaLogFactory.java 2010-01-07 14:20:03 UTC (rev 30968)
@@ -30,6 +30,7 @@
import com.arjuna.common.internal.util.logging.LogFactoryInterface;
import com.arjuna.common.internal.util.logging.LogInterface;
+import com.arjuna.common.internal.util.logging.Logi18nInterface;
import com.arjuna.common.util.exceptions.LogConfigurationException;
/**
@@ -53,7 +54,36 @@
this.logImpl = logImpl;
}
- /**
+ /**
+ * Determine if the underlying logging framework supports i18n or not.
+ *
+ * @return true if i18n is supported, false otherwise.
+ */
+ @Override
+ public boolean isInternationalizationSupported()
+ {
+ return false;
+ }
+
+ /**
+ * Method to return a named logger with a given ResourceBundle associated.
+ *
+ * @param name Logical name of the <code>Log</code> instance to be
+ * returned (the meaning of this name is only known to the underlying
+ * logging implementation that is being wrapped)
+ * @param resourceBundleName The name of the ResourceBundle to associate with the logger
+ * @return an appropriately configured LogInterface implementation
+ * @throws com.arjuna.common.util.exceptions.LogConfigurationException
+ * if a suitable <code>LogInterface</code>
+ * instance cannot be returned, including where the logger does not support i18n.
+ */
+ @Override
+ public Logi18nInterface getLog(String name, String resourceBundleName) throws LogConfigurationException
+ {
+ throw new LogConfigurationException("i18n not supported");
+ }
+
+ /**
* Convenience method to return a named logger, without the application
* having to care about factories.
*
More information about the jboss-svn-commits
mailing list