public class SimpleThreadPoolTaskExecutor extends SimpleThreadPool implements AsyncListenableTaskExecutor, SchedulingTaskExecutor, InitializingBean, DisposableBean
TaskExecutor インターフェースを実装し、Spring ライフサイクルコールバックをリッスンする Quartz の SimpleThreadPool のサブクラス。Quartz スケジューラ ( "taskExecutor" として指定) と他の TaskExecutor ユーザー間で共有することも、Quartz スケジューラから完全に独立して使用することもできます (プレーンな TaskExecutor バックエンドとして)。
SimpleThreadPool, TaskExecutor, SchedulerFactoryBean.setTaskExecutor(java.util.concurrent.Executor)TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE| コンストラクターと説明 |
|---|
SimpleThreadPoolTaskExecutor() |
| 修飾子と型 | メソッドと説明 |
|---|---|
void | afterPropertiesSet() |
void | destroy()Bean の破棄時に、包含 BeanFactory によって呼び出されます。 |
void | execute(RunnableSE task) 指定された task を実行します。 |
void | execute(RunnableSE task, long startTimeout) 指定された task を実行します。 |
void | setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown) シャットダウン時に実行中のジョブが完了するのを待つかどうかを設定します。 |
<T> FutureSE<T> | submit(CallableSE<T> task)Callable タスクを送信して実行し、そのタスクを表す Future を受け取ります。 |
FutureSE<?> | submit(RunnableSE task) 実行可能な Runnable タスクを送信し、そのタスクを表す Future を受け取ります。 |
<T> ListenableFuture<T> | submitListenable(CallableSE<T> task)Callable タスクを実行のために送信し、そのタスクを表す ListenableFuture を受け取ります。 |
ListenableFuture<?> | submitListenable(RunnableSE task)Runnable タスクを実行のために送信し、そのタスクを表す ListenableFuture を受け取ります。 |
blockForAvailableThreads, clearFromBusyWorkersList, createWorkerThreads, getLog, getPoolSize, getThreadCount, getThreadNamePrefix, getThreadPriority, initialize, isMakeThreadsDaemons, isThreadsInheritContextClassLoaderOfInitializingThread, isThreadsInheritGroupOfInitializingThread, makeAvailable, runInThread, setInstanceId, setInstanceName, setMakeThreadsDaemons, setThreadCount, setThreadNamePrefix, setThreadPriority, setThreadsInheritContextClassLoaderOfInitializingThread, setThreadsInheritGroupOfInitializingThread, shutdown, shutdowncloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEprefersShortLivedTaskspublic void setWaitForJobsToCompleteOnShutdown(boolean waitForJobsToCompleteOnShutdown)
public void afterPropertiesSet()
throws SchedulerConfigExceptionInitializingBeanBeanFactoryAware、ApplicationContextAware などを満たした後、包含 BeanFactory によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean の afterPropertiesSet SchedulerConfigExceptionpublic void execute(RunnableSE task)
TaskExecutortask を実行します。実装が非同期実行戦略を使用している場合、呼び出しはすぐに戻るか、同期実行の場合はブロックする可能性があります。
ExecutorSE の executeSE TaskExecutor の execute task - 実行する Runnable (非 null)public void execute(RunnableSE task, long startTimeout)
AsyncTaskExecutortask を実行します。AsyncTaskExecutor の execute task - 実行する Runnable (非 null)startTimeout - タスクが開始される予定の期間(ミリ秒)。これはエグゼキューターへのヒントとして意図されており、即時タスクの優先処理を可能にします。一般的な値は AsyncTaskExecutor.TIMEOUT_IMMEDIATE または AsyncTaskExecutor.TIMEOUT_INDEFINITE(TaskExecutor.execute(Runnable) で使用されるデフォルト)です。public FutureSE<?> submit(RunnableSE task)
AsyncTaskExecutornull の結果を返します。AsyncTaskExecutor の submit task - 実行する Runnable (非 null)public <T> FutureSE<T> submit(CallableSE<T> task)
AsyncTaskExecutorAsyncTaskExecutor の submit task - 実行する Callable (非 null)public ListenableFuture<?> submitListenable(RunnableSE task)
AsyncListenableTaskExecutorRunnable タスクを実行のために送信し、そのタスクを表す ListenableFuture を受け取ります。Future は完了時に null の結果を返します。AsyncListenableTaskExecutor の submitListenable task - 実行する Runnable (非 null)ListenableFuture public <T> ListenableFuture<T> submitListenable(CallableSE<T> task)
AsyncListenableTaskExecutorCallable タスクを実行のために送信し、そのタスクを表す ListenableFuture を受け取ります。Future は、完了時に Callable の結果を返します。AsyncListenableTaskExecutor の submitListenable task - 実行する Callable (非 null)ListenableFuture public void destroy()
DisposableBeanBeanFactory によって呼び出されます。DisposableBean の destroy