nablarch.fw.invoker
クラス AbstractExecutorServiceFactory

java.lang.Object
  上位を拡張 nablarch.fw.invoker.AbstractExecutorServiceFactory
すべての実装されたインタフェース:
nablarch.core.repository.initialization.Initializable, ExecutorServiceFactory
直系の既知のサブクラス:
FixedExecutorServiceFactory

@Published(tag="architect")
public abstract class AbstractExecutorServiceFactory
extends java.lang.Object
implements ExecutorServiceFactory, nablarch.core.repository.initialization.Initializable

ExecutorServiceFactoryの実装をサポートする抽象クラス。 ExecutorServiceFactoryの実装クラスで共通となる処理を提供する。


フィールドの概要
static long DEFAULT_TIMEOUT_SECOND
          デフォルトのタイムアウト(秒)
protected  java.util.concurrent.ExecutorService executorService
          ExecutorService
protected  long timeoutSecond
          タイムアウト(秒)
 
コンストラクタの概要
AbstractExecutorServiceFactory()
           
 
メソッドの概要
protected  boolean awaitTermination()
          スレッド終了を待つ。
protected abstract  java.util.concurrent.ExecutorService createExecutorService()
          ExecutorServiceインスタンスを生成する。
 java.util.concurrent.ExecutorService getExecutorService()
          ExecutorServiceを取得する。
 void initialize()
           
protected  boolean needsShutdown()
          シャットダウン処理を行う必要があるかどうか判定する。
 void setTimeoutSecond(long timeoutSecond)
          スレッドの停止を待機する時間(秒)を設定する。
 void shutdownService()
          シャットダウンを行う。
 void startShutdownService()
          シャットダウンを開始する。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

DEFAULT_TIMEOUT_SECOND

public static final long DEFAULT_TIMEOUT_SECOND
デフォルトのタイムアウト(秒)

関連項目:
定数フィールド値

timeoutSecond

protected long timeoutSecond
タイムアウト(秒)


executorService

protected java.util.concurrent.ExecutorService executorService
ExecutorService

コンストラクタの詳細

AbstractExecutorServiceFactory

public AbstractExecutorServiceFactory()
メソッドの詳細

initialize

public void initialize()
定義:
インタフェース nablarch.core.repository.initialization.Initializable 内の initialize

createExecutorService

protected abstract java.util.concurrent.ExecutorService createExecutorService()
ExecutorServiceインスタンスを生成する。 サブクラスにて、インスタンスを生成、必要な設定を行うこと。

戻り値:
ExecutorServiceインスタンス

getExecutorService

public java.util.concurrent.ExecutorService getExecutorService()
インタフェース ExecutorServiceFactory の記述:
ExecutorServiceを取得する。

定義:
インタフェース ExecutorServiceFactory 内の getExecutorService
戻り値:
ExecutorService

startShutdownService

public void startShutdownService()
インタフェース ExecutorServiceFactory の記述:
シャットダウンを開始する。 このメソッド起動後は、以降の要求は受け付けられない。

定義:
インタフェース ExecutorServiceFactory 内の startShutdownService

shutdownService

public void shutdownService()
インタフェース ExecutorServiceFactory の記述:
シャットダウンを行う。

定義:
インタフェース ExecutorServiceFactory 内の shutdownService

awaitTermination

protected boolean awaitTermination()
                            throws java.lang.InterruptedException
スレッド終了を待つ。

戻り値:
ExecutorService.awaitTermination(long, TimeUnit)の戻り値
例外:
java.lang.InterruptedException - 割り込みが発生した場合

needsShutdown

protected boolean needsShutdown()
シャットダウン処理を行う必要があるかどうか判定する。

戻り値:
必要がある場合、真

setTimeoutSecond

public void setTimeoutSecond(long timeoutSecond)
スレッドの停止を待機する時間(秒)を設定する。

パラメータ:
timeoutSecond - スレッドの停止を待機する時間