Repository: mina Updated Branches: refs/heads/2.0 d5393beec -> e81c0eb01
Returning the CloseFuture when doing a close() Project: http://git-wip-us.apache.org/repos/asf/mina/repo Commit: http://git-wip-us.apache.org/repos/asf/mina/commit/41d11b96 Tree: http://git-wip-us.apache.org/repos/asf/mina/tree/41d11b96 Diff: http://git-wip-us.apache.org/repos/asf/mina/diff/41d11b96 Branch: refs/heads/2.0 Commit: 41d11b96331cc792111e9de777d170f72c1f1153 Parents: 0aea087 Author: Emmanuel Lécharny <[email protected]> Authored: Thu Jan 8 18:56:21 2015 +0100 Committer: Emmanuel Lécharny <[email protected]> Committed: Thu Jan 8 18:56:21 2015 +0100 ---------------------------------------------------------------------- .../mina/core/session/AbstractIoSession.java | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mina/blob/41d11b96/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 8c06e73..f59adf2 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 @@ -59,7 +59,7 @@ import org.apache.mina.util.ExceptionMonitor; /** * Base implementation of {@link IoSession}. - * + * * @author <a href="http://mina.apache.org">Apache MINA Project</a> */ public abstract class AbstractIoSession implements IoSession { @@ -92,7 +92,7 @@ public abstract class AbstractIoSession implements IoSession { /** * An internal write request object that triggers session close. - * + * * @see #writeRequestQueue */ private static final WriteRequest CLOSE_REQUEST = new DefaultWriteRequest(new Object()); @@ -203,7 +203,7 @@ public abstract class AbstractIoSession implements IoSession { /** * {@inheritDoc} - * + * * We use an AtomicLong to guarantee that the session ID are unique. */ public final long getId() { @@ -270,7 +270,7 @@ public abstract class AbstractIoSession implements IoSession { /** * Set the scheduledForFLush flag. As we may have concurrent access to this * flag, we compare and set it in one call. - * + * * @param schedule * the new value to set if not already set. * @return true if the session flag has been set, and if it wasn't set @@ -294,7 +294,9 @@ public abstract class AbstractIoSession implements IoSession { public final CloseFuture close(boolean rightNow) { if (!isClosing()) { if (rightNow) { - return close(); + CloseFuture closeFuture = close(); + + return closeFuture; } return closeOnFlush(); @@ -630,7 +632,7 @@ public abstract class AbstractIoSession implements IoSession { /** * Create a new close aware write queue, based on the given write queue. - * + * * @param writeRequestQueue * The write request queue */ @@ -1275,7 +1277,7 @@ public abstract class AbstractIoSession implements IoSession { /** * Fires a {@link IoEventType#SESSION_IDLE} event to any applicable sessions * in the specified collection. - * + * * @param currentTime * the current time (i.e. {@link System#currentTimeMillis()}) */ @@ -1290,7 +1292,7 @@ public abstract class AbstractIoSession implements IoSession { /** * Fires a {@link IoEventType#SESSION_IDLE} event if applicable for the * specified {@code session}. - * + * * @param currentTime * the current time (i.e. {@link System#currentTimeMillis()}) */ @@ -1335,7 +1337,7 @@ public abstract class AbstractIoSession implements IoSession { /** * A queue which handles the CLOSE request. - * + * * TODO : Check that when closing a session, all the pending requests are * correctly sent. */
