Example usage for org.apache.http.nio.reactor ListeningIOReactor pause

List of usage examples for org.apache.http.nio.reactor ListeningIOReactor pause

Introduction

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

Prototype

void pause() throws IOException;

Source Link

Document

Suspends the I/O reactor preventing it from accepting new connections on all active endpoints.

Usage

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

/**
 * Pause IO Reactor which is registered by HTTPListener running on given port
 *
 * @param port Port of  axis2 PTT Listener
 * @throws IOException Exception throwing when pausing
 *///w w w . j a  v  a  2 s .  com
public void pauseIOReactor(int port) throws IOException {
    ListeningIOReactor listeningIOReactor = passThroughListenerIOReactorMapper.get(port);
    ServerIODispatch serverIODispatch = passThroughListenerServerIODispatchMapper.get(port);
    if (listeningIOReactor != null) {
        if (serverIODispatch instanceof MultiListenerServerIODispatch
                || serverIODispatch instanceof MultiListenerSSLServerIODispatch) {
            log.info("Pausing shared IO Reactor bind for port " + port + " will be caused for pausing non "
                    + "axis2 Listeners ");
        } else {
            log.info("Pausing  IO Reactor bind for port " + port);
        }
        listeningIOReactor.pause();
    } else {
        log.error("Cannot find Pass Through Listener for port " + port);
    }
}