Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / tests / POA / Bug_1592_Regression / ServantLocator.cpp
blob68139aea534f70e72adfbc34dd58261ee8753a0b
1 #include "ServantLocator.h"
2 #include "test_i.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)),
10 servant_ ()
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)
29 error_status_ = true;
30 ACE_ERROR ((LM_ERROR,
31 "PortableInterceptor::ServerRequestInterceptor:: "
32 "receive_request_service_contexts() not called\n"
33 "prior to "
34 "PortableServer::ServantLocator::preinvoke().\n"));
36 throw CORBA::INTERNAL ();
39 if (this->servant_.in () == 0)
41 test_i * servant;
43 ACE_NEW_THROW_EX (servant,
44 test_i (this->orb_.in ()),
45 CORBA::NO_MEMORY ());
47 this->servant_ = servant;
51 return this->servant_.in ();
55 void
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)
68 error_status_ = true;
69 ACE_ERROR ((LM_ERROR,
70 "ERROR: PortableInterceptor::ServerRequestInterceptor"
71 "\n"
72 "ERROR: ending interception point incorrectly "
73 "called prior to\n"
74 "ERROR: "
75 "PortableServer::ServantLocator::postinvoke().\n"));
77 throw CORBA::INTERNAL ();