1 #include "ServantLocator.h"
4 extern CORBA::Boolean receive_request_service_contexts_called
;
5 extern CORBA::Boolean ending_interception_point_called
;
7 ServantLocator::ServantLocator (CORBA::ORB_ptr orb
)
8 : error_status_ (false),
9 orb_ (CORBA::ORB::_duplicate (orb
)),
14 ServantLocator::~ServantLocator ()
18 PortableServer::Servant
19 ServantLocator::preinvoke (
20 const PortableServer::ObjectId
& /* oid */,
21 PortableServer::POA_ptr
/* adapter */,
22 const char * operation
,
23 PortableServer::ServantLocator::Cookie
& /* the_cookie */)
25 if (ACE_OS::strcmp (operation
, "shutdown") != 0)
27 if (receive_request_service_contexts_called
== 0)
31 "PortableInterceptor::ServerRequestInterceptor:: "
32 "receive_request_service_contexts() not called\n"
34 "PortableServer::ServantLocator::preinvoke().\n"));
36 throw CORBA::INTERNAL ();
39 if (this->servant_
.in () == 0)
43 ACE_NEW_THROW_EX (servant
,
44 test_i (this->orb_
.in ()),
47 this->servant_
= servant
;
51 return this->servant_
.in ();
56 ServantLocator::postinvoke (
57 const PortableServer::ObjectId
& /* oid */,
58 PortableServer::POA_ptr
/* adapter */,
59 const char * operation
,
60 PortableServer::ServantLocator::Cookie
/* the_cookie */,
61 PortableServer::Servant
/* the_servant */)
63 if (ACE_OS::strcmp (operation
, "shutdown") != 0)
65 // Ending interception points should be called after postinvoke().
66 if (::ending_interception_point_called
!= 0)
70 "ERROR: PortableInterceptor::ServerRequestInterceptor"
72 "ERROR: ending interception point incorrectly "
75 "PortableServer::ServantLocator::postinvoke().\n"));
77 throw CORBA::INTERNAL ();