Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / PortableServer / Object_Adapter.inl
blob7092ede9222aafbbc22f809582da1ef2330605ec
1 // -*- C++ -*-
2 #include "tao/SystemException.h"
3 #include "ace/CORBA_macros.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
7 ACE_INLINE TAO_Policy_Validator &
8 TAO_Object_Adapter::validator ()
10   return this->default_validator_;
13 ACE_INLINE TAO_POA_Policy_Set &
14 TAO_Object_Adapter::default_poa_policies ()
16   return this->default_poa_policies_;
19 ACE_INLINE ACE_Lock &
20 TAO_Object_Adapter::lock ()
22   return *this->lock_;
25 ACE_INLINE TAO_SYNCH_MUTEX &
26 TAO_Object_Adapter::thread_lock ()
28   return this->thread_lock_;
31 ACE_INLINE ACE_Reverse_Lock<ACE_Lock> &
32 TAO_Object_Adapter::reverse_lock ()
34   return this->reverse_lock_;
37 /* static */
38 ACE_INLINE CORBA::ULong
39 TAO_Object_Adapter::transient_poa_name_size ()
41   return TAO_Object_Adapter::transient_poa_name_size_;
44 ACE_INLINE int
45 TAO_Object_Adapter::locate_servant (const TAO::ObjectKey &key)
47   // Lock access for the duration of this transaction.
48   TAO_OBJECT_ADAPTER_GUARD_RETURN (-1);
50   return this->locate_servant_i (key);
53 ACE_INLINE TAO_Servant_Location
54 TAO_Object_Adapter::find_servant (const TAO::ObjectKey &key,
55                                   PortableServer::Servant &servant)
57   // Lock access for the duration of this transaction.
58   TAO_OBJECT_ADAPTER_GUARD_RETURN (Not_Found);
60   return this->find_servant_i (key, servant);
63 ACE_INLINE int
64 TAO_Object_Adapter::find_persistent_poa (const poa_name &system_name,
65                                          TAO_Root_POA *&poa)
67   return this->hint_strategy_->find_persistent_poa (system_name, poa);
70 ACE_INLINE int
71 TAO_Object_Adapter::find_poa (const poa_name &system_name,
72                               CORBA::Boolean activate_it,
73                               CORBA::Boolean root,
74                               const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time,
75                               TAO_Root_POA *&poa)
77   if (activate_it)
78     {
79       return this->find_persistent_poa (system_name, poa);
80     }
81   else
82     {
83       return this->find_transient_poa (system_name,
84                                        root,
85                                        poa_creation_time,
86                                        poa);
87     }
90 ACE_INLINE int
91 TAO_Object_Adapter::bind_transient_poa (TAO_Root_POA *poa,
92                                         poa_name_out system_name)
94   poa_name name;
95   int result = this->transient_poa_map_->bind_create_key (poa, name);
97   if (result == 0)
98     {
99       ACE_NEW_RETURN (system_name,
100                       poa_name (name),
101                       -1);
102     }
104   return result;
107 ACE_INLINE int
108 TAO_Object_Adapter::bind_persistent_poa (const poa_name &folded_name,
109                                          TAO_Root_POA *poa,
110                                          poa_name_out system_name)
112   return this->hint_strategy_->bind_persistent_poa (folded_name,
113                                                     poa,
114                                                     system_name);
117 ACE_INLINE int
118 TAO_Object_Adapter::unbind_transient_poa (const poa_name &system_name)
120   return this->transient_poa_map_->unbind (system_name);
123 ACE_INLINE int
124 TAO_Object_Adapter::unbind_persistent_poa (const poa_name &folded_name,
125                                            const poa_name &system_name)
127   return this->hint_strategy_->unbind_persistent_poa (folded_name,
128                                                       system_name);
131 ACE_INLINE TAO_Root_POA *
132 TAO_Object_Adapter::root_poa () const
134   return this->root_;
137 ACE_INLINE TAO_ORB_Core &
138 TAO_Object_Adapter::orb_core () const
140   return this->orb_core_;
143 ACE_INLINE TAO::Portable_Server::Non_Servant_Upcall *
144 TAO_Object_Adapter::non_servant_upcall_in_progress () const
146   return this->non_servant_upcall_in_progress_;
149 TAO_END_VERSIONED_NAMESPACE_DECL