com.infoteria.asteria.flowengine2.flow
Class Component

java.lang.Object
  |
  +--com.infoteria.asteria.flowengine2.flow.Component
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SimpleBranchComponent, SimpleComponent

public abstract class Component
extends Object
implements Cloneable

コンポーネントの基底クラス
すべてのコンポーネントに共通のプロパティとして「ExecuteCount」が最初から登録されています。


Field Summary
static int LOOP_CONTINUE
          executeLoopの返り値のシンボル、Loop処理を実行し、Loopは継続する
static int LOOP_END
          executeLoopの返り値のシンボル、Loop処理を実行し、Loopは終了した
static int LOOP_NOTHING
          executeLoopの返り値のシンボル、Loop処理を実行されなかった
static String STATE_DEFAULT
          デフォルトの出力State
 
Constructor Summary
protected Component()
          コンストラクタ
 
Method Summary
 boolean cancel()
          コンポーネントのキャンセル処理を記述します。
キャンセル処理が正しく行えた場合はtrueを返します。
(デフォルトの実装では常にfalseを返します。)
 void checkLicense()
          ライセンスチェック処理を実装します。
3rdパーティー製のコンポーネントでライセンスチェックを実装する場合はこのメソッドをオーバーライドします。
 Object clone()
          コンポーネントの複製を返します。
このメソッドは Class#newInstanceメソッドを用いて実装されています。
 void commit(ExecuteContext context)
          コミットの実行コードを記述します
 void endFlow(ExecuteContext context)
          個別のフロー実行終了時の処理を記述します
 void endLoop(ExecuteContext context)
          ループ処理の終了時の処理を記述します
abstract  boolean execute(ExecuteContext context)
          コンポーネントの実行コードを記述します
 int executeLoop(ExecuteContext context)
          ループ処理の実行コードを記述します
protected  ComponentCompiler getCompiler()
          コンポーネントコンパイラを返します。
標準のコンパイラではなく自作のコンパイラを使用する場合はオーバーライドします。
abstract  ComponentEntrance getComponentEntrance()
          入力コネクタセットを取得します
abstract  ComponentExit getComponentExit(String state)
          stateに対応する出力コネクタセットを取得します
abstract  String getComponentName()
          コンポーネントの登録名を取得します
 long getExecuteCount()
          コンポーネントの実行回数を返します。
 String getFlowlibPath()
          [install dir]/flow/lib/flowlibフォルダーのパスを返します。
 String getFullName()
          プロジェクト名、フロー名を含む完全なコンポーネント名を取得します
 StreamDataObject getIgnoreThroughStream()
          エラー処理として「エラーを無視する」を選択した場合に出力するストリームを返します。
デフォルトではfalseを返します。
 String getMessage(String key)
          コンポーネント定義ファイルに定義したMessageを取得します。
 String getMessage(String key, Object o1)
          パラメータを置換してコンポーネント定義ファイルに定義したMessageを取得します。
 String getMessage(String key, Object o1, Object o2)
          パラメータを置換してコンポーネント定義ファイルに定義したMessageを取得します。
 String getMessage(String key, Object o1, Object o2, Object o3)
          パラメータを置換してコンポーネント定義ファイルに定義したMessageを取得します。
protected  String getMessageResource(String cname, String key)
          ComponentManagerからメッセージリソースを取得します。
 String getName()
          コンポーネント名を取得します
 Property getProperty(int index)
          indexに対応するプロパティを取得します
 Property getProperty(String name)
          nameに対応するプロパティを取得します
 int getPropertyCount()
          登録されたプロパティの数を返します
 String getState()
          コンポーネントの出力Stateを取得します
コンポーネントは出力Stateごとに出力先を変更することができます。
abstract  String[] getStateArray()
          全ての出力Stateの配列を取得します
 boolean hasProperty(String name)
          nameに対応するプロパティが存在する場合はtrue、存在しない場合はfalseを返します
 void init(ExecuteContext context)
          初期化処理を記述します
 void internalInit()
          コンポーネントの登録時に最初に1度だけ呼び出される初期化メソッドです。
例えば、カスタムコンポーネントでコネクションプールを実装する場合に、 コネクションプールを初期化する処理を記述するのにこのメソッドが利用できます。
 boolean isBreakPoint()
          このコンポーネントにブレイクポイントが設定されている場合trueを返します。
 boolean loopPossibility()
          このコンポーネントがループを生成する可能性がある場合は trueを返すようにオーバーライドします。
デフォルトではfalseを返します。
 PluginResponse pluginCall(TestContext context, PluginRequest request)
          プラグインから実行できるコールバックメソッドです。
protected  void preClone(Component c)
          clone実行後に最初に実行されるコールバックメソッドです。
必要に応じてオーバーライドします。
protected  void registPriperty(Property[] properties)
          Deprecated. 代わりにregistProperty(Property...)を使用してください。
protected  void registProperty(Property property)
          コンポーネントにプロパティを登録します
protected  void registProperty(Property[] properties)
          コンポーネントにプロパティを登録します
protected  void release()
          このコンポーネントに繋がるリンクを全て解除します
protected  boolean releaseComponentExit(String state)
          このコンポーネントに繋がるリンクを全て解除します
 void resetMacro()
          プロパティ式をリセットします。
 void rollback(ExecuteContext context)
          ロールバックの実行コードを記述します
 void setExceptionParam(FlowException e)
          コンポーネント実行中にExceptionが発生した場合に呼び出されるメソッドです。
Exceptionに対してExceptionParamを設定する場合はオーバーライドして引数のExceptionに対してExceptionParamを設定します。
 void term(ExecuteContext context)
          終了処理を記述します
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_DEFAULT

public static final String STATE_DEFAULT
デフォルトの出力State

LOOP_END

public static final int LOOP_END
executeLoopの返り値のシンボル、Loop処理を実行し、Loopは終了した

LOOP_CONTINUE

public static final int LOOP_CONTINUE
executeLoopの返り値のシンボル、Loop処理を実行し、Loopは継続する

LOOP_NOTHING

public static final int LOOP_NOTHING
executeLoopの返り値のシンボル、Loop処理を実行されなかった
Constructor Detail

Component

protected Component()
コンストラクタ
Method Detail

getComponentName

public abstract String getComponentName()
コンポーネントの登録名を取得します

getState

public String getState()
コンポーネントの出力Stateを取得します
コンポーネントは出力Stateごとに出力先を変更することができます。

getComponentEntrance

public abstract ComponentEntrance getComponentEntrance()
入力コネクタセットを取得します

getComponentExit

public abstract ComponentExit getComponentExit(String state)
stateに対応する出力コネクタセットを取得します

getStateArray

public abstract String[] getStateArray()
全ての出力Stateの配列を取得します

getName

public String getName()
コンポーネント名を取得します

getFullName

public String getFullName()
プロジェクト名、フロー名を含む完全なコンポーネント名を取得します

execute

public abstract boolean execute(ExecuteContext context)
                         throws FlowException
コンポーネントの実行コードを記述します

executeLoop

public int executeLoop(ExecuteContext context)
                throws FlowException
ループ処理の実行コードを記述します

commit

public void commit(ExecuteContext context)
            throws FlowException
コミットの実行コードを記述します

rollback

public void rollback(ExecuteContext context)
              throws FlowException
ロールバックの実行コードを記述します

internalInit

public void internalInit()
コンポーネントの登録時に最初に1度だけ呼び出される初期化メソッドです。
例えば、カスタムコンポーネントでコネクションプールを実装する場合に、 コネクションプールを初期化する処理を記述するのにこのメソッドが利用できます。

init

public void init(ExecuteContext context)
          throws FlowException
初期化処理を記述します

endLoop

public void endLoop(ExecuteContext context)
             throws FlowException
ループ処理の終了時の処理を記述します

endFlow

public void endFlow(ExecuteContext context)
個別のフロー実行終了時の処理を記述します

term

public void term(ExecuteContext context)
終了処理を記述します

cancel

public boolean cancel()
コンポーネントのキャンセル処理を記述します。
キャンセル処理が正しく行えた場合はtrueを返します。
(デフォルトの実装では常にfalseを返します。)

loopPossibility

public boolean loopPossibility()
このコンポーネントがループを生成する可能性がある場合は trueを返すようにオーバーライドします。
デフォルトではfalseを返します。

registProperty

protected void registProperty(Property property)
コンポーネントにプロパティを登録します

registPriperty

protected void registPriperty(Property[] properties)
Deprecated. 代わりにregistProperty(Property...)を使用してください。

コンポーネントにプロパティを登録します

registProperty

protected void registProperty(Property[] properties)
コンポーネントにプロパティを登録します

getProperty

public Property getProperty(String name)
nameに対応するプロパティを取得します

hasProperty

public boolean hasProperty(String name)
nameに対応するプロパティが存在する場合はtrue、存在しない場合はfalseを返します

getPropertyCount

public int getPropertyCount()
登録されたプロパティの数を返します

getProperty

public Property getProperty(int index)
indexに対応するプロパティを取得します

setExceptionParam

public void setExceptionParam(FlowException e)
コンポーネント実行中にExceptionが発生した場合に呼び出されるメソッドです。
Exceptionに対してExceptionParamを設定する場合はオーバーライドして引数のExceptionに対してExceptionParamを設定します。

getMessageResource

protected String getMessageResource(String cname,
                                    String key)
ComponentManagerからメッセージリソースを取得します。

getMessage

public String getMessage(String key)
コンポーネント定義ファイルに定義したMessageを取得します。

getMessage

public String getMessage(String key,
                         Object o1)
パラメータを置換してコンポーネント定義ファイルに定義したMessageを取得します。

getMessage

public String getMessage(String key,
                         Object o1,
                         Object o2)
パラメータを置換してコンポーネント定義ファイルに定義したMessageを取得します。

getMessage

public String getMessage(String key,
                         Object o1,
                         Object o2,
                         Object o3)
パラメータを置換してコンポーネント定義ファイルに定義したMessageを取得します。

preClone

protected void preClone(Component c)
clone実行後に最初に実行されるコールバックメソッドです。
必要に応じてオーバーライドします。

clone

public Object clone()
コンポーネントの複製を返します。
このメソッドは Class#newInstanceメソッドを用いて実装されています。
Overrides:
clone in class Object

release

protected void release()
このコンポーネントに繋がるリンクを全て解除します

releaseComponentExit

protected boolean releaseComponentExit(String state)
このコンポーネントに繋がるリンクを全て解除します

getCompiler

protected ComponentCompiler getCompiler()
コンポーネントコンパイラを返します。
標準のコンパイラではなく自作のコンパイラを使用する場合はオーバーライドします。

getExecuteCount

public long getExecuteCount()
コンポーネントの実行回数を返します。

checkLicense

public void checkLicense()
                  throws LicenseException
ライセンスチェック処理を実装します。
3rdパーティー製のコンポーネントでライセンスチェックを実装する場合はこのメソッドをオーバーライドします。
Throws:
LicenseException - ライセンスチェックでエラーとなった場合

isBreakPoint

public boolean isBreakPoint()
このコンポーネントにブレイクポイントが設定されている場合trueを返します。

pluginCall

public PluginResponse pluginCall(TestContext context,
                                 PluginRequest request)
                          throws FlowException
プラグインから実行できるコールバックメソッドです。

getIgnoreThroughStream

public StreamDataObject getIgnoreThroughStream()
                                        throws StreamException
エラー処理として「エラーを無視する」を選択した場合に出力するストリームを返します。
デフォルトではfalseを返します。

resetMacro

public void resetMacro()
プロパティ式をリセットします。

getFlowlibPath

public String getFlowlibPath()
[install dir]/flow/lib/flowlibフォルダーのパスを返します。
Returns:
flowlibフォルダーのパス