[jboss-svn-commits] JBL Code SVN: r29016 - in labs/jbosstm/trunk: ArjunaJTA/jta/classes/com/arjuna/ats/jta/common and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Aug 21 11:17:43 EDT 2009
Author: jhalliday
Date: 2009-08-21 11:17:42 -0400 (Fri, 21 Aug 2009)
New Revision: 29016
Added:
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBeanMBean.java
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/DefaultLogEnvironmentBean.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBean.java
Log:
Further config bean enhancements. JBTM-596
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java 2009-08-21 14:49:03 UTC (rev 29015)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -82,7 +82,7 @@
public void setStaticInventoryElements(List<String> staticInventoryElements)
{
if(staticInventoryElements == null) {
- this.staticInventoryElements.clear();
+ this.staticInventoryElements = new ArrayList<String>();
} else {
this.staticInventoryElements = new ArrayList<String>(staticInventoryElements);
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java 2009-08-21 14:49:03 UTC (rev 29015)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -178,7 +178,7 @@
public void setExpiryScanners(List<String> expiryScanners)
{
if(expiryScanners == null) {
- this.expiryScanners.clear();
+ this.expiryScanners = new ArrayList<String>();
} else {
this.expiryScanners = new ArrayList<String>(expiryScanners);
}
@@ -192,7 +192,7 @@
public void setRecoveryExtensions(List<String> recoveryExtensions)
{
if(recoveryExtensions == null) {
- this.recoveryExtensions.clear();
+ this.recoveryExtensions = new ArrayList<String>();
} else {
this.recoveryExtensions = new ArrayList<String>(recoveryExtensions);
}
@@ -206,7 +206,7 @@
public void setRecoveryActivators(List<String> recoveryActivators)
{
if(recoveryActivators == null) {
- this.recoveryActivators.clear();
+ this.recoveryActivators = new ArrayList<String>();
} else {
this.recoveryActivators = new ArrayList<String>(recoveryActivators);
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java 2009-08-21 14:49:03 UTC (rev 29015)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -143,7 +143,7 @@
public void setXaRecoveryNodes(List<String> xaRecoveryNodes)
{
if(xaRecoveryNodes == null) {
- this.xaRecoveryNodes.clear();
+ this.xaRecoveryNodes = new ArrayList<String>();
} else {
this.xaRecoveryNodes = new ArrayList<String>(xaRecoveryNodes);
}
@@ -157,7 +157,7 @@
public void setXaResourceRecoveryInstances(List<String> xaResourceRecoveryInstances)
{
if(xaResourceRecoveryInstances == null) {
- this.xaResourceRecoveryInstances.clear();
+ this.xaResourceRecoveryInstances = new ArrayList<String>();
} else {
this.xaResourceRecoveryInstances = new ArrayList<String>(xaResourceRecoveryInstances);
}
@@ -226,7 +226,7 @@
public void setXaErrorHandlers(List<String> xaErrorHandlers)
{
if(xaErrorHandlers == null) {
- this.xaErrorHandlers.clear();
+ this.xaErrorHandlers = new ArrayList<String>();
} else {
this.xaErrorHandlers = new ArrayList(xaErrorHandlers);
}
Modified: labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java 2009-08-21 14:49:03 UTC (rev 29015)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -125,7 +125,7 @@
public void setEventHandlers(List<String> eventHandlers)
{
if(eventHandlers == null) {
- this.eventHandlers.clear();
+ this.eventHandlers = new ArrayList<String>();
} else {
this.eventHandlers = new ArrayList<String>(eventHandlers);
}
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/DefaultLogEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/DefaultLogEnvironmentBean.java 2009-08-21 14:49:03 UTC (rev 29015)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/DefaultLogEnvironmentBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -25,8 +25,6 @@
/**
* A JavaBean containing configuration properties for the default log system.
*
- * TODO testcase
- *
* @author Jonathan Halliday (jonathan.halliday at redhat.com)
*/
@PropertyPrefix(prefix = "com.arjuna.common.util.logging.default.")
@@ -42,61 +40,140 @@
private String logFile = "error.log";
+ /**
+ * Returns true if the log output should contain the log name element.
+ *
+ * Default: false
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default.showLogName
+ *
+ * @return true if the log name should appear in the log output, false otherwise.
+ */
public boolean isShowLogName()
{
return showLogName;
}
+ /**
+ * Enables the use of the log name element in log output.
+ *
+ * @param showLogName true if the log name should appear in the log output, false otherwise.
+ */
public void setShowLogName(boolean showLogName)
{
this.showLogName = showLogName;
}
+ /**
+ * Returns true if the log output should contain the short form log name element.
+ *
+ * Default: true
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default.showShortLogName
+ *
+ * @return true if the short log name should appear in the log output, false otherwise.
+ */
public boolean isShowShortLogName()
{
return showShortLogName;
}
+ /**
+ * Enables use of the short log name element in log output.
+ *
+ * @param showShortLogName true if the log name should appear in the log output, false otherwise.
+ */
public void setShowShortLogName(boolean showShortLogName)
{
this.showShortLogName = showShortLogName;
}
+ /**
+ * Returns true if the log output should contain the date/time element.
+ *
+ * Default: true
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default.showDate
+ *
+ * @return true if the date/time should appear in the log output, false otherwise.
+ */
public boolean isShowDate()
{
return showDate;
}
+ /**
+ * Enables use of the date/time element in log output.
+ *
+ * @param showDate true if the date/time should appear in log output, false otherwise.
+ */
public void setShowDate(boolean showDate)
{
this.showDate = showDate;
}
+ /**
+ * Returns true if the log file should be appended to.
+ *
+ * Default: true
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default.logFileAppend
+ *
+ * @return true if append behaviour is required, false for overwrite behaviour.
+ */
public boolean isLogFileAppend()
{
return logFileAppend;
}
+ /**
+ * Enables appending to an existing log file rather than overwiting it.
+ *
+ * @param logFileAppend true for appending, false otherwise.
+ */
public void setLogFileAppend(boolean logFileAppend)
{
this.logFileAppend = logFileAppend;
}
+ /**
+ * Returns the threshold level for logging.
+ *
+ * Default: "info"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default.defaultLevel
+ *
+ * @return the default threshold logging level.
+ */
public String getDefaultLevel()
{
return defaultLevel;
}
+ /**
+ * Sets the default log threshold.
+ * Valid values (in order) are: all, trace, debug, info, warn, error, fatal, off
+ *
+ * @param defaultLevel the default log threshold.
+ */
public void setDefaultLevel(String defaultLevel)
{
this.defaultLevel = defaultLevel;
}
+ /**
+ * Returns the name of the log file to use.
+ *
+ * Default: "error.log"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default.logFile
+ *
+ * @return the name of the file to which the log statements will be written.
+ */
public String getLogFile()
{
return logFile;
}
+ /**
+ * Sets the name of the log file to write output to.
+ *
+ * @param logFile the filename, relative or absolute.
+ */
public void setLogFile(String logFile)
{
this.logFile = logFile;
Modified: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBean.java 2009-08-21 14:49:03 UTC (rev 29015)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -24,12 +24,12 @@
import com.arjuna.common.internal.util.propertyservice.FullPropertyName;
/**
- * A JavaBean containing configuration properties for the logging system.
+ * A JavaBean containing configuration properties for the logging abstraction system.
*
* @author Jonathan Halliday (jonathan.halliday at redhat.com)
*/
@PropertyPrefix(prefix = "com.arjuna.common.util.logging.")
-public class LoggingEnvironmentBean
+public class LoggingEnvironmentBean implements LoggingEnvironmentBeanMBean
{
// don't mess with language and country defaults unless
// you also change the way logging bundles are built.
@@ -52,71 +52,162 @@
private String visibilityLevel = "0xffffffff";
+ /**
+ * Returns the language code. ISO language code as used with Locale objects.
+ *
+ * Default: "en"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.language
+ *
+ * @return the ISO language code.
+ */
public String getLanguage()
{
return language;
}
+ /**
+ * Sets the language code. Use ISO language code as with Locale objects.
+ *
+ * @param language the ISO language code.
+ */
public void setLanguage(String language)
{
this.language = language;
}
+ /**
+ * Returns the country code. ISO country code as used with Locale objects.
+ *
+ * Default: "US"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.country
+ *
+ * @return the ISO country code.
+ */
public String getCountry()
{
return country;
}
+ /**
+ * Sets the country code. Use ISO country code as with Locale objects.
+ *
+ * @param country the ISO country code.
+ */
public void setCountry(String country)
{
this.country = country;
}
+ /**
+ * Should the internal default log system be used in addition to the underlying logger.
+ *
+ * Default: false
+ * Equivalent deprecated property: com.arjuna.common.util.logging.default
+ *
+ * @return true if the default log should be enabled, otherwise false.
+ */
public boolean isUseDefaultLog()
{
return useDefaultLog;
}
+ /**
+ * Enables the default log system.
+ *
+ * @param useDefaultLog true if default log should be enabled, false otherwise.
+ */
public void setUseDefaultLog(boolean useDefaultLog)
{
this.useDefaultLog = useDefaultLog;
}
+ /**
+ * Returns the identifier for the underlying logging system.
+ *
+ * Default: "log4j"
+ * Equivalent deprecated property: com.arjuna.common.util.logger
+ *
+ * @return the identifier of the underlying logging system.
+ */
public String getLoggingSystem()
{
return loggingSystem;
}
+ /**
+ * Sets the identifier for the underlying logging system.
+ *
+ * @param loggingSystem the identifier for the underlying logging system.
+ */
public void setLoggingSystem(String loggingSystem)
{
this.loggingSystem = loggingSystem;
}
+ /**
+ * Returns the debug log level in hex form.
+ *
+ * Default: "0xffffffff"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.DebugLevel
+ *
+ * @return the debug log level.
+ */
public String getDebugLevel()
{
return debugLevel;
}
+ /**
+ * Sets the debug log level.
+ *
+ * @param debugLevel the debug log level, expressed as a hex string.
+ */
public void setDebugLevel(String debugLevel)
{
this.debugLevel = debugLevel;
}
+ /**
+ * Returns the logging facility level in hex form.
+ *
+ * Default: "0xffffffff"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.FacilityLevel
+ *
+ * @return the facility log level.
+ */
public String getFacilityLevel()
{
return facilityLevel;
}
+ /**
+ * Sets the facility log level.
+ *
+ * @param facilityLevel the facility log level, expressed as a hex string.
+ */
public void setFacilityLevel(String facilityLevel)
{
this.facilityLevel = facilityLevel;
}
+ /**
+ * Returns the visibility log level in hex form.
+ *
+ * Default: "0xffffffff"
+ * Equivalent deprecated property: com.arjuna.common.util.logging.VisibilityLevel
+ *
+ * @return the visibility log level.
+ */
public String getVisibilityLevel()
{
return visibilityLevel;
}
+ /**
+ * Sets the visibility log level.
+ *
+ * @param visibilityLevel the visibility log level, expressed as a hex string.
+ */
public void setVisibilityLevel(String visibilityLevel)
{
this.visibilityLevel = visibilityLevel;
Added: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBeanMBean.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBeanMBean.java (rev 0)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/LoggingEnvironmentBeanMBean.java 2009-08-21 15:17:42 UTC (rev 29016)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, 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) 2009,
+ * @author JBoss, a division of Red Hat.
+ */
+package com.arjuna.common.internal.util.logging;
+
+/**
+ * A JMX MBean interface configuration for the logging abstraction system.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+public interface LoggingEnvironmentBeanMBean
+{
+ String getLanguage();
+
+ void setLanguage(String language);
+
+ String getCountry();
+
+ void setCountry(String country);
+
+ boolean isUseDefaultLog();
+
+ void setUseDefaultLog(boolean useDefaultLog);
+
+ String getLoggingSystem();
+
+ void setLoggingSystem(String loggingSystem);
+
+ String getDebugLevel();
+
+ void setDebugLevel(String debugLevel);
+
+ String getFacilityLevel();
+
+ void setFacilityLevel(String facilityLevel);
+
+ String getVisibilityLevel();
+
+ void setVisibilityLevel(String visibilityLevel);
+}
More information about the jboss-svn-commits
mailing list