diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2008-03-28 14:36:30 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2008-03-28 14:36:30 +0000 |
commit | 328439e83872b7b36e973da52d0dc4e2a5325628 (patch) | |
tree | c5d839c8e611bbe29657ffb2646a763d78717961 | |
parent | 3887687e9d0de2367760ce12dc47305d371ebf26 (diff) | |
download | ATCD-328439e83872b7b36e973da52d0dc4e2a5325628.tar.gz |
ChangeLogTag: Fri Mar 28 14:34:35 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 16 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp | 76 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h | 24 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb | 17 |
6 files changed, 119 insertions, 32 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index ab159e3ab40..8e1bca45ffa 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,19 @@ +Fri Mar 28 14:34:35 UTC 2008 Chad Elliott <elliott_c@ociweb.com> + + * orbsvcs/orbsvcs/CosNaming_Serv.mpc: + * orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb: + + Pulled the persistence related files into it's own base project + that's only enabled with the 'corba_e_micro' feature is disabled. + + * orbsvcs/orbsvcs/Naming/Naming_Server.h: + * orbsvcs/orbsvcs/Naming/Naming_Server.cpp: + * orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp: + + Made modifications to allow the server library to compile when + 'corba_e_micro' is enabled. All persistence is disabled in this + case. It requires more functionality than is provided by the POA. + Fri Mar 28 09:07:14 UTC 2008 Vladimir Zykov <vladimir.zykov@prismtech.com> * tao/GIOP_Message_Base.cpp: diff --git a/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc index d2514ab814e..1b27d09bf55 100644 --- a/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc +++ b/TAO/orbsvcs/orbsvcs/CosNaming_Serv.mpc @@ -2,7 +2,7 @@ // // $Id$ -project(CosNaming_Serv) : orbsvcslib, orbsvcs_output, install, naming_skel, messaging_optional, svc_utils, iortable { +project(CosNaming_Serv) : cosnaming_serv_persistence, orbsvcslib, orbsvcs_output, install, naming_skel, messaging_optional, svc_utils, iortable { sharedname = TAO_CosNaming_Serv dynamicflags = TAO_NAMING_SERV_BUILD_DLL tagchecks += Naming @@ -13,17 +13,10 @@ project(CosNaming_Serv) : orbsvcslib, orbsvcs_output, install, naming_skel, mess Source_Files(ORBSVCS_COMPONENTS) { Naming { Naming/Entries.cpp - Naming/Flat_File_Persistence.cpp Naming/Hash_Naming_Context.cpp Naming/Naming_Context_Interface.cpp Naming/Naming_Loader.cpp Naming/Naming_Server.cpp - Naming/Persistent_Context_Index.cpp - Naming/Persistent_Entries.cpp - Naming/Persistent_Naming_Context.cpp - Naming/Storable.cpp - Naming/Storable_Naming_Context.cpp - Naming/Storable_Naming_Context_Activator.cpp Naming/Transient_Naming_Context.cpp } } diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index bdd28e58252..a57baab9295 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -2,10 +2,14 @@ #include "orbsvcs/Naming/Naming_Server.h" #include "orbsvcs/Naming/Transient_Naming_Context.h" + +#if !defined (CORBA_E_MICRO) #include "orbsvcs/Naming/Persistent_Context_Index.h" #include "orbsvcs/Naming/Storable_Naming_Context.h" #include "orbsvcs/Naming/Storable_Naming_Context_Activator.h" #include "orbsvcs/Naming/Flat_File_Persistence.h" +#endif /* CORBA_E_MICRO */ + #include "orbsvcs/CosNamingC.h" #include "tao/debug.h" @@ -35,16 +39,18 @@ TAO_Naming_Server::TAO_Naming_Server (void) : naming_context_ (), ior_multicast_ (0), naming_service_ior_ (), - context_index_ (0), ior_file_name_ (0), pid_file_name_ (0), context_size_ (ACE_DEFAULT_MAP_SIZE), + multicast_ (0), +#if !defined (CORBA_E_MICRO) + context_index_ (0), persistence_file_name_ (0), base_address_ (TAO_NAMING_BASE_ADDR), - multicast_ (0), use_storable_context_ (0), use_servant_activator_ (false), servant_activator_ (0), +#endif /* CORBA_E_MICRO */ use_redundancy_(0), round_trip_timeout_ (0), use_round_trip_timeout_ (0) @@ -65,16 +71,18 @@ TAO_Naming_Server::TAO_Naming_Server (CORBA::ORB_ptr orb, : naming_context_ (), ior_multicast_ (0), naming_service_ior_ (), - context_index_ (0), ior_file_name_ (0), pid_file_name_ (0), context_size_ (ACE_DEFAULT_MAP_SIZE), + multicast_ (0), +#if !defined (CORBA_E_MICRO) + context_index_ (0), persistence_file_name_ (0), base_address_ (TAO_NAMING_BASE_ADDR), - multicast_ (0), use_storable_context_ (use_storable_context), use_servant_activator_ (false), servant_activator_ (0), +#endif /* CORBA_E_MICRO */ use_redundancy_(0), round_trip_timeout_ (0), use_round_trip_timeout_ (0) @@ -168,7 +176,9 @@ TAO_Naming_Server::parse_args (int argc, #endif /* TAO_HAS_MINIMUM_POA */ int c; - int size, result; + int size; +#if !defined (CORBA_E_MICRO) + int result; // This is declared this way to avoid warnings from // some compilers that complain about mismatching types @@ -178,6 +188,7 @@ TAO_Naming_Server::parse_args (int argc, #else long int address; #endif /* ACE_SIZEOF_VOID_P */ +#endif /* CORBA_E_MICRO */ // Make sure only one persistence option is specified int f_opt_used = 0; @@ -201,6 +212,10 @@ TAO_Naming_Server::parse_args (int argc, if (size >= 0) this->context_size_ = size; break; + case 'm': + this->multicast_ = ACE_OS::atoi(get_opts.opt_arg ()); + break; +#if !defined (CORBA_E_MICRO) case 'b': result = ::sscanf (ACE_TEXT_ALWAYS_CHAR (get_opts.opt_arg ()), #if ACE_SIZEOF_VOID_P == ACE_SIZEOF_LONG_LONG @@ -215,9 +230,6 @@ TAO_Naming_Server::parse_args (int argc, -1); this->base_address_ = (void *) address; break; - case 'm': - this->multicast_ = ACE_OS::atoi(get_opts.opt_arg ()); - break; case 'f': this->persistence_file_name_ = get_opts.opt_arg (); f_opt_used = 1; @@ -235,19 +247,25 @@ TAO_Naming_Server::parse_args (int argc, u_opt_used = 1; break; #endif /* TAO_HAS_MINIMUM_POA == 0 */ +#endif /* !CORBA_E_MICRO */ case 'z': this->use_round_trip_timeout_ = 1; this->round_trip_timeout_ = (int)1.0e7 * ACE_OS::atoi (get_opts.opt_arg ()); break; case '?': default: +#if !defined (ACE_NLOGGING) const ACE_TCHAR *reqNonMinCorba= -#if (TAO_HAS_MINIMUM_POA == 0) - ACE_TEXT (" -u <storable_persistence_directory (not used with -f)> ") - ACE_TEXT (" -r <redundant_persistence_directory> "); +#if !defined (CORBA_E_MICRO) + ACE_TEXT ("-f <persistence_file_name> ") +#endif /* CORBA_E_MICRO */ +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) + ACE_TEXT ("-u <storable_persistence_directory (not used with -f)> ") + ACE_TEXT ("-r <redundant_persistence_directory> "); #else ACE_TEXT (""); -#endif /* TAO_HAS_MINIMUM_POA */ +#endif /* TAO_HAS_MINIMUM_POA && !CORBA_E_MICRO */ +#endif /* !ACE_NLOGGING */ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("usage: %s ") ACE_TEXT ("-d ") @@ -256,7 +274,7 @@ TAO_Naming_Server::parse_args (int argc, ACE_TEXT ("-s <context_size> ") ACE_TEXT ("-b <base_address> ") ACE_TEXT ("-m <1=enable multicast, 0=disable multicast(default) ") - ACE_TEXT ("-f <persistence_file_name> %s") + ACE_TEXT ("%s") ACE_TEXT ("-z <relative round trip timeout> ") ACE_TEXT ("\n"), argv [0], reqNonMinCorba), @@ -312,6 +330,9 @@ TAO_Naming_Server::init_with_orb (int argc, poa_manager->activate (); +#if defined (CORBA_E_MICRO) + this->ns_poa_ = PortableServer::POA::_duplicate (this->root_poa_); +#else int numPolicies = 2; #if (TAO_HAS_MINIMUM_POA == 0) if (this->use_storable_context_) @@ -364,7 +385,21 @@ TAO_Naming_Server::init_with_orb (int argc, CORBA::Policy_ptr policy = policies[i]; policy->destroy (); } +#endif /* CORBA_E_MICRO */ +#if defined (CORBA_E_MICRO) + result = this->init (orb, + this->ns_poa_.in (), + this->context_size_, + 0, + 0, + 0, + 0, + this->multicast_, + false, + this->round_trip_timeout_, + this->use_round_trip_timeout_); +#else result = this->init (orb, this->ns_poa_.in (), this->context_size_, @@ -376,6 +411,8 @@ TAO_Naming_Server::init_with_orb (int argc, this->use_storable_context_, this->round_trip_timeout_, this->use_round_trip_timeout_); +#endif /* CORBA_E_MICRO */ + if (result == -1) return result; } @@ -433,6 +470,11 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, { try { +#if defined (CORBA_E_MICRO) + ACE_UNUSED_ARG (persistence_location); + ACE_UNUSED_ARG (base_addr); + ACE_UNUSED_ARG (use_storable_context); +#else if (use_storable_context) { // In lieu of a fully implemented service configurator version @@ -510,6 +552,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, this->context_index_->root_context (); } else +#endif /* CORBA_E_MICRO */ { // // Initialize Transient Naming Service. @@ -521,11 +564,13 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, } +#if !defined (CORBA_E_MICRO) // Register with the ORB's resolve_initial_references() // mechanism. Primarily useful for dynamically loaded Name // Services. orb->register_initial_reference ("NameService", this->naming_context_.in ()); +#endif /* CORBA_E_MICRO */ // Set the ior of the root Naming Context. this->naming_service_ior_= @@ -700,7 +745,9 @@ TAO_Naming_Server::fini (void) delete this->ior_multicast_; } +#if !defined (CORBA_E_MICRO) delete this->context_index_; +#endif /* CORBA_E_MICRO */ return 0; } @@ -719,7 +766,8 @@ TAO_Naming_Server::operator-> (void) const TAO_Naming_Server::~TAO_Naming_Server (void) { -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) +#if (TAO_HAS_MINIMUM_POA == 0) && \ + !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) if (this->use_servant_activator_) delete this->servant_activator_; #endif /* TAO_HAS_MINIMUM_POA */ diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h index f194f75ea10..f02ad30808a 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.h @@ -28,9 +28,11 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL +#if !defined (CORBA_E_MICRO) // Forward decl; class TAO_Persistent_Context_Index; class TAO_Storable_Naming_Context_Activator; +#endif /* !CORBA_E_MICRO */ /** * @class TAO_Naming_Server @@ -166,13 +168,6 @@ protected: /// The IOR string of the root naming context. CORBA::String_var naming_service_ior_; - /** - * Pointer to the object used to create/initialize - * the Naming Service when local persistent Naming Service is - * desired. - */ - TAO_Persistent_Context_Index *context_index_; - /// The ORB CORBA::ORB_var orb_; @@ -196,6 +191,17 @@ protected: */ size_t context_size_; + /// If not zero multicast is enabled. + int multicast_; + +#if !defined (CORBA_E_MICRO) + /** + * Pointer to the object used to create/initialize + * the Naming Service when local persistent Naming Service is + * desired. + */ + TAO_Persistent_Context_Index *context_index_; + /// Path to the file to be used to store/read in Naming Service /// persistent state. const ACE_TCHAR *persistence_file_name_; @@ -204,9 +210,6 @@ protected: /// identified by the <persistence_file_name_>. void *base_address_; - /// If not zero multicast is enabled. - int multicast_; - /// If not zero use flat file persistence int use_storable_context_; @@ -220,6 +223,7 @@ protected: * init_with_orb() and init_new_naming(). */ TAO_Storable_Naming_Context_Activator *servant_activator_; +#endif /* !CORBA_E_MICRO */ /** * If not zero support redundant naming servers. diff --git a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp index 4e6911cd4bb..e568d12df5e 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Transient_Naming_Context.cpp @@ -171,10 +171,14 @@ TAO_Transient_Naming_Context::make_new_context (PortableServer::POA_ptr poa, PortableServer::ServantBase_var s = context; // Register the new context with the POA. +#if defined (CORBA_E_MICRO) + PortableServer::ObjectId_var id = poa->activate_object (context); +#else PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId (poa_id); poa->activate_object_with_id (id.in (), context); +#endif /* CORBA_E_MICRO */ result = context->_this (); @@ -306,11 +310,16 @@ TAO_Transient_Naming_Context::list (CORBA::ULong how_many, "%s_%d", this->poa_id_.c_str (), this->counter_++); +#if defined (CORBA_E_MICRO) + PortableServer::ObjectId_var id = + this->poa_->activate_object (bind_iter); +#else PortableServer::ObjectId_var id = PortableServer::string_to_ObjectId (poa_id); this->poa_->activate_object_with_id (id.in (), bind_iter); +#endif /* CORBA_E_MICRO */ bi = bind_iter->_this (); } diff --git a/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb b/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb new file mode 100644 index 00000000000..1caf3ca3f1f --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/cosnaming_serv_persistence.mpb @@ -0,0 +1,17 @@ +// -*- MPC -*- +// +// $Id$ + +feature(!corba_e_micro) { + Source_Files(ORBSVCS_COMPONENTS) { + Naming { + Naming/Flat_File_Persistence.cpp + Naming/Persistent_Context_Index.cpp + Naming/Persistent_Entries.cpp + Naming/Persistent_Naming_Context.cpp + Naming/Storable.cpp + Naming/Storable_Naming_Context.cpp + Naming/Storable_Naming_Context_Activator.cpp + } + } +} |