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

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

Introduction

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

Prototype

void shutdown(long waitMs) throws IOException;

Source Link

Document

Initiates shutdown of the reactor and blocks approximately for the given period of time in milliseconds waiting for the reactor to terminate all active connections, to shut down itself and to release system resources it currently holds.

Usage

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

/**
 * ShutdownIOReactor which is registered by HTTPListener running on given port
 *
 * @param port        Port of  axis2 PTT Listener
 * @param miliSeconds Waiting Time before close IO Reactor
 * @throws IOException Exception throwing when Shutdown
 *///from   ww  w.j a  v a2 s.  c  o  m
public void shutdownIOReactor(int port, long miliSeconds) throws IOException {
    ListeningIOReactor ioReactor = shutdownReactor(port);
    if (ioReactor != null) {
        try {
            ioReactor.shutdown(miliSeconds);
        } catch (IOException e) {
            throw new IOException(
                    "IOException occurred when shutting down IOReactor for Listener started on port " + port,
                    e);
        }
        passThroughListenerIOReactorMapper.remove(port);
        passThroughListenerServerIODispatchMapper.remove(port);
    }
}