イベントチャネルに接続する際、自身のオブジェクトを登録します。このオブジェクトの生成方法(コンシューマのオブジェクトの作成例)を以下に示します。
イベントサービスの場合
[Pushモデルのコンシューマのオブジェクト]
CORBA_ORB orb; CORBA_BOA boa; CORBA_Repository intf_rep; CORBA_InterfaceDef intf; CORBA_ImplementationDef impl; CORBA_ReferenceData refid; CosEventComm_PushConsumer my_object; intf_rep = CORBA_ORB_resolve_initial_references( orb, CORBA_ORB_ObjectId_LightInterfaceRepository, &env ); intf = CORBA_Repository_lookup_id( intf_rep, _INTF_CosEventComm_PushConsumer, &env ); refid._length = refid._maximum = 0; refid._value = NULL; my_object = CORBA_BOA_create( boa, &refid, intf, impl, &env );
オブジェクトは、CORBA_BOA_createメソッドで作成します。
CORBA_BOA_createメソッドに指定するパラメタのインタフェース情報には、自身が実装するインタフェースリポジトリID(_INTF_CosEventComm_PushConsumer)を指定します。インプリメンテーション情報には、自身のインプリメンテーションリポジトリIDを指定します。
各アプリケーションが実装するインタフェースを以下に示します。アプリケーションは、CORBA_Repository_lookup_idメソッドに以下のパラメタを指定してインタフェースリポジトリIDを獲得します。
通信モデル | サプライヤ | コンシューマ |
---|---|---|
Push | _INTF_CosEventComm_PushSupplier | _INTF_CosEventComm_PushConsumer |
Pull | _INTF_CosEventComm_PullSupplier | _INTF_CosEventComm_PullConsumer |
Mixed | _INTF_CosEventComm_PushSupplier | _INTF_CosEventComm_PullConsumer |
ノーティフィケーションサービスの場合
[Mixedモデルのコンシューマのオブジェクト]
CORBA_ORB orb; CORBA_BOA boa; CORBA_Repository intf_rep; CORBA_InterfaceDef intf; CORBA_ImplementationDef impl; CORBA_ReferenceData refid; CosNotifyComm_PullConsumer my_object; intf_rep = CORBA_ORB_resolve_initial_references( orb, CORBA_ORB_ObjectId_LightInterfaceRepository, &env ); intf = CORBA_Repository_lookup_id( intf_rep, _INTF_CosEventComm_PullConsumer, &env ); refid._length = refid._maximum = 0; refid._value = NULL; my_object = CORBA_BOA_create( boa, &refid, intf, impl, &env );
オブジェクトは、CORBA_BOA_createメソッドで作成します。
CORBA_BOA_createメソッドに指定するパラメタのインタフェース情報には、自身が実装するインタフェースリポジトリID(_INTF_CosEventComm_PullConsumer)を指定します。インプリメンテーション情報には、自身のインプリメンテーションリポジトリIDを指定します。
各アプリケーションが実装するインタフェースを以下に示します。アプリケーションは、CORBA_Repository_lookup_idメソッドに以下のパラメタを指定してインタフェースリポジトリIDを獲得します。
通信モデル | サプライヤ | コンシューマ |
---|---|---|
Mixed | _INTF_CosEventComm_PushSupplier | _INTF_CosEventComm_PullConsumer |
Mixed | _INTF_CosNotifyComm_StructuredPushSupplier | _INTF_CosNotifyComm_StructuredPullConsumer |