Author: kfujino Date: Thu May 21 09:57:47 2015 New Revision: 1680796 URL: http://svn.apache.org/r1680796 Log: Use StringManager to provide i18n support in the org.apache.catalina.tribes.transport.bio.util package.
Added: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/LocalStrings.properties (with props) Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/FastQueue.java Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/FastQueue.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/FastQueue.java?rev=1680796&r1=1680795&r2=1680796&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/FastQueue.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/FastQueue.java Thu May 21 09:57:47 2015 @@ -22,6 +22,7 @@ import java.util.concurrent.atomic.Atomi import org.apache.catalina.tribes.ChannelMessage; import org.apache.catalina.tribes.Member; import org.apache.catalina.tribes.group.InterceptorPayload; +import org.apache.catalina.tribes.util.StringManager; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -31,12 +32,12 @@ import org.apache.juli.logging.LogFactor * A fast queue that remover thread lock the adder thread. <br>Limit the queue * length when you have strange producer thread problems. * - * FIXME add i18n support to log messages * @author Peter Rossbach */ public class FastQueue { private static final Log log = LogFactory.getLog(FastQueue.class); + protected static final StringManager sm = StringManager.getManager(FastQueue.class); /** * This is the actual queue @@ -197,7 +198,7 @@ public class FastQueue { if (!enabled) { if (log.isInfoEnabled()) - log.info("FastQueue.add: queue disabled, add aborted"); + log.info(sm.getString("fastQueue.queue.disabled")); return false; } @@ -220,7 +221,7 @@ public class FastQueue { } else { if (last == null) { ok = false; - log.error("FastQueue.add: Could not add, since last is null although size is "+ size.get() + " (>0)"); + log.error(sm.getString("fastQueue.last.null", size.get())); } else { last.append(element); last = element; @@ -230,10 +231,10 @@ public class FastQueue { } if (first == null) { - log.error("FastQueue.add: first is null, size is " + size.get() + " at end of add"); + log.error(sm.getString("fastQueue.first.null", size.get())); } if (last == null) { - log.error("FastQueue.add: last is null, size is " + size.get() + " at end of add"); + log.error(sm.getString("fastQueue.last.null.end", size.get())); } if (log.isTraceEnabled()) log.trace("FastQueue.add: add ending with size " + size.get()); @@ -254,7 +255,7 @@ public class FastQueue { if (!enabled) { if (log.isInfoEnabled()) - log.info("FastQueue.remove: queue disabled, remove aborted"); + log.info(sm.getString("fastQueue.remove.queue.disabled")); return null; } @@ -264,10 +265,10 @@ public class FastQueue { if (!gotLock) { if (enabled) { if (log.isInfoEnabled()) - log.info("FastQueue.remove: Remove aborted although queue enabled"); + log.info(sm.getString("fastQueue.remove.aborted")); } else { if (log.isInfoEnabled()) - log.info("FastQueue.remove: queue disabled, remove aborted"); + log.info(sm.getString("fastQueue.remove.queue.disabled")); } return null; } Added: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/LocalStrings.properties?rev=1680796&view=auto ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/LocalStrings.properties (added) +++ tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/LocalStrings.properties Thu May 21 09:57:47 2015 @@ -0,0 +1,21 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +fastQueue.queue.disabled=FastQueue.add: queue disabled, add aborted +fastQueue.last.null=FastQueue.add: Could not add, since last is null although size is {0} (>0) +fastQueue.first.null=FastQueue.add: first is null, size is {0} at end of add +fastQueue.last.null.end=FastQueue.add: last is null, size is {0} at end of add +fastQueue.remove.queue.disabled=FastQueue.remove: queue disabled, remove aborted +fastQueue.remove.aborted=FastQueue.remove: Remove aborted although queue enabled \ No newline at end of file Propchange: tomcat/trunk/java/org/apache/catalina/tribes/transport/bio/util/LocalStrings.properties ------------------------------------------------------------------------------ svn:eol-style = native --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org