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

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

Introduction

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

Prototype

Object getAttribute(String name);

Source Link

Document

Returns the value of the attribute with the given name.

Usage

From source file:org.wso2.carbon.inbound.endpoint.protocol.hl7.core.MLLPSourceHandler.java

@Override
public void connected(IOSession session) {
    if (session.getAttribute(MLLPConstants.MLLP_CONTEXT) == null) {
        session.setAttribute(MLLPConstants.MLLP_CONTEXT,
                MLLPContextFactory.createMLLPContext(session, hl7Processor));
    }/*from   w  w  w  . j  a  va2  s  . co  m*/

    inputBuffer = bufferFactory.getBuffer();
    outputBuffer = bufferFactory.getBuffer();
}

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

public void disconnected(final IOSession session) {
    DefaultNHttpClientConnection conn = (DefaultNHttpClientConnection) session.getAttribute(NHTTP_CONN);

    this.handler.closed(conn);
}

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  w  w  w . ja v a2 s .  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();/*from   ww  w .ja v a 2s  .  c  om*/
        }
    }
}

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 .  j av  a2 s .  c om
        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 {//ww  w .  j  a  va 2s.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.SSLClientIOEventDispatch.java

public void inputReady(final IOSession session) {
    DefaultNHttpClientConnection conn = (DefaultNHttpClientConnection) session.getAttribute(NHTTP_CONN);
    SSLIOSession sslSession = (SSLIOSession) session.getAttribute(SSL_SESSION);
    try {//from  w  ww  . j a va  2 s .  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 v  a  2  s.co  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.wso2.carbon.inbound.endpoint.protocol.hl7.core.MLLPSourceHandler.java

@Override
public void outputReady(IOSession session) {
    MLLPContext mllpContext = (MLLPContext) session.getAttribute(MLLPConstants.MLLP_CONTEXT);
    writeOut(session, mllpContext);//from w  w  w  .  ja  v  a2  s . c om
}

From source file:org.wso2.carbon.inbound.endpoint.protocol.hl7.core.MLLPSourceHandler.java

@Override
public void timeout(IOSession session) {
    MLLPContext mllpContext = (MLLPContext) session.getAttribute(MLLPConstants.MLLP_CONTEXT);
    shutdownConnection(session, mllpContext, null);
}