#include <Table_Adapter.h>
Inheritance diagram for TAO_Table_Adapter:
Public Member Functions | |
TAO_Table_Adapter (TAO_ORB_Core *orb_core) | |
Constructor. | |
virtual | ~TAO_Table_Adapter (void) |
Destructor. | |
virtual void | open () |
virtual void | close (int wait_for_completion) |
virtual void | check_close (int wait_for_completion) |
virtual int | priority (void) const |
virtual int | dispatch (TAO::ObjectKey &key, TAO_ServerRequest &request, CORBA::Object_out foward_to) throw (CORBA::SystemException) |
virtual const char * | name (void) const |
virtual CORBA::Object_ptr | root (void) |
virtual CORBA::Object_ptr | create_collocated_object (TAO_Stub *, const TAO_MProfile &) |
virtual CORBA::Long | initialize_collocated_object (TAO_Stub *) |
Private Member Functions | |
CORBA::Long | find_object (TAO::ObjectKey &key, CORBA::Object_out forward_to) throw (CORBA::SystemException) |
Private Attributes | |
TAO_ORB_Core *const | orb_core_ |
The ORB Core we belong to. | |
TAO_IOR_Table_Impl * | root_ |
The table implementation. |
|
Constructor.
Definition at line 24 of file Table_Adapter.cpp.
|
|
Destructor.
Definition at line 30 of file Table_Adapter.cpp.
00031 { 00032 ::CORBA::release (this->root_); 00033 } |
|
Implements TAO_Adapter. Definition at line 52 of file Table_Adapter.cpp.
00053 { 00054 } |
|
Implements TAO_Adapter. Definition at line 45 of file Table_Adapter.cpp.
|
|
Implements TAO_Adapter. Definition at line 86 of file Table_Adapter.cpp. References CORBA::Object::_nil(), ACE_NEW_RETURN, and initialize_collocated_object().
00088 { 00089 CORBA::Object_ptr result = CORBA::Object::_nil (); 00090 00091 if (! this->initialize_collocated_object (stub)) // 0 == success 00092 { 00093 // A reference was found in the table. The stub has been forwarded 00094 // to this. The collocation indicators are now correct on the stub 00095 // (although they may well now indicate that the stub is not in fact 00096 // collocated at all). 00097 ACE_NEW_RETURN (result, 00098 CORBA::Object (stub, 00099 stub->is_collocated (), 00100 stub->collocated_servant ()), 00101 CORBA::Object::_nil ()); 00102 00103 } 00104 00105 return result; 00106 } |
|
Implements TAO_Adapter. Definition at line 63 of file Table_Adapter.cpp.
00068 { 00069 return this->find_object (key, forward_to) ? TAO_Adapter::DS_FORWARD 00070 : TAO_Adapter::DS_MISMATCHED_KEY; 00071 } |
|
Helper method to find an object bound in the table.
Definition at line 144 of file Table_Adapter.cpp. References ACE_CATCH, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, and TAO::ObjectKey::encode_sequence_to_string(). Referenced by initialize_collocated_object().
00148 { 00149 CORBA::String_var object_key; 00150 TAO::ObjectKey::encode_sequence_to_string (object_key.out (), 00151 key); 00152 ACE_TRY 00153 { 00154 CORBA::String_var ior = 00155 this->root_->find (object_key.in () ACE_ENV_ARG_PARAMETER); 00156 ACE_TRY_CHECK; 00157 00158 forward_to = 00159 this->orb_core_->orb ()->string_to_object (ior.in () 00160 ACE_ENV_ARG_PARAMETER); 00161 ACE_TRY_CHECK; 00162 } 00163 ACE_CATCH (IORTable::NotFound, nf_ex) 00164 { 00165 return 0; 00166 } 00167 ACE_ENDTRY; 00168 return 1; 00169 } |
|
Implements TAO_Adapter. Definition at line 109 of file Table_Adapter.cpp. References TAO_Profile::_key(), CORBA::Object::_nil(), ACE_CATCHANY, ACE_ENDTRY, ACE_TRY_NEW_ENV, TAO_Stub::add_forward_profiles(), TAO_Stub::base_profiles(), find_object(), TAO_Stub::forward_profiles(), TAO_MProfile::get_profile(), TAO_Stub::next_profile(), and TAO_PHandle. Referenced by create_collocated_object().
00110 { 00111 // Get the effective profile set. 00112 const TAO_MProfile &mp = stub->forward_profiles () ? *(stub->forward_profiles ()) 00113 : stub->base_profiles (); 00114 TAO_PHandle j = 0; 00115 // We only look at the key from the 0th profile but we only really care about 00116 // corbaloc's here where all profiles share a single object key 00117 TAO::ObjectKey_var key = mp.get_profile (j)->_key (); 00118 00119 CORBA::Object_var forward_to = CORBA::Object::_nil (); 00120 CORBA::Boolean found = false; 00121 00122 ACE_TRY_NEW_ENV 00123 { 00124 found = this->find_object (key, forward_to.out ()); 00125 } 00126 ACE_CATCHANY 00127 { 00128 } 00129 ACE_ENDTRY; 00130 00131 if (found) 00132 { 00133 // This call will set the appropriate collocation values 00134 // to correspond to the reference we found in the table. 00135 stub->add_forward_profiles (forward_to->_stubobj ()->base_profiles ()); 00136 stub->next_profile (); 00137 } 00138 00139 // 0 for success 00140 return ! found; 00141 } |
|
Implements TAO_Adapter. Definition at line 74 of file Table_Adapter.cpp.
00075 { 00076 return "IORTable"; 00077 } |
|
Implements TAO_Adapter. Definition at line 36 of file Table_Adapter.cpp. References ACE_CHECK, and ACE_NEW_THROW_EX.
00037 { 00038 ACE_NEW_THROW_EX (this->root_, 00039 TAO_IOR_Table_Impl (), 00040 CORBA::NO_MEMORY ()); 00041 ACE_CHECK; 00042 } |
|
Implements TAO_Adapter. Definition at line 57 of file Table_Adapter.cpp.
00058 { 00059 return 16; // @@ 00060 } |
|
Implements TAO_Adapter. Definition at line 80 of file Table_Adapter.cpp. References CORBA::Object::_duplicate().
00081 { 00082 return CORBA::Object::_duplicate (this->root_); 00083 } |
|
The ORB Core we belong to.
Definition at line 69 of file Table_Adapter.h. |
|
The table implementation.
Definition at line 72 of file Table_Adapter.h. |