@Published(tag="architect") public abstract class AbstractExecutorServiceFactory extends Object implements ExecutorServiceFactory, nablarch.core.repository.initialization.Initializable
ExecutorServiceFactoryの実装をサポートする抽象クラス。
ExecutorServiceFactoryの実装クラスで共通となる処理を提供する。| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_TIMEOUT_SECOND
デフォルトのタイムアウト(秒)
|
protected ExecutorService |
executorService
|
protected long |
timeoutSecond
タイムアウト(秒)
|
| Constructor and Description |
|---|
AbstractExecutorServiceFactory() |
| Modifier and Type | Method and Description |
|---|---|
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
public void initialize()
initialize in interface nablarch.core.repository.initialization.Initializableprotected abstract ExecutorService createExecutorService()
ExecutorServiceインスタンスを生成する。
サブクラスにて、インスタンスを生成、必要な設定を行うこと。ExecutorServiceインスタンスpublic ExecutorService getExecutorService()
ExecutorServiceFactoryExecutorServiceを取得する。getExecutorService in interface ExecutorServiceFactoryExecutorServicepublic void startShutdownService()
ExecutorServiceFactorystartShutdownService in interface ExecutorServiceFactorypublic void shutdownService()
ExecutorServiceFactoryshutdownService in interface ExecutorServiceFactoryprotected boolean awaitTermination()
throws InterruptedException
ExecutorService.awaitTermination(long, TimeUnit)の戻り値InterruptedException - 割り込みが発生した場合protected boolean needsShutdown()
public void setTimeoutSecond(long timeoutSecond)
timeoutSecond - スレッドの停止を待機する時間Copyright © 2020. All rights reserved.