directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r371789 - in /directory: sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/ sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/ sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/trans...
Date Tue, 24 Jan 2006 03:39:19 GMT
Author: trustin
Date: Mon Jan 23 19:39:06 2006
New Revision: 371789

URL: http://svn.apache.org/viewcvs?rev=371789&view=rev
Log:
Resolved issue: DIRMINA-143 (SocketAcceptor.bind() should fillInStackTrace() before rethrowing
exception)
* Removed ExceptionUtils
* Wrapped thrown exceptions from other threads


Removed:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/util/ExceptionUtil.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/util/ExceptionUtil.java
Modified:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/ConnectFuture.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeSession.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/common/ConnectFuture.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/ConnectFuture.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/ConnectFuture.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/ConnectFuture.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/ConnectFuture.java
Mon Jan 23 19:39:06 2006
@@ -20,8 +20,6 @@
 
 import java.io.IOException;
 
-import org.apache.mina.util.ExceptionUtil;
-
 /**
  * An {@link IoFuture} for asynchronous connect requests.
  *
@@ -72,8 +70,7 @@
         Object v = getValue();
         if( v instanceof Throwable )
         {
-            ExceptionUtil.throwException( ( Throwable ) v );
-            throw new InternalError(); // this cannot be executed
+            throw ( IOException ) new IOException( "Failed to get the session." ).initCause(
( Throwable ) v );
         }
         else
         {

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
Mon Jan 23 19:39:06 2006
@@ -39,7 +39,6 @@
 import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.common.IoFilter.WriteRequest;
 import org.apache.mina.common.IoServiceProvider.IoAcceptor;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -97,7 +96,7 @@
         
         if( request.exception != null )
         {
-            ExceptionUtil.throwException( request.exception );
+            throw ( IOException ) new IOException( "Failed to bind" ).initCause( request.exception
);
         }
     }
 
@@ -143,8 +142,7 @@
         
         if( request.exception != null )
         {
-            request.exception.fillInStackTrace();
-            throw request.exception;
+            throw new RuntimeIOException( "Failed to unbind" , request.exception );
         }
     }
     

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
Mon Jan 23 19:39:06 2006
@@ -40,8 +40,8 @@
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoService;
 import org.apache.mina.common.IoSession;
+import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.common.IoServiceProvider.IoAcceptor;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -110,7 +110,7 @@
         
         if( request.exception != null )
         {
-            ExceptionUtil.throwException( request.exception );
+            throw ( IOException ) new IOException( "Failed to bind." ).initCause( request.exception
);
         }
     }
 
@@ -186,9 +186,7 @@
         
         if( request.exception != null )
         {
-            request.exception.fillInStackTrace();
-
-            throw request.exception;
+            throw new RuntimeIOException( "Failed to unbind.", request.exception );
         }
         
         // Disconnect all clients

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
Mon Jan 23 19:39:06 2006
@@ -36,7 +36,6 @@
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.IoService;
 import org.apache.mina.common.IoServiceProvider.IoConnector;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -313,7 +312,7 @@
         }
         catch( Throwable e )
         {
-            ExceptionUtil.throwException( e );
+            throw ( IOException ) new IOException( "Failed to create a session." ).initCause(
e );
         }
         session.getManagedSessions().add( session );
         session.getIoProcessor().addNew( session );

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeSession.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeSession.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeSession.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeSession.java
Mon Jan 23 19:39:06 2006
@@ -33,7 +33,6 @@
 import org.apache.mina.common.support.BaseIoSession;
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -93,7 +92,7 @@
         }
         catch( Throwable t )
         {
-            ExceptionUtil.throwException( t );
+            throw ( IOException ) new IOException( "Failed to create a session." ).initCause(
t );
         }
 
         VmPipeIdleStatusChecker.getInstance().addSession( remoteSession );

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/ConnectFuture.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/ConnectFuture.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/ConnectFuture.java (original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/ConnectFuture.java Mon
Jan 23 19:39:06 2006
@@ -20,8 +20,6 @@
 
 import java.io.IOException;
 
-import org.apache.mina.util.ExceptionUtil;
-
 /**
  * An {@link IoFuture} for asynchronous connect requests.
  *
@@ -72,8 +70,7 @@
         Object v = getValue();
         if( v instanceof Throwable )
         {
-            ExceptionUtil.throwException( ( Throwable ) v );
-            throw new InternalError(); // this cannot be executed
+            throw ( IOException ) new IOException( "Failed to get the session." ).initCause(
( Throwable ) v );
         }
         else
         {

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
Mon Jan 23 19:39:06 2006
@@ -37,7 +37,6 @@
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.IoFilter.WriteRequest;
 import org.apache.mina.common.support.BaseIoAcceptor;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -118,7 +117,7 @@
         
         if( request.exception != null )
         {
-            ExceptionUtil.throwException( request.exception );
+            throw ( IOException ) new IOException( "Failed to bind" ).initCause( request.exception
);
         }
     }
 
@@ -167,8 +166,7 @@
         
         if( request.exception != null )
         {
-            request.exception.fillInStackTrace();
-            throw request.exception;
+            throw new RuntimeException( "Failed to unbind" , request.exception );
         }
     }
     

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketConnectorDelegate.java
Mon Jan 23 19:39:06 2006
@@ -37,7 +37,6 @@
 import org.apache.mina.common.IoHandler;
 import org.apache.mina.common.support.BaseIoConnector;
 import org.apache.mina.transport.socket.nio.SocketSessionManager;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -282,7 +281,7 @@
         }
         catch( Throwable e )
         {
-            ExceptionUtil.throwException( e );
+            throw ( IOException ) new IOException( "Failed to create a session." ).initCause(
e );
         }
         session.getManagedSessions().add( session );
         session.getIoProcessor().addNew( session );

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java?rev=371789&r1=371788&r2=371789&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeSessionImpl.java
Mon Jan 23 19:39:06 2006
@@ -20,7 +20,6 @@
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
 import org.apache.mina.transport.vmpipe.VmPipeSession;
-import org.apache.mina.util.ExceptionUtil;
 import org.apache.mina.util.Queue;
 
 /**
@@ -84,7 +83,7 @@
         }
         catch( Throwable t )
         {
-            ExceptionUtil.throwException( t );
+            throw ( IOException ) new IOException( "Failed to create a session." ).initCause(
t );
         }
 
         VmPipeIdleStatusChecker.getInstance().addSession( remoteSession );



Mime
View raw message