directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r385248 - in /directory/trunks/mina/core/src/main/java/org/apache/mina: common/IoFuture.java common/support/AbstractIoFilterChain.java transport/socket/nio/support/SocketIoProcessor.java transport/vmpipe/support/VmPipeFilterChain.java
Date Sun, 12 Mar 2006 05:13:07 GMT
Author: trustin
Date: Sat Mar 11 21:13:05 2006
New Revision: 385248

URL: http://svn.apache.org/viewcvs?rev=385248&view=rev
Log:
* Made sure IoFuture.setValue() calls callback only once
* AbstractIoFilterChain.sessionClosed() calls CloseFuture.setClosed() automatically.

Modified:
    directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoFuture.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeFilterChain.java

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoFuture.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoFuture.java?rev=385248&r1=385247&r2=385248&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoFuture.java (original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoFuture.java Sat Mar
11 21:13:05 2006
@@ -160,6 +160,12 @@
     {
         synchronized( lock )
         {
+            // Allow only once.
+            if( ready )
+            {
+                return;
+            }
+
             result = newValue;
             ready = true;
             lock.notifyAll();

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java?rev=385248&r1=385247&r2=385248&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/AbstractIoFilterChain.java
Sat Mar 11 21:13:05 2006
@@ -440,6 +440,17 @@
 
     public void sessionClosed( IoSession session )
     {
+        // Update future.
+        try
+        {
+            session.getCloseFuture().setClosed();
+        }
+        catch( Throwable t )
+        {
+            exceptionCaught( session, t );
+        }
+        
+        // And start the chain.
         Entry head = this.head;
         callNextSessionClosed(head, session);
     }

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java?rev=385248&r1=385247&r2=385248&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/SocketIoProcessor.java
Sat Mar 11 21:13:05 2006
@@ -248,7 +248,6 @@
                 session.getManagedSessions().remove( session );
 
                 ( ( SocketFilterChain ) session.getFilterChain() ).sessionClosed( session
);
-                session.getCloseFuture().setClosed();
             }
         }
     }

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeFilterChain.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeFilterChain.java?rev=385248&r1=385247&r2=385248&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeFilterChain.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeFilterChain.java
Sat Mar 11 21:13:05 2006
@@ -97,7 +97,6 @@
             {
                 s.getManagedSessions().remove( s );
                 ( ( VmPipeFilterChain ) s.getFilterChain() ).sessionClosed( session );
-                session.getCloseFuture().setClosed();
                 s.remoteSession.close();
             }
         }



Mime
View raw message