Interstage Application Server アプリケーション作成ガイド (イベントサービス編) |
目次
索引
![]() ![]() |
第4章 アプリケーションの開発(各機能) | > 4.3 イベントファクトリのアプリケーション開発 |
イベントファクトリを使用してイベントチャネルを作成するC++プログラムの例(イベントサービスの場合/ノーティフィケーションの場合)と処理の流れを以下に説明します。
[イベントファクトリによるイベントチャネルの生成(C++の場合)]
CORBA::ORB_ptr orb; CORBA::Object_ptr obj; CORBA::Environment env; EventFactory_ptr factory; EventFactory::Option *option; CosEventChannelAdmin::EventChannel_ptr event_ch; try { obj = orb->resolve_initial_references( EventFactory::ObjectId_Factory, env ); /* 1 */ factory = EventFactory::_narrow( obj ); CORBA::release( obj ); option = new EventFactory::Option(); option->max_queuing = 100; option->life_time = 60; option->model = EventFactory::ModelAny; event_ch = factory->create( "keyword", option, env ); /* 2 */ .... event_ch->destroy( env ); /* 3 */ } catch( CORBA::Exception &e ) { .... }
アプリケーションとイベントチャネルの動的生成のシーケンスを以下に示します。
[イベントファクトリによるイベントチャネルの生成(C++の場合)]
CORBA::ORB_ptr orb; CORBA::Object_ptr obj; CORBA::Environment env; CosNotifyChannelAdmin::EventChannelFactory_ptr factory; CosNotification::QoSProperties initial_qos; CosNotification::AdminProperties initial_admin; CosNotifyChannelAdmin::ChannelID id; CosNotifyChannelAdmin::EventChannel_ptr event_ch; try { obj = orb->resolve_initial_references("NotificationService",env); /* 1 */ factory = CosNotifyChannelAdmin::EventChannelFactory::_narrow( obj ); CORBA::release( obj ); event_ch = factory->create_channel( &initial_qos, &initial_admin, &id, env ); /* 2 */ .... event_ch->destroy( env ); /* 3 */ } catch( CORBA::Exception &e ) { .... }
アプリケーションとイベントチャネルの動的生成のシーケンスを以下に示します。
目次
索引
![]() ![]() |