@Published(tag="architect") public abstract class AbstractExecutorServiceFactory extends Object implements ExecutorServiceFactory, Initializable
ExecutorServiceFactory
の実装をサポートする抽象クラス。
ExecutorServiceFactory
の実装クラスで共通となる処理を提供する。修飾子とタイプ | フィールドと説明 |
---|---|
static long |
DEFAULT_TIMEOUT_SECOND
デフォルトのタイムアウト(秒)
|
protected ExecutorService |
executorService
ExecutorService |
protected long |
timeoutSecond
タイムアウト(秒)
|
修飾子とタイプ | メソッドと説明 |
---|---|
protected boolean |
awaitTermination()
スレッド終了を待つ。
|
protected abstract ExecutorService |
createExecutorService()
ExecutorService インスタンスを生成する。 |
ExecutorService |
getExecutorService()
ExecutorService を取得する。 |
void |
initialize()
初期化処理を行う。
|
protected boolean |
needsShutdown()
シャットダウン処理を行う必要があるかどうか判定する。
|
void |
setTimeoutSecond(long timeoutSecond)
スレッドの停止を待機する時間(秒)を設定する。
|
void |
shutdownService()
シャットダウンを行う。
|
void |
startShutdownService()
シャットダウンを開始する。
|
public static final long DEFAULT_TIMEOUT_SECOND
protected long timeoutSecond
protected ExecutorService executorService
ExecutorService
public void initialize()
Initializable
initialize
インタフェース内 Initializable
protected abstract ExecutorService createExecutorService()
ExecutorService
インスタンスを生成する。
サブクラスにて、インスタンスを生成、必要な設定を行うこと。ExecutorService
インスタンスpublic ExecutorService getExecutorService()
ExecutorServiceFactory
ExecutorService
を取得する。getExecutorService
インタフェース内 ExecutorServiceFactory
ExecutorService
public void startShutdownService()
ExecutorServiceFactory
startShutdownService
インタフェース内 ExecutorServiceFactory
public void shutdownService()
ExecutorServiceFactory
shutdownService
インタフェース内 ExecutorServiceFactory
protected boolean awaitTermination()
ExecutorService#awaitTermination(long, TimeUnit)
の戻り値InterruptedException
- 割り込みが発生した場合protected boolean needsShutdown()
public void setTimeoutSecond(long timeoutSecond)
timeoutSecond
- スレッドの停止を待機する時間