プロジェクト

全般

プロフィール

機能 #2014

ComponentAction listener の追加

n-ando約13年前に追加. 約12年前に更新.

ステータス:
終了
優先度:
高め
担当者:
-
対象バージョン:
-
開始日:
2011/01/27
期日:
進捗率:

100%

予定工数:

説明

  • RTコンポーネントの各種アクション(ComponentAction)をフックするためのリスナクラス、ComponentAction listener を追加する。
    • PreAction: 引数に ec_id を取るリスナ
    • PostAction: 引数に ec_id と ReturnCode_t をとるリスナ
  • RTObject にリスナホルダを持たせる
  • RTObject のon_xxx() 関数内の onXxx() の前後にPreActionとPostActionを仕掛ける
  • RTObject にリスナをセットする関数を追加する

関係しているリビジョン

リビジョン 521 (差分)
fsi-katami が12年以上前に追加

Implements of ComponentAction listener

refs #2014

リビジョン 522 (差分)
fsi-katami が12年以上前に追加

Implemented of ComponentAction listener. refs #2014

リビジョン 523 (差分)
fsi-katami が12年以上前に追加

Implemented of ComponentAction listener. refs #2014

履歴

#1 匿名ユーザー が約13年前に更新

  • ステータス新規 から 担当 に変更

#2 匿名ユーザー が約13年前に更新

ComponentActionListenerに実装は終了.

#3 匿名ユーザー が約13年前に更新

  • 進捗率0 から 30 に変更

Templateを除く部分に関しては動作確認済み。

#4 匿名ユーザー が12年以上前に更新

Generics を使用して実装予定。
リスナの登録では、method名を文字列で指定する。

    public <DataType>
    PreComponentActionListener
    addPreComponentActionListener(int listener_type,
                                   DataType obj,
                                   String memfunc) {
      class Noname extends PreComponentActionListener {
          public Noname(DataType obj, String memfunc) {
              m_obj = obj;
              try {
                  Class clazz = m_obj.getClass();
                  m_method = clazz.getMethod(memfunc,int.class);
              }
              catch(java.lang.Exception e){
                  rtcout.println(Logbuf.WARN,
                      "Exception caught."+e.toString());
              }
          }
          public void operator(final int exec_handle) {
              try {
                  m_method.invoke(
                        m_obj,
                        exec_handle);
              }
              catch(java.lang.Exception e){
                  rtcout.println(Logbuf.WARN,
                      "Exception caught."+e.toString());
              }
          }
          private DataType m_obj;
          private Method m_method;
      };
      Noname listener = new Noname(obj, memfunc);
      addPreComponentActionListener(listener_type, listener, true);
      return listener;
    }

#5 匿名ユーザー が12年以上前に更新

コールバック

リスナーを準備する。

    public class TestPreComponentActionListener {
        public void listener_ON_INITIALIZE(int ic){
            System.out.println("------------------------------");
            System.out.println("PreComponentActionListener PRE_ON_INITIALIZE");
            System.out.println("------------------------------");
        }
    }

リスナーを登録する。

        TestPreComponentActionListener pcal 
            = new TestPreComponentActionListener();
        addPreComponentActionListener(0,pcal,"listener_ON_INITIALIZE");

#6 匿名ユーザー が12年以上前に更新

  • ステータス担当 から 解決 に変更
  • 進捗率30 から 100 に変更

#7 n-ando約12年前に更新

  • ステータス解決 から 終了 に変更

他の形式にエクスポート: Atom PDF