Example usage for org.apache.http.nio NHttpServerEventHandler exception

List of usage examples for org.apache.http.nio NHttpServerEventHandler exception

Introduction

In this page you can find the example usage for org.apache.http.nio NHttpServerEventHandler exception.

Prototype

void exception(NHttpServerConnection conn, Exception ex);

Source Link

Document

Triggered if an error occurs during the HTTP exchange.

Usage

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onException(final DefaultNHttpServerConnection defaultNHttpServerConnection, IOException e) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {//  w  w  w. j  a v a 2 s . c  o  m
        handler.exception(defaultNHttpServerConnection, e);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onClosed(final DefaultNHttpServerConnection defaultNHttpServerConnection) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {// www.  j a v  a  2 s  .  c  om
        handler.closed(defaultNHttpServerConnection);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onTimeout(final DefaultNHttpServerConnection defaultNHttpServerConnection) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {/*from ww w . j av  a  2 s  .c  o m*/
        handler.timeout(defaultNHttpServerConnection);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onConnected(final DefaultNHttpServerConnection defaultNHttpServerConnection) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {// w  w w  .  j  a  va  2  s.co m
        handler.connected(defaultNHttpServerConnection);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onInputReady(final DefaultNHttpServerConnection defaultNHttpServerConnection) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {//from w  ww. ja v  a2  s  . c o m
        defaultNHttpServerConnection.consumeInput(handler);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}

From source file:org.apache.synapse.transport.passthru.core.MultiListenerServerIODispatch.java

@Override
protected void onOutputReady(final DefaultNHttpServerConnection defaultNHttpServerConnection) {
    int localPort = defaultNHttpServerConnection.getLocalPort();
    NHttpServerEventHandler handler = handlers.get(localPort);
    try {/*from  ww w.j  av  a 2 s.c  om*/
        defaultNHttpServerConnection.produceOutput(handler);
    } catch (final Exception ex) {
        handler.exception(defaultNHttpServerConnection, ex);
    }
}