Package io.dropwizard.lifecycle
Class ExecutorServiceManager
- java.lang.Object
-
- io.dropwizard.lifecycle.ExecutorServiceManager
-
-
Constructor Summary
Constructors Constructor Description ExecutorServiceManager(ExecutorService executor, Duration shutdownPeriod, String poolName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExecutorService
getExecutor()
String
getPoolName()
Duration
getShutdownPeriod()
void
start()
Starts the object.void
stop()
Stops the object.String
toString()
-
-
-
Constructor Detail
-
ExecutorServiceManager
public ExecutorServiceManager(ExecutorService executor, Duration shutdownPeriod, String poolName)
-
-
Method Detail
-
start
public void start() throws Exception
Description copied from interface:Managed
Starts the object. Called before the application becomes available.
-
stop
public void stop() throws InterruptedException, Exception
Stops the object. Called after the application is no longer accepting requests.- Specified by:
stop
in interfaceManaged
- Throws:
InterruptedException
- This is thrown if the thread executing this method is interrupted while awaiting executor tasks to complete.Exception
- if something goes wrong.
-
getExecutor
public ExecutorService getExecutor()
-
getShutdownPeriod
public Duration getShutdownPeriod()
-
getPoolName
public String getPoolName()
-
-