directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r330415 - in /directory/network: branches/0.8/src/java/org/apache/mina/io/ branches/0.8/src/java/org/apache/mina/io/handler/ branches/0.8/src/java/org/apache/mina/io/socket/ branches/0.8/src/java/org/apache/mina/protocol/ trunk/src/java/org...
Date Thu, 03 Nov 2005 02:19:18 GMT
Author: trustin
Date: Wed Nov  2 18:19:03 2005
New Revision: 330415

URL: http://svn.apache.org/viewcvs?rev=330415&view=rev
Log:
Resolved issue: DIRMINA-112 Get rid of printStackTrace().
* Replaced all printStackTraces with SessionLog or SLF4J Logger calls


Modified:
    directory/network/branches/0.8/src/java/org/apache/mina/io/AbstractIoFilterChain.java
    directory/network/branches/0.8/src/java/org/apache/mina/io/handler/StreamIoHandler.java
    directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
    directory/network/branches/0.8/src/java/org/apache/mina/protocol/AbstractProtocolFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/common/support/AbstractIoFilterChain.java
    directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java

Modified: directory/network/branches/0.8/src/java/org/apache/mina/io/AbstractIoFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/io/AbstractIoFilterChain.java?rev=330415&r1=330414&r2=330415&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/io/AbstractIoFilterChain.java
(original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/io/AbstractIoFilterChain.java
Wed Nov  2 18:19:03 2005
@@ -28,6 +28,7 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.io.IoFilter.NextFilter;
+import org.apache.mina.util.SessionLog;
 
 /**
  * An abstract implementation of {@link IoFilterChain} that provides
@@ -413,7 +414,9 @@
         }
         catch( Throwable e )
         {
-            e.printStackTrace();
+            SessionLog.warn(
+                    session,
+                    "Unexpected exception from exceptionCaught handler.", e );
         }
     }
     

Modified: directory/network/branches/0.8/src/java/org/apache/mina/io/handler/StreamIoHandler.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/io/handler/StreamIoHandler.java?rev=330415&r1=330414&r2=330415&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/io/handler/StreamIoHandler.java
(original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/io/handler/StreamIoHandler.java
Wed Nov  2 18:19:03 2005
@@ -11,6 +11,7 @@
 import org.apache.mina.io.IoHandler;
 import org.apache.mina.io.IoHandlerAdapter;
 import org.apache.mina.io.IoSession;
+import org.apache.mina.util.SessionLog;
 
 /**
  * A {@link IoHandler} that adapts asynchronous MINA events to stream I/O.
@@ -176,7 +177,7 @@
         }
         else
         {
-            cause.printStackTrace();
+            SessionLog.warn( session, "Unexpected exception.", cause );
             session.close();
         }
     }

Modified: directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java?rev=330415&r1=330414&r2=330415&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
(original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/io/socket/SocketIoProcessor.java
Wed Nov  2 18:19:03 2005
@@ -31,6 +31,8 @@
 import org.apache.mina.common.SessionConfig;
 import org.apache.mina.io.WriteTimeoutException;
 import org.apache.mina.util.Queue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Performs all I/O operations for sockets which is connected or bound.
@@ -41,6 +43,7 @@
  */
 class SocketIoProcessor
 {
+    private static final Logger log = LoggerFactory.getLogger( SocketIoProcessor.class );
     private static final SocketIoProcessor instance;
 
     static
@@ -557,9 +560,9 @@
                         }
                     }
                 }
-                catch( IOException e )
+                catch( Throwable t )
                 {
-                    e.printStackTrace();
+                    log.warn( "Unexpected exception.", t );
 
                     try
                     {

Modified: directory/network/branches/0.8/src/java/org/apache/mina/protocol/AbstractProtocolFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/branches/0.8/src/java/org/apache/mina/protocol/AbstractProtocolFilterChain.java?rev=330415&r1=330414&r2=330415&view=diff
==============================================================================
--- directory/network/branches/0.8/src/java/org/apache/mina/protocol/AbstractProtocolFilterChain.java
(original)
+++ directory/network/branches/0.8/src/java/org/apache/mina/protocol/AbstractProtocolFilterChain.java
Wed Nov  2 18:19:03 2005
@@ -27,6 +27,7 @@
 
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.protocol.ProtocolFilter.NextFilter;
+import org.apache.mina.util.SessionLog;
 
 /**
  * An abstract implementation of {@link ProtocolFilterChain} that provides
@@ -406,7 +407,9 @@
         }
         catch( Throwable e )
         {
-            e.printStackTrace();
+            SessionLog.warn(
+                    session,
+                    "Unexpected exception from exceptionCaught handler.", e );
         }
     }
     

Modified: directory/network/trunk/src/java/org/apache/mina/common/support/AbstractIoFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/common/support/AbstractIoFilterChain.java?rev=330415&r1=330414&r2=330415&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/common/support/AbstractIoFilterChain.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/common/support/AbstractIoFilterChain.java
Wed Nov  2 18:19:03 2005
@@ -33,8 +33,7 @@
 import org.apache.mina.common.IoFilter.NextFilter;
 import org.apache.mina.common.IoFilter.WriteRequest;
 import org.apache.mina.util.ByteBufferUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.mina.util.SessionLog;
 
 /**
  * An abstract implementation of {@link IoFilterChain} that provides
@@ -51,8 +50,6 @@
  */
 public abstract class AbstractIoFilterChain implements IoFilterChain
 {
-    private static final Logger log = LoggerFactory.getLogger( IoFilterChain.class );
-    
     private final Object parent;
 
     private final Map name2entry = new HashMap();
@@ -557,7 +554,9 @@
         }
         catch( Throwable e )
         {
-            log.warn( "Uncaught exception.", e );
+            SessionLog.warn(
+                    session,
+                    "Unexpected exception from exceptionCaught handler.", e );
         }
     }
     

Modified: directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java?rev=330415&r1=330414&r2=330415&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/codec/ProtocolCodecFilter.java
Wed Nov  2 18:19:03 2005
@@ -8,13 +8,10 @@
 import org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput;
 import org.apache.mina.filter.codec.support.SimpleProtocolEncoderOutput;
 import org.apache.mina.util.Queue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.mina.util.SessionLog;
 
 public class ProtocolCodecFilter extends IoFilterAdapter
 {
-    private static final Logger log = LoggerFactory.getLogger( ProtocolCodecFilter.class
);
-
     public static final String ENCODER = ProtocolCodecFilter.class.getName() + ".encoder";
     public static final String DECODER = ProtocolCodecFilter.class.getName() + ".decoder";
     public static final String ENCODER_OUT = ProtocolCodecFilter.class.getName() + ".encoderOutput";
@@ -206,7 +203,9 @@
         }
         catch( Throwable t )
         {
-            log.warn( "Failed to dispose: " + encoder.getClass().getName() +
+            SessionLog.warn(
+                    session,
+                    "Failed to dispose: " + encoder.getClass().getName() +
                     " (" + encoder + ')' );
         }
     }
@@ -226,7 +225,9 @@
         }
         catch( Throwable t )
         {
-            log.warn( "Falied to dispose: " + decoder.getClass().getName() +
+            SessionLog.warn(
+                    session,
+                    "Falied to dispose: " + decoder.getClass().getName() +
                     " (" + decoder + ')' );
         }
     }



Mime
View raw message