okuyama.base.util
クラス HelperPool

java.lang.Object
  上位を拡張 java.lang.Thread
      上位を拡張 okuyama.base.util.HelperPool
すべての実装されたインタフェース:
java.lang.Runnable

public class HelperPool
extends java.lang.Thread

Helperの蓄積と状態の管理を行うスレッド.

作成者:
T.Okuyama

入れ子のクラスの概要
 
クラス java.lang.Thread から継承された入れ子のクラス/インタフェース
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
フィールドの概要
 
クラス java.lang.Thread から継承されたフィールド
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
コンストラクタの概要
HelperPool()
           
 
メソッドの概要
static void addParameterQueue(java.lang.Object[] params)
          Helper用のパラメータキューに追加.
static void addSpecificationParameterQueue(java.lang.String helperName, java.lang.Object[] params)
          Helper用のパラメータキューに追加.
static void addSpecificationParameterQueue(java.lang.String helperName, java.lang.Object[] params, boolean debug)
          Helper用のパラメータキューに追加.
static void cleanEndHelper(int helperHashCode)
          Helperが終了後のリソースを破棄する.
static void createUniqueHelperParamQueue(java.lang.String uniqueQueueName, int size)
          オリジナルのキュー領域を作成する.
static int getActiveHelperInstanceCount(java.lang.String helperName)
           
static AbstractHelper getHelper(java.lang.String helperName)
          Helperインスタンスを貸し出す.
static java.lang.String getHelperStatus(int helperHashCode)
          指定したHelperのステータスを返す.
static int getParameterQueueSize(java.lang.String queueName)
          パラメータキューのサイズを返す.
static java.lang.Object getReturnParam(int helperHashCode)
          Helperが終了時にセットした返却値を取得する.
static void initializeHelperPool()
          明示的に初期化を行う
static void managedHelperConfig(HelperConfigMap helperConfigMap)
          Helperのプールを初期化する.
static java.lang.Object[] pollParameterQueue()
          Helper用のパラメータキューから取得 全てのHelper共通
static java.lang.Object[] pollSpecificationParameterQueue(java.lang.String helperName)
          Helper用のパラメータキューに追加|.
 void poolEnd()
           
static void returnHelper(java.lang.String helperName, AbstractHelper helper)
          Helperインスタンスを返す.
 void run()
           
 
クラス java.lang.Thread から継承されたメソッド
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

HelperPool

public HelperPool()
メソッドの詳細

run

public void run()
定義:
インタフェース java.lang.Runnable 内の run
オーバーライド:
クラス java.lang.Thread 内の run

initializeHelperPool

public static void initializeHelperPool()
明示的に初期化を行う


getHelper

public static AbstractHelper getHelper(java.lang.String helperName)
                                throws BatchException
Helperインスタンスを貸し出す.
Helperが定義として存在しない場合BatchExceptionがthrowされる.
全て貸し出し中の場合はNullが返る.

パラメータ:
String - helperName
戻り値:
AbstractHelper ヘルパー
例外:
BatchException

returnHelper

public static void returnHelper(java.lang.String helperName,
                                AbstractHelper helper)
                         throws BatchException
Helperインスタンスを返す.
Helperが定義として存在しない場合BatchExceptionがthrowされる.

パラメータ:
String - helperName
AbstractHelper - ヘルパーインスタンス
例外:
BatchException

getActiveHelperInstanceCount

public static int getActiveHelperInstanceCount(java.lang.String helperName)

managedHelperConfig

public static void managedHelperConfig(HelperConfigMap helperConfigMap)
                                throws BatchException
Helperのプールを初期化する.

パラメータ:
HelperConfigMap - helperConfigMap プールしたHelperの設定ファイル
例外:
BatchException

createUniqueHelperParamQueue

public static void createUniqueHelperParamQueue(java.lang.String uniqueQueueName,
                                                int size)
オリジナルのキュー領域を作成する.

パラメータ:
uniqueQueueName - キュー名
size - キューの最大サイズ

getParameterQueueSize

public static int getParameterQueueSize(java.lang.String queueName)
                                 throws java.lang.Exception
パラメータキューのサイズを返す.

パラメータ:
queueName - 名前
例外:
java.lang.Exception

addParameterQueue

public static void addParameterQueue(java.lang.Object[] params)
                              throws java.lang.Exception
Helper用のパラメータキューに追加.
全てのHelper共通.

パラメータ:
params - パラメータ
例外:
java.lang.Exception

addSpecificationParameterQueue

public static void addSpecificationParameterQueue(java.lang.String helperName,
                                                  java.lang.Object[] params)
                                           throws java.lang.Exception
Helper用のパラメータキューに追加.
Helper個別.

パラメータ:
params - パラメータ
例外:
java.lang.Exception

addSpecificationParameterQueue

public static void addSpecificationParameterQueue(java.lang.String helperName,
                                                  java.lang.Object[] params,
                                                  boolean debug)
                                           throws java.lang.Exception
Helper用のパラメータキューに追加.
Helper個別.

パラメータ:
params - パラメータ
例外:
java.lang.Exception

pollParameterQueue

public static java.lang.Object[] pollParameterQueue()
Helper用のパラメータキューから取得 全てのHelper共通

戻り値:
Object[] パラメータ

pollSpecificationParameterQueue

public static java.lang.Object[] pollSpecificationParameterQueue(java.lang.String helperName)
Helper用のパラメータキューに追加|.
Helper個別.

パラメータ:
params - パラメータ

getReturnParam

public static java.lang.Object getReturnParam(int helperHashCode)
Helperが終了時にセットした返却値を取得する.

パラメータ:
helperHashCode - 対象HelperオブジェクトのhashCode
戻り値:
Object 返却値 値がセットされていない場合はnullが返る

cleanEndHelper

public static void cleanEndHelper(int helperHashCode)
Helperが終了後のリソースを破棄する.

パラメータ:
helperHashCode - 対象HelperオブジェクトのhashCode

getHelperStatus

public static java.lang.String getHelperStatus(int helperHashCode)
指定したHelperのステータスを返す.

パラメータ:
helperHashCode - 対象HelperオブジェクトのhashCode
戻り値:
String ステータス文字列 Helperが存在しない場合はnullが返る

poolEnd

public void poolEnd()