diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-19 19:43:36 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-19 19:43:36 +0000 |
commit | 97f43db9e3dacb366038f91d79fdbfdaa20ee22f (patch) | |
tree | 504b14495c3090b11754f1f58ea4c25bd22a143a | |
parent | e4b072a65e5e31997a28c529974026ac4fbd7ec2 (diff) | |
download | ATCD-97f43db9e3dacb366038f91d79fdbfdaa20ee22f.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/poa.cpp | 36 | ||||
-rw-r--r-- | TAO/tao/poa.h | 3 |
2 files changed, 20 insertions, 19 deletions
diff --git a/TAO/tao/poa.cpp b/TAO/tao/poa.cpp index e6f0fe85130..1feb98d9542 100644 --- a/TAO/tao/poa.cpp +++ b/TAO/tao/poa.cpp @@ -12,17 +12,6 @@ // auto_ptr class #include "ace/Auto_Ptr.h" -template <class STUB, class IMPLEMENTATION> -IMPLEMENTATION * -stub_to_impl (STUB stub) -{ - PortableServer::Servant servant = stub->_servant (); - if (servant == 0) - return 0; - - return ACE_dynamic_cast (IMPLEMENTATION *, servant); -} - TAO_Thread_Policy::TAO_Thread_Policy (PortableServer::ThreadPolicyValue value) : value_ (value) { @@ -627,10 +616,18 @@ TAO_POA::create_POA (const char *adapter_name, } else { - poa_manager_impl = stub_to_impl<PortableServer::POAManager_ptr, - TAO_POA_Manager> (poa_manager); - } + PortableServer::Servant servant = poa_manager->_servant (); + if (servant == 0) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return PortableServer::POA::_nil (); + } + + poa_manager_impl = ACE_dynamic_cast (TAO_POA_Manager *, servant); + } + TAO_POA *result = this->create_POA (adapter_name, *poa_manager_impl, tao_policies, @@ -2231,8 +2228,15 @@ TAO_Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, const char *name, CORBA::Environment &env) { - TAO_POA *parent_impl = stub_to_impl<PortableServer::POA_ptr, - TAO_POA> (parent); + PortableServer::Servant servant = parent->_servant (); + if (servant == 0) + { + CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); + env.exception (exception); + return CORBA::B_FALSE; + } + + TAO_POA *parent_impl = ACE_dynamic_cast (TAO_POA *, servant); return this->unknown_adapter_i (parent_impl, name, diff --git a/TAO/tao/poa.h b/TAO/tao/poa.h index 4d44825e756..ebc5cb6a419 100644 --- a/TAO/tao/poa.h +++ b/TAO/tao/poa.h @@ -52,9 +52,6 @@ class TAO_POA; class TAO_POA_Manager; -template <class STUB, class IMPLEMENTATION> -IMPLEMENTATION *stub_to_impl (STUB stub); - class TAO_Thread_Policy : public POA_PortableServer::ThreadPolicy { public: |