Package nablarch.fw.invoker
Class AbstractExecutorServiceFactory
java.lang.Object
nablarch.fw.invoker.AbstractExecutorServiceFactory
- All Implemented Interfaces:
Initializable,ExecutorServiceFactory
- Direct Known Subclasses:
FixedExecutorServiceFactory
@Published(tag="architect")
public abstract class AbstractExecutorServiceFactory
extends Object
implements ExecutorServiceFactory, Initializable
ExecutorServiceFactoryの実装をサポートする抽象クラス。
ExecutorServiceFactoryの実装クラスで共通となる処理を提供する。- Author:
- T.Kawasaki
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longデフォルトのタイムアウト(秒)protected ExecutorServiceprotected longタイムアウト(秒) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanスレッド終了を待つ。protected abstract ExecutorServiceExecutorServiceインスタンスを生成する。 サブクラスにて、インスタンスを生成、必要な設定を行うこと。ExecutorServiceを取得する。void初期化処理を行う。protected booleanシャットダウン処理を行う必要があるかどうか判定する。voidsetTimeoutSecond(long timeoutSecond) スレッドの停止を待機する時間(秒)を設定する。voidシャットダウンを行う。voidシャットダウンを開始する。 このメソッド起動後は、以降の要求は受け付けられない。
-
Field Details
-
DEFAULT_TIMEOUT_SECOND
public static final long DEFAULT_TIMEOUT_SECONDデフォルトのタイムアウト(秒)- See Also:
-
timeoutSecond
protected long timeoutSecondタイムアウト(秒) -
executorService
-
-
Constructor Details
-
AbstractExecutorServiceFactory
public AbstractExecutorServiceFactory()
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:Initializable初期化処理を行う。- Specified by:
initializein interfaceInitializable
-
createExecutorService
ExecutorServiceインスタンスを生成する。 サブクラスにて、インスタンスを生成、必要な設定を行うこと。- Returns:
ExecutorServiceインスタンス
-
getExecutorService
Description copied from interface:ExecutorServiceFactoryExecutorServiceを取得する。- Specified by:
getExecutorServicein interfaceExecutorServiceFactory- Returns:
ExecutorService
-
startShutdownService
public void startShutdownService()Description copied from interface:ExecutorServiceFactoryシャットダウンを開始する。 このメソッド起動後は、以降の要求は受け付けられない。- Specified by:
startShutdownServicein interfaceExecutorServiceFactory
-
shutdownService
public void shutdownService()Description copied from interface:ExecutorServiceFactoryシャットダウンを行う。- Specified by:
shutdownServicein interfaceExecutorServiceFactory
-
awaitTermination
スレッド終了を待つ。- Returns:
ExecutorService.awaitTermination(long, TimeUnit)の戻り値- Throws:
InterruptedException- 割り込みが発生した場合
-
needsShutdown
protected boolean needsShutdown()シャットダウン処理を行う必要があるかどうか判定する。- Returns:
- 必要がある場合、真
-
setTimeoutSecond
public void setTimeoutSecond(long timeoutSecond) スレッドの停止を待機する時間(秒)を設定する。- Parameters:
timeoutSecond- スレッドの停止を待機する時間
-