Example usage for org.apache.http.nio.reactor IOSession isClosed

List of usage examples for org.apache.http.nio.reactor IOSession isClosed

Introduction

In this page you can find the example usage for org.apache.http.nio.reactor IOSession isClosed.

Prototype

boolean isClosed();

Source Link

Document

Determines if the session has been terminated.

Usage

From source file:com.ok2c.lightmtp.impl.pool.MailIOSessionManager.java

public void releaseSession(final LeasedSession managedSession) {
    Args.notNull(managedSession, "Managed session");
    synchronized (managedSession) {
        final IOSession iosession = managedSession.getConnection();
        try {/*from   ww  w  .  j  a  va 2s .com*/
            if (!iosession.isClosed()) {
                managedSession.updateExpiry(30, TimeUnit.SECONDS);
                if (this.log.isDebugEnabled()) {
                    this.log.debug(
                            "Connection " + format(managedSession) + " can be kept alive for 30 seconds");
                }
            }
        } finally {
            this.pool.release(managedSession, !iosession.isClosed());
            if (this.log.isDebugEnabled()) {
                this.log.debug(
                        "Session released: " + format(managedSession) + formatStats(managedSession.getRoute()));
            }
        }
    }
}

From source file:org.apache.http.impl.nio.conn.HttpPoolEntry.java

@Override
public boolean isClosed() {
    final IOSession session = getConnection();
    return session.isClosed();
}

From source file:org.apache.http.impl.nio.conn.ManagedNHttpClientConnectionImpl.java

@Override
public void bind(final IOSession iosession) {
    Args.notNull(iosession, "I/O session");
    Asserts.check(!iosession.isClosed(), "I/O session is closed");
    this.status = ACTIVE;
    this.original = iosession;
    if (this.log.isDebugEnabled() || this.wirelog.isDebugEnabled()) {
        this.log.debug(this.id + " Upgrade session " + iosession);
        super.bind(new LoggingIOSession(iosession, this.id, this.log, this.wirelog));
    } else {/*from   w w w.  j  a v  a 2 s.c  o m*/
        super.bind(iosession);
    }
}