Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / PortableServer / RequestProcessingStrategyAOMOnly.cpp
blob6d90a05f0237d275015785bede4aff6e67669edc
1 // -*- C++ -*-
2 #include "tao/ORB_Constants.h"
3 #include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h"
4 #include "tao/PortableServer/ServantManagerC.h"
5 #include "tao/PortableServer/Non_Servant_Upcall.h"
6 #include "tao/PortableServer/Servant_Base.h"
7 #include "tao/PortableServer/Root_POA.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 namespace TAO
13 namespace Portable_Server
15 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
16 PortableServer::ServantManager_ptr
17 RequestProcessingStrategyAOMOnly::get_servant_manager ()
19 throw PortableServer::POA::WrongPolicy ();
22 void
23 RequestProcessingStrategyAOMOnly::set_servant_manager (
24 PortableServer::ServantManager_ptr /*imgr*/)
26 throw PortableServer::POA::WrongPolicy ();
29 void
30 RequestProcessingStrategyAOMOnly::set_servant (
31 PortableServer::Servant /*servant*/)
33 throw PortableServer::POA::WrongPolicy ();
36 PortableServer::Servant
37 RequestProcessingStrategyAOMOnly::get_servant ()
39 throw PortableServer::POA::WrongPolicy ();
41 #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
43 TAO_Servant_Location
44 RequestProcessingStrategyAOMOnly::locate_servant (
45 const PortableServer::ObjectId & system_id,
46 PortableServer::Servant & servant)
48 return this->poa_->servant_present (system_id, servant);
51 PortableServer::Servant
52 RequestProcessingStrategyAOMOnly::locate_servant (
53 const char * /*operation*/,
54 const PortableServer::ObjectId &system_id,
55 TAO::Portable_Server::Servant_Upcall &servant_upcall,
56 TAO::Portable_Server::POA_Current_Impl &poa_current_impl,
57 bool & /*wait_occurred_restart_call*/)
59 PortableServer::Servant servant = 0;
61 servant = this->poa_->find_servant (system_id,
62 servant_upcall,
63 poa_current_impl);
65 if (servant == 0)
67 throw ::CORBA::OBJECT_NOT_EXIST (
68 CORBA::OMGVMCID | 2,
69 CORBA::COMPLETED_NO);
72 return servant;
75 PortableServer::Servant
76 RequestProcessingStrategyAOMOnly::system_id_to_servant (
77 const PortableServer::ObjectId &system_id)
79 return this->poa_->find_servant (system_id);
82 PortableServer::Servant
83 RequestProcessingStrategyAOMOnly::id_to_servant (
84 const PortableServer::ObjectId &id)
86 return this->poa_->user_id_to_servant_i (id);
89 void
90 RequestProcessingStrategyAOMOnly::cleanup_servant (
91 PortableServer::Servant servant,
92 const PortableServer::ObjectId &user_id)
94 if (servant)
96 // ATTENTION: Trick locking here, see class header for details
97 Non_Servant_Upcall non_servant_upcall (*this->poa_);
98 ACE_UNUSED_ARG (non_servant_upcall);
102 servant->_remove_ref ();
104 catch (...)
106 // Ignore exceptions from servant cleanup.
110 // This operation causes the association of the Object Id specified
111 // by the oid parameter and its servant to be removed from the
112 // Active Object Map.
113 if (this->poa_->unbind_using_user_id (user_id) != 0)
115 throw ::CORBA::OBJ_ADAPTER ();
119 void
120 RequestProcessingStrategyAOMOnly::etherealize_objects (
121 CORBA::Boolean /*etherealize_objects*/)
125 PortableServer::ObjectId *
126 RequestProcessingStrategyAOMOnly::servant_to_id (
127 PortableServer::Servant servant)
129 return this->poa_->servant_to_user_id (servant);
132 void
133 RequestProcessingStrategyAOMOnly::post_invoke_servant_cleanup(
134 const PortableServer::ObjectId &/*system_id*/,
135 const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/)
141 TAO_END_VERSIONED_NAMESPACE_DECL