[jboss-svn-commits] JBL Code SVN: r33704 - in labs/jbosstm/trunk: ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging and 34 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jun 30 09:27:34 EDT 2010
Author: jhalliday
Date: 2010-06-30 09:27:32 -0400 (Wed, 30 Jun 2010)
New Revision: 33704
Removed:
labs/jbosstm/trunk/antbuildsystem/classes/com/hp/mw/buildsystem/doclet/resbundledoclet/ResourceBundleDoclet.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nDelegatingImpl.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nImpl.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/Logi18n.java
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/ExerciseLoggerImpls.java
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_en.properties
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_fr.properties
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logi18n.java
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java
labs/jbosstm/trunk/ArjunaCore/tsmx/build.xml
labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/logging/txojLogger.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/build.xml
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/logging/jdbcLogger.java
labs/jbosstm/trunk/ArjunaJTA/jta/build.xml
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/logging/jtaLogger.java
labs/jbosstm/trunk/ArjunaJTS/jtax/build.xml
labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/utils/jtaxLogger.java
labs/jbosstm/trunk/ArjunaJTS/jts/build.xml
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/logging/jtsLogger.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/build.xml
labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/logging/opLogger.java
labs/jbosstm/trunk/XTS/WS-C/build.xml
labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java
labs/jbosstm/trunk/XTS/WS-T/build.xml
labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java
labs/jbosstm/trunk/XTS/WSAS/build.xml
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java
labs/jbosstm/trunk/XTS/WSCF/build.xml
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java
labs/jbosstm/trunk/XTS/WSTX/build.xml
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java
labs/jbosstm/trunk/XTS/recovery/build.xml
labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/logging/XTSLogger.java
labs/jbosstm/trunk/XTS/sar/build.xml
labs/jbosstm/trunk/XTS/sharedbuild.xml
labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/logging/jbossatxLogger.java
labs/jbosstm/trunk/common/build.xml
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/Log4JLogger.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java
labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/TestLevels.java
labs/jbosstm/trunk/sharedbuild.xml
Log:
Strip out obsolete CLF based i18n code. JBTM-750
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -39,7 +39,7 @@
public static LogNoi18n arjLogger;
public static arjunaI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
i18NLogger = new arjunaI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.arjuna"));
@@ -47,6 +47,6 @@
static
{
- LogFactory.initializeModuleLogger(tsLogger.class, "arjuna_msg", "com.arjuna.ats.arjuna");
+ LogFactory.initializeModuleLogger(tsLogger.class, "com.arjuna.ats.arjuna");
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -33,14 +33,6 @@
</target>
- <target name="generateresourcebundle">
- <generateresourcebundle.macro>
- <args>
- <param name="-appendkey" value="[]"/>
- </args>
- </generateresourcebundle.macro>
- </target>
-
<target name="tools" depends="compile">
<property name="install.dir" value="${build.dir}/tools"/>
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -39,7 +39,7 @@
public static LogNoi18n logger;
public static tsmxI18NLogger i18nLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
i18nLogger = new tsmxI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.tsmx"));
@@ -47,6 +47,6 @@
static
{
- LogFactory.initializeModuleLogger(tsmxLogger.class, "tsmx_msg", "com.arjuna.ats.tsmx");
+ LogFactory.initializeModuleLogger(tsmxLogger.class, "com.arjuna.ats.tsmx");
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/logging/txojLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/logging/txojLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/logging/txojLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -29,7 +29,7 @@
public static LogNoi18n aitLogger;
public static txojI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
aitLogger = noi18n;
i18NLogger = new txojI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.txoj"));
@@ -37,6 +37,6 @@
static
{
- LogFactory.initializeModuleLogger(txojLogger.class, "txoj_msg", "com.arjuna.ats.txoj");
+ LogFactory.initializeModuleLogger(txojLogger.class, "com.arjuna.ats.txoj");
}
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -37,14 +37,6 @@
</target>
- <target name="generateresourcebundle">
- <generateresourcebundle.macro>
- <args>
- <param name="-appendkey" value="[]"/>
- </args>
- </generateresourcebundle.macro>
- </target>
-
<target name="run.tests">
<run.tests.macro>
<tests>
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/logging/jdbcLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/logging/jdbcLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/logging/jdbcLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -39,7 +39,7 @@
public static LogNoi18n logger;
public static jdbcI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
i18NLogger = new jdbcI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.jdbc"));
@@ -47,6 +47,6 @@
static
{
- LogFactory.initializeModuleLogger(jdbcLogger.class, "jdbc_msg", "com.arjuna.ats.jdbc");
+ LogFactory.initializeModuleLogger(jdbcLogger.class, "com.arjuna.ats.jdbc");
}
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -34,14 +34,6 @@
</target>
- <target name="generateresourcebundle">
- <generateresourcebundle.macro>
- <args>
- <param name="-appendkey" value="[]"/>
- </args>
- </generateresourcebundle.macro>
- </target>
-
<target name="run.tests">
<!-- we need to run the CrashRecovery test using a byteman script -->
<run.tests.macro script="recovery.txt">
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/logging/jtaLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/logging/jtaLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/logging/jtaLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -39,7 +39,7 @@
public static LogNoi18n logger;
public static jtaI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
i18NLogger = new jtaI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.jta"));
@@ -47,10 +47,6 @@
static
{
- LogFactory.initializeModuleLogger(jtaLogger.class, "jta_msg", "com.arjuna.ats.jta");
+ LogFactory.initializeModuleLogger(jtaLogger.class, "com.arjuna.ats.jta");
}
-}
-
-
-
-
+}
\ No newline at end of file
Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -50,14 +50,6 @@
parameters="include='idl/omg/;idl/arjuna;${jacorb.home}/idl/omg',classpath='${jacorb.classpath}'"/>
</target>
- <target name="generateresourcebundle">
- <generateresourcebundle.macro>
- <args>
- <param name="-appendkey" value="[]"/>
- </args>
- </generateresourcebundle.macro>
- </target>
-
<target name="run.tests">
<run.tests.macro>
<additional.classpath>
Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/utils/jtaxLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/utils/jtaxLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/utils/jtaxLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -22,7 +22,6 @@
import com.arjuna.common.util.logging.LogFactory;
import com.arjuna.common.util.logging.LogNoi18n;
-import com.arjuna.common.util.logging.Logi18n;
import org.jboss.logging.Logger;
/**
@@ -33,7 +32,7 @@
public static LogNoi18n logger;
public static jtaxI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
i18NLogger = new jtaxI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.jtax"));
@@ -41,6 +40,6 @@
static
{
- LogFactory.initializeModuleLogger(jtaxLogger.class, "jtax_msg", "com.arjuna.ats.jtax");
+ LogFactory.initializeModuleLogger(jtaxLogger.class, "com.arjuna.ats.jtax");
}
}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -81,15 +81,6 @@
parameters="include='${basedir}/idl/omg/;${basedir}/idl/arjuna;${jacorb.home}/idl/omg',classpath='${jacorb.classpath}'"/>
</target>
- <target name="generateresourcebundle">
- <generateresourcebundle.macro>
- <args>
- <param name="-appendkey" value="[]"/>
- </args>
- </generateresourcebundle.macro>
- </target>
-
-
<target name="run.tests">
<run.tests.macro>
<additional.classpath>
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/logging/jtsLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/logging/jtsLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/logging/jtsLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -39,7 +39,7 @@
public static LogNoi18n logger;
public static jtsI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
i18NLogger = new jtsI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.jts"));
@@ -47,6 +47,6 @@
static
{
- LogFactory.initializeModuleLogger(jtsLogger.class, "jts_msg", "com.arjuna.ats.jts");
+ LogFactory.initializeModuleLogger(jtsLogger.class, "com.arjuna.ats.jts");
}
}
\ No newline at end of file
Modified: labs/jbosstm/trunk/ArjunaJTS/orbportability/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -66,14 +66,6 @@
</target>
- <target name="generateresourcebundle">
- <generateresourcebundle.macro>
- <args>
- <param name="-appendkey" value="[]"/>
- </args>
- </generateresourcebundle.macro>
- </target>
-
<target name="run.tests">
<run.tests.macro>
<additional.classpath>
Modified: labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/logging/opLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/logging/opLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/logging/opLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -29,7 +29,7 @@
public static LogNoi18n logger;
public static orbportabilityI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
i18NLogger =new orbportabilityI18NLoggerImpl(Logger.getLogger("com.arjuna.orbportability"));
@@ -37,6 +37,6 @@
static
{
- LogFactory.initializeModuleLogger(opLogger.class, "orbportability_msg", "com.arjuna.orbportability");
+ LogFactory.initializeModuleLogger(opLogger.class, "com.arjuna.orbportability");
}
}
Modified: labs/jbosstm/trunk/XTS/WS-C/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WS-C/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -83,10 +83,6 @@
<fileset dir="${jbossts.build.extlib.dir}" includes="${tests.libs}"/>
</path>
- <!-- name of the resource bundle -->
- <property name="wsc.resourcebundle"
- value="wsc_msg_en_US.properties"/>
-
<!-- module targets -->
<target name="clean">
@@ -151,39 +147,6 @@
<target name="compile" depends="init, compile-generic, compile10, compile11"/>
- <target name="resourcebundle-both" if="build10">
- <echo message="Generating WS-C Bundle"/>
- <resourcebundle.macro resourcebundle="${wsc.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src10.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
- <target name="resourcebundle11" if="nobuild10">
- <echo message="Generating WS-C Bundle"/>
- <resourcebundle.macro resourcebundle="${wsc.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
- <target name="resourcebundle" depends="resourcebundle-both, resourcebundle11"/>
-
<target name="wsdl11" >
<!-- wsdl files for services - loaded as /WEB-INF/wsdl/... -->
<copy file="${dd.dir}/wscoor1.1/wsdl/wscoor.wsdl" tofile="${build.dd.dir}/wsdl/wscoor.wsdl"/>
@@ -235,7 +198,7 @@
</jar>
</target>
- <target name="jars" depends="compile, resourcebundle, wsdl11, jars11, jars10, jars-generic"/>
+ <target name="jars" depends="compile, wsdl11, jars11, jars10, jars-generic"/>
<target name="webapps10" if="build10">
<copy file="${dd.dir}/ws-c_web-app.xml" tofile="${build.dd.dir}/web-app.xml"/>
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -33,7 +33,6 @@
import com.arjuna.common.util.logging.LogFactory;
import com.arjuna.common.util.logging.LogNoi18n;
-import com.arjuna.common.util.logging.Logi18n;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
@@ -42,28 +41,21 @@
*/
public class WSCLogger
{
- /**
- * The non I18N logger.
- */
+
public static LogNoi18n arjLogger;
public static BasicLogger logger;
public static wscI18NLogger i18NLogger;
- /**
- * The I18N logger.
- */
- //public static Logi18n arjLoggerI18N;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
- //arjLoggerI18N = i18n;
logger = Logger.getLogger("com.arjuna.wsc");
i18NLogger = new wscI18NLoggerImpl(Logger.getLogger("com.arjuna.wsc"));
}
static
{
- LogFactory.initializeModuleLogger(WSCLogger.class, "wsc_msg", "com.arjuna.wsc");
+ LogFactory.initializeModuleLogger(WSCLogger.class, "com.arjuna.wsc");
}
}
Modified: labs/jbosstm/trunk/XTS/WS-T/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WS-T/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -139,10 +139,6 @@
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="off"/>
- <!-- name of the resource bundle -->
- <property name="wst.resourcebundle"
- value="wst_msg_en_US.properties"/>
-
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${tests.build.dir}"/>
@@ -216,44 +212,6 @@
<target name="compile" depends="init, compile-generic, compile10, compile11"/>
- <target name="resourcebundle-both" if="build10">
- <echo message="Generating WS-T Bundle"/>
- <resourcebundle.macro resourcebundle="${wst.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- <include name="org/jboss/jbossts/xts/**"/>
- </packageset>
- <packageset dir="${src10.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- <include name="org/jboss/jbossts/xts/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- <include name="org/jboss/jbossts/xts/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
- <target name="resourcebundle11" if="nobuild10">
- <echo message="Generating WS-T Bundle"/>
- <resourcebundle.macro resourcebundle="${wst.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- <include name="org/jboss/jbossts/xts/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- <include name="org/jboss/jbossts/xts//**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
- <target name="resourcebundle" depends="resourcebundle-both, resourcebundle11"/>
-
<target name="wsdl11">
<!-- wsdl files for services -->
<copy file="${dd.dir}/wscoor1.1/wsdl/wsat.wsdl" tofile="${build.dd.dir}/wsdl/wsat.wsdl"/>
@@ -332,7 +290,7 @@
</jar>
</target>
- <target name="jars" depends="compile, resourcebundle, wsdl11, jars-generic, jars10, jars11"/>
+ <target name="jars" depends="compile, wsdl11, jars-generic, jars10, jars11"/>
<target name="webapps10" if="build10">
<copy file="${dd.dir}/ws-t_web-app.xml" tofile="${build.dd.dir}/web-app.xml"/>
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -33,7 +33,6 @@
import com.arjuna.common.util.logging.LogFactory;
import com.arjuna.common.util.logging.LogNoi18n;
-import com.arjuna.common.util.logging.Logi18n;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
@@ -44,18 +43,16 @@
public static BasicLogger logger;
public static wstI18NLogger i18NLogger;
- //public static Logi18n arjLoggerI18N;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
- //arjLoggerI18N = i18n;
- logger = Logger.getLogger("com.arjuna.wst");
+ //arjLoggerI18N = i18n logger = Logger.getLogger("com.arjuna.wst");
i18NLogger = new wstI18NLoggerImpl((Logger)logger);
}
static
{
- LogFactory.initializeModuleLogger(WSTLogger.class, "wst_msg", "com.arjuna.wst");
+ LogFactory.initializeModuleLogger(WSTLogger.class, "com.arjuna.wst");
}
}
Modified: labs/jbosstm/trunk/XTS/WSAS/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WSAS/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -38,8 +38,6 @@
<!-- internal paths and jars -->
- <property name="wsas.resourcebundle" value="wsas_msg_en_US.properties"/>
-
<!-- Set internal property defaults -->
<!-- Path names -->
<property name="src.dir" value="classes"/>
@@ -101,7 +99,7 @@
<property name="htdocs.list" value="*"/>
<!-- Jar targets -->
- <target name="jar" depends="compile, htdocs, generateresourcebundle">
+ <target name="jar" depends="compile, htdocs">
<echo message="Building jar file"/>
<mkdir dir="${build.lib.dir}"/>
<jar jarfile="${build.lib.dir}/${modulename}.jar" basedir="${build.classes.dir}" excludes="com/arjuna/qa/junit/*.class"/>
@@ -124,17 +122,6 @@
</javadoc>
</target>
- <target name="generateresourcebundle">
- <echo message="Generating WSAS Bundle"/>
- <resourcebundle.macro resourcebundle="${wsas.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
<!-- test targets -->
<target name="tests.init">
<delete dir="${tests.build.dir}"/>
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -39,17 +39,15 @@
public static LogNoi18n arjLogger;
public static wsasI18NLogger i18NLogger;
- //public static Logi18n arjLoggerI18N;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
- //arjLoggerI18N = i18n;
i18NLogger = new wsasI18NLoggerImpl(Logger.getLogger("com.arjuna.mw.wsas"));
}
static
{
- LogFactory.initializeModuleLogger(wsasLogger.class, "wsas_msg", "com.arjuna.mw.wsas");
+ LogFactory.initializeModuleLogger(wsasLogger.class, "com.arjuna.mw.wsas");
}
}
Modified: labs/jbosstm/trunk/XTS/WSCF/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WSCF/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -74,8 +74,6 @@
<property name="wsc10.api.libs" value="ws-c10-api.jar"/>
<property name="wsc11.libs" value="ws-c11.jar"/>
- <property name="wscf.resourcebundle" value="wscf_msg_en_US.properties"/>
-
<path id="wscf.lib.classpath">
<path refid="build.classpath"/>
<fileset dir="${wsas.build.lib.dir}" includes="${wsas.libs}"/>
@@ -194,7 +192,7 @@
</jar>
</target>
- <target name="jar" depends ="compile, resourcebundle, jar-generic, jar10, jar11"/>
+ <target name="jar" depends ="compile, jar-generic, jar10, jar11"/>
<target name="htdocs11" if="nobuild10">
<echo message="Building htdocs "/>
@@ -230,40 +228,7 @@
</target>
<target name="htdocs" depends="htdocs-both, htdocs11"/>
-
- <target name="resourcebundle11" if="nobuild10">
- <echo message="Generating WSCF Bundle"/>
- <resourcebundle.macro resourcebundle="${wscf.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
- <target name="resourcebundle-both" if="build10">
- <echo message="Generating WSCF Bundle"/>
- <resourcebundle.macro resourcebundle="${wscf.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src10.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
- <target name="resourcebundle" depends="resourcebundle-both, resourcebundle11"/>
-
<target name="war10" if="build10">
<war warfile="${build.webapps.dir}/${modulename}10.war" webxml="xml/wscf_web-app.xml"/>
</target>
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -38,17 +38,15 @@
{
public static LogNoi18n arjLogger;
public static wscfI18NLogger i18NLogger;
- //public static Logi18n arjLoggerI18N;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
- //arjLoggerI18N = i18n;
i18NLogger = new wscfI18NLoggerImpl(Logger.getLogger("com.arjuna.ws.wscf"));
}
static
{
- LogFactory.initializeModuleLogger(wscfLogger.class, "wscf_msg", "com.arjuna.mw.wscf");
+ LogFactory.initializeModuleLogger(wscfLogger.class, "com.arjuna.mw.wscf");
}
}
Modified: labs/jbosstm/trunk/XTS/WSTX/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WSTX/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -103,8 +103,6 @@
<property name="wstx11.libs" value="${modulename}11.jar"/>
<property name="wstx.all.libs" value="${wstx.libs} ${wstx10.libs} ${wstx11.libs}"/>
- <property name="wstx.resourcebundle" value="wstx_msg_en_US.properties"/>
-
<!--Set external directories -->
<property name="wsas.build.lib.dir" value="${wsas.dir}/build/lib"/>
@@ -252,40 +250,7 @@
</target>
<target name="htdocs" depends="htdocs-both, htdocs11"/>
-
- <target name="resourcebundle-both" if="build10">
- <echo message="Generating WSTX Bundle"/>
- <resourcebundle.macro resourcebundle="${wstx.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src10.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
- <target name="resourcebundle11" if="nobuild10">
- <echo message="Generating WSTX Bundle"/>
- <resourcebundle.macro resourcebundle="${wstx.resourcebundle}">
- <packagesets>
- <packageset dir="${src.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- <packageset dir="${src11.dir}" defaultexcludes="yes">
- <include name="com/arjuna/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
- <target name="resourcebundle" depends="resourcebundle-both, resourcebundle11"/>
-
<!-- Jar targets -->
<target name="jar-generic">
<jar jarfile="${build.lib.dir}/${modulename}.jar">
@@ -328,7 +293,7 @@
</jar>
</target>
- <target name="jar" depends="compile, htdocs, resourcebundle, jar-generic, jar10, jar11"/>
+ <target name="jar" depends="compile, htdocs, jar-generic, jar10, jar11"/>
<target name="war10" if="build10">
<war warfile="${build.webapps.dir}/${modulename}10.war" webxml="xml/wstx_web-app.xml"/>
Modified: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -40,17 +40,15 @@
public static LogNoi18n arjLogger;
public static wstxI18NLogger i18NLogger;
- //public static Logi18n arjLoggerI18N;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
- //arjLoggerI18N = i18n;
i18NLogger = new wstxI18NLoggerImpl(Logger.getLogger("com.arjuna.mw.wstx"));
}
static
{
- LogFactory.initializeModuleLogger(wstxLogger.class, "wstx_msg", "com.arjuna.mw.wstx");
+ LogFactory.initializeModuleLogger(wstxLogger.class, "com.arjuna.mw.wstx");
}
}
Modified: labs/jbosstm/trunk/XTS/recovery/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/recovery/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/recovery/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -54,9 +54,6 @@
<property name="recovery-api.libs" value="${modulename}-api.jar"/>
<property name="recovery.all.libs" value="${recovery.libs}"/>
- <property name="recovery.resourcebundle"
- value="recovery_msg_en_US.properties"/>
-
<!--Set external directories -->
<property name="wsas.jar.dest" value="../WSAS/build/lib"/>
@@ -88,7 +85,7 @@
<target name="recovery.compile"
depends="recovery.compile-generic,
- recovery.htdocs, recovery.generateresourcebundle"/>
+ recovery.htdocs"/>
<target name="recovery.compile-generic" depends="recovery.init">
<echo message="Compiling module generic code"/>
@@ -134,29 +131,6 @@
</javadoc>
</target>
- <target name="recovery.generateresourcebundle">
-
- <echo message="Generating recovery Bundle"/>
-
- <javadoc packagenames="com.arjuna.*"
- failonerror="yes"
- private="yes"
- defaultexcludes="yes"
- classpathref="build.classpath">
-
- <packageset dir="${recovery.src}" defaultexcludes="yes">
- <include name="org/jboss/jbossts/**"/>
- </packageset>
-
- <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
- <path refid="doclet.classpath"/>
- <param name="-basedir" value="${basedir}/${recovery.dest}"/>
- <param name="-resourcebundle" value="${recovery.resourcebundle}"/>
- </doclet>
- </javadoc>
-
- </target>
-
<!-- Clean targets -->
<target name="recovery.clean">
<echo message="Cleaning module"/>
Modified: labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/logging/XTSLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/logging/XTSLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/recovery/src/org/jboss/jbossts/xts/logging/XTSLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -2,7 +2,6 @@
import com.arjuna.common.util.logging.LogFactory;
import com.arjuna.common.util.logging.LogNoi18n;
-import com.arjuna.common.util.logging.Logi18n;
import org.jboss.logging.BasicLogger;
import org.jboss.logging.Logger;
@@ -13,18 +12,15 @@
public static BasicLogger logger;
public static xtsrecoveryI18NLogger i18NLogger;
- //public static Logi18n arjLoggerI18N;
-
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
arjLogger = noi18n;
- //arjLoggerI18N = i18n;
logger = Logger.getLogger("com.arjuna.wsrecovery");
i18NLogger = new xtsrecoveryI18NLoggerImpl(Logger.getLogger("com.arjuna.wsrecovery"));
}
static
{
- LogFactory.initializeModuleLogger(XTSLogger.class, "recovery_msg", "com.arjuna.wsrecovery");
+ LogFactory.initializeModuleLogger(XTSLogger.class, "com.arjuna.wsrecovery");
}
}
Modified: labs/jbosstm/trunk/XTS/sar/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/sar/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -78,10 +78,6 @@
<property name="javac.debug" value="on"/>
- <!-- name of the resource bundle -->
- <property name="xts.resourcebundle"
- value="xts_msg_en_US.properties"/>
-
<property name="bridge.api.class.files" value="org/jboss/jbossts/xts/bridge/at/BridgeWrapper.class"/>
<!-- by default we build 1.0 and 1.1 for ease of testing,
@@ -129,18 +125,6 @@
</compile.macro>
</target>
- <!-- build the messages resource bundle for use by the XTS logger -->
- <target name="resourcebundle">
- <echo message="Generating XTS Bundle"/>
- <resourcebundle.macro packagenames="org.jboss.jbossts.*" resourcebundle="${xts.resourcebundle}">
- <packagesets>
- <packageset dir="src" defaultexcludes="yes">
- <include name="org/jboss/jbossts/**"/>
- </packageset>
- </packagesets>
- </resourcebundle.macro>
- </target>
-
<!-- build the full api jar -->
<target name="api-both-jar" if="build10">
<mkdir dir="${build.dir}/tmp/api"/>
@@ -267,7 +251,7 @@
</jar>
</target>
- <target name="sar" depends="compile.bridge, resourcebundle, api-jar, sar-both, sar-11"/>
+ <target name="sar" depends="compile.bridge, api-jar, sar-both, sar-11"/>
<target name="clean">
<delete dir="${build.dir}"/>
Modified: labs/jbosstm/trunk/XTS/sharedbuild.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sharedbuild.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/XTS/sharedbuild.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -173,24 +173,5 @@
</sequential>
</macrodef>
- <macrodef name="resourcebundle.macro">
- <attribute name="resourcebundle"/>
- <attribute name="packagenames" default="com.arjuna.*"/>
- <attribute name="classpathref" default="build.classpath"/>
- <element name="packagesets" optional="true"/>
- <sequential>
- <javadoc packagenames="@{packagenames}"
- failonerror="yes"
- private="yes"
- defaultexcludes="yes"
- classpathref="@{classpathref}">
- <packagesets/>
- <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
- <path refid="doclet.classpath"/>
- <param name="-basedir" value="${basedir}/${build.classes.dir}"/>
- <param name="-resourcebundle" value="@{resourcebundle}"/>
- </doclet>
- </javadoc>
- </sequential>
- </macrodef>
+
</project>
Deleted: labs/jbosstm/trunk/antbuildsystem/classes/com/hp/mw/buildsystem/doclet/resbundledoclet/ResourceBundleDoclet.java
===================================================================
--- labs/jbosstm/trunk/antbuildsystem/classes/com/hp/mw/buildsystem/doclet/resbundledoclet/ResourceBundleDoclet.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/antbuildsystem/classes/com/hp/mw/buildsystem/doclet/resbundledoclet/ResourceBundleDoclet.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,690 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2001, 2002,
- *
- * Hewlett-Packard Arjuna Labs,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: ResourceBundleDoclet.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.hp.mw.buildsystem.doclet.resbundledoclet;
-
-import com.sun.javadoc.*;
-
-import java.io.FileWriter;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.util.HashSet;
-
-/**
- * This class is a doclet for the JavaDoc tool which ships with the Java Development Kit.
- * It produces resource bundle property files from comments placed in Java source. The
- * comments have the following format:
- *
- * @message <key> <text>
- * e.g. @message foo This is a message: {0}
- *
- * It takes the following parameters (some of which are mandatory):
- *
- * -resourcebundle <filename> This pecifies the name of the resource bundle to create, only use
- * this if the Doclet is to produce a single resource bundle.
- * -basedir <directory> This specifies the base directory to generate the resource bundle
- * property files within (MANDATORY).
- * -perclass This indicates that the doclet should produce resource bundles
- * per class. If this is not specified then a single resource bundle
- * properties file is produced for all of the source specified.
- * -ignorerepetition This indicates that the doclet should ignore key repetition and not
- * flag an error.
- * -language <language code> This indicates which language is to be used.
- * -locale <locale code> This indicates which locale is to be used.
- * -properties This indicates that the property filename should be postfixed with
- * the .properties postfix.
- */
-public class ResourceBundleDoclet extends Doclet
-{
- private static final String RESOURCE_BUNDLE_PARAMETER = "-resourcebundle";
- private static final String PER_CLASS_GENERATION_PARAMETER = "-perclass";
- private static final String DESTINATION_DIRECTORY_PARAMETER = "-basedir";
- private static final String REPETITION_PARAMETER = "-ignorerepetition";
- private static final String LANGUAGE_PARAMETER = "-language";
- private static final String LOCALE_PARAMETER = "-locale";
- private static final String PROPERTIES_PARAMETER = "-properties";
- private static final String APPEND_KEY_TO_TEXT_PARAMETER = "-appendkey";
-
- private static final int RESOURCE_BUNDLE_ELEMENTS = 2;
- private static final int PER_CLASS_GENERATION_ELEMENTS = 1;
- private static final int DESTINATION_DIRECTORY_ELEMENTS = 2;
- private static final int REPETITION_ELEMENTS = 1;
- private static final int LANGUAGE_ELEMENTS = 2;
- private static final int LOCALE_ELEMENTS = 2;
- private static final int PROPERTIES_ELEMENTS = 2;
- private static final int APPEND_KEY_TO_TEXT_ELEMENTS = 2;
-
- private static final int INVALID_PARAMETER = -1;
-
- private static final String MESSAGE_TAG = "@message";
- private static final String RESOURCE_TAG = "@resource";
- private static final String DEFAULT_LOCALE = null;
- private static final String DEFAULT_LANGUAGE = null;
-
- private static String ResourceBundleParameter = null;
- private static String DestinationDirectory = ".";
- private static String Language = DEFAULT_LANGUAGE;
- private static String Locale = DEFAULT_LOCALE;
- private static boolean PropertiesPostfix = false;
- private static boolean PerClassGeneration = false;
- private static boolean AppendKey = false;
- private static HashSet PropertyKeys = new HashSet();
- private static boolean IgnoreRepetition = false;
-
- private static RootDoc ThisRoot = null;
-
- private static final String HEADER = "#--------------------------------------------\n"+
- "# Copyright 2002\n" +
- "# Hewlett Packard\n" +
- "# Arjuna Labs\n"+
- "#--------------------------------------------\n";
- /**
- * Returns the number of elements to a given parameter
- *
- * @param option The parameter passed in
- * @return The number of elements required for this parameter
- */
- public static int optionLength(String option)
- {
- /**
- * The -resourcebundle parameter has the following format:
- *
- * -resourcebundle <filename.properties>
- */
- if (option.equalsIgnoreCase(RESOURCE_BUNDLE_PARAMETER))
- {
- return(RESOURCE_BUNDLE_ELEMENTS);
- }
- else
- {
- /**
- * The -perclass parameter has the following format:
- *
- * -perclass
- */
- if (option.equalsIgnoreCase(PER_CLASS_GENERATION_PARAMETER))
- {
- return(PER_CLASS_GENERATION_ELEMENTS);
- }
- else
- {
- /**
- * The -basedir parameter has the following format:
- *
- * -basedir <base directory>
- */
- if (option.equalsIgnoreCase(DESTINATION_DIRECTORY_PARAMETER))
- {
- return(DESTINATION_DIRECTORY_ELEMENTS);
- }
- else
- {
- /**
- * The -language parameter has the following format:
- *
- * -language <two letter language code>
- */
- if (option.equalsIgnoreCase(LANGUAGE_PARAMETER))
- {
- return(LANGUAGE_ELEMENTS);
- }
- else
- {
- /**
- * The -locale parameter has the following format:
- *
- * -locale <locale code>
- */
- if (option.equalsIgnoreCase(LOCALE_PARAMETER))
- {
- return(LOCALE_ELEMENTS);
- }
- else
- {
- /**
- * The -ignorerepetition parameter has the following format:
- *
- * -ignorerepetition
- */
- if (option.equalsIgnoreCase(REPETITION_PARAMETER))
- {
- return(REPETITION_ELEMENTS);
- }
- else
- {
- /**
- * The -properties parameter has the following format:
- *
- * -properties
- */
- if (option.equalsIgnoreCase(PROPERTIES_PARAMETER))
- {
- return(PROPERTIES_ELEMENTS);
- }
- else
- {
- /**
- * The -appendkey parameter has the following format:
- *
- * -appendkey
- */
- if (option.equalsIgnoreCase(APPEND_KEY_TO_TEXT_PARAMETER))
- {
- return(APPEND_KEY_TO_TEXT_ELEMENTS);
- }
- }
- }
- }
- }
- }
- }
- }
-
- return(INVALID_PARAMETER);
- }
-
- private static void parseOptions(String[][] options)
- {
- for (int optionCount=0;optionCount<options.length;optionCount++)
- {
- String[] subOptions = options[optionCount];
-
- if (subOptions[0].equalsIgnoreCase(RESOURCE_BUNDLE_PARAMETER))
- {
- ResourceBundleParameter = subOptions[1];
- }
- else
- if (subOptions[0].equalsIgnoreCase(PER_CLASS_GENERATION_PARAMETER))
- {
- PerClassGeneration = true;
- }
- else
- if (subOptions[0].equalsIgnoreCase(REPETITION_PARAMETER))
- {
- IgnoreRepetition = true;
- }
- else
- if (subOptions[0].equalsIgnoreCase(DESTINATION_DIRECTORY_PARAMETER))
- {
- DestinationDirectory = subOptions[1];
- }
- else
- if (subOptions[0].equalsIgnoreCase(LANGUAGE_PARAMETER))
- {
- Language = subOptions[1];
- }
- else
- if (subOptions[0].equalsIgnoreCase(LOCALE_PARAMETER))
- {
- Locale = subOptions[1];
- }
- else
- if (subOptions[0].equalsIgnoreCase(PROPERTIES_PARAMETER))
- {
- PropertiesPostfix = true;
- }
- else
- if (subOptions[0].equalsIgnoreCase(APPEND_KEY_TO_TEXT_PARAMETER))
- {
- AppendKey = true;
- }
- }
-
- ThisRoot.printNotice("Per Class: "+PerClassGeneration);
- ThisRoot.printNotice("Append Key to National Text: "+AppendKey);
- ThisRoot.printNotice("Destination Directory: "+DestinationDirectory);
- if (PerClassGeneration)
- {
- ThisRoot.printNotice("Language: "+Language);
- ThisRoot.printNotice("Locale: "+Locale);
- ThisRoot.printNotice("Properties Postfix: "+PropertiesPostfix);
- }
- else
- {
- ThisRoot.printNotice("Resource Bundle: "+ResourceBundleParameter);
- }
- ThisRoot.printNotice("Ignore Repetition: "+IgnoreRepetition);
- }
-
- /**
- * Validate the parameters passed in
- */
- public static boolean validOptions(String[][] options,
- DocErrorReporter reporter)
- {
- boolean returnValue = true;
- boolean resourceBundleParameter = false;
- boolean baseDirSpecified = false;
- boolean perClass = false;
-
- for (int optionCount=0;optionCount<options.length;optionCount++)
- {
- String[] subOptions = options[optionCount];
-
- if (subOptions[0].equalsIgnoreCase(RESOURCE_BUNDLE_PARAMETER))
- {
- if (resourceBundleParameter)
- {
- reporter.printError("Resource bundle specified twice");
- returnValue = false;
- }
-
- resourceBundleParameter = true;
- }
- else
- if (subOptions[0].equalsIgnoreCase(PER_CLASS_GENERATION_PARAMETER))
- {
- perClass = true;
- }
- else
- if (subOptions[0].equalsIgnoreCase(DESTINATION_DIRECTORY_PARAMETER))
- {
- baseDirSpecified = true;
- }
- }
-
- if ((!perClass) && (!resourceBundleParameter))
- {
- reporter.printError("Not using per class resource bundle generation and no resource bundle file specified (use "+RESOURCE_BUNDLE_PARAMETER+")");
- returnValue = false;
- }
- if (!baseDirSpecified)
- {
- reporter.printNotice("Please specify a base director (using "+DESTINATION_DIRECTORY_PARAMETER+" <directory>)");
- returnValue = false;
- }
-
- return(returnValue);
- }
-
- /**
- * Process the document
- *
- * @param root The RootDoc of the document set
- */
- public static boolean start(RootDoc root)
- {
- ThisRoot = root;
-
- ThisRoot.printNotice("ResourceBundle Generator Doclet");
- ThisRoot.printNotice("HP Arjuna Labs");
- /**
- * Parse and interpret the options
- */
- parseOptions(root.options());
-
- /**
- * Retrieve all packages specified
- */
- PackageDoc[] packages = root.specifiedPackages();
- StringBuffer results = new StringBuffer();
-
- for (int count=0;count<packages.length;count++)
- {
- parseClasses(packages[count].allClasses(),results);
- }
-
- parseClasses(root.specifiedClasses(),results);
-
- if (!PerClassGeneration)
- {
- writeResourceBundleFile(results, new File(DestinationDirectory, ResourceBundleParameter));
- }
-
- return(true);
- }
-
- /**
- * This method parses an array of classes and produces the required key/text pairs
- * in the string buffer.
- */
- protected static StringBuffer parseClasses(ClassDoc[] classes, StringBuffer results)
- {
- for (int count=0;count<classes.length;count++)
- {
- ClassDoc cl = classes[count];
-
- /**
- * If we are performing per class resource bundle generation
- * then clear the stored property keys as they will not affect
- * this class
- */
- if (PerClassGeneration)
- {
- PropertyKeys.clear();
- }
-
- /**
- * Parse the class level doc
- */
- if (!parseDoc(cl, results))
- {
- ThisRoot.printError("Error while parsing class '"+cl.qualifiedTypeName()+"'");
- }
- else
- {
- /**
- * Parse the constructor level docs
- */
- if (!parseDocArray(cl.constructors(),results))
- {
- ThisRoot.printError("Error while parsing constructors of class '"+cl.qualifiedTypeName()+"'");
- }
- else
- {
- /**
- * Parse the method level docs
- */
- if (!parseDocArray(cl.methods(),results))
- {
- ThisRoot.printError("Error while parsing methods of class '"+cl.qualifiedTypeName()+"'");
- }
- else
- {
- /**
- * Parse the field level docs
- */
- if (!parseDocArray(cl.fields(),results))
- {
- ThisRoot.printError("Error while parsing fields of class '"+cl.qualifiedTypeName()+"'");
- }
- }
- }
- }
-
- if (PerClassGeneration)
- {
- writeResourceBundleFile(results, generatePerClassResourceFile(classes[count]));
- results = new StringBuffer();
- }
- }
-
- return(results);
- }
-
- /**
- * Given a class doc object this method generates the resource bundle
- * filename.
- */
- protected static File generatePerClassResourceFile(ClassDoc c)
- {
- String filename = DestinationDirectory + File.separatorChar + c.qualifiedTypeName().replace('.',File.separatorChar)+"_msg";
-
- if (Language != null)
- {
- filename += "_" + Language;
- if (Locale != null)
- {
- filename += "_"+Locale;
- }
- }
-
- if (PropertiesPostfix)
- {
- filename += ".properties";
- }
-
- return(new File(filename));
- }
-
- /**
- * This method writes the given key/text property pairs into a file
- */
- protected static boolean writeResourceBundleFile(StringBuffer properties, File filename)
- {
- boolean result = true;
-
- if ( properties.length() > 0 )
- {
- try
- {
- ThisRoot.printNotice("Generating '"+filename+"'");
- /**
- * Create the directories if necessary
- */
- filename.getParentFile().mkdirs();
-
- BufferedWriter out = new BufferedWriter(new FileWriter(filename));
- out.write(HEADER + '\n');
- out.write(properties.toString() + "\n");
- out.close();
- }
- catch (java.io.IOException e)
- {
- ThisRoot.printError("Error while generating resource bundle - "+e);
- result = false;
- }
- }
-
- return(result);
- }
-
- /**
- * This method iterates through the array of docs and parses
- * them into the string buffer. This method can be used for
- * parsing any Doc type array.
- */
- protected static boolean parseDocArray(Doc[] docs, StringBuffer buffer)
- {
- boolean result = true;
-
- for (int count=0;(count<docs.length)&&result;count++)
- {
- result &= parseDoc(docs[count], buffer);
- }
-
- return(result);
- }
- /**
- * For a given classdoc this method generates a string buffer containing
- * all the key to text mappings contained within this class.
- */
- protected static boolean parseDoc(Doc doc, StringBuffer buffer)
- {
- boolean returnValue = false;
-
- /**
- * Generate key/text pairs for the class
- */
- Tag[] tags = doc.tags(MESSAGE_TAG);
- returnValue = generatePropertyString(tags, buffer, false);
-
- /**
- * Generate key/text pairs for the class
- */
- Tag[] resourceTags = doc.tags(RESOURCE_TAG);
- return(returnValue && generatePropertyString(resourceTags, buffer, true));
- }
-
- /**
- * Given an array of Tag classes this method produces the key/text pairs
- * that are specified in the tags and places them in a string buffer
- */
- private static boolean generatePropertyString(Tag[] classTags, StringBuffer results, boolean isResource)
- {
- String key = null;
- boolean errorFound = false;
-
- for (int tagCount=0;tagCount<classTags.length;tagCount++)
- {
- /**
- * If the key has been used previously and we don't allow repetition then flag an error
- */
- key = getKey(classTags[tagCount]);
- if ( (!IgnoreRepetition) && (PropertyKeys.contains(key)) )
- {
- ThisRoot.printError("The key '"+key+"' has been defined multiple times");
- }
- else
- {
- String keyTextPair = null;
-
- if ( isResource )
- {
- keyTextPair = generateKeyResourceTextPair(classTags[tagCount]);
- }
- else
- {
- keyTextPair = generateKeyTextPair(classTags[tagCount]);
- }
-
- if (keyTextPair != null)
- {
- results.append(keyTextPair);
- results.append('\n');
- }
- else
- {
- ThisRoot.printError("Non valid tag - "+classTags[tagCount].toString());
- errorFound = true;
- }
- }
-
- PropertyKeys.add(key);
- }
-
- return(!errorFound);
- }
-
- /**
- * Generates a key=text pair from a message tag
- *
- * @param tag The tag to produce the pair from
- * @return The textual key-text pair
- */
- public static String generateKeyTextPair(Tag tag)
- {
- String returnValue = null;
-
- try
- {
- String txt = handleNewlines(tag.text());
- String key = txt.substring(0,txt.indexOf(' '));
- String value = txt.substring(txt.indexOf(' ') + 1);
-
- returnValue = key + "=" + (AppendKey?("["+key+"] "):"") + value;
- }
- catch (Exception e)
- {
- // Ignore this exception just return null
- }
-
- return(returnValue);
- }
-
- /**
- * Generates a key=text pair from a resource tag
- *
- * @param tag The tag to produce the pair from
- * @return The textual key-text pair
- */
- public static String generateKeyResourceTextPair(Tag tag)
- {
- String returnValue = null;
-
- try
- {
- String txt = handleNewlines(tag.text());
- String key = txt.substring(0,txt.indexOf(' '));
- String value = txt.substring(txt.indexOf(' ') + 1);
-
- returnValue = key + "=" + value;
- }
- catch (Exception e)
- {
- // Ignore this exception just return null
- }
-
- return(returnValue);
- }
-
- /**
- * Generate a key from a tag
- *
- * @param tag The tag to produce the key from.
- * @return The key value
- */
- public static String getKey(Tag tag)
- {
- String returnValue = null;
-
- try
- {
- returnValue = tag.text().substring(0,tag.text().indexOf(' '));
- }
- catch (Exception e)
- {
- // Ignore this exception just return null
- }
-
- return(returnValue);
- }
-
- /**
- * Replace occurances of the newline character with a space and a backslash.
- * @param tag The current tag value.
- * @return The modified tag value.
- */
- private static String handleNewlines(final String tag)
- {
- final String trimmed = tag.trim() ;
- int newlineIndex = trimmed.indexOf('\n') ;
- if (newlineIndex != -1)
- {
- final StringBuffer newTagBuffer = new StringBuffer() ;
- int fromIndex = 0 ;
- do
- {
- final int toIndex ;
- if ((newlineIndex > 1) && (trimmed.charAt(newlineIndex-1) == '\r'))
- {
- toIndex = newlineIndex-1 ;
- }
- else
- {
- toIndex = newlineIndex ;
- }
-
- newTagBuffer.append(trimmed.substring(fromIndex, toIndex)) ;
- newTagBuffer.append(" \\") ;
-
- fromIndex = toIndex ;
-
- newlineIndex = trimmed.indexOf('\n', newlineIndex+1) ;
- }
- while (newlineIndex != -1) ;
-
- newTagBuffer.append(trimmed.substring(fromIndex)) ;
- return newTagBuffer.toString() ;
- }
- return trimmed ;
- }
-}
Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/logging/jbossatxLogger.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/logging/jbossatxLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/logging/jbossatxLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -32,28 +32,22 @@
package com.arjuna.ats.jbossatx.logging;
import com.arjuna.common.util.logging.*;
-import com.arjuna.common.internal.util.logging.commonPropertyManager;
import org.jboss.logging.Logger;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
public class jbossatxLogger
{
public static LogNoi18n logger;
- //public static Logi18n loggerI18N;
public static jbossatxI18NLogger i18NLogger;
- public static void initialize(LogNoi18n noi18n, Logi18n i18n)
+ public static void initialize(LogNoi18n noi18n)
{
logger = noi18n;
- //loggerI18N = i18n;
i18NLogger = new jbossatxI18NLoggerImpl(Logger.getLogger("com.arjuna.ats.jbossatx"));
}
static
{
- LogFactory.initializeModuleLogger(jbossatxLogger.class, "jbossatx_msg", "com.arjuna.ats.jbossatx");
+ LogFactory.initializeModuleLogger(jbossatxLogger.class, "com.arjuna.ats.jbossatx");
}
}
Modified: labs/jbosstm/trunk/common/build.xml
===================================================================
--- labs/jbosstm/trunk/common/build.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/build.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -28,23 +28,6 @@
<target name="run.tests">
- <javadoc sourcepath="${tests.dir}"
- packagenames="com.arjuna.common.tests.logging"
- failonerror="yes"
- private="yes"
- defaultexcludes="yes">
-
- <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
- <path>
- <pathelement location="${sharedbuild.base.dir}/antbuildsystem/build/lib/buildsystem.jar"/>
- </path>
- <!-- force absolute path for -basedir or bad things happen -->
- <param name="-basedir" value="${basedir}/${build.dir}/tests"/>
- <param name="-resourcebundle" value="TestLevels_en_US.properties"/>
- </doclet>
-
- </javadoc>
-
<copy todir="${build.dir}/tests" flatten="true">
<fileset dir="${tests.dir}" includes="**/logging_msg*"/>
<fileset dir="${tests.dir}" includes="**/test-product.xml"/>
Deleted: 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 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nDelegatingImpl.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,185 +0,0 @@
-/*
- * 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)
- {
- super(logi18nInterface, resBundle);
- 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");
- }
-}
Deleted: 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-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Logi18nImpl.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,482 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
-* Logi18nImpl.java
-*
-* Copyright (c) 2003 Arjuna Technologies Ltd.
-* Arjuna Technologies Ltd. Confidential
-*
-* Created on Jun 30, 2003, 12:48:49 PM by Thomas Rischbeck
-*/
-package com.arjuna.common.internal.util.logging;
-
-import com.arjuna.common.util.logging.*;
-
-import java.util.ResourceBundle;
-import java.util.PropertyResourceBundle;
-import java.util.Locale;
-import java.util.MissingResourceException;
-
-/**
- * Implementation of the Log interface without i18n support.
- *
- * Most log subsystems do not provide i18n, therefore we do resource
- * bundle evaluation in this class.
- *
- * @author Thomas Rischbeck <thomas.rischbeck at arjuna.com>
- * @version $Revision: 2342 $ $Date: 2006-03-30 14:06:17 +0100 (Thu, 30 Mar 2006) $
- * @since clf-2.0
- */
-public class Logi18nImpl implements Logi18n
-{
- private ResourceBundle m_resourceBundle = null;
-
- /**
- * Interface to the log subsystem to use
- */
- private final LogInterface m_logInterface;
-
- /**
- * constructor
- *
- * @param logInterface the underlying logger to wrap
- * @param resBundle bundle used for this logger (if a resource bundle is used per logger)
- */
- public Logi18nImpl(LogInterface logInterface, String resBundle)
- {
- m_logInterface = logInterface;
- addResourceBundle(resBundle);
- }
-
- /**
- * Add the given resource bundle to this logger.
- *
- * @param bundleName The name of the resource bundle.
- */
- private synchronized void addResourceBundle(String bundleName)
- {
- try
- {
- m_resourceBundle = PropertyResourceBundle.getBundle(bundleName, Locale.getDefault(), Thread.currentThread().getContextClassLoader());
- }
- catch (MissingResourceException mre)
- {
- System.err.println("resource bundle " + mre.getClassName() + " not found!");
- }
- }
-
-
- /**
- * Determine if this logger is enabled for DEBUG messages.
- *
- * This method returns true when the underlying logger is configured with DEBUG level on.
- *
- * @return True if the logger is enabled for DEBUG, false otherwise
- */
- public boolean isDebugEnabled()
- {
- return m_logInterface.isDebugEnabled();
- }
-
- /**
- * Determine if this logger is enabled for INFO messages.
- * @return True if the logger is enabled for INFO, false otherwise
- */
- public boolean isInfoEnabled()
- {
- return m_logInterface.isInfoEnabled();
- }
-
- /**
- * Determine if this logger is enabled for WARN messages.
- * @return True if the logger is enabled for WARN, false otherwise
- */
- public boolean isWarnEnabled()
- {
- return m_logInterface.isWarnEnabled();
- }
-
- /**
- * Determine if this logger is enabled for ERROR messages.
- * @return True if the logger is enabled for ERROR, false otherwise
- */
- public boolean isErrorEnabled()
- {
- return m_logInterface.isErrorEnabled();
- }
-
- /**
- * Determine if this logger is enabled for FATAL messages.
- * @return True if the logger is enabled for FATAL, false otherwise
- */
- public boolean isFatalEnabled()
- {
- return m_logInterface.isFatalEnabled();
- }
-
-
- /**********************************************************************************************************/
- /* RESOURCE BUNDLE EVALUATION */
- /**********************************************************************************************************/
-
- /**
- * Obtain a localized message from one of the resource bundles associated
- * with this logger.
- *
- * The user supplied parameter <code>key</code> is replaced by its localized
- * version from the resource bundle.
- *
- * @param key unique key to identify an entry in the resource bundle.
- * @return The localised string according to user's locale and available resource bundles. placeholder message
- * if the resource bundle or key cannot be found.
- */
- public String getString(String key)
- {
- try
- {
- return getResourceBundleString(key);
- }
- catch (MissingResourceException mre)
- {
- return mre.getLocalizedMessage() + ": [key='" + key + "']";
- }
- }
-
- /**
- * Obtain a localized and parameterized message from one of the resource
- * bundles associated with this logger.
- *
- * First, the user supplied <code>key</code> is searched in the resource
- * bundle. Next, the resulting pattern is formatted using
- * {@link java.text.MessageFormat#format(String,Object[])} method with the
- * user supplied object array <code>params</code>.
- *
- * @param key unique key to identify an entry in the resource bundle.
- * @param params parameters to fill placeholders (e.g., {0}, {1}) in the resource bundle string.
- * @return The localised string according to user's locale and available resource bundles. placeholder message
- * if the resource bundle or key cannot be found.
- */
- public String getString(String key, Object[] params)
- {
- try
- {
- String pattern = getResourceBundleString(key);
- return java.text.MessageFormat.format(pattern, params);
- }
- catch (MissingResourceException mre)
- {
- StringBuffer sb = new StringBuffer();
- for(Object param : params) {
- sb.append(param);
- sb.append( ", ");
- }
- return mre.getLocalizedMessage() + ": [key='" + key + "']" + sb.toString();
- }
- }
-
- /**
- *
- * @param key the message key
- * @return the resource bundle String
- * @throws MissingResourceException if the default bundle is not set
- */
- synchronized String getResourceBundleString(String key) throws MissingResourceException
- {
- String resource = null;
- if (m_resourceBundle == null)
- {
- throw new MissingResourceException("no resource bundle set for this logger", null, null);
- }
- else
- {
- resource = m_resourceBundle.getString(key);
- }
- return resource;
- }
-
- /**
- * Log a message with DEBUG Level
- *
- * @param key resource bundle key for the message to log
- *
- * @deprecated use debug (String key, null) instead
- */
- public void debug(String key)
- {
- if (!isDebugEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.debug(message);
- }
-
- /**
- * Log a message with the DEBUG Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable The Throwable to log
- */
- public void debug(String key, Throwable throwable)
- {
- if (!isDebugEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.debug(message, throwable);
- }
-
- /**
- * 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
- */
- public void debug(String key, Object[] params)
- {
- if (!isDebugEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.debug(message);
- }
-
- /**
- * 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
- */
- public void debug(String key, Object[] params, Throwable throwable)
- {
- if (!isDebugEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.debug(message, throwable);
- }
-
- /**
- * Log a message with INFO Level
- *
- * @param key resource bundle key for the message to log
- *
- * @deprecated use info (String key, null) instead
- */
- public void info(String key)
- {
- if (!isInfoEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.info(message);
- }
-
- /**
- * Log a message with the INFO Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated to the logging message
- */
- public void info(String key, Throwable throwable)
- {
- if (!isInfoEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.info(message, 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
- */
- public void info(String key, Object[] params)
- {
- if (!isInfoEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.info(message);
- }
-
- /**
- * 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
- */
- public void info(String key, Object[] params, Throwable throwable)
- {
- if (!isInfoEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.info(message, throwable);
- }
-
- /**
- * Log a message with the WARN Level
- * @param key resource bundle key for the message to log
- *
- * @deprecated use warn (String key, null) instead
- */
- public void warn(String key)
- {
- if (!isWarnEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.warn(message);
- }
-
- /**
- * Log a message with the WARN Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated with the logging request
- */
- public void warn(String key, Throwable throwable)
- {
- if (!isWarnEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.warn(message, 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
- */
- public void warn(String key, Object[] params)
- {
- if (!isWarnEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.warn(message);
- }
-
- /**
- * 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
- */
- public void warn(String key, Object[] params, Throwable throwable)
- {
- if (!isWarnEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.warn(message, throwable);
- }
-
- /**
- * Log a message with the ERROR Level
- * @param key resource bundle key for the message to log
- *
- * @deprecated use error (String key, null) instead
- */
- public void error(String key)
- {
- if (!isErrorEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.error(message);
- }
-
- /**
- * Log a message with the ERROR Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated with the logging request
- */
- public void error(String key, Throwable throwable)
- {
- if (!isErrorEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.error(message, 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
- */
- public void error(String key, Object[] params)
- {
- if (!isErrorEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.error(message);
- }
-
- /**
- * 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
- */
- public void error(String key, Object[] params, Throwable throwable)
- {
- if (!isErrorEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.error(message, throwable);
- }
-
- /**
- * Log a message with the FATAL Level
- * @param key resource bundle key for the message to log
- *
- * @deprecated use fatal (String key, null) instead
- */
- public void fatal(String key)
- {
- if (!isFatalEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.fatal(message);
- }
-
- /**
- * Log a message with the FATAL Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated with the logging request
- */
- public void fatal(String key, Throwable throwable)
- {
- if (!isFatalEnabled()) return;
- String message = evalResourceBundle(key);
- m_logInterface.fatal(message, 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
- */
- public void fatal(String key, Object[] params)
- {
- if (!isFatalEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.fatal(message);
- }
-
- /**
- * 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
- */
- public void fatal(String key, Object[] params, Throwable throwable)
- {
- if (!isFatalEnabled()) return;
- String message = evalResourceBundle(key, params);
- m_logInterface.fatal(message, throwable);
- }
-
- // -------------------------------------------------------------------------------------
- // internal methods
- // -------------------------------------------------------------------------------------
-
- protected String evalResourceBundle(String key)
- {
- return getString(key);
- }
-
- protected String evalResourceBundle(String key, Object[] params)
- {
- return getString(key, params);
- }
-}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/Log4JLogger.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/Log4JLogger.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/jakarta/Log4JLogger.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -44,8 +44,6 @@
import org.apache.log4j.Priority;
import org.apache.log4j.Level;
-import com.arjuna.common.internal.util.logging.Logi18nImpl;
-
/**
* Implementation of {@link Log} that maps directly to a
* <strong>Logger</strong> for log4J version 1.2.
@@ -75,7 +73,7 @@
/** The fully qualified name of the Log4JLogger class. */
//private static final String FQCN = Log4JLogger.class.getName(); // apache version
- private static final String FQCN = Logi18nImpl.class.getName(); // Red Hat modification
+ private static final String FQCN = Log4JLogger.class.getName(); // Red Hat modification
/** Log to this logger */
private transient Logger logger = null;
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/LogFactory.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -33,11 +33,9 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
-import java.util.Locale;
-import java.util.ResourceBundle;
/**
- * Factory for {@link Logi18n} and {@link LogNoi18n} objects.
+ * Factory for {@link LogNoi18n} objects.
*
* LogFactory instantiates and returns different implementations of Logi18n and LogNoi18n according to
* which logging subsystem is configured.
@@ -75,26 +73,13 @@
*/
private static boolean m_isInitialized = false;
- public static void initializeModuleLogger(Class moduleLogger, String bundleName, String name) {
+ public static void initializeModuleLogger(Class moduleLogger, String name) {
LogNoi18n logger = getLogNoi18n(name);
- String _language = commonPropertyManager.getLoggingEnvironmentBean().getLanguage();
- String _country = commonPropertyManager.getLoggingEnvironmentBean().getCountry();
-
- Logi18n loggerI18N;
- try
- {
- loggerI18N = getLogi18n(name, bundleName+"_"+_language+"_"+_country);
- }
- catch (Throwable ex)
- {
- loggerI18N = getLogi18n(name, bundleName+"_en_US");
- }
-
try {
- Method initializer = moduleLogger.getMethod("initialize", new Class[] {LogNoi18n.class, Logi18n.class});
- initializer.invoke(null, new Object[] {logger, loggerI18N});
+ Method initializer = moduleLogger.getMethod("initialize", new Class[] {LogNoi18n.class});
+ initializer.invoke(null, new Object[] {logger});
} catch(Exception e) {
throw new RuntimeException("An unexpected exception occurred while initializing the logger: " + e.getMessage(), e);
}
@@ -118,31 +103,6 @@
return log;
}
- /**
- * Convenience method to return a named logger, without the application
- * having to care about factories.
- *
- * @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 resBundle resource bundle associated with the returned logger.
- * @return a Logi18n instance
- */
- public static Logi18n getLogi18n(String name, String resBundle) {
- setupLogSystem();
- Logi18n log;
- if(m_logFactory.isInternationalizationSupported()) {
- // TODO can all logging frameworks cope with having the same name used twice,
- // once with and once without a resBundle?
- Logi18nInterface logi18nInterface = m_logFactory.getLog(name, resBundle);
- log = new Logi18nDelegatingImpl(logi18nInterface, resBundle);
- } else {
- LogInterface logInterface = m_logFactory.getLog(name);
- log = new Logi18nImpl(logInterface, resBundle);
- }
- return log;
- }
-
public static synchronized void reset() {
m_isInitialized = false;
}
Deleted: labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/Logi18n.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/Logi18n.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/util/logging/Logi18n.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,294 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
-* Log.java
-*
-* Copyright (c) 2003 Arjuna Technologies Ltd.
-* Arjuna Technologies Ltd. Confidential
-*
-* Created on Jun 30, 2003, 10:04:22 AM by Thomas Rischbeck
-*/
-package com.arjuna.common.util.logging;
-
-/**
- * Internationalised logging interface abstracting the various logging APIs
- * supported by Arjuna CLF.
- *
- * <p> The five logging levels used by <code>Log</code> are (in order):
- * <ol>
- * <li>debug (the least serious</li>
- * <li>info</li>
- * <li>warn</li>
- * <li>error</li>
- * <li>fatal (the most serious)</li>
- * </ol>
- *
- * The mapping of these log levels to the concepts used by the underlying
- * logging system is implementation dependent. The implemention should ensure,
- * though, that this ordering behaves as expected.</p>
- *
- * <p>Performance is often a logging concern. By examining the appropriate property,
- * a component can avoid expensive operations (producing information
- * to be logged).</p>
- *
- * <p> For example,
- * <code><pre>
- * if (log.isDebugEnabled()) {
- * ... do something expensive ...
- * log.debug(theResult);
- * }
- * </pre></code>
- * </p>
- *
- * <p>Configuration of the underlying logging system will generally be done
- * external to the Logging APIs, through whatever mechanism is supported by
- * that system.</p>
- *
- * @author Thomas Rischbeck <thomas.rischbeck at arjuna.com>
- * @version $Revision: 2342 $ $Date: 2006-03-30 14:06:17 +0100 (Thu, 30 Mar 2006) $
- * @since clf-2.0
- */
-public interface Logi18n
-{
- /**
- * Determine if this logger is enabled for DEBUG messages.
- *
- * This method returns true when the underlying logger is configured with DEBUG level on.
- *
- * @return True if the logger is enabled for DEBUG, false otherwise
- */
- boolean isDebugEnabled();
-
- /**
- * Determine if this logger is enabled for INFO messages.
- * @return True if the logger is enabled for INFO, false otherwise
- */
- boolean isInfoEnabled();
-
- /**
- * Determine if this logger is enabled for WARN messages.
- * @return True if the logger is enabled for WARN, false otherwise
- */
- boolean isWarnEnabled();
-
- /**
- * Determine if this logger is enabled for ERROR messages.
- * @return True if the logger is enabled for ERROR, false otherwise
- */
- boolean isErrorEnabled();
-
- /**
- * Determine if this logger is enabled for FATAL messages.
- * @return True if the logger is enabled for FATAL, false otherwise
- */
- boolean isFatalEnabled();
-
-
- /************************ Log Debug Messages ****************************/
-
- /**
- * Log a message with DEBUG Level
- *
- * @param key resource bundle key for the message to log
- */
- void debug(String key);
-
- /**
- * Log a message with the DEBUG Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable The Throwable to log
- */
- void debug(String key, Throwable throwable);
-
- /**
- * 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
- */
- void debug(String key, Object[] 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
- */
- void debug(String key, Object[] params, Throwable throwable);
-
- /************************ Log Info Messages ****************************/
-
- /**
- * Log a message with INFO Level
- *
- * @param key resource bundle key for the message to log
- */
- void info(String key);
-
- /**
- * Log a message with the INFO Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated to the logging message
- */
- void info(String key, Throwable 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
- */
- void info(String key, Object[] 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
- */
- void info(String key, Object[] params, Throwable throwable);
-
-
- /************************ Log Warn Messages ****************************/
-
- /**
- * Log a message with the WARN Level
- * @param key resource bundle key for the message to log
- */
- void warn(String key);
-
- /**
- * Log a message with the WARN Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated with the logging request
- */
- void warn(String key, Throwable 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
- */
- void warn(String key, Object[] 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
- */
- void warn(String key, Object[] params, Throwable throwable);
-
-
- /************************ Log Error Messages ****************************/
-
- /**
- * Log a message with the ERROR Level
- * @param key resource bundle key for the message to log
- */
- void error(String key);
-
- /**
- * Log a message with the ERROR Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated with the logging request
- */
- void error(String key, Throwable 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
- */
- void error(String key, Object[] 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
- */
- void error(String key, Object[] params, Throwable throwable);
-
- /************************ Log Fatal Messages ****************************/
-
- /**
- * Log a message with the FATAL Level
- * @param key resource bundle key for the message to log
- */
- void fatal(String key);
-
- /**
- * Log a message with the FATAL Level and with a throwable arguments
- * @param key resource bundle key for the message to log
- * @param throwable Throwable associated with the logging request
- */
- void fatal(String key, Throwable 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
- */
- void fatal(String key, Object[] 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
- */
- void fatal(String key, Object[] params, Throwable throwable);
-
-
- /**********************************************************************************************************/
- /* RESOURCE BUNDLE EVALUATION */
- /**********************************************************************************************************/
-
- /**
- * Obtain a localized message from one of the resource bundles associated
- * with this logger.
- *
- * The user supplied parameter <code>key</code> is replaced by its localized
- * version from the resource bundle.
- *
- * @param key unique key to identify an entry in the resource bundle.
- * @return The localised string according to user's locale and available resource bundles. placeholder message
- * if the resource bundle or key cannot be found.
- */
- public String getString(String key);
-
- /**
- * Obtain a localized and parameterized message from one of the resource
- * bundles associated with this logger.
- *
- * First, the user supplied <code>key</code> is searched in the resource
- * bundle. Next, the resulting pattern is formatted using
- * {@link java.text.MessageFormat#format(String,Object[])} method with the
- * user supplied object array <code>params</code>.
- *
- * @param key unique key to identify an entry in the resource bundle.
- * @param params parameters to fill placeholders (e.g., {0}, {1}) in the resource bundle string.
- * @return The localised string according to user's locale and available resource bundles. placeholder message
- * if the resource bundle or key cannot be found.
- */
- public String getString(String key, Object[] params);
-}
Deleted: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/ExerciseLoggerImpls.java
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/ExerciseLoggerImpls.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/ExerciseLoggerImpls.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,175 +0,0 @@
-/*
- * 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.tests.logging;
-
-import com.arjuna.common.internal.util.logging.LoggingEnvironmentBean;
-import com.arjuna.common.internal.util.logging.commonPropertyManager;
-import com.arjuna.common.util.logging.LogFactory;
-import com.arjuna.common.util.logging.LogNoi18n;
-import com.arjuna.common.util.logging.Logi18n;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.Arrays;
-import java.util.Locale;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- * Verify logger classes produce the expected output.
- *
- * @author Jonathan Halliday (jonathan.halliday at redhat.com) 2010-01
- */
-public class ExerciseLoggerImpls
-{
- private static final String CLASS = ExerciseLoggerImpls.class.getName();
-
- @Test
- public void testJakartaLog4j() {
- testWithFactory("com.arjuna.common.internal.util.logging.jakarta.JakartaLogFactory;com.arjuna.common.internal.util.logging.jakarta.Log4JLogger", 0);
- }
-
- @Test
- public void testBasicLog() {
-
- commonPropertyManager.getBasicLogEnvironmentBean().setLogFile(null);
- commonPropertyManager.getBasicLogEnvironmentBean().setLevel("debug");
- testWithFactory("com.arjuna.common.internal.util.logging.basic.BasicLogFactory", 5);
- }
-
- private void testWithFactory(String factory, int skipHeaderLines) {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- PrintStream bufferedStream = new PrintStream(buffer);
- PrintStream originalStream = System.out;
-
- LoggingEnvironmentBean loggingEnvironmentBean = commonPropertyManager.getLoggingEnvironmentBean();
- String originalFactory = loggingEnvironmentBean.getLoggingFactory();
- Locale originalLocale = Locale.getDefault();
-
- loggingEnvironmentBean.setLoggingFactory(factory);
-
- System.setOut(bufferedStream);
- LogFactory.reset(); // make sure it reloads the modified config.
-
- try {
-
- Locale.setDefault(new Locale("en", "US"));
-
- Logi18n logi18n = LogFactory.getLogi18n(CLASS, "logging_msg");
- generateTestOutput(logi18n);
-
- LogNoi18n logNoi18n = LogFactory.getLogNoi18n("loggingtest");
- generateTestOutput(logNoi18n);
-
- } finally {
- loggingEnvironmentBean.setLoggingFactory(originalFactory);
- Locale.setDefault(originalLocale);
- System.setOut(originalStream);
- LogFactory.reset();
- }
- verifyResult(buffer.toString(), skipHeaderLines);
-
- }
-
- private void generateTestOutput(Logi18n logi18n) {
- logi18n.debug("debug_message");
- logi18n.debug("debug_message", (Throwable)null);
- logi18n.debug("debug_param_message", new Object[] {"one", "two"});
- logi18n.debug("debug_param_message", new Object[] {"one", "two"}, null);
-
- logi18n.info("info_message");
- logi18n.info("info_message", (Throwable)null);
- logi18n.info("info_param_message", new Object[] {"one", "two"});
- logi18n.info("info_param_message", new Object[] {"one", "two"}, null);
-
- logi18n.warn("warn_message");
- logi18n.warn("warn_message", (Throwable)null);
- logi18n.warn("warn_param_message", new Object[] {"one", "two"});
- logi18n.warn("warn_param_message", new Object[] {"one", "two"}, null);
-
- logi18n.error("error_message");
- logi18n.error("error_message", (Throwable)null);
- logi18n.error("error_param_message", new Object[] {"one", "two"});
- logi18n.error("error_param_message", new Object[] {"one", "two"}, null);
-
- logi18n.fatal("fatal_message");
- logi18n.fatal("fatal_message", (Throwable)null);
- logi18n.fatal("fatal_param_message", new Object[] {"one", "two"});
- logi18n.fatal("fatal_param_message", new Object[] {"one", "two"}, null);
-
- }
-
- private void generateTestOutput(LogNoi18n logNoi18n) {
-
- }
-
- private void verifyResult(String result, int skipHeaderLines) {
- String[] lines = result.split("\r?\n");
-
- if(skipHeaderLines > 0) {
- lines = Arrays.copyOfRange(lines, skipHeaderLines, lines.length);
- }
-
- String[][] expected = new String[][] {
- {"DEBUG", "This is a debug message"},
- {"DEBUG", "This is a debug message"},
- {"DEBUG", "This is a debug message with params one and two"},
- {"DEBUG", "This is a debug message with params one and two"},
-
- {"INFO", "This is a info message"},
- {"INFO", "This is a info message"},
- {"INFO", "This is a info message with params one and two"},
- {"INFO", "This is a info message with params one and two"},
-
- {"WARN", "This is a warn message"},
- {"WARN", "This is a warn message"},
- {"WARN", "This is a warn message with params one and two"},
- {"WARN", "This is a warn message with params one and two"},
-
- {"ERROR", "This is a error message"},
- {"ERROR", "This is a error message"},
- {"ERROR", "This is a error message with params one and two"},
- {"ERROR", "This is a error message with params one and two"},
-
- {"FATAL", "This is a fatal message"},
- {"FATAL", "This is a fatal message"},
- {"FATAL", "This is a fatal message with params one and two"},
- {"FATAL", "This is a fatal message with params one and two"}
-
-
-
- };
-
- assertNotNull(lines);
-
- for(String line : lines) {
- System.out.println("LINE: "+line);
- }
-
- assertEquals(expected.length, lines.length);
-
- for(int i = 0; i < expected.length; i++) {
- String expectedPattern = ".*"+expected[i][0]+".*ExerciseLoggerImpls.*"+expected[i][1]+"$";
- assertTrue("Got actual value: "+lines[i], lines[i].matches(expectedPattern));
- }
- }
-}
Modified: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/TestLevels.java
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/TestLevels.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/TestLevels.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -21,7 +21,7 @@
package com.arjuna.common.tests.logging;
import com.arjuna.common.internal.util.logging.LoggingEnvironmentBean;
-import com.arjuna.common.util.logging.Logi18n;
+import com.arjuna.common.util.logging.LogNoi18n;
import com.arjuna.common.util.logging.LogFactory;
import com.arjuna.common.internal.util.logging.commonPropertyManager;
@@ -92,28 +92,16 @@
private static void writeLogMessages() {
// Don't init the log in a member variable - it must be done AFTER System.out is changed.
- Logi18n log = LogFactory.getLogi18n(CLASS, "TestLevels");
- log.debug("testMessage", new Object[] {"1st", "debug"});
- log.info("testMessage", new Object[] {"1st", "info"});
- log.warn("testMessage", new Object[] {"1st", "warn"});
- log.error("testMessage", new Object[] {"1st", "error"});
- log.fatal("testMessage", new Object[] {"1st", "fatal"});
+ LogNoi18n log = LogFactory.getLogNoi18n(CLASS);
+ log.debug("testMessage");
}
private static void verifyResult(String result, boolean expectReleveling) {
String[] lines = result.split("\r?\n");
assertNotNull(lines);
- assertEquals(5, lines.length);
- assertTrue("Got actual value: "+lines[0], lines[0].matches("\\s*DEBUG \\[main\\] \\(TestLevels.java.*"));
+ assertEquals(1, lines.length);
+ assertTrue("Got actual value: "+lines[0], lines[0].matches("\\s*DEBUG \\[main\\] \\(JakartaRelevelingLogger.java.*"));
- if(expectReleveling) {
- assertTrue("Got actual value: "+lines[1], lines[1].matches("\\s*DEBUG \\[main\\] \\(TestLevels.java.*"));
- } else {
- assertTrue("Got actual value: "+lines[1], lines[1].matches("\\s*INFO \\[main\\] \\(TestLevels.java.*"));
- }
- assertTrue("Got actual value: "+lines[2], lines[2].matches("\\s*WARN \\[main\\] \\(TestLevels.java.*"));
- assertTrue("Got actual value: "+lines[3], lines[3].matches("\\s*ERROR \\[main\\] \\(TestLevels.java.*"));
- assertTrue("Got actual value: "+lines[4], lines[4].matches("\\s*FATAL \\[main\\] \\(TestLevels.java.*"));
}
}
Deleted: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_en.properties
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_en.properties 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_en.properties 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,37 +0,0 @@
-#
-# JBoss, Home of Professional Open Source
-# Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
-# @author JBoss Inc.
-#
-debug_message = This is a debug message
-debug_param_message = This is a debug message with params {0} and {1}
-
-info_message = This is a info message
-info_param_message = This is a info message with params {0} and {1}
-
-warn_message = This is a warn message
-warn_param_message = This is a warn message with params {0} and {1}
-
-error_message = This is a error message
-error_param_message = This is a error message with params {0} and {1}
-
-fatal_message = This is a fatal message
-fatal_param_message = This is a fatal message with params {0} and {1}
-
-IDENTIFICATION = The FirstName is {0} and the LastName is {1}
-#
Deleted: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_fr.properties
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_fr.properties 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logging_msg_fr.properties 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,23 +0,0 @@
-#
-# JBoss, Home of Professional Open Source
-# Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
-# @author JBoss Inc.
-#
-fatal_message = Ceci est un message Fatal
-info_message = Ceci est un message pour information
-IDENTIFICATION = le prenom est {0} et le nom est {1}
Deleted: labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logi18n.java
===================================================================
--- labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logi18n.java 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/common/tests/com/arjuna/common/tests/logging/logi18n.java 2010-06-30 13:27:32 UTC (rev 33704)
@@ -1,106 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.common.tests.logging;
-
-import com.arjuna.common.internal.util.logging.LoggingEnvironmentBean;
-import com.arjuna.common.util.logging.Logi18n;
-import com.arjuna.common.util.logging.LogFactory;
-import com.arjuna.common.internal.util.logging.commonPropertyManager;
-
-import java.util.*;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- * Tests that i18n works by outputting the same message for two different locales.
- *
- */
-public class logi18n
-{
- private static final String CLASS = logi18n.class.getName();
-
- @Test
- public void testLogi18n() {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- PrintStream bufferedStream = new PrintStream(buffer);
- PrintStream originalStream = System.out;
-
- LoggingEnvironmentBean loggingEnvironmentBean = commonPropertyManager.getLoggingEnvironmentBean();
- String originalFactory = loggingEnvironmentBean.getLoggingFactory();
-
- commonPropertyManager.getLoggingEnvironmentBean().setLoggingFactory("com.arjuna.common.internal.util.logging.jakarta.JakartaLogFactory;com.arjuna.common.internal.util.logging.jakarta.Log4JLogger");
-
- System.setOut(bufferedStream);
- LogFactory.reset(); // make sure it reloads the modified config.
-
- try {
- writeLogMessages();
- } finally {
- loggingEnvironmentBean.setLoggingFactory(originalFactory);
- System.setOut(originalStream);
- LogFactory.reset();
- }
- verifyResult(buffer.toString());
-
- }
-
- private static void writeLogMessages()
- {
- Logi18n log = LogFactory.getLogi18n(CLASS, "logging_msg");
-
- Locale originalDefault = Locale.getDefault();
- try {
- Locale.setDefault(new Locale("en", "US"));
- log.info("IDENTIFICATION", new String[] { "Foo", "Bar"});
- log.fatal("fatal_message");
- log.info("info_message");
-
- Locale.setDefault(new Locale("fr", "FR"));
- log = LogFactory.getLogi18n(CLASS, "logging_msg");
- log.info("IDENTIFICATION", new String[] { "Foo", "Bar"});
- log.fatal("fatal_message");
- log.info("info_message");
- } finally {
- Locale.setDefault(originalDefault);
- }
- }
-
- private static void verifyResult(String result) {
- String[] lines = result.split("\r?\n");
-
- assertNotNull(lines);
- assertEquals(6, lines.length);
-
- assertTrue("Got actual value: "+lines[0], lines[0].matches("\\s*INFO \\[main\\] \\(logi18n.java.*The FirstName is Foo and the LastName is Bar$"));
- assertTrue("Got actual value: "+lines[1], lines[1].matches("\\s*FATAL \\[main\\] \\(logi18n.java.*This is a fatal message$"));
- assertTrue("Got actual value: "+lines[2], lines[2].matches("\\s*INFO \\[main\\] \\(logi18n.java.*This is a info message$"));
-
- assertTrue("Got actual value: "+lines[3], lines[3].matches("\\s*INFO \\[main\\] \\(logi18n.java.*le prenom est Foo et le nom est Bar$"));
- assertTrue("Got actual value: "+lines[4], lines[4].matches("\\s*FATAL \\[main\\] \\(logi18n.java.*Ceci est un message Fatal$"));
- assertTrue("Got actual value: "+lines[5], lines[5].matches("\\s*INFO \\[main\\] \\(logi18n.java.*Ceci est un message pour information$"));
- }
-}
-
-
-
Modified: labs/jbosstm/trunk/sharedbuild.xml
===================================================================
--- labs/jbosstm/trunk/sharedbuild.xml 2010-06-30 13:12:01 UTC (rev 33703)
+++ labs/jbosstm/trunk/sharedbuild.xml 2010-06-30 13:27:32 UTC (rev 33704)
@@ -204,38 +204,8 @@
basedir="${build.dir}/htdocs"/>
</target>
- <macrodef name="generateresourcebundle.macro">
-
- <element name="args" optional="true"/>
- <sequential>
- <javadoc sourcepath="${src.dir}"
- packagenames="*"
- failonerror="yes"
- private="yes"
- defaultexcludes="yes">
-
- <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
- <path>
- <pathelement location="${sharedbuild.base.dir}/antbuildsystem/build/lib/buildsystem.jar"/>
- </path>
- <!-- force absolute path for -basedir or bad things happen -->
- <param name="-basedir" value="${basedir}/${build.dir}/classes"/>
- <param name="-resourcebundle" value="${modulename}_msg_en_US.properties"/>
- <args/>
- </doclet>
-
- </javadoc>
-
- <jar jarfile="${build.dir}/lib/${modulename}.jar" update="true">
- <fileset dir="${build.dir}/classes/" includes="${modulename}_msg_en_US.properties"/>
- </jar>
-
- </sequential>
-
- </macrodef>
-
<target name="generateresourcebundle" depends="init">
- <generateresourcebundle.macro/>
+ <!-- placeholder, does nothing for now -->
</target>
<target name="install.ext.libs">
More information about the jboss-svn-commits
mailing list