[openrtm-commit:00276] r506 - in branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . SDOPackage port
openrtm @ openrtm.org
openrtm @ openrtm.org
2011年 7月 28日 (木) 18:13:04 JST
Author: fsi-katami
Date: 2011-07-28 18:13:03 +0900 (Thu, 28 Jul 2011)
New Revision: 506
Added:
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListener.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerArgument.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerHolder.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerType.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListeners.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListener.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerArgument.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerHolder.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerType.java
Modified:
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ExecutionContextActionListenerType.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java
Log:
Introduction of SDOServiceAdmin class refs #2039
Modified: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ExecutionContextActionListenerType.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ExecutionContextActionListenerType.java 2011-07-13 04:12:30 UTC (rev 505)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/ExecutionContextActionListenerType.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -18,13 +18,13 @@
*
*/
public class ExecutionContextActionListenerType {
- public static final int ATTACH_EC = 0;
- public static final int DETACH_EC = 1;
+ public static final int EC_ATTACHED = 0;
+ public static final int EC_DETACHED = 1;
public static final int EC_ACTION_LISTENER_NUM = 2;
private static final String[] TypeString = {
- "ATTACH_EC",
- "DETACH_ECT",
+ "EC_ATTACHED",
+ "EC_DETACHED",
"EC_ACTION_LISTENER_NUM"
};
Modified: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2011-07-13 04:12:30 UTC (rev 505)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/RTObject_impl.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -11,6 +11,11 @@
import jp.go.aist.rtm.RTC.port.OutPortBase;
import jp.go.aist.rtm.RTC.port.PortAdmin;
import jp.go.aist.rtm.RTC.port.PortBase;
+import jp.go.aist.rtm.RTC.port.PortConnectListener;
+import jp.go.aist.rtm.RTC.port.PortConnectListeners;
+import jp.go.aist.rtm.RTC.port.PortConnectListenerType;
+import jp.go.aist.rtm.RTC.port.PortConnectRetListener;
+import jp.go.aist.rtm.RTC.port.PortConnectRetListenerType;
import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.ORBUtil;
@@ -135,7 +140,7 @@
m_writeAllCompletion = false;
m_objref = this._this();
- m_pSdoConfigImpl = new Configuration_impl(m_configsets);
+ m_pSdoConfigImpl = new Configuration_impl(m_configsets,m_sdoservice);
m_pSdoConfig = m_pSdoConfigImpl.getObjRef();
if( m_ecMine == null ) {
m_ecMine = new ExecutionContextServiceListHolder();
@@ -178,7 +183,7 @@
m_writeAllCompletion = false;
m_objref = this._this();
- m_pSdoConfigImpl = new Configuration_impl(m_configsets);
+ m_pSdoConfigImpl = new Configuration_impl(m_configsets,m_sdoservice);
m_pSdoConfig = m_pSdoConfigImpl.getObjRef();
if( m_ecMine == null ) {
@@ -606,7 +611,7 @@
/**
* {@.ja [CORBA interface] RTCを初期化する}
- * {@.en [CORBA interface] IInitialize the RTC that realizes
+ * {@.en [CORBA interface] Initialize the RTC that realizes
* this interface.}
*
* <p>
@@ -685,8 +690,7 @@
/**
* {@.ja [CORBA interface] RTC を終了する。}
- * {@.en [CORBA interface] Finalize the RTC for preparing it
- * for destruction}
+ * {@.en [CORBA interface] Finalize the RTC for destruction}
*
* <p>
* {@.ja このオペレーション呼び出しの結果として
@@ -3236,6 +3240,364 @@
}
/**
+ * {@.ja [local interface] 実行コンテキストを取得する}
+ * {@.en [local interface] Getting current execution context}
+ * <p>
+ * {@.ja get_context() と同じ機能のローカル版。違いはない。
+ * この関数は以下の関数内で呼ばれることを前提としている。
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * この関数の引数はこれらの関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function is the local version of get_context(). completely
+ * same as get_context() function. This function is assumed to be
+ * called from the following functions.
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above functions.}
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ *
+ */
+ public ExecutionContext getExecutionContext(int ec_id){
+ return get_context(ec_id);
+ }
+
+ /**
+ * {@.ja [local interface] 実行コンテキストの実行レートを取得する}
+ * {@.en [local interface] Getting current context' execution rate}
+ * <p>
+ * {@.ja 現在実行中の実行コンテキストの実行レートを取得する。実行コンテキ
+ * ストのKindがPERIODIC以外の場合の動作は未定義である。この関数は以
+ * 下の関数内で呼ばれることを前提としている。
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * この関数の引数はこれらの関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function returns current execution rate in this
+ * context. If this context's kind is not PERIODC, behavior is not
+ * defined. This function is assumed to be called from the
+ * following functions.
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above functions.}
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ *
+ */
+ public double getExecutionRate(int ec_id) {
+ ExecutionContext ec = getExecutionContext(ec_id);
+ if (ec == null) {
+ return 0.0;
+ }
+ return ec.get_rate();
+ }
+
+ /**
+ * {@.ja [local interface] 実行コンテキストの実行レートを設定する}
+ * {@.en [local interface] Setting current context' execution rate}
+ * <p>
+ * {@.ja 現在実行中の実行コンテキストの実行レートを設定する。実行コンテキ
+ * ストのKindがPERIODIC以外の場合の動作は未定義である。この関数は以
+ * 下の関数内で呼ばれることを前提としている。
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * この関数の引数はこれらの関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function sets a execution rate in the context. If this
+ * context's kind is not PERIODC, behavior is not defined. This
+ * function is assumed to be called from the following functions.
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above functions.}
+ *
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ * @param rate
+ * {@.ja 実行レートを [Hz] で与える}
+ * {@.en Execution rate in [Hz].}
+ *
+ */
+ public ReturnCode_t setExecutionRate(int ec_id, double rate){
+ ExecutionContext ec=getExecutionContext(ec_id);
+ if (ec==null) {
+ return ReturnCode_t.RTC_ERROR;
+ }
+ ec.set_rate(rate);
+ return ReturnCode_t.RTC_OK;
+ }
+
+ /**
+ * {@.ja [local interface] 実行コンテキストの所有権を調べる}
+ * {@.en [local interface] Checking if the current context is own context}
+ * <p>
+ * {@.ja 現在実行中の実行コンテキストの所有権を調べる。この関数は以下の関
+ * 数内で呼ばれることを前提としている。
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * この関数の引数はこれらの関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function checks if the current context is own execution
+ * context. This function is assumed to be called from the
+ * following functions.
+ *
+ * - onStartup()
+ * - onShutdown()
+ * - onActivated()
+ * - onDeactivated()
+ * - onExecute()
+ * - onAborting()
+ * - onError()
+ * - onReset()
+ * - onStateUpdate()
+ * - onRateChanged()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above functions.}
+ *
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ * @return
+ * {@.ja true: 自身の実行コンテキスト、false: 他の実行コンテキスト}
+ * {@.en true: Own context, false: other's context}
+ *
+ */
+ public boolean isOwnExecutionContext(int ec_id){
+ if (ec_id < ECOTHER_OFFSET) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@.ja [local interface] 状態を Inactive に遷移させる}
+ * {@.en [local interface] Make transition to Inactive state}
+ * <p>
+ * {@.ja 状態を Active から Inactive に遷移させる。この関数は以下の関
+ * 数内で呼ばれることを前提としている。
+ *
+ * - onActivated()
+ * - onExecute()
+ * - onStateUpdate()
+ *
+ * この関数の引数は上記の関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function makes transition from Active to Inactive
+ * state. This function is assumed to be called from the following
+ * functions.
+ *
+ * - onActivated()
+ * - onExecute()
+ * - onStateUpdate()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above function.}
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ * @return
+ * {@.ja リターンコード}
+ * {@.en Return code}
+ *
+ */
+ public ReturnCode_t deactivate(int ec_id) {
+ ExecutionContext ec=getExecutionContext(ec_id);
+ if (ec==null) {
+ return ReturnCode_t.RTC_ERROR;
+ }
+ return ec.deactivate_component((LightweightRTObject)getObjRef()._duplicate());
+ }
+
+ /**
+ * {@.ja [local interface] 状態を Active に遷移させる}
+ * {@.en [local interface] Make transition to Active state}
+ * <p>
+ * {@.ja 状態を Inactive から Active に遷移させる。この関数は以下の関
+ * 数内で呼ばれることを前提としている。
+ *
+ * - onStartup()
+ * - onDeactivated()
+ *
+ * この関数の引数は上記の関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function makes transition from Inactive to Active
+ * state. This function is assumed to be called from the following
+ * functions.
+ *
+ * - onStartup()
+ * - onDeactivated()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above function.}
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ * @return
+ * {@.ja リターンコード}
+ * {@.en Return code}
+ *
+ */
+ public ReturnCode_t activate(int ec_id){
+ ExecutionContext ec = getExecutionContext(ec_id);
+ if (ec == null) {
+ return ReturnCode_t.RTC_ERROR;
+ }
+ return ec.activate_component((LightweightRTObject)getObjRef()._duplicate());
+ }
+
+ /**
+ * {@.ja [local interface] 状態をリセットし Inactive に遷移させる}
+ * {@.en [local interface] Resetting and go to Inactive state}
+ * <p>
+ * {@.ja 状態を Error から Inactive に遷移させる。この関数は以下の関
+ * 数内で呼ばれることを前提としている。
+ *
+ * - onError()
+ *
+ * この関数の引数は上記の関数の引数 UniquieID exec_handle でなけ
+ * ればならない。}
+ * {@.en This function reset RTC and makes transition from Error to Inactive
+ * state. This function is assumed to be called from the following
+ * functions.
+ *
+ * - onError()
+ *
+ * The argument of this function should be the first argument
+ * (UniqueId ec_id) of the above function.}
+ *
+ * @param ec_id
+ * {@.ja 上記関数の第1引数 exec_handle を渡す必要がある。}
+ * {@.en The above functions' first argument "exec_handle."}
+ * @return
+ * {@.ja リターンコード}
+ * {@.en Return code}
+ *
+ */
+ public ReturnCode_t reset(int ec_id) {
+ ExecutionContext ec=getExecutionContext(ec_id);
+ if (ec==null) {
+ return ReturnCode_t.RTC_ERROR;
+ }
+ return ec.reset_component((LightweightRTObject)getObjRef()._duplicate());
+ }
+
+ /**
+ * {@.ja [local interface] SDO service provider をセットする}
+ * {@.en [local interface] Set a SDO service provider}
+ */
+ public boolean addSdoServiceProvider(final ServiceProfile prof,
+ SdoServiceProviderBase provider){
+ return m_sdoservice.addSdoServiceProvider(prof, provider);
+ }
+
+ /**
+ * {@.ja [local interface] SDO service provider を削除する}
+ * {@.en [local interface] Remove a SDO service provider}
+ */
+ public boolean removeSdoServiceProvider(final String id) {
+ return m_sdoservice.removeSdoServiceProvider(id);
+ }
+
+ /**
+ * {@.ja [local interface] SDO service provider をセットする}
+ * {@.en [local interface] Set a SDO service provider}
+ */
+ public boolean addSdoServiceConsumer(final ServiceProfile prof) {
+ return m_sdoservice.addSdoServiceConsumer(prof);
+ }
+
+ /**
+ * {@.ja [local interface] SDO service provider を削除する}
+ * {@.en [local interface] Remove a SDO service provider}
+ */
+ public boolean removeSdoServiceConsumer(final String id) {
+ return m_sdoservice.removeSdoServiceConsumer(id);
+ }
+
+ /**
* {@.ja 全 InPort のデータを読み込む。}
* {@.en Readout the value from All InPorts.}
* <p>
@@ -4054,8 +4416,267 @@
return;
}
+ /**
+ * {@.ja PortConnectListener リスナを追加する}
+ * {@.en Adding PortConnect type listener}
+ * <p>
+ * {@.ja Portの接続時や接続解除時に呼び出される各種リスナを設定する。
+ *
+ * 設定できるリスナのタイプとコールバックイベントは以下の通り
+ *
+ * - ON_NOTIFY_CONNECT: notify_connect() 関数内呼び出し直後
+ * - ON_NOTIFY_DISCONNECT: notify_disconnect() 呼び出し直後
+ * - ON_UNSUBSCRIBE_INTERFACES: notify_disconnect() 内のIF購読解除時
+ *
+ * リスナは PortConnectListener を継承し、以下のシグニチャを持つ
+ * operator() を実装している必要がある。
+ *
+ * PortConnectListener::operator()(const char*, ConnectorProfile)
+ *
+ * デフォルトでは、この関数に与えたリスナオブジェクトの所有権は
+ * RTObjectに移り、RTObject解体時もしくは、
+ * removePortConnectListener() により削除時に自動的に解体される。
+ * リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引
+ * 数に false を指定し、自動的な解体を抑制することができる。}
+ * {@.en This operation adds certain listeners related to Port's connect
+ * actions.
+ * The following listener types are available.
+ *
+ * - ON_NOTIFY_CONNECT: right after entering into notify_connect()
+ * - ON_NOTIFY_DISCONNECT: right after entering into notify_disconnect()
+ * - ON_UNSUBSCRIBE_INTERFACES: unsubscribing IF in notify_disconnect()
+ *
+ * Listeners should have the following function operator().
+ *
+ * PortConnectListener::operator()(const char*, ConnectorProfile)
+ *
+ * The ownership of the given listener object is transferred to
+ * this RTObject object in default. The given listener object will
+ * be destroied automatically in the RTObject's dtor or if the
+ * listener is deleted by removePortConnectListener() function.
+ * If you want to keep ownership of the listener object, give
+ * "false" value to 3rd argument to inhibit automatic destruction.}
+ *
+ * @param listener_type
+ * {@.ja リスナタイプ}
+ * {@.en A listener type}
+ * @param listener
+ * {@.ja リスナオブジェクトへのポインタ}
+ * {@.en A pointer to a listener object}
+ * @param autoclean
+ * {@.ja リスナオブジェクトの自動的解体を行うかどうかのフラグ}
+ * {@.en A flag for automatic listener destruction
+ *
+ */
+ public void addPortConnectListener(int listener_type,
+ PortConnectListener listener) {
+ if(listener_type < PortConnectListenerType.PORT_CONNECT_LISTENER_NUM){
+ m_portconnListeners.
+ portconnect_[listener_type].addObserver(listener);
+ }
+ }
+ public void addPortConnectListener(int listener_type,
+ PortConnectListener listener,
+ boolean autoclean) {
+ if(listener_type < PortConnectListenerType.PORT_CONNECT_LISTENER_NUM){
+ m_portconnListeners.
+ portconnect_[listener_type].addObserver(listener);
+ }
+ }
+/*
+ template <class Listener>
+ PortConnectListener*
+ addPortConnectListener(PortConnectListenerType listener_type,
+ Listener& obj,
+ void (Listener::*memfunc)(const char*,
+ ConnectorProfile&))
+ {
+ class Noname
+ : public PortConnectListener
+ {
+ public:
+ Noname(Listener& obj,
+ void (Listener::*memfunc)(const char*, ConnectorProfile&))
+ : m_obj(obj), m_memfunc(memfunc)
+ {
+ }
+ void operator()(const char* portname, ConnectorProfile& cprofile)
+ {
+ (m_obj.*m_memfunc)(portname, cprofile);
+ }
+ private:
+ Listener& m_obj;
+ typedef void (Listener::*Memfunc)(const char*, ConnectorProfile&);
+ Memfunc m_memfunc;
+ };
+ Noname* listener(new Noname(obj, memfunc));
+ addPortConnectListener(listener_type, listener, true);
+ return listener;
+ }
+*/
+
/**
+ * {@.ja PortConnectListener リスナを削除する}
+ * {@.en Removing PortConnect type listener}
+ * <p>
+ * {@.ja 設定した各種リスナを削除する。}
+ * {@.en This operation removes a specified listener.}
+ *
+ * @param listener_type
+ * {@.ja リスナタイプ}
+ * {@.en A listener type}
+ * @param listener
+ * {@.ja リスナオブジェクトへのポインタ}
+ * {@.en A pointer to a listener object}
+ *
+ */
+ public void
+ removePortConnectListener(int listener_type,
+ PortConnectListener listener) {
+ if(listener_type < PortConnectListenerType.PORT_CONNECT_LISTENER_NUM){
+ m_portconnListeners.
+ portconnect_[listener_type].deleteObserver(listener);
+ }
+ }
+
+ /**
+ * {@.ja PortConnectRetListener リスナを追加する}
+ * {@.en Adding PortConnectRet type listener}
+ * <p>
+ * {@.ja Portの接続時や接続解除時に呼び出される各種リスナを設定する。
+ *
+ * 設定できるリスナのタイプとコールバックイベントは以下の通り
+ *
+ * - ON_CONNECT_NEXTPORT: notify_connect() 中のカスケード呼び出し直後
+ * - ON_SUBSCRIBE_INTERFACES: notify_connect() 中のインターフェース購読直後
+ * - ON_CONNECTED: nofity_connect() 接続処理完了時に呼び出される
+ * - ON_DISCONNECT_NEXT: notify_disconnect() 中にカスケード呼び出し直後
+ * - ON_DISCONNECTED: notify_disconnect() リターン時
+ *
+ * リスナは PortConnectRetListener を継承し、以下のシグニチャを持つ
+ * operator() を実装している必要がある。
+ *
+ * PortConnectRetListener::operator()(const char*, ConnectorProfile)
+ *
+ * デフォルトでは、この関数に与えたリスナオブジェクトの所有権は
+ * RTObjectに移り、RTObject解体時もしくは、
+ * removePortConnectRetListener() により削除時に自動的に解体される。
+ * リスナオブジェクトの所有権を呼び出し側で維持したい場合は、第3引
+ * 数に false を指定し、自動的な解体を抑制することができる。}
+ * {@.en This operation adds certain listeners related to Port's connect
+ * actions.
+ * The following listener types are available.
+ *
+ * - ON_CONNECT_NEXTPORT: after cascade-call in notify_connect()
+ * - ON_SUBSCRIBE_INTERFACES: after IF subscribing in notify_connect()
+ * - ON_CONNECTED: completed nofity_connect() connection process
+ * - ON_DISCONNECT_NEXT: after cascade-call in notify_disconnect()
+ * - ON_DISCONNECTED: completed notify_disconnect() disconnection process
+ *
+ * Listeners should have the following function operator().
+ *
+ * PortConnectRetListener::operator()(const char*, ConnectorProfile)
+ *
+ * The ownership of the given listener object is transferred to
+ * this RTObject object in default. The given listener object will
+ * be destroied automatically in the RTObject's dtor or if the
+ * listener is deleted by removePortConnectRetListener() function.
+ * If you want to keep ownership of the listener object, give
+ * "false" value to 3rd argument to inhibit automatic destruction.}
+ *
+ * @param listener_type
+ * {@.ja リスナタイプ}
+ * {@.en A listener type}
+ * @param listener
+ * {@.ja リスナオブジェクトへのポインタ}
+ * {@.en A pointer to a listener object}
+ * @param autoclean
+ * {@.ja リスナオブジェクトの自動的解体を行うかどうかのフラグ}
+ * {@.en A flag for automatic listener destruction}
+ *
+ */
+ public void addPortConnectRetListener(int listener_type,
+ PortConnectRetListener listener) {
+ if(listener_type < PortConnectRetListenerType.PORT_CONNECT_RET_LISTENER_NUM){
+ m_portconnListeners.
+ portconnret_[listener_type].addObserver(listener);
+ }
+ }
+ public void addPortConnectRetListener(int listener_type,
+ PortConnectRetListener listener,
+ boolean autoclean) {
+ if(listener_type < PortConnectRetListenerType.PORT_CONNECT_RET_LISTENER_NUM){
+ m_portconnListeners.
+ portconnret_[listener_type].addObserver(listener);
+ }
+ }
+/*
+ template <class Listener>
+ PortConnectRetListener*
+ addPortConnectRetListener(PortConnectRetListenerType listener_type,
+ Listener& obj,
+ void (Listener::*memfunc)(const char*,
+ ConnectorProfile&,
+ ReturnCode_t))
+ {
+ class Noname
+ : public PortConnectRetListener
+ {
+ public:
+ Noname(Listener& obj,
+ void (Listener::*memfunc)(const char*,
+ ConnectorProfile&,
+ ReturnCode_t))
+ : m_obj(obj), m_memfunc(memfunc)
+ {
+ }
+ void operator()(const char* portname,
+ ConnectorProfile& cprofile,
+ ReturnCode_t ret)
+ {
+ (m_obj.*m_memfunc)(portname, cprofile, ret);
+ }
+ private:
+ Listener& m_obj;
+ typedef void (Listener::*Memfunc)(const char* portname,
+ ConnectorProfile& cprofile,
+ ReturnCode_t ret);
+ Memfunc m_memfunc;
+ };
+ Noname* listener(new Noname(obj, memfunc));
+ addPortConnectRetListener(listener_type, listener, true);
+ return listener;
+ }
+*/
+
+ /**
+ * {@.ja PortConnectRetListener リスナを削除する}
+ * {@.en Removing PortConnectRet type listener}
+ * <p>
+ * {@.ja 設定した各種リスナを削除する。}
+ * {@.en This operation removes a specified listener.}
+ *
+ * @param listener_type
+ * {@.ja リスナタイプ}
+ * {@.en A listener type}
+ * @param listener
+ * {@.ja リスナオブジェクトへのポインタ}
+ * {@.en A pointer to a listener object}
+ *
+ */
+ public void
+ removePortConnectRetListener(int listener_type,
+ PortConnectRetListener listener) {
+ if(listener_type < PortConnectRetListenerType.PORT_CONNECT_RET_LISTENER_NUM){
+ m_portconnListeners.
+ portconnret_[listener_type].deleteObserver(listener);
+ }
+ }
+
+
+
+ /**
* {@.ja ConfigurationParamListener を追加する}
* {@.en Adding ConfigurationParamListener}
* <p>
@@ -4490,12 +5111,12 @@
protected void onAttachExecutionContext(int ec_id)
{
- m_actionListeners.ecaction_[ExecutionContextActionListenerType.ATTACH_EC].notify(ec_id);
+ m_actionListeners.ecaction_[ExecutionContextActionListenerType.EC_ATTACHED].notify(ec_id);
}
protected void onDetachExecutionContext(int ec_id)
{
- m_actionListeners.ecaction_[ExecutionContextActionListenerType.DETACH_EC].notify(ec_id);
+ m_actionListeners.ecaction_[ExecutionContextActionListenerType.EC_DETACHED].notify(ec_id);
}
@@ -4524,12 +5145,6 @@
protected OrganizationListHolder m_sdoOwnedOrganizations = new OrganizationListHolder();
/**
- * {@.ja SDOService のプロファイルリスト}
- * {@.en SDOService Profile List}
- */
- protected ServiceProfileListHolder m_sdoSvcProfiles = new ServiceProfileListHolder();
-
- /**
* {@.ja SDO Configuration オブジェクト}
* {@.en The SDO Configuration Object}
*/
@@ -4596,6 +5211,11 @@
*/
protected boolean m_created;
/**
+ * {@.ja RTCの終了状態フラグ}
+ * {@.en RTC Finalize Status Flag}
+ */
+ protected boolean m_exiting;
+ /**
* {@.ja RTC のプロパティ}
* {@.en RTC's Property}
*/
@@ -4606,6 +5226,36 @@
*/
protected ConfigAdmin m_configsets;
/**
+ * {@.ja SDO Service 管理オブジェクト}
+ * {@.en SDO Service Administrator Object}
+ */
+ protected SdoServiceAdmin m_sdoservice;
+
+ /**
+ * {@.ja readAll()呼出用のフラグ}
+ * {@.en flag for readAll()}
+ */
+ protected boolean m_readAll;
+
+ /**
+ * {@.ja writeAll()呼出用のフラグ}
+ * {@.en flag for writeAll()}
+ */
+ protected boolean m_writeAll;
+
+
+
+ /**
+ * {@.ja PortConnectListenerホルダ}
+ * {@.en PortConnectListener holder}
+ * <p>
+ * {@.ja PortConnectListenrを保持するホルダ}
+ * {@.en Holders of PortConnectListeners}
+ *
+ */
+ protected PortConnectListeners m_portconnListeners;
+
+ /**
* {@.ja RTコンポーネント検索用ヘルパークラス}
* {@.en Functor to find NVList}
*/
@@ -4784,6 +5434,7 @@
if(ecs != null && !ecs._non_existent()) {
ecs.deactivate_component(
(LightweightRTObject)m_comp._duplicate());
+ ecs.stop();
}
}
LightweightRTObject m_comp;
@@ -4808,18 +5459,6 @@
protected Vector<OutPortBase> m_outports = new Vector<OutPortBase>();
/**
- * {@.ja readAll()呼出用のフラグ}
- * {@.en flag for readAll()}
- */
- protected boolean m_readAll;
-
- /**
- * {@.ja writeAll()呼出用のフラグ}
- * {@.en flag for writeAll()}
- */
- protected boolean m_writeAll;
-
- /**
* {@.ja readAll()用のフラグ}
* {@.en flag for readAll()}
* <p>
Modified: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java 2011-07-13 04:12:30 UTC (rev 505)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/SDOPackage/Configuration_impl.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -6,6 +6,7 @@
import java.util.Vector;
import jp.go.aist.rtm.RTC.ConfigAdmin;
+import jp.go.aist.rtm.RTC.SdoServiceAdmin;
import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
import jp.go.aist.rtm.RTC.util.NVUtil;
@@ -94,9 +95,12 @@
* {@.ja コンフィギュレーション情報}
* {@.en information of Configuration}
*/
- public Configuration_impl(ConfigAdmin configsets){
+ public Configuration_impl(ConfigAdmin configsets,
+ SdoServiceAdmin sdoServiceAdmin){
this.m_configsets = configsets;
+ this.m_sdoservice = sdoServiceAdmin;
this.m_objref = this._this();
+
rtcout = new Logbuf("Configuration_impl");
m_organizations = new OrganizationListHolder();
@@ -240,6 +244,8 @@
rtcout.println(Logbuf.TRACE, "Configuration_impl.add_service_profile()");
try{
+ return m_sdoservice.addSdoServiceConsumer(sProfile);
+/*
if( m_serviceProfiles==null ) {
m_serviceProfiles = new ServiceProfileListHolder();
m_serviceProfiles.value = new ServiceProfile[0];
@@ -258,6 +264,7 @@
}
CORBA_SeqUtil.push_back(m_serviceProfiles, sProfile);
return true;
+*/
} catch (Exception ex) {
throw new InternalError("Configuration::add_service_profile");
}
@@ -339,16 +346,19 @@
rtcout.println(Logbuf.TRACE, "Configuration_impl.remove_service_profile("+id+")");
try {
+ return m_sdoservice.removeSdoServiceConsumer(id);
+/*
for(int index=0; index<m_serviceProfiles.value.length; index++ ) {
if(id.equals(m_serviceProfiles.value[index].id)) {
CORBA_SeqUtil.erase(m_serviceProfiles, index);
return true;
}
}
+*/
} catch(Exception ex) {
throw new InternalError("Configuration::remove_service_profile");
}
- return true;
+// return true;
}
/**
@@ -1040,6 +1050,13 @@
protected ConfigAdmin m_configsets;
protected Map<String, Properties> m_configsetopts = new HashMap<String, Properties>();
/**
+ * {@.ja Lock 付き SDO Service 管理オブジェクト}
+ * {@.en SDO Service admin object with mutex lock}
+ */
+ protected SdoServiceAdmin m_sdoservice;
+ protected String m_sdoservice_mutex;
+
+ /**
* {@.ja Organization リスト}
* {@.en List of Organization}
*/
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListener.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListener.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListener.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,45 @@
+package jp.go.aist.rtm.RTC.port;
+
+import java.util.Observer;
+
+import RTC.ConnectorProfile;
+ /**
+ * {@.ja PortConnectListener クラス}
+ * {@.en PortConnectListener class}
+ * <p>
+ * {@.ja 各アクションに対応するユーザーコードが呼ばれる直前のタイミング
+ * でコールされるリスナクラスの基底クラス。
+ *
+ * - ON_NOTIFY_CONNECT: notify_connect() 関数内呼び出し直後
+ * - ON_NOTIFY_DISCONNECT: notify_disconnect() 呼び出し直後
+ * - ON_UNSUBSCRIBE_INTERFACES: notify_disconnect() 内のIF購読解除時}
+ *
+ * {@.en This class is abstract base class for listener classes that
+ * provides callbacks for various events in rtobject.
+ *
+ * - ON_NOTIFY_CONNECT: right after entering into notify_connect()
+ * - ON_NOTIFY_DISCONNECT: right after entering into notify_disconnect()
+ * - ON_UNSUBSCRIBE_INTERFACES: unsubscribing IF in notify_disconnect()}
+ *
+ */
+public abstract class PortConnectListener implements Observer{
+
+ /**
+ * {@.ja デストラクタ}
+ * {@.en Destructor}
+ */
+ //virtual ~PortConnectListener();
+
+ /**
+ * {@.ja 仮想コールバック関数}
+ * {@.en Virtual Callback function}
+ * <p>
+ * {@.ja PortConnectListener のコールバック関数}
+ * {@.en This is a the Callback function for PortConnectListener.}
+ *
+ */
+ public abstract void operator(final String portname,
+ ConnectorProfile profile);
+ };
+
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerArgument.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerArgument.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerArgument.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,28 @@
+package jp.go.aist.rtm.RTC.port;
+
+import RTC.ReturnCode_t;
+ /**
+ * {@.ja PortConnectListenerArgument クラス}
+ * {@.en PortConnectListenerArgument class}
+ *
+ *
+ */
+public class PortConnectListenerArgument {
+ /**
+ * {@.ja コンストラクタ}
+ * {@.en Constructor}
+ *
+ */
+ public PortConnectListenerArgument(final String config_set_name,
+ final String config_param_name){
+ m_config_set_name = config_set_name;
+ m_config_param_name = config_param_name;
+ }
+ public String m_config_set_name;
+ public String m_config_param_name;
+}
+
+
+
+
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerHolder.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerHolder.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerHolder.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,22 @@
+package jp.go.aist.rtm.RTC.port;
+
+import java.util.Observable;
+ /**
+ * {@.ja PortConnectListener ホルダクラス}
+ * {@.en PortConnectListener holder class}
+ * <p>
+ * {@.ja 複数の PortConnectListener を保持し管理するクラス。}
+ * {@.en This class manages one ore more instances of
+ * PortConnectListener class.}
+ *
+ */
+public class PortConnectListenerHolder extends Observable{
+ public void notify(final String config_set_name,final String config_param_name) {
+ super.setChanged();
+ PortConnectListenerArgument arg
+ = new PortConnectListenerArgument(config_set_name,config_param_name);
+ super.notifyObservers(arg);
+ super.clearChanged();
+ }
+};
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerType.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerType.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListenerType.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,52 @@
+package jp.go.aist.rtm.RTC.port;
+ /**
+ * {@.ja PortConnectListener のタイプ}
+ * {@.en The types of ConnectorDataListener}
+ * <p>
+ * {@.ja
+ * - ON_NOTIFY_CONNECT: notify_connect() 関数内呼び出し直後
+ * - ON_NOTIFY_DISCONNECT: notify_disconnect() 呼び出し直後
+ * - ON_UNSUBSCRIBE_INTERFACES: notify_disconnect() 内のIF購読解除時}
+ * {@.en
+ * - ON_NOTIFY_CONNECT: right after entering into notify_connect()
+ * - ON_NOTIFY_DISCONNECT: right after entering into notify_disconnect()
+ * - ON_UNSUBSCRIBE_INTERFACES: unsubscribing IF in notify_disconnect()}
+ *
+ */
+public class PortConnectListenerType {
+ public static final int ON_NOTIFY_CONNECT = 0;
+ public static final int ON_NOTIFY_DISCONNECT = 1;
+ public static final int ON_UNSUBSCRIBE_INTERFACES = 2;
+ public static final int PORT_CONNECT_LISTENER_NUM = 3;
+
+ private static final String[] TypeString = {
+ "ON_NOTIFY_CONNECT",
+ "ON_NOTIFY_DISCONNECT",
+ "ON_UNSUBSCRIBE_INTERFACES",
+ "PORT_CONNECT_LISTENER_NUM"
+ };
+
+ /**
+ * {@.ja ConfigurationParamListenerType を文字列に変換}
+ * {@.en Convert ConfigurationParamListenerType into the string.}
+ * <p>
+ * {@.ja ConfigurationParamListenerType を文字列に変換する}
+ * {@.en Convert ConfigurationParamListenerType into the string.}
+ * </p>
+ *
+ * @param type
+ * {@.ja 変換対象 ConfigurationParamListenerType}
+ * {@.en The target ConfigurationParamListenerType for transformation}
+ *
+ * @return
+ * {@.ja 文字列変換結果}
+ * {@.en Trnasformation result of string representation}
+ *
+ */
+ public static String toString(final int type){
+ if (type < PORT_CONNECT_LISTENER_NUM) {
+ return TypeString[type];
+ }
+ return "";
+ }
+}
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListeners.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListeners.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectListeners.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,27 @@
+package jp.go.aist.rtm.RTC.port;
+ /**
+ * {@.ja PortConnectListeners クラス}
+ * {@.en PortConnectListeners class}
+ *
+ */
+public class PortConnectListeners {
+ /**
+ * {@.ja PortConnectListenerType リスナ配列}
+ * {@.en PortConnectListenerType listener array}
+ * <p>
+ * {@.ja PortConnectListenerType リスナを格納}
+ * {@.en The PortConnectListenerType listener is stored. }
+ */
+ public PortConnectListenerHolder[] portconnect_
+ = new PortConnectListenerHolder[PortConnectListenerType.PORT_CONNECT_LISTENER_NUM];
+ /**
+ * {@.ja PortConnectRetTypeリスナ配列}
+ * {@.en PortConnectRetType listener array}
+ * <p>
+ * {@.ja PortConnectRetTypeリスナを格納}
+ * {@.en The PortConnectRetType listener is stored.}
+ */
+ public PortConnectRetListenerHolder[] portconnret_
+ = new PortConnectRetListenerHolder[PortConnectRetListenerType.PORT_CONNECT_RET_LISTENER_NUM];
+ };
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListener.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListener.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListener.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,51 @@
+package jp.go.aist.rtm.RTC.port;
+
+import java.util.Observer;
+
+import RTC.ConnectorProfile;
+import RTC.ReturnCode_t;
+
+ /**
+ * {@.ja PortConnectRetListener クラス}
+ * {@.en PortConnectRetListener class}
+ * <p>
+ * {@.ja 各アクションに対応するユーザーコードが呼ばれる直前のタイミング
+ * でコールされるリスなクラスの基底クラス。
+ *
+ * - ON_PUBLISH_INTERFACES: notify_connect() 中のインターフェース公開直後
+ * - ON_CONNECT_NEXTPORT: notify_connect() 中のカスケード呼び出し直後
+ * - ON_SUBSCRIBE_INTERFACES: notify_connect() 中のインターフェース購読直後
+ * - ON_CONNECTED: nofity_connect() 接続処理完了時に呼び出される
+ * - ON_DISCONNECT_NEXT: notify_disconnect() 中にカスケード呼び出し直後
+ * - ON_DISCONNECTED: notify_disconnect() リターン時}
+ * {@en This class is abstract base class for listener classes that
+ * provides callbacks for various events in rtobject.
+ *
+ * - ON_CONNECT_NEXTPORT: after cascade-call in notify_connect()
+ * - ON_SUBSCRIBE_INTERFACES: after IF subscribing in notify_connect()
+ * - ON_CONNECTED: completed nofity_connect() connection process
+ * - ON_DISCONNECT_NEXT: after cascade-call in notify_disconnect()
+ * - ON_DISCONNECTED: completed notify_disconnect() disconnection}
+ *
+ */
+public abstract class PortConnectRetListener implements Observer{
+
+ /**
+ * {@.ja デストラクタ}
+ * {@.en Destructor}
+ */
+ //virtual ~PortConnectRetListener();
+
+ /**
+ * {@.ja 仮想コールバック関数}
+ * {@.en Virtual Callback function}
+ * <p>
+ * {@.ja PortConnectRetListener のコールバック関数}
+ * {@.en This is a the Callback function for PortConnectRetListener.}
+ *
+ */
+ public abstract void operator(final String portname,
+ ConnectorProfile profile,
+ ReturnCode_t ret);
+ };
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerArgument.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerArgument.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerArgument.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,27 @@
+package jp.go.aist.rtm.RTC.port;
+
+import RTC.ReturnCode_t;
+ /**
+ * {@.ja PortConnectRetListenerArgument クラス}
+ * {@.en PortConnectRetListenerArgument class}
+ *
+ *
+ */
+public class PortConnectRetListenerArgument {
+ /**
+ * {@.ja コンストラクタ}
+ * {@.en Constructor}
+ *
+ */
+ public PortConnectRetListenerArgument(final String config_set_name,
+ final String config_param_name){
+ m_config_set_name = config_set_name;
+ m_config_param_name = config_param_name;
+ }
+ public String m_config_set_name;
+ public String m_config_param_name;
+}
+
+
+
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerHolder.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerHolder.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerHolder.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,23 @@
+package jp.go.aist.rtm.RTC.port;
+
+import java.util.Observable;
+ /**
+ * {@.ja PortConnectRetListener ホルダクラス}
+ * {@.en PortConnectRetListener holder class}
+ * <p>
+ * {@.ja 複数の PortConnectRetListener を保持し管理するクラス。}
+ * {@.en This class manages one ore more instances of
+ * PortConnectRetListener class.}
+ *
+ */
+public class PortConnectRetListenerHolder extends Observable{
+ public void notify(final String config_set_name,final String config_param_name) {
+ super.setChanged();
+ PortConnectRetListenerArgument arg
+ = new PortConnectRetListenerArgument(config_set_name,config_param_name);
+ super.notifyObservers(arg);
+ super.clearChanged();
+ }
+}
+
+
Added: branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerType.java
===================================================================
--- branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerType.java (rev 0)
+++ branches/work/ForSDOServiceAdminClass/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/PortConnectRetListenerType.java 2011-07-28 09:13:03 UTC (rev 506)
@@ -0,0 +1,62 @@
+package jp.go.aist.rtm.RTC.port;
+ /**
+ * {@.ja PortConnectRetListenerType のタイプ}
+ *
+ * - ON_CONNECT_NEXTPORT: notify_connect() 中のカスケード呼び出し直後
+ * - ON_SUBSCRIBE_INTERFACES: notify_connect() 中のインターフェース購読直後
+ * - ON_CONNECTED: nofity_connect() 接続処理完了時に呼び出される
+ * - ON_DISCONNECT_NEXT: notify_disconnect() 中にカスケード呼び出し直後
+ * - ON_DISCONNECTED: notify_disconnect() リターン時}
+ * {@.en The types of PortConnectRetListenerType}
+ *
+ * - ON_CONNECT_NEXTPORT: after cascade-call in notify_connect()
+ * - ON_SUBSCRIBE_INTERFACES: after IF subscribing in notify_connect()
+ * - ON_CONNECTED: completed nofity_connect() connection process
+ * - ON_DISCONNECT_NEXT: after cascade-call in notify_disconnect()
+ * - ON_DISCONNECTED: completed notify_disconnect() disconnection}
+ *
+ */
+public class PortConnectRetListenerType {
+ public static final int ON_PUBLISH_INTERFACES = 0;
+ public static final int ON_CONNECT_NEXTPORT = 1;
+ public static final int ON_SUBSCRIBE_INTERFACES = 2;
+ public static final int ON_CONNECTED = 3;
+ public static final int ON_DISCONNECT_NEXT = 4;
+ public static final int ON_DISCONNECTED = 5;
+ public static final int PORT_CONNECT_RET_LISTENER_NUM = 6;
+
+ private static final String[] TypeString = {
+ "ON_PUBLISH_INTERFACES",
+ "ON_CONNECT_NEXTPORT",
+ "ON_SUBSCRIBE_INTERFACES",
+ "ON_CONNECTED",
+ "ON_DISCONNECT_NEXT",
+ "ON_DISCONNECTED",
+ "PORT_CONNECT_RET_LISTENER_NUM"
+ };
+
+ /**
+ * {@.ja ConfigurationParamListenerType を文字列に変換}
+ * {@.en Convert ConfigurationParamListenerType into the string.}
+ * <p>
+ * {@.ja ConfigurationParamListenerType を文字列に変換する}
+ * {@.en Convert ConfigurationParamListenerType into the string.}
+ * </p>
+ *
+ * @param type
+ * {@.ja 変換対象 ConfigurationParamListenerType}
+ * {@.en The target ConfigurationParamListenerType for transformation}
+ *
+ * @return
+ * {@.ja 文字列変換結果}
+ * {@.en Trnasformation result of string representation}
+ *
+ */
+ public static String toString(final int type){
+ if (type < PORT_CONNECT_RET_LISTENER_NUM) {
+ return TypeString[type];
+ }
+ return "";
+ }
+}
+
openrtm-commit メーリングリストの案内