[jboss-cvs] JBossAS SVN: r77368 - in trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster: load/impl and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 22 13:50:38 EDT 2008


Author: pferraro
Date: 2008-08-22 13:50:36 -0400 (Fri, 22 Aug 2008)
New Revision: 77368

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/LocalStrings.properties
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/load/impl/DynamicLoadBalanceFactorProvider.java
Log:
Migrate error messages to LocalStrings.properties.
Fixed modcluster.error.uninitialized key.

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/LocalStrings.properties
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/LocalStrings.properties	2008-08-22 17:15:13 UTC (rev 77367)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/LocalStrings.properties	2008-08-22 17:50:36 UTC (rev 77368)
@@ -21,6 +21,7 @@
 modcluster.error.jmxRegister=Error during JMX registration
 modcluster.error.jmxUnregister=Error during JMX unregistration
 modcluster.error.noproxy=No proxy list or URL configured, advertise disabled and no localhost available; connect connect to mod_cluster
+modcluster.error.nonPositiveAttribute=Invalid {0} specified [{1}] - must be a positive number.
 modcluster.error.nullAttribute=Value for attribute {0} cannot be null
 modcluster.error.other=Error [{2}: {3}] sending command {0} to proxy {1}, configuration will be reset
 modcluster.error.iae.null=[{0}] is null
@@ -36,4 +37,4 @@
 modcluster.error.stopListener=Error stopping advertise listener
 modcluster.error.stopOldMaster=Call to stopOldMaster failed. New master singleton will not start.
 modcluster.error.syntax=Unrecoverable syntax error [{2}: {3}] sending command {0} to proxy {1}
-modcluster.error.unitialized=Not initialized; call init() first
\ No newline at end of file
+modcluster.error.uninitialized=Not initialized; call init() first
\ No newline at end of file

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/load/impl/DynamicLoadBalanceFactorProvider.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/load/impl/DynamicLoadBalanceFactorProvider.java	2008-08-22 17:15:13 UTC (rev 77367)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/load/impl/DynamicLoadBalanceFactorProvider.java	2008-08-22 17:50:36 UTC (rev 77368)
@@ -27,7 +27,9 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.catalina.util.StringManager;
 import org.apache.log4j.Logger;
+import org.jboss.web.tomcat.service.modcluster.Constants;
 import org.jboss.web.tomcat.service.modcluster.load.LoadBalanceFactorProvider;
 import org.jboss.web.tomcat.service.modcluster.load.metric.LoadMetric;
 import org.jboss.web.tomcat.service.modcluster.load.metric.LoadMetricSource;
@@ -41,6 +43,8 @@
 public class DynamicLoadBalanceFactorProvider implements LoadBalanceFactorProvider, LoadMetricSourceRegistration, DynamicLoadBalanceFactorProviderMBean
 {
    private final Logger log = Logger.getLogger(this.getClass());
+   private final StringManager sm = StringManager.getManager(Constants.Package);
+   
    private final Collection<LoadMetricSource> sources = new ArrayList<LoadMetricSource>();
    private final Map<LoadMetric, List<Double>> loadHistory = new HashMap<LoadMetric, List<Double>>();
    
@@ -178,7 +182,7 @@
    {
       if (decayFactor <= 0)
       {
-         throw new IllegalArgumentException("Decay factor must be greater than 0.");
+         throw new IllegalArgumentException(this.sm.getString("modcluster.error.nonPositiveAttribute", "decayFactor", String.valueOf(decayFactor)));
       }
       
       this.decayFactor = decayFactor;
@@ -201,7 +205,7 @@
    {
       if (history <= 0)
       {
-         throw new IllegalArgumentException("History must be greater than 0.");
+         throw new IllegalArgumentException(this.sm.getString("modcluster.error.nonPositiveAttribute", "history", String.valueOf(history)));
       }
       
       this.history = history;




More information about the jboss-cvs-commits mailing list