2 #include "ace/OS_NS_unistd.h"
3 #include "ace/OS_NS_string.h"
6 test_i::test_i (CORBA::ORB_ptr orb
,
7 PortableServer::POA_ptr poa
)
8 : orb_ (CORBA::ORB::_duplicate (orb
)),
9 poa_ (PortableServer::POA::_duplicate (poa
))
13 PortableServer::POA_ptr
14 test_i::_default_POA ()
16 return PortableServer::POA::_duplicate (this->poa_
.in ());
25 test_i::oneway_method ()
30 test_i::sleep (CORBA::ULong timeout
,
34 "Thread %t starting %s with timeout %d\n",
38 ACE_OS::sleep (timeout
);
41 "Thread %t completes %s\n",
46 test_i::timed_method (CORBA::ULong timeout
)
49 "test_i::timed_method");
53 test_i::timed_oneway_method (CORBA::ULong timeout
)
56 "test_i::timed_oneway_method");
62 this->orb_
->shutdown (false);
66 // This is the point of entry into this library.
67 extern "C" GENERIC_SERVANT_Export
PortableServer::Servant
create_test_i (CORBA::ORB_ptr orb
,
68 PortableServer::POA_ptr poa
);
70 PortableServer::Servant
71 create_test_i (CORBA::ORB_ptr orb
,
72 PortableServer::POA_ptr poa
)
74 PortableServer::Servant servant
;
76 ACE_NEW_RETURN (servant
,
84 extern "C" GENERIC_SERVANT_Export
PortableServer::Servant
supply_servant (const PortableServer::ObjectId
&oid
,
85 PortableServer::POA_ptr poa
,
88 PortableServer::Servant
89 supply_servant (const PortableServer::ObjectId
&oid
,
90 PortableServer::POA_ptr poa
,
93 PortableServer::Servant servant
= 0;
95 // Convert ObjectId to string.
96 CORBA::String_var s
= PortableServer::ObjectId_to_string (oid
);
98 if (ACE_OS::strstr (s
.in (), "test") != 0)
99 ACE_NEW_RETURN (servant
,
106 extern "C" GENERIC_SERVANT_Export
void destroy_servant (const PortableServer::ObjectId
&oid
,
107 PortableServer::POA_ptr poa
,
108 PortableServer::Servant servant
);
111 destroy_servant (const PortableServer::ObjectId
& /* oid */,
112 PortableServer::POA_ptr
/* poa */,
113 PortableServer::Servant servant
)