diff options
author | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-04-13 18:58:34 +0000 |
---|---|---|
committer | michel_j <michel_j@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2005-04-13 18:58:34 +0000 |
commit | 839d93889cdbfcf23e075d6fb785e092bc71aaf7 (patch) | |
tree | 16015c47b4f8c5e760c7ed3968cb401a129c2eea | |
parent | 071a348789b173814ae956a2aa2e74dfec5fddd0 (diff) | |
download | ATCD-839d93889cdbfcf23e075d6fb785e092bc71aaf7.tar.gz |
Wed Apr 13 19:51:12 UTC 2005 Justin Michel <michel_j@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 26 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp | 8 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp | 11 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp | 13 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/ImR_Client/ImR_Client.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.h | 10 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ServantRetentionStrategy.h | 3 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h | 3 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp | 15 | ||||
-rw-r--r-- | TAO/tao/PortableServer/ServantRetentionStrategyRetain.h | 4 |
14 files changed, 106 insertions, 34 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index fbedd606664..c1e5c358b1e 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,29 @@ +Wed Apr 13 19:51:12 UTC 2005 Justin Michel <michel_j@ociweb.com> + + * TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp: + * TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp: + * TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp: + * TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp: + * TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp: + * TAO/tao/ImR_Client/ImR_Client.cpp: + * TAO/tao/PortableServer/Root_POA.cpp: + * TAO/tao/PortableServer/Root_POA.h: + * TAO/tao/PortableServer/ServantRetentionStrategy.h: + * TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp: + * TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h: + * TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp: + * TAO/tao/PortableServer/ServantRetentionStrategyRetain.h: + + Add the ability to specify whether you want an indirect object + reference when calling TAO_Root_POA::id_to_reference_i(). This is + required for efficient and correct use of an IORTable with the ImR. + No new methods whatsoever were added to support this feature. Instead, + I just had to add the additional bool parameter to several places. Therefore + I expect the footprint impact to be minimal. + + Updated all ImR tests and examples that use an IORTable, to bind + a direct object reference by specifying id_to_reference(id.in(), false) + Wed Apr 13 11:47:14 2005 Ossama Othman <ossama@dre.vanderbilt.edu> * tao/Utils/Server_Main.cpp: diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp index 5350e4393de..8566023c945 100644 --- a/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp +++ b/TAO/orbsvcs/examples/ImR/Combined_Service/dynserver.cpp @@ -2,6 +2,7 @@ #include "dynserver.h" #include "tao/IORTable/IORTable.h" +#include "tao/PortableServer/Root_POA.h" #include "ace/Dynamic_Service.h" #include "ace/Task.h" @@ -92,10 +93,13 @@ DynServer_Loader::init (int argc, ACE_TCHAR* argv[] ACE_ENV_ARG_DECL) poa1->activate_object_with_id(id.in(), svt1); poa2->activate_object_with_id(id.in(), svt2); - obj = poa1->id_to_reference(id.in()); + TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(poa1.in()); + obj = tmp_poa->id_to_reference_i (id.in(), false); String_var ior = orb_->object_to_string(obj.in()); ior_table->bind ("DynObject1", ior.in()); - obj = poa2->id_to_reference(id.in()); + + tmp_poa = dynamic_cast<TAO_Root_POA*>(poa2.in()); + obj = tmp_poa->id_to_reference_i (id.in(), false); ior = orb_->object_to_string(obj.in()); ior_table->bind ("DynObject2", ior.in()); diff --git a/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp b/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp index c83a0dc78d4..a3d821fde70 100644 --- a/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp +++ b/TAO/orbsvcs/examples/ImR/Combined_Service/test_server.cpp @@ -5,6 +5,7 @@ #include "testS.h" #include "tao/IORTable/IORTable.h" +#include "tao/PortableServer/Root_POA.h" #include "ace/streams.h" #include "ace/ARGV.h" @@ -64,10 +65,13 @@ int main(int argc, char* argv[]) { poa1->activate_object_with_id(id.in(), &svt1); poa2->activate_object_with_id(id.in(), &svt2); - obj = poa1->id_to_reference(id.in()); + TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(poa1.in()); + obj = tmp_poa->id_to_reference_i (id.in(), false); String_var ior = orb->object_to_string(obj.in()); ior_table->bind ("TestObject1", ior.in()); - obj = poa2->id_to_reference(id.in()); + + tmp_poa = dynamic_cast<TAO_Root_POA*>(poa2.in()); + obj = tmp_poa->id_to_reference_i (id.in(), false); ior = orb->object_to_string(obj.in()); ior_table->bind ("TestObject2", ior.in()); diff --git a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp index fef9a2c0b7d..b0e9d462649 100644 --- a/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/airplane_server_i.cpp @@ -5,6 +5,7 @@ #include "tao/IORTable/IORTable.h" #include "tao/ImR_Client/ImR_Client.h" #include "tao/debug.h" +#include "tao/PortableServer/Root_POA.h" #include "ace/Get_Opt.h" #include "ace/Read_Buffer.h" @@ -151,10 +152,16 @@ Airplane_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) CORBA::String_var ior = this->orb_->object_to_string (server_obj.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "The IOR is: <%s>\n", ior.in ())); + TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(airplane_poa_.in()); + server_obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + CORBA::String_var direct_ior = + this->orb_->object_to_string (server_obj.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + CORBA::Object_var table_object = this->orb_->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; @@ -163,7 +170,7 @@ Airplane_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; ACE_ASSERT(! CORBA::is_nil (adapter.in ())); - adapter->bind (poa_name, ior.in () ACE_ENV_ARG_PARAMETER); + adapter->bind (poa_name, direct_ior.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; // Make sure the POA manager is activated. diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp index 9330dcfe194..3fc4e802894 100644 --- a/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp @@ -1,9 +1,12 @@ // $Id$ #include "nestea_server_i.h" + #include "tao/IORTable/IORTable.h" #include "tao/ImR_Client/ImR_Client.h" #include "tao/debug.h" +#include "tao/PortableServer/Root_POA.h" + #include "ace/Get_Opt.h" #include "ace/Read_Buffer.h" #include "ace/OS_NS_stdio.h" @@ -182,10 +185,16 @@ Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) CORBA::String_var server_str = this->orb_->object_to_string (server_obj.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "The IOR is: <%s>\n", server_str.in ())); + TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(nestea_poa_.in()); + server_obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + CORBA::String_var direct_ior = + this->orb_->object_to_string (server_obj.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + CORBA::Object_var table_object = this->orb_->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER); @@ -200,7 +209,7 @@ Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) } else { - adapter->bind (poa_name, server_str.in () ACE_ENV_ARG_PARAMETER); + adapter->bind (poa_name, direct_ior.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp index e19d5b4e0d3..4f03db1f63b 100644 --- a/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/scale/server_i.cpp @@ -4,6 +4,7 @@ #include "tao/IORTable/IORTable.h" #include "tao/PortableServer/PS_CurrentC.h" +#include "tao/PortableServer/Root_POA.h" #include "tao/ImR_Client/ImR_Client.h" #include "ace/Get_Opt.h" @@ -158,13 +159,15 @@ Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) poa->activate_object_with_id (server_id.in (), test_svt ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - obj = poa->id_to_reference (server_id.in() ACE_ENV_ARG_PARAMETER); + TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(poa.in()); + obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - CORBA::String_var ior = this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER); + CORBA::String_var direct_ior = + this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - ior_table->bind (name.c_str(), ior.in () ACE_ENV_ARG_PARAMETER); + ior_table->bind (name.c_str(), direct_ior.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/tao/ImR_Client/ImR_Client.cpp b/TAO/tao/ImR_Client/ImR_Client.cpp index 39abaf9da0b..6c1be42c8e8 100644 --- a/TAO/tao/ImR_Client/ImR_Client.cpp +++ b/TAO/tao/ImR_Client/ImR_Client.cpp @@ -69,7 +69,7 @@ namespace TAO ACE_ENV_ARG_PARAMETER); ACE_CHECK; - CORBA::Object_var obj = root_poa->id_to_reference_i (id.in () + CORBA::Object_var obj = root_poa->id_to_reference_i (id.in (), false ACE_ENV_ARG_PARAMETER); ACE_CHECK; diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index 8aad96c6e66..57d3c1f3b0e 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -752,7 +752,7 @@ TAO_Root_POA::id_to_reference (const PortableServer::ObjectId &oid // Lock access for the duration of this transaction. TAO_POA_GUARD_RETURN (0); - return this->id_to_reference_i (oid ACE_ENV_ARG_PARAMETER); + return this->id_to_reference_i (oid, true ACE_ENV_ARG_PARAMETER); } @@ -1625,14 +1625,15 @@ TAO_Root_POA::user_id_to_servant_i (const PortableServer::ObjectId &id } CORBA::Object_ptr -TAO_Root_POA::id_to_reference_i (const PortableServer::ObjectId &id +TAO_Root_POA::id_to_reference_i (const PortableServer::ObjectId &id, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, PortableServer::POA::WrongPolicy)) { return this->active_policy_strategies_.servant_retention_strategy()-> - id_to_reference (id ACE_ENV_ARG_PARAMETER); + id_to_reference (id, indirect ACE_ENV_ARG_PARAMETER); } CORBA::OctetSeq * @@ -2031,7 +2032,8 @@ TAO_Root_POA::invoke_key_to_object (ACE_ENV_SINGLE_ARG_DECL) this->key_to_object_params_.type_id_, this->key_to_object_params_.servant_, this->key_to_object_params_.collocated_, - this->key_to_object_params_.priority_ + this->key_to_object_params_.priority_, + this->key_to_object_params_.indirect_ ACE_ENV_ARG_PARAMETER); } @@ -2040,7 +2042,8 @@ TAO_Root_POA::key_to_object (const TAO::ObjectKey &key, const char *type_id, TAO_ServantBase *servant, CORBA::Boolean collocated, - CORBA::Short priority + CORBA::Short priority, + bool indirect ACE_ENV_ARG_DECL) { // Check if the ORB is still running, otherwise throw an exception. @@ -2056,7 +2059,7 @@ TAO_Root_POA::key_to_object (const TAO::ObjectKey &key, CORBA::Object_ptr obj = CORBA::Object::_nil (); - if (this->active_policy_strategies_.lifespan_strategy()->use_imr ()) + if (indirect && this->active_policy_strategies_.lifespan_strategy()->use_imr ()) { // Check to see if we alter the IOR. CORBA::Object_var imr = @@ -2722,13 +2725,15 @@ TAO_Root_POA::Key_To_Object_Params::set (PortableServer::ObjectId_var &system_id const char *type_id, TAO_ServantBase *servant, CORBA::Boolean collocated, - CORBA::Short priority) + CORBA::Short priority, + bool indirect) { this->system_id_ = &system_id; this->type_id_ = type_id; this->servant_ = servant; this->collocated_ = collocated; this->priority_ = priority; + this->indirect_ = indirect; } CORBA::ULong diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h index 64cb4ecadf1..33aab49e7b2 100644 --- a/TAO/tao/PortableServer/Root_POA.h +++ b/TAO/tao/PortableServer/Root_POA.h @@ -529,7 +529,8 @@ public: PortableServer::POA::ServantAlreadyActive, PortableServer::POA::WrongPolicy)); - CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid + CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, @@ -643,7 +644,8 @@ protected: const char *type_id, TAO_ServantBase *servant, CORBA::Boolean collocated, - CORBA::Short priority + CORBA::Short priority, + bool indirect ACE_ENV_ARG_DECL); /// Like key_to_stub() but assume that the ORB is not shutting down. @@ -915,12 +917,14 @@ public: TAO_ServantBase *servant_; CORBA::Boolean collocated_; CORBA::Short priority_; + bool indirect_; void set (PortableServer::ObjectId_var &system_id_, const char *type_id_, TAO_ServantBase *servant_, CORBA::Boolean collocated_, - CORBA::Short priority_); + CORBA::Short priority_, + bool indirect); }; Key_To_Object_Params key_to_object_params_; diff --git a/TAO/tao/PortableServer/ServantRetentionStrategy.h b/TAO/tao/PortableServer/ServantRetentionStrategy.h index e710ff25f97..96128f3d920 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategy.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategy.h @@ -96,7 +96,8 @@ namespace TAO PortableServer::POA::WrongPolicy)) = 0; virtual CORBA::Object_ptr id_to_reference ( - const PortableServer::ObjectId &id + const PortableServer::ObjectId &id, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp index 11d451756ff..c26ac5b373d 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp @@ -97,7 +97,8 @@ namespace TAO CORBA::Object_ptr ServantRetentionStrategyNonRetain::id_to_reference ( - const PortableServer::ObjectId &/*id*/ + const PortableServer::ObjectId &/*id*/, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, @@ -247,7 +248,8 @@ namespace TAO intf, 0, 1, - priority); + priority, + true); return this->poa_->invoke_key_to_object_helper_i (intf, user_id @@ -288,7 +290,8 @@ namespace TAO intf, servant, 1, - priority); + priority, + true); return this->poa_->invoke_key_to_object_helper_i (intf, oid diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h index e161732e088..7262b3d8a90 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h @@ -89,7 +89,8 @@ namespace TAO PortableServer::POA::WrongPolicy)); CORBA::Object_ptr - id_to_reference (const PortableServer::ObjectId &id + id_to_reference (const PortableServer::ObjectId &id, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp index 152f3e2aad8..fc5fd099267 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp @@ -224,7 +224,8 @@ namespace TAO CORBA::Object_ptr ServantRetentionStrategyRetain::id_to_reference ( - const PortableServer::ObjectId &id + const PortableServer::ObjectId &id, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, @@ -248,7 +249,8 @@ namespace TAO servant->_interface_repository_id (), servant, 1, - priority); + priority, + indirect); return this->poa_->invoke_key_to_object_helper_i (servant->_interface_repository_id (), id @@ -692,7 +694,8 @@ namespace TAO servant->_interface_repository_id (), servant, 1, - priority); + priority, + true); // Ask the ORT to create the object. // @@NOTE:There is a possible deadlock lurking here. We held the @@ -916,7 +919,8 @@ namespace TAO intf, 0, 1, - priority); + priority, + true); return this->poa_->invoke_key_to_object_helper_i (intf, user_id @@ -963,7 +967,8 @@ namespace TAO intf, servant, 1, - priority); + priority, + true); return this->poa_->invoke_key_to_object_helper_i (intf, oid diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h index a40689512b3..738f58fdd3c 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h @@ -87,8 +87,8 @@ namespace TAO PortableServer::POA::ObjectNotActive, PortableServer::POA::WrongPolicy)); - CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) + CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, + bool indirect ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException, PortableServer::POA::ObjectNotActive, PortableServer::POA::WrongPolicy)); |