ページの先頭行へ戻る
Interstage Application Server アプリケーション作成ガイド(イベントサービス編)

4.2.4 ノーティフィケーションサービスへのアプリケーション変更

  イベントサービスのアプリケーションをノーティフィケーションサービスのアプリケーションに変更するには、使用するインタフェースを変更する必要があります。
  各サービスのインタフェースの対応を、アプリケーションの処理に沿って以下の表に示します。


  1. イベントチャネル管理オブジェクトのオブジェクトリファレンスを獲得

  2. イベントチャネルのオブジェクトリファレンスを獲得

  3. イベントチャネルと接続

  4. イベントチャネルにイベントデータを送信/受信

  5. イベントチャネルと切断

  6. イベントファクトリによるイベントチャネルの生成


  なお、ノーティフィケーションサービス固有(QoS機能)のインタフェースは、新規に作り込む必要があります。インタフェースおよび使用方法については、以降の各開発言語のノーティフィケーションサービスインタフェース(開発手順の節内)、および“4.4.1 QoSプロパティ項目の設定”を参照してください。


項番

イベントサービスのインタフェース

ノーティフィケーションサービスのインタフェース

1

CosEventChannelAdmin_
EventChannel_for_suppliers

Structured
Event

CosNotifyChannelAdmin_
EventChannel__
get_default_supplier_admin

any

CosEventChannelAdmin_
EventChannel_for_consumers

Structured
Event

CosNotifyChannelAdmin_
EventChannel__
get_default_consumer_admin

any

2

CosEventChannelAdmin_
SupplierAdmin_obtain_push_consumer

Structured
Event

CosNotifyChannelAdmin_
SupplierAdmin_
obtain_notification_push_consumer

any

CosEventChannelAdmin_
ConsumerAdmin_obtain_pull_supplier

Structured
Event

CosNotifyChannelAdmin_
ConsumerAdmin_
obtain_notification_pull_supplier

any

3

CosEventChannelAdmin_
ProxyPushConsumer_connect_push_supplier

Structured
Event

CosNotifyChannelAdmin_
StructuredProxyPushConsumer_
connect_structured_push_supplier

any

CosNotifyChannelAdmin_
ProxyPushConsumer_
connect_any_push_supplier

CosEventChannelAdmin_
ProxyPullSupplier_connect_pull_consumer

Structured
Event

CosNotifyChannelAdmin_
StructuredProxyPullSupplier_
connect_structured_pull_consumer

any

CosNotifyChannelAdmin_
ProxyPullSupplier_
connect_any_pull_consumer

4

CosEventComm_
PushConsumer_push

CosEventChannelAdmin_
ProxyPushConsumer_push

Structured
Event

CosNotifyComm_
StructuredPushConsumer_
push_structured_event

CosNotifyChannelAdmin_
StructuredProxyPushConsumer_
push_structured_event

any

CosNotifyChannelAdmin_
ProxyPushConsumer_push

CosEventComm_
PullSupplier_pull

CosEventChannelAdmin_
ProxyPullSupplier_pull

Structured
Event

CosNotifyComm_
StructuredPullSupplier_
pull_structured_event

CosNotifyChannelAdmin_
StructuredProxyPullSupplier_
pull_structured_event

any

CosNotifyChannelAdmin_
ProxyPullSupplier_pull

CosEventComm_
PullSupplier_try_pull

CosEventChannelAdmin_
ProxyPullSupplier_try_pull

Structured
Event

CosNotifyComm_
StructuredPullSupplier_
try_pull_structured_event

CosNotifyChannelAdmin_
StructuredProxyPullSupplier_
try_pull_structured_event

any

CosNotifyChannelAdmin_
ProxyPullSupplier_try_pull

5

CosEventComm_
PushConsumer_disconnect_push_consumer

CosEventChannelAdmin_
ProxyPushConsumer_disconnect_push_consumer

Structured
Event

CosNotifyComm_
StructuredPushConsumer_
disconnect_structured_push_consumer

CosNotifyChannelAdmin_
StructuredProxyPushConsumer_
disconnect_structured_push_consumer

any

イベントサービスのインタフェース使用可能

CosEventComm_
PullSupplier_disconnect_pull_supplier

CosEventChannelAdmin_
ProxyPullSupplier_disconnect_pull_supplier

Structured
Event

CosNotifyComm_
StructuredPullSupplier_
disconnect_structured_pull_supplier

CosNotifyChannelAdmin_
StructuredProxyPullSupplier_
disconnect_structured_pull_supplier

any

イベントサービスのインタフェース使用可能

6

EventFactory_create

Structured
Event

CosNotifyChannelAdmin_
EventChannelFactory_create_channel

any


■ノーティフィケーションサービスのイベントチャネルとの接続

  イベントサービスのアプリケーションで、ノーティフィケーションサービスのイベントチャネルと接続する場合には、アプリケーションの一部を変更し、翻訳する必要があります。運用形態については、“1.8 イベントチャネルとアプリケーションとの接続互換”を参照してください。

  イベントチャネルのオブジェクトリファレンスの獲得処理で、ノーティフィケーションサービスのイベントチャネルのオブジェクトリファレンスを獲得するため、オブジェクトリファレンスのデータ型を変更します。詳細については、本章の各開発言語の“イベントチャネルのオブジェクトリファレンスの獲得”を参照してください。
  サンプルプログラムでのアプリケーションの変更例を以下に示します。


C言語の場合

  インクルードファイルの指定、およびイベントチャネルのオブジェクトリファレンスの型を変更します。

[インクルードファイルの指定]

#include    "EventService.h"
  ↓
#include    "NotificationService.h"

[イベントチャネルのオブジェクトリファレンスの型の変更]

CosEventChannelAdmin_EventChannel      channel;
  ↓
CosNotifyChannelAdmin_EventChannel     channel;

C++言語の場合

  インクルードファイルの指定、およびイベントチャネルのオブジェクトリファレンスの型を変更します。

[インクルードファイルの指定]

#include    "EventService_cplus.h"
  ↓
#include    "NotificationService_cplus.h"

[イベントチャネルのオブジェクトリファレンスの型の変更]

CosEventChannelAdmin::EventChannel_ptr   channel;
  ↓
CosNotifyChannelAdmin::EventChannel_ptr  channel;
channel = CosEventChannelAdmin::EventChannel::_narrow( obj );
  ↓
channel = CosNotifyChannelAdmin::EventChannel::_narrow( obj );

Java言語の場合

  イベントチャネルのオブジェクトリファレンスの型を変更します。

[イベントチャネルのオブジェクトリファレンスの型の変更]

EventChannel        channel;
  ↓
org.omg.CosNotifyChannelAdmin.EventChannel  channel;
channel = EventChannelHelper.narrow( nameobj );
  ↓
channel = org.omg.CosNotifyChannelAdmin.EventChannelHelper.narrow( nameobj );

COBOL場合

  イベントチャネルのオブジェクトリファレンスの型を変更します。

[イベントチャネルのオブジェクトリファレンスの型の変更]

01 COPY OBJECT IN CORBA REPLACING CORBA-OBJECT BY EVENTCHOBJ.
  ↓
01 COPY NOTIFYEVENTCHANNEL IN COSEVENTCOMM REPLACING COSNOTIFYCHANNELADMIN-EVENTCHA BY EVENTCHOBJ;

  また、コンシューマアプリケーションで、StructuredEvent型のデータを受信する場合は、any型のメンバとして、StructuredEvent型のメッセージ構造が格納されます。変換方式については、“1.5.4 StructuredEvent型からany型への変換”を参照してください。
  なお、C言語、C++言語、およびCOBOLアプリケーションでは、ノーティフィケーションサービスのスタブライブラリを結合する必要があります。