29.4.2 CORBA::Objectのメソッド
-
CORBA::Policy_ptr get_client_policy(
CORBA::PolicyType type);
このメソッドは,オブジェクトリファレンスの有効なオーバーライドポリシーを返します。まず,Objectスコープに指定したPolicyTypeのオーバーライドがあるかどうかをチェックし,次にCurrentスコープ,最後にVisiBroker ORBスコープをチェックすると取得できます。要求されたPolicyTypeのオーバーライドがない場合,そのPolicyTypeのシステム依存のデフォルト値が使用されます。デフォルトのポリシー値は指定されていないので,ポータブルアプリケーションは,VisiBroker ORBスコープで必要なデフォルトを設定してください。
-
CORBA::PolicyType type);
このメソッドは,オブジェクトリファレンスの有効ポリシーを返します。有効ポリシーは,リクエストの発行時に使用するポリシーです。まず,get_client_policyが返すPolicyTypeの有効オーバーライドを取得します。次に,IOR指定のポリシーと有効オーバーライドを比較します。有効ポリシーは,有効オーバーライドとIOR指定のポリシーが許容する値の共通部分です。共通部分が空の場合は,INV_POLICYシステム例外が発生します。空でない場合は,共通部分に正しく入っているポリシーを有効ポリシーとして返します。IORにポリシー値の指定がない場合は,正しい任意の値を使用できます。有効なポリシーを確実に返すには,get_policyメソッドを呼び出す前に,オブジェクトリファレンスに対して_non_existentメソッド,またはvalidate_connectionメソッドを呼び出してください。オブジェクトリファレンスをバインドする前にget_policyを呼び出すと,実装に依存した有効なポリシーが返されます。この状況では,仕様に準拠したインプリメンテーションは次のどれかの動作をする可能性があります。
-
CORBA::BAD_INV_ORDER例外を発生する
-
バインドの実行後に変更される可能性のあるPolicyTypeの値を返す
-
バインドを試みてから有効ポリシーを返す
RebindPolicyの値がTRANSPARENTである場合は,透過的なリバインドによって,有効ポリシーは呼び出しごとに変わる可能性があります。
- 注
-
Borland Enterprise Server VisiBrokerインプリメンテーションでは,このメソッドはオブジェクト,スレッド,およびVisiBroker ORBに割り当てられたポリシーを取得します。
-
-
CORBA::PolicyList *get_policy_overrides(
const CORBA::PolicyTypeSeq& ts);
このメソッドは,要求されたPolicy型のポリシーを含むリストを返します。空シーケンスを指定した場合,つまりリストの長さが0の場合,該当するスコープのポリシーをすべて返します。要求されたPolicy型がターゲットPolicyManagerに設定されていない場合,空シーケンスを返します。
-
CORBA::Object_ptr set_policy_overrides(
const PolicyList& _policies, CORBA::SetOverrideType _set_add);
このメソッドは,指定されたポリシーのリストを反映したCORBA::Objectの複製を返します。
-
policies
Policyオブジェクトのリファレンスのシーケンス
-
set_add
ポリシーを,Objectにすでに存在するほかのオーバーライドに追加(ADD_OVERRIDE)するか,またはオーバーライドがないObjectに追加(SET_OVERRIDE)するかを示します。
-
-
CORBA::Boolean validate_connection(
CORBA::PolicyList& inconsistent_policies);
オブジェクトの現在の有効ポリシーで呼び出せる場合,このメソッドはTRUEを返します。オブジェクトリファレンスがバインド済みでない場合,オペレーションの一環としてバインディングをします。オブジェクトリファレンスがバインド済みの場合でも,現在のポリシーオーバーライドが変更されていたり,バインディングが無効になっている場合は,RebindPolicyオーバーライドの設定に関係なくリバインドされます。現在の有効RebindPolicyが暗黙的リバインドを許可していない場合,そのようなリバインドを強制的にできるのはvalidate_connectionオペレーションだけです。バインドやリバインドを試みると,VisiBroker ORBによってGIOPのLocateRequests処理がされます。
現在の有効ポリシーで呼び出すとINV_POLICYシステム例外が発生する場合,このメソッドはFALSEを返します。現在の有効ポリシーに不具合がある場合,不具合を生じさせるポリシーを,outパラメタのinconsistent_policiesに格納します。この返されたポリシーのリストは,すべての原因を網羅しているわけではありません。ポリシーのオーバーライドに関係ない原因によってバインディングが失敗した場合は,その原因に応じたシステム例外が発生します。