Stop the endpoint. This will cause all processing threads to stop.
()
| 387 | * Stop the endpoint. This will cause all processing threads to stop. |
| 388 | */ |
| 389 | @Override |
| 390 | public void stopInternal() { |
| 391 | if (!paused) { |
| 392 | pause(); |
| 393 | } |
| 394 | if (running) { |
| 395 | running = false; |
| 396 | /* |
| 397 | * Need to wait for the acceptor to unlock but not too long. 100ms plus twice the unlock timeout should be |
| 398 | * plenty of time for the acceptor to unlock without being an excessively long wait if the unlock fails. |
| 399 | */ |
| 400 | int acceptorWaitMilliSeconds = 100 + 2 * getSocketProperties().getUnlockTimeout(); |
| 401 | acceptor.stopMillis(acceptorWaitMilliSeconds); |
| 402 | if (poller != null) { |
| 403 | poller.destroy(); |
| 404 | poller = null; |
| 405 | } |
| 406 | try { |
| 407 | if (!getStopLatch().await(selectorTimeout + 100, TimeUnit.MILLISECONDS)) { |
| 408 | log.warn(sm.getString("endpoint.nio.stopLatchAwaitFail")); |
| 409 | } |
| 410 | } catch (InterruptedException e) { |
| 411 | log.warn(sm.getString("endpoint.nio.stopLatchAwaitInterrupted"), e); |
| 412 | } |
| 413 | shutdownExecutor(); |
| 414 | if (eventCache != null) { |
| 415 | eventCache.clear(); |
| 416 | eventCache = null; |
| 417 | } |
| 418 | if (nioChannels != null) { |
| 419 | NioChannel socket; |
| 420 | while ((socket = nioChannels.pop()) != null) { |
| 421 | socket.free(); |
| 422 | } |
| 423 | nioChannels = null; |
| 424 | } |
| 425 | if (processorCache != null) { |
| 426 | processorCache.clear(); |
| 427 | processorCache = null; |
| 428 | } |
| 429 | } |
| 430 | } |
| 431 | |
| 432 | |
| 433 | /** |
nothing calls this directly
no test coverage detected