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

E.2.2 サーバの活性化

サーバアプリケーションの初期化が完了すると、ORBに対してその旨を通知します。ORBは、この命令が発行された時点で、クライアントからの要求をサーバアプリケーションに伝えます。


(1)インプリメンテーションリポジトリのオブジェクトリファレンスの獲得

インプリメンテーションリポジトリのオブジェクトリファレンスを取り出します。メソッドのパラメタには、CORBA_ORB_ObjectId_ImplementationRepositoryを指定します。


(2)ImplementationDefオブジェクトのオブジェクトリファレンスの検索

FJ::ImplementationRep::lookup_id()を使用して、ImplementationDefオブジェクトのオブジェクトリファレンスを求めます。パラメタには、サーバアプリケーションのImplementationRepオブジェクトを指定します。


(3)サーバの活性化

CORBA::BOA::impl_is_ready()を使用して、サーバの活性化を行います。

CORBA::ImplementationDef_ptr impl;     // インプリメンテーション情報検索用
FJ::ImplementationRep_ptr    impl_rep; // ImplementationRepオブジェクトリファレンス

// インプリメンテーション情報のオブジェクトリファレンス検索
o = orb->resolve_initial_references( CORBA_ORB_ObjectId_ImplementationRepository, *env );

// ImplementationRepクラスへの変換
impl_rep = FJ::ImplementationRep::_narrow(o); 

// サーバのImplementationRepオブジェクトの検索
o = impl_rep->lookup_id( "IMPL_SSNSAMPLE", *env );

// ImplementationDefクラスへの変換
impl = CORBA::ImplementationDef::_narrow(o); 

// サーバの活性化
boa->impl_is_ready( impl, *env );