You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2015/12/04 23:42:52 UTC

[2/5] mina git commit: o Imported the code of the close() deprecated method o Stop using the deprecated close() method in MINA

o Imported the code of the close() deprecated method
o Stop using the deprecated close() method in MINA

Project: http://git-wip-us.apache.org/repos/asf/mina/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/14078181
Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/14078181
Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/14078181

Branch: refs/heads/2.0
Commit: 14078181493bc57fc93503ae693b3dbfbada7df7
Parents: 8bb2a34
Author: Emmanuel Lécharny <el...@symas.com>
Authored: Fri Dec 4 21:40:02 2015 +0100
Committer: Emmanuel Lécharny <el...@symas.com>
Committed: Fri Dec 4 21:40:02 2015 +0100

----------------------------------------------------------------------
 .../org/apache/mina/core/session/AbstractIoSession.java | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina/blob/14078181/mina-core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java
----------------------------------------------------------------------
diff --git a/mina-core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java b/mina-core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java
index f59adf2..0c3ea7a 100644
--- a/mina-core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java
+++ b/mina-core/src/main/java/org/apache/mina/core/session/AbstractIoSession.java
@@ -294,7 +294,15 @@ public abstract class AbstractIoSession implements IoSession {
     public final CloseFuture close(boolean rightNow) {
         if (!isClosing()) {
             if (rightNow) {
-                CloseFuture closeFuture = close();
+                synchronized (lock) {
+                    if (isClosing()) {
+                        return closeFuture;
+                    }
+
+                    closing = true;
+                }
+
+                getFilterChain().fireFilterClose();
 
                 return closeFuture;
             }
@@ -1359,7 +1367,7 @@ public abstract class AbstractIoSession implements IoSession {
             WriteRequest answer = queue.poll(session);
 
             if (answer == CLOSE_REQUEST) {
-                AbstractIoSession.this.close();
+                AbstractIoSession.this.close( true );
                 dispose(session);
                 answer = null;
             }