Example usage for org.apache.http.impl.nio.reactor SSLIOSession shutdown

List of usage examples for org.apache.http.impl.nio.reactor SSLIOSession shutdown

Introduction

In this page you can find the example usage for org.apache.http.impl.nio.reactor SSLIOSession shutdown.

Prototype

public void shutdown() 

Source Link

Usage

From source file:org.apache.axis2.transport.nhttp.SSLServerIOEventDispatch.java

public void timeout(final IOSession session) {
    DefaultNHttpServerConnection conn = (DefaultNHttpServerConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    this.handler.timeout(conn);
    synchronized (sslSession) {
        if (sslSession.isOutboundDone() && !sslSession.isInboundDone()) {
            // The session failed to terminate cleanly
            sslSession.shutdown();
        }/*from  ww w.j a v a  2s.  c o  m*/
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLClientIOEventDispatch.java

public void timeout(final IOSession session) {
    DefaultNHttpClientConnection conn = (DefaultNHttpClientConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    this.handler.timeout(conn);
    synchronized (sslSession) {
        if (sslSession.isOutboundDone() && !sslSession.isInboundDone()) {
            // The session failed to terminate cleanly
            sslSession.shutdown();
        }//  w  w  w.j a  v  a2 s  .c  o m
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLServerIOEventDispatch.java

public void inputReady(final IOSession session) {
    DefaultNHttpServerConnection conn = (DefaultNHttpServerConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    try {/*from w ww .  ja  va2 s.  c  o m*/
        synchronized (sslSession) {
            if (sslSession.isAppInputReady()) {
                conn.consumeInput(this.handler);
            }
            sslSession.inboundTransport();
        }
    } catch (IOException ex) {
        this.handler.exception(conn, ex);
        sslSession.shutdown();
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLServerIOEventDispatch.java

public void outputReady(final IOSession session) {
    DefaultNHttpServerConnection conn = (DefaultNHttpServerConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    try {//from  w w w  .  j a  va 2s. c  om
        synchronized (sslSession) {
            if (sslSession.isAppOutputReady()) {
                conn.produceOutput(this.handler);
            }
            sslSession.outboundTransport();
        }
    } catch (IOException ex) {
        this.handler.exception(conn, ex);
        sslSession.shutdown();
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLClientIOEventDispatch.java

public void inputReady(final IOSession session) {
    DefaultNHttpClientConnection conn = (DefaultNHttpClientConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    try {//w w  w.j  a  v  a2s.com
        synchronized (sslSession) {
            while (sslSession.isAppInputReady()) {
                conn.consumeInput(this.handler);
            }
            sslSession.inboundTransport();
        }
    } catch (IOException ex) {
        this.handler.exception(conn, ex);
        sslSession.shutdown();
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLClientIOEventDispatch.java

public void outputReady(final IOSession session) {
    DefaultNHttpClientConnection conn = (DefaultNHttpClientConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    try {/* ww w  . ja va2  s  .  c o m*/
        synchronized (sslSession) {
            if (sslSession.isAppOutputReady()) {
                conn.produceOutput(this.handler);
            }
            sslSession.outboundTransport();
        }
    } catch (IOException ex) {
        this.handler.exception(conn, ex);
        sslSession.shutdown();
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLServerIOEventDispatch.java

public void connected(final IOSession session) {

    SSLIOSession sslSession = new SSLIOSession(session, this.sslcontext, this.sslHandler);

    LoggingNHttpServerConnection conn = new LoggingNHttpServerConnection(new LoggingIOSession(sslSession),
            new DefaultHttpRequestFactory(), new HeapByteBufferAllocator(), this.params);

    session.setAttribute(NHTTP_CONN, conn);
    session.setAttribute(SSL_SESSION, sslSession);

    this.handler.connected(conn);

    try {//from   w  ww  .j a  va  2  s  . c  o m
        sslSession.bind(SSLMode.SERVER, this.params);
    } catch (SSLException ex) {
        this.handler.exception(conn, ex);
        sslSession.shutdown();
    }
}

From source file:org.apache.axis2.transport.nhttp.SSLClientIOEventDispatch.java

public void connected(final IOSession session) {

    SSLIOSession sslSession = new SSLIOSession(session, this.sslcontext, this.sslHandler);

    LoggingNHttpClientConnection conn = new LoggingNHttpClientConnection(new LoggingIOSession(sslSession),
            new DefaultHttpResponseFactory(), new HeapByteBufferAllocator(), this.params);

    session.setAttribute(NHTTP_CONN, conn);
    session.setAttribute(SSL_SESSION, sslSession);

    Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
    this.handler.connected(conn, attachment);

    try {/*from  w  w w  . j av  a2 s  .  com*/
        sslSession.bind(SSLMode.CLIENT, this.params);
    } catch (SSLException ex) {
        this.handler.exception(conn, ex);
        sslSession.shutdown();
    }
}