You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/08/07 21:06:06 UTC

svn commit: r1370433 - /tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java

Author: markt
Date: Tue Aug  7 19:06:06 2012
New Revision: 1370433

URL: http://svn.apache.org/viewvc?rev=1370433&view=rev
Log:
i18n and fix unused StringManager instance

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java?rev=1370433&r1=1370432&r2=1370433&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java Tue Aug  7 19:06:06 2012
@@ -80,7 +80,7 @@ public class NioReceiver extends Receive
         try {
             setPool(new RxTaskPool(getMaxThreads(),getMinThreads(),this));
         } catch (Exception x) {
-            log.fatal("ThreadPool can initilzed. Listener not started", x);
+            log.fatal(sm.getString("NioReceiver.threadpool.fail"), x);
             if ( x instanceof IOException ) throw (IOException)x;
             else throw new IOException(x.getMessage());
         }
@@ -91,7 +91,7 @@ public class NioReceiver extends Receive
             t.setDaemon(true);
             t.start();
         } catch (Exception x) {
-            log.fatal("Unable to start cluster receiver", x);
+            log.fatal(sm.getString("NioReceiver.start.fail"), x);
             if ( x instanceof IOException ) throw (IOException)x;
             else throw new IOException(x.getMessage());
         }
@@ -214,7 +214,12 @@ public class NioReceiver extends Receive
                         long delta = now - ka.getLastAccess();
                         if (delta > getTimeout() && (!ka.isAccessed())) {
                             if (log.isWarnEnabled())
-                                log.warn("Channel key is registered, but has had no interest ops for the last "+getTimeout()+" ms. (cancelled:"+ka.isCancelled()+"):"+key+" last access:"+new java.sql.Timestamp(ka.getLastAccess())+" Possible cause: all threads used, perform thread dump");
+                                log.warn(sm.getString(
+                                        "NioReceiver.threadsExhausted",
+                                        Integer.valueOf(getTimeout()),
+                                        Boolean.valueOf(ka.isCancelled()),
+                                        key,
+                                        new java.sql.Timestamp(ka.getLastAccess())));
                             ka.setLastAccess(now);
                             //key.interestOps(SelectionKey.OP_READ);
                         }//end if
@@ -238,7 +243,7 @@ public class NioReceiver extends Receive
      */
     protected void listen() throws Exception {
         if (doListen()) {
-            log.warn("ServerSocketChannel already started");
+            log.warn(sm.getString("NioReceiver.alreadyStarted"));
             return;
         }
 
@@ -308,7 +313,7 @@ public class NioReceiver extends Receive
             } catch (java.nio.channels.ClosedSelectorException cse) {
                 // ignore is normal at shutdown or stop listen socket
             } catch (java.nio.channels.CancelledKeyException nx) {
-                log.warn("Replication client disconnected, error when polling key. Ignoring client.");
+                log.warn(sm.getString("NioReceiver.clientDisconnect"));
             } catch (Throwable t) {
                 if (t instanceof ThreadDeath) {
                     throw (ThreadDeath) t;
@@ -316,7 +321,7 @@ public class NioReceiver extends Receive
                 if (t instanceof VirtualMachineError) {
                     throw (VirtualMachineError) t;
                 }
-                log.error("Unable to process request in NioReceiver", t);
+                log.error(sm.getString("NioReceiver.requestError"), t);
             }
 
         }
@@ -346,7 +351,7 @@ public class NioReceiver extends Receive
                 selector.wakeup();
                 closeSelector();
             } catch (Exception x) {
-                log.error("Unable to close cluster receiver selector.", x);
+                log.error(sm.getString("NioReceiver.stop.fail"), x);
             } finally {
                 selector = null;
             }
@@ -368,7 +373,7 @@ public class NioReceiver extends Receive
             }
         }catch ( IOException ignore ){
             if (log.isWarnEnabled()) {
-                log.warn("Unable to cleanup on selector close.",ignore);
+                log.warn(sm.getString("NioReceiver.cleanup.fail"), ignore);
             }
         }catch ( ClosedSelectorException ignore){}
         selector.close();
@@ -399,7 +404,7 @@ public class NioReceiver extends Receive
         try {
             listen();
         } catch (Exception x) {
-            log.error("Unable to run replication listener.", x);
+            log.error(sm.getString("NioReceiver.run.fail"), x);
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org