Interface Shutdownable
- All Known Subinterfaces:
Router,ShutdownableExecutorService,ShutdownableResource,ShutdownableScheduledExecutorService
- All Known Implementing Classes:
AbstractShutdownableResource,Router4Impl,ShutdownableChannelGroup,ShutdownableExecutorServiceImpl,ShutdownableHashedWheelTimer,ShutdownableNioEventLoopGroup,ShutdownableScheduledExecutorServiceImpl,SyncResourceRegistry,SyncShutdownableAdapter
public interface Shutdownable
-
Method Summary
Modifier and TypeMethodDescriptionvoidshutdown()Starts the shutdown process.static booleanshutdownNow(Object object) voidWaits for shutdown to completevoidwaitForShutdown(long timeoutInMs) Waits for shutdown to complete with a timeout
-
Method Details
-
shutdown
void shutdown()Starts the shutdown process. It is recommended to perform the actual shutdown activity in a separate thread from the thread that calls shutdown -
waitForShutdown
Waits for shutdown to complete- Throws:
InterruptedException- when the wait is interruptedIllegalStateException- when the method is invoked when the shutdown has yet to be started
-
waitForShutdown
void waitForShutdown(long timeoutInMs) throws InterruptedException, IllegalStateException, TimeoutException Waits for shutdown to complete with a timeout- Parameters:
timeoutInMs- number of milliseconds to wait before throwing TimeoutException- Throws:
InterruptedException- when the wait is interruptedIllegalStateException- when the method is invoked when the shutdown has yet to be startedTimeoutException- when the operation times out
-
shutdownNow
-