Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / MT_NoUpcall_Connect / SharedIntf_i.cpp
blobe6803e01c06c490cfae97430988a35dc854adbcb
1 #include "SharedIntf_i.h"
2 #include "ace/Log_Priority.h"
3 #include "ace/OS_NS_unistd.h"
5 #include "tao/Messaging/Messaging.h"
6 #include "tao/PolicyC.h"
7 #include "tao/AnyTypeCode/Any.h"
9 Test_Idl_SharedIntf_i::Test_Idl_SharedIntf_i(CORBA::ORB_ptr orb)
10 : upper_ior (),
11 orb_ (orb)
15 Test_Idl_SharedIntf_i::~Test_Idl_SharedIntf_i() {}
17 void
18 Test_Idl_SharedIntf_i::set_upper (const char *ior)
20 this->upper_ior = CORBA::string_dup (ior);
23 void
24 Test_Idl_SharedIntf_i::do_upcall ()
26 ACE_DEBUG((LM_DEBUG,"(%P|%t) Test_Idl_SharedIntf::do_upcall called\n"));
28 CORBA::Object_var obj =
29 orb_->resolve_initial_references ("ORBPolicyManager");
31 CORBA::PolicyManager_var policy_manager_ =
32 CORBA::PolicyManager::_narrow (obj.in ());
34 TimeBase::TimeT timeout = 10000 * 100;
36 CORBA::Any any_orb;
37 any_orb <<= timeout;
39 CORBA::PolicyList policy_list (1);
40 policy_list.length (1);
41 policy_list[0] =
42 orb_->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
43 any_orb);
45 policy_manager_->set_policy_overrides (policy_list,
46 CORBA::SET_OVERRIDE);
49 obj = this->orb_->string_to_object (this->upper_ior.in());
50 Test_Idl::SharedIntf_var upper = Test_Idl::SharedIntf::_narrow (obj.in());
51 upper->ping ();
52 ACE_DEBUG((LM_DEBUG,"(%P|%t) Test_Idl_SharedIntf::do_upcall returning\n"));
55 void Test_Idl_SharedIntf_i::ping ()
57 ACE_DEBUG((LM_DEBUG,"(%P|%t) Test_Idl_SharedIntf::ping - called\n"));
60 void Test_Idl_SharedIntf_i::farewell ()
62 ACE_DEBUG((LM_INFO,"(%P|%t) farewell begins\n"));
63 // if (!CORBA::is_nil (this->upper_.in ()))
64 // {
65 // this->upper_->farewell ();
66 // }
67 this->orb_->shutdown ();
68 ACE_DEBUG((LM_INFO,"(%P|%t) farewell completes\n"));