tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r995576 - in /tomcat/trunk/java/org/apache/tomcat/util/net: AbstractEndpoint.java AprEndpoint.java JIoEndpoint.java NioEndpoint.java
Date Thu, 09 Sep 2010 21:07:37 GMT
Author: markt
Date: Thu Sep  9 21:07:37 2010
New Revision: 995576

URL: http://svn.apache.org/viewvc?rev=995576&view=rev
Log:
Refactor log messages to use logger from concrete class

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=995576&r1=995575&r2=995576&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Thu Sep  9 21:07:37
2010
@@ -42,7 +42,6 @@ import org.apache.tomcat.util.threads.Th
  * @author Remy Maucherat
  */
 public abstract class AbstractEndpoint {
-    private static final Log log = LogFactory.getLog(AbstractEndpoint.class);
     
     // -------------------------------------------------------------- Constants
     protected static final StringManager sm = StringManager.getManager("org.apache.tomcat.util.net.res");
@@ -318,7 +317,7 @@ public abstract class AbstractEndpoint {
                 return IntrospectionUtils.setProperty(this,name,value,false);
             }
         }catch ( Exception x ) {
-            log.error("Unable to set attribute \""+name+"\" to \""+value+"\"",x);
+            getLog().error("Unable to set attribute \""+name+"\" to \""+value+"\"",x);
             return false;
         }
     }
@@ -408,16 +407,16 @@ public abstract class AbstractEndpoint {
             s.setSoTimeout(getSocketProperties().getSoTimeout());
             // TODO Consider hard-coding to s.setSoLinger(true,0)
             s.setSoLinger(getSocketProperties().getSoLingerOn(),getSocketProperties().getSoLingerTime());
-            if (log.isDebugEnabled()) {
-                log.debug("About to unlock socket for:"+saddr);
+            if (getLog().isDebugEnabled()) {
+                getLog().debug("About to unlock socket for:"+saddr);
             }
             s.connect(saddr,getSocketProperties().getUnlockTimeout());
-            if (log.isDebugEnabled()) {
-                log.debug("Socket unlock completed for:"+saddr);
+            if (getLog().isDebugEnabled()) {
+                getLog().debug("Socket unlock completed for:"+saddr);
             }
         } catch(Exception e) {
-            if (log.isDebugEnabled()) {
-                log.debug(sm.getString("endpoint.debug.unlock", "" + getPort()), e);
+            if (getLog().isDebugEnabled()) {
+                getLog().debug(sm.getString("endpoint.debug.unlock", "" + getPort()), e);
             }
         } finally {
             if (s != null) {
@@ -470,7 +469,7 @@ public abstract class AbstractEndpoint {
             f = new File(path);
         }
         if (!f.exists()) {
-            log.warn("configured file:["+path+"] does not exist.");
+            getLog().warn("configured file:["+path+"] does not exist.");
         }
         return path;
     }
@@ -480,6 +479,8 @@ public abstract class AbstractEndpoint {
         return val;
     }
     
+    protected abstract Log getLog();
+
     // --------------------  SSL related properties --------------------
 
     private String algorithm = KeyManagerFactory.getDefaultAlgorithm();

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=995576&r1=995575&r2=995576&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Thu Sep  9 21:07:37 2010
@@ -887,6 +887,11 @@ public class AprEndpoint extends Abstrac
         }
     }
 
+    @Override
+    protected Log getLog() {
+        return log;
+    }
+
     // --------------------------------------------------- Acceptor Inner Class
 
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=995576&r1=995575&r2=995576&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Thu Sep  9 21:07:37 2010
@@ -538,6 +538,11 @@ public class JIoEndpoint extends Abstrac
     protected ConcurrentLinkedQueue<SocketWrapper<Socket>> waitingRequests =
         new ConcurrentLinkedQueue<SocketWrapper<Socket>>();
 
+    @Override
+    protected Log getLog() {
+        return log;
+    }
+
     private static class PrivilegedSetTccl implements PrivilegedAction<Void> {
 
         private ClassLoader cl;

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=995576&r1=995575&r2=995576&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Thu Sep  9 21:07:37 2010
@@ -747,6 +747,10 @@ public class NioEndpoint extends Abstrac
         return true;
     }
 
+    @Override
+    protected Log getLog() {
+        return log;
+    }
 
     // --------------------------------------------------- Acceptor Inner Class
 



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


Mime
View raw message