[Ace-users] [tao-users] How to set different message timeout policies for different calls
mitza at ociweb.com
Wed Feb 13 13:41:24 CST 2008
Keith Nicewarner wrote:
> I’m using the message timeout policy like this:
> // Create the policy and put it in a policy list.
> CORBA::PolicyList policies;
> policies =
> // Apply the policy at the ORB level using the ORBPolicyManager.
> CORBA::Object_var obj =
> CORBA::PolicyManager_var policy_manager =
> This sets the timeout for all client calls in my process (they all use
> the same ORB). But I want to set different timeouts for different
> calls on the same object. In fact, I might want to set the timeout
> dynamically (i.e. compute the timeout on the fly). Do I need to create
> a separate ORB for each timeout value or can I switch the policy on
> the fly? Or is there a better way to specify a per-method timeout value?
Set the policy at the object or thread level, whichever is appropriate
for your situation, instead of on the ORB. If you set the policy on the
object level you get a new object reference that enforces the policy, so
you can have as many of these as you'd like. See the
_set_policy_overrides() method of CORBA::Object. (This is discussed in
Section 184.108.40.206 of the TAO Developer's Guide.)
Object Computing, Inc.
More information about the Ace-users