diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-06 01:17:22 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-10-06 01:17:22 +0000 |
commit | 48bdb23c1ae2285335102534e103fc06ad6b1cdf (patch) | |
tree | 416d4433dd4a718bf3e6540e826144f6c9fb714b | |
parent | b98e64990a1ff45cdccc502e53acbb1aca1fcb6a (diff) | |
download | ATCD-48bdb23c1ae2285335102534e103fc06ad6b1cdf.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.cpp | 31 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.h | 7 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp | 3 |
4 files changed, 34 insertions, 11 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 53b241d6c54..44bcff2fdc0 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,5 +1,9 @@ Mon Oct 05 18:54:31 1998 Irfan Pyarali <irfan@cs.wustl.edu> + * orbsvcs/orbsvcs/Naming/CosNaming_i: Fixed the POA id generation + to take into account the name of the parent. Otherwise everyone + was using the same "namespace". + * performance-tests/Cubit/TAO/IDL_Cubit: Added the testing of sequences of structs. diff --git a/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.cpp b/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.cpp index cf5d5072481..04ea91364cc 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.cpp @@ -19,15 +19,18 @@ ACE_RCSID(Naming, CosNaming_i, "$Id$") TAO_NamingContext::TAO_NamingContext (PortableServer::POA_ptr poa, + const char *poa_id, size_t default_hash_table_size, int root) : root_ (root), lock_ (0), poa_ (PortableServer::POA::_duplicate (poa)), - counter_ (0) + counter_ (0), + hash_table_size_ (default_hash_table_size), + poa_id_ (poa_id) { // Deal with faults. - if (context_.open (default_hash_table_size) == -1) + if (context_.open (this->hash_table_size_) == -1) ACE_ERROR ((LM_ERROR, "%p\n", "TAO_NamingContext")); @@ -468,17 +471,22 @@ TAO_NamingContext::new_context (CORBA::Environment &_env) CosNaming::NamingContext_var result; + char poa_id[BUFSIZ]; + ACE_OS::sprintf (poa_id, + "%s_%ld", + this->poa_id_.c_str (), + this->counter_++); + ACE_NEW_THROW_RETURN (c, - TAO_NamingContext (poa_.in ()), + TAO_NamingContext (poa_.in (), + poa_id, + this->hash_table_size_), CORBA::NO_MEMORY (CORBA::COMPLETED_NO), result._retn ()); TAO_TRY { - char name[BUFSIZ]; - ACE_OS::sprintf (name, "%d", this->counter_++); - PortableServer::ObjectId_var id = - PortableServer::string_to_ObjectId (name); + PortableServer::string_to_ObjectId (poa_id); this->poa_->activate_object_with_id (id.in (), c, @@ -686,11 +694,14 @@ TAO_NamingContext::list (CORBA::ULong how_many, TAO_TRY_ENV); TAO_CHECK_ENV; - char name[BUFSIZ]; - ACE_OS::sprintf (name, "%d", this->counter_++); + char poa_id[BUFSIZ]; + ACE_OS::sprintf (poa_id, + "%s_%ld", + this->poa_id_.c_str (), + this->counter_++); PortableServer::ObjectId_var id = - PortableServer::string_to_ObjectId (name); + PortableServer::string_to_ObjectId (poa_id); this->poa_->activate_object_with_id (id.in (), bind_iter, diff --git a/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.h b/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.h index 6567d8ebd45..4074c5a165b 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.h +++ b/TAO/orbsvcs/orbsvcs/Naming/CosNaming_i.h @@ -39,6 +39,7 @@ public: // = Initialization and termination methods. TAO_NamingContext (PortableServer::POA_ptr poa, + const char *poa_id, size_t default_hash_table_size = ACE_DEFAULT_MAP_SIZE, int root = 0); @@ -174,6 +175,12 @@ protected: u_long counter_; // This counter is used to generate names for children + + size_t hash_table_size_; + // Hash table size + + ACE_CString poa_id_; + // My POA Id }; class TAO_ORBSVCS_Export TAO_BindingIterator : public POA_CosNaming::BindingIterator diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp index f31ff6952e7..1b3139f3501 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Utils.cpp @@ -86,7 +86,8 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa) { ACE_NEW_RETURN (this->naming_context_impl_, - TAO_NamingContext (poa, + TAO_NamingContext (poa, + "root", ACE_DEFAULT_MAP_SIZE, 1), -1); |