Interface ManagedExtensionExecutorService
-
- All Superinterfaces:
Executor,ExecutorService,ScheduledExecutorService
@DoNotImplement public interface ManagedExtensionExecutorService extends ScheduledExecutorService
A shared thread pool executor which is aScheduledExecutorService. It is recommended to use this instead of creating your own thread(-pool) in your extension.Use this class for all concurrent code.
- Since:
- 4.0.0, CE 2019.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description @NotNull CompletableScheduledFuture<?>schedule(@NotNull Runnable command, long delay, @NotNull TimeUnit unit)<V> @NotNull CompletableScheduledFuture<V>schedule(@NotNull Callable<V> callable, long delay, @NotNull TimeUnit unit)@NotNull CompletableScheduledFuture<?>scheduleAtFixedRate(@NotNull Runnable command, long initialDelay, long period, @NotNull TimeUnit unit)@NotNull CompletableScheduledFuture<?>scheduleWithFixedDelay(@NotNull Runnable command, long initialDelay, long delay, @NotNull TimeUnit unit)default voidshutdown()Deprecated.default @NotNull List<@NotNull Runnable>shutdownNow()Deprecated.@NotNull CompletableFuture<?>submit(@NotNull Runnable task)<T> @NotNull CompletableFuture<T>submit(@NotNull Runnable task, T result)<T> @NotNull CompletableFuture<T>submit(@NotNull Callable<T> task)-
Methods inherited from interface java.util.concurrent.ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
-
-
-
-
Method Detail
-
shutdown
@Deprecated default void shutdown()
Deprecated.DO NOT CALL THIS METHOD!The Extension Executor Service is automatically shut down when HiveMQ is shut down.
Manual calls to this method from the extension system are not supported.
- Specified by:
shutdownin interfaceExecutorService- Throws:
UnsupportedOperationException- If it should be called.- Since:
- 4.0.0, CE 2019.1
-
shutdownNow
@Deprecated default @NotNull List<@NotNull Runnable> shutdownNow()
Deprecated.DO NOT CALL THIS METHOD!The Extension Executor Service is automatically shut down when HiveMQ shuts down.
Manual calls to this method from the extension system are not supported.
- Specified by:
shutdownNowin interfaceExecutorService- Throws:
UnsupportedOperationException- If it should be called.- Since:
- 4.0.0, CE 2019.1
-
submit
@NotNull CompletableFuture<?> submit(@NotNull Runnable task)
- Specified by:
submitin interfaceExecutorService- Returns:
- A
CompletableFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ExecutorService.submit(Runnable)
-
submit
<T> @NotNull CompletableFuture<T> submit(@NotNull Callable<T> task)
- Specified by:
submitin interfaceExecutorService- Returns:
- A
CompletableFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ExecutorService.submit(Callable)
-
submit
<T> @NotNull CompletableFuture<T> submit(@NotNull Runnable task, @NotNull T result)
- Specified by:
submitin interfaceExecutorService- Returns:
- A
CompletableFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ExecutorService.submit(Runnable, Object)
-
schedule
@NotNull CompletableScheduledFuture<?> schedule(@NotNull Runnable command, long delay, @NotNull TimeUnit unit)
- Specified by:
schedulein interfaceScheduledExecutorService- Returns:
- A
CompletableScheduledFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ScheduledExecutorService.schedule(Runnable, long, TimeUnit)
-
schedule
<V> @NotNull CompletableScheduledFuture<V> schedule(@NotNull Callable<V> callable, long delay, @NotNull TimeUnit unit)
- Specified by:
schedulein interfaceScheduledExecutorService- Returns:
- A
CompletableScheduledFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ScheduledExecutorService.schedule(Callable, long, TimeUnit)
-
scheduleAtFixedRate
@NotNull CompletableScheduledFuture<?> scheduleAtFixedRate(@NotNull Runnable command, long initialDelay, long period, @NotNull TimeUnit unit)
- Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService- Returns:
- A
CompletableScheduledFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
-
scheduleWithFixedDelay
@NotNull CompletableScheduledFuture<?> scheduleWithFixedDelay(@NotNull Runnable command, long initialDelay, long delay, @NotNull TimeUnit unit)
- Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService- Returns:
- A
CompletableScheduledFuturerepresenting pending completion of the task. - Since:
- 4.0.0, CE 2019.1
- See Also:
ScheduledExecutorService.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)
-
-