Search in sources :

Example 6 with ListeningIOReactor

use of org.apache.http.nio.reactor.ListeningIOReactor in project wso2-synapse by wso2.

the class PassThroughListeningIOReactorManager method pauseIOReactor.

/**
 * 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
 */
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);
    }
}
Also used : ServerIODispatch(org.apache.synapse.transport.passthru.ServerIODispatch) MultiListenerSSLServerIODispatch(org.apache.synapse.transport.passthru.core.ssl.MultiListenerSSLServerIODispatch) ListeningIOReactor(org.apache.http.nio.reactor.ListeningIOReactor) DefaultListeningIOReactor(org.apache.http.impl.nio.reactor.DefaultListeningIOReactor) MultiListenerSSLServerIODispatch(org.apache.synapse.transport.passthru.core.ssl.MultiListenerSSLServerIODispatch)

Aggregations

DefaultListeningIOReactor (org.apache.http.impl.nio.reactor.DefaultListeningIOReactor)6 ListeningIOReactor (org.apache.http.nio.reactor.ListeningIOReactor)6 IOException (java.io.IOException)3 ServerIODispatch (org.apache.synapse.transport.passthru.ServerIODispatch)3 MultiListenerSSLServerIODispatch (org.apache.synapse.transport.passthru.core.ssl.MultiListenerSSLServerIODispatch)3 IOReactorException (org.apache.http.nio.reactor.IOReactorException)2 InetSocketAddress (java.net.InetSocketAddress)1 ListenerEndpoint (org.apache.http.nio.reactor.ListenerEndpoint)1