4 * @author Carlos O'Ryan <coryan@atdesk.com>
7 #include "tao/Messaging/Messaging.h"
8 #include "orbsvcs/CosNamingC.h"
11 ORB_Task::ORB_Task (CORBA::ORB_ptr orb
)
12 : orb_ (CORBA::ORB::_duplicate (orb
))
21 CORBA::Object_var ncRef
=
22 orb_
->string_to_object(
23 "corbaloc:iiop:10.175.12.99:15025/NameService");
25 CORBA::PolicyList policies
;
27 TimeBase::TimeT timeout
= 5000 * 10000;
29 CORBA::Any timeoutAny
;
30 timeoutAny
<<= timeout
;
33 policies
[0] = orb_
->create_policy(
34 Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE
, timeoutAny
);
36 CORBA::Object_var object
= ncRef
->_set_policy_overrides(
37 policies
, CORBA::SET_OVERRIDE
);
39 policies
[0]->destroy();
41 CosNaming::NamingContext_var namingContext
=
42 CosNaming::NamingContext::_narrow( object
.in());
43 namingContext
->_non_existent();
45 catch ( const CORBA::TRANSIENT
&)
47 ACE_DEBUG ((LM_DEBUG
, "Caught transient\n"));
49 catch ( const CORBA::TIMEOUT
&)
51 ACE_DEBUG ((LM_DEBUG
, "Caught timeout\n"));
53 catch ( const CORBA::Exception
& e
)
55 e
._tao_print_exception ("Exception caught");