diff options
Diffstat (limited to 'TAO/tao/PortableServer/Root_POA.cpp')
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.cpp | 197 |
1 files changed, 77 insertions, 120 deletions
diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index c68b5dba54a..ffad80905db 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -1,35 +1,35 @@ // $Id$ -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/Regular_POA.h" - -#include "tao/PortableServer/ThreadPolicy.h" -#include "tao/PortableServer/LifespanPolicy.h" -#include "tao/PortableServer/IdAssignmentPolicy.h" -#include "tao/PortableServer/IdUniquenessPolicy.h" -#include "tao/PortableServer/ImplicitActivationPolicy.h" -#include "tao/PortableServer/RequestProcessingPolicy.h" -#include "tao/PortableServer/ServantRetentionPolicy.h" -#include "tao/PortableServer/Active_Object_Map.h" -#include "tao/PortableServer/Default_Acceptor_Filter.h" -#include "tao/PortableServer/ORT_Adapter.h" -#include "tao/PortableServer/ORT_Adapter_Factory.h" -#include "tao/PortableServer/POA_Current_Impl.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/AdapterActivatorC.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/POAManager.h" -#include "tao/PortableServer/ServantManagerC.h" -#include "tao/PortableServer/poa_macros.h" -#include "tao/PortableServer/POA_Guard.h" -#include "tao/PortableServer/Creation_Time.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/LifespanStrategy.h" -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "tao/PortableServer/ThreadStrategy.h" +#include "Root_POA.h" +#include "Regular_POA.h" + +#include "ThreadPolicy.h" +#include "LifespanPolicy.h" +#include "IdAssignmentPolicy.h" +#include "IdUniquenessPolicy.h" +#include "ImplicitActivationPolicy.h" +#include "RequestProcessingPolicy.h" +#include "ServantRetentionPolicy.h" +#include "Active_Object_Map.h" +#include "Default_Acceptor_Filter.h" +#include "ORT_Adapter.h" +#include "ORT_Adapter_Factory.h" +#include "POA_Current_Impl.h" +#include "Servant_Upcall.h" +#include "AdapterActivatorC.h" +#include "Non_Servant_Upcall.h" +#include "POAManager.h" +#include "ServantManagerC.h" +#include "poa_macros.h" +#include "POA_Guard.h" +#include "Creation_Time.h" +#include "RequestProcessingStrategy.h" +#include "LifespanStrategy.h" +#include "IdUniquenessStrategy.h" +#include "IdAssignmentStrategy.h" +#include "ServantRetentionStrategy.h" +#include "ImplicitActivationStrategy.h" +#include "ThreadStrategy.h" #include "tao/StringSeqC.h" #include "tao/PortableInterceptorC.h" @@ -53,17 +53,14 @@ #include "ace/OS_NS_netdb.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" -#include "ace/Log_Msg.h" #if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Root_POA.inl" +# include "Root_POA.inl" #endif /* ! __ACE_INLINE__ */ ACE_RCSID (PortableServer, - Root_POA, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL + POA, + "$Id$") // This is the TAO_Object_key-prefix that is appended to all TAO Object keys. // It's an array of octets representing ^t^a^o/0 in octal. @@ -825,10 +822,6 @@ TAO_Root_POA::destroy_i (CORBA::Boolean etherealize_objects, this->cleanup_in_progress_ = 1; - // Inform the custom servant dispatching strategy to stop the working - // threads when the poa is destroyed. - this->poa_deactivated_hook (); - // This operation destroys the POA and all descendant POAs. The POA // so destroyed (that is, the POA with its name) may be re-created // later in the same process. (This differs from the @@ -1117,9 +1110,9 @@ TAO_Root_POA::add_ior_component_to_profile ( { // Add the given tagged component to all profiles matching the given // ProfileId. - bool found_profile = false; + int found_profile = 0; - CORBA::ULong const profile_count = mprofile.profile_count (); + const CORBA::ULong profile_count = mprofile.profile_count (); for (CORBA::ULong i = 0; i < profile_count; ++i) { @@ -1131,14 +1124,14 @@ TAO_Root_POA::add_ior_component_to_profile ( ACE_ENV_ARG_PARAMETER); ACE_CHECK; - found_profile = true; + found_profile = 1; } } // According to the Portable Interceptor specification, we're // supposed to throw a CORBA::BAD_PARAM exception if no profile // matched the given ProfileId. - if (found_profile == false) + if (found_profile == 0) ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 29, CORBA::COMPLETED_NO)); } @@ -1502,8 +1495,7 @@ TAO_Root_POA::reference_to_servant_i (CORBA::Object_ptr reference } PortableServer::ObjectId system_id; - bool const is_generated = - this->is_poa_generated (reference, system_id ACE_ENV_ARG_PARAMETER); + bool is_generated = this->is_poa_generated (reference, system_id ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); if (!is_generated) @@ -1548,18 +1540,18 @@ TAO_Root_POA::is_poa_generated (CORBA::Object_ptr reference, ACE_CHECK_RETURN (false); TAO_Object_Adapter::poa_name poa_system_name; - CORBA::Boolean is_root = false; - CORBA::Boolean is_persistent = false; - CORBA::Boolean is_system_id = false; + CORBA::Boolean is_root = 0; + CORBA::Boolean is_persistent = 0; + CORBA::Boolean is_system_id = 0; TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; - int const result = this->parse_key (key.in (), - poa_system_name, - system_id, - is_root, - is_persistent, - is_system_id, - poa_creation_time); + int result = this->parse_key (key.in (), + poa_system_name, + system_id, + is_root, + is_persistent, + is_system_id, + poa_creation_time); if (result != 0 || !this->root () && poa_system_name != this->system_name () || @@ -1598,9 +1590,9 @@ TAO_Root_POA::reference_to_id (CORBA::Object_ptr reference // reference was not created by this POA, the WrongAdapter exception // is raised. PortableServer::ObjectId system_id; - bool const is_generated = this->is_poa_generated (reference, - system_id - ACE_ENV_ARG_PARAMETER); + bool is_generated = this->is_poa_generated (reference, + system_id + ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (0); if (!is_generated) @@ -1750,11 +1742,11 @@ TAO_Root_POA::parse_key (const TAO::ObjectKey &key, char root_key_type = key_data[starting_at]; if (root_key_type == TAO_Root_POA::root_key_char ()) { - is_root = true; + is_root = 1; } else if (root_key_type == TAO_Root_POA::non_root_key_char ()) { - is_root = false; + is_root = 0; } else { @@ -1769,11 +1761,11 @@ TAO_Root_POA::parse_key (const TAO::ObjectKey &key, char system_id_key_type = key_data[starting_at]; if (system_id_key_type == TAO_Root_POA::system_id_key_char ()) { - is_system_id = true; + is_system_id = 1; } else if (system_id_key_type == TAO_Root_POA::user_id_key_char ()) { - is_system_id = false; + is_system_id = 0; } else { @@ -1788,11 +1780,11 @@ TAO_Root_POA::parse_key (const TAO::ObjectKey &key, char persistent_key_type = key_data[starting_at]; if (persistent_key_type == TAO_Root_POA::persistent_key_char ()) { - is_persistent = true; + is_persistent = 1; } else if (persistent_key_type == TAO_Root_POA::transient_key_char ()) { - is_persistent = false; + is_persistent = 0; } else { @@ -1842,7 +1834,7 @@ TAO_Root_POA::parse_key (const TAO::ObjectKey &key, starting_at += sizeof (poa_name_size); } - // Grep the name if there is a name + // Grep the name if there is aname if (!is_root) { poa_system_name.replace (poa_name_size, @@ -1891,9 +1883,9 @@ TAO_Root_POA::create_object_key (const PortableServer::ObjectId &id) TAO::ObjectKey *key = 0; ACE_NEW_RETURN (key, TAO::ObjectKey (buffer_size, - buffer_size, - buffer, - 1), + buffer_size, + buffer, + 1), 0); return key; @@ -1910,7 +1902,7 @@ TAO_Root_POA::set_id (TAO_Root_POA *parent) // used, then we need to add the POA name length field to the object // key. Otherwise, the POA name length can be calculated by looking // at the remainder after extracting other parts of the key. - bool const add_poa_name_length = + int add_poa_name_length = this->is_persistent () && !this->system_id (); @@ -1932,14 +1924,14 @@ TAO_Root_POA::set_id (TAO_Root_POA *parent) // Get the space needed for the lifespan length // byte. - CORBA::ULong const lifespan_key_length = + CORBA::ULong lifespan_key_length = this->active_policy_strategies_.lifespan_strategy()->key_length (); - CORBA::ULong const id_assignment_key_length = + CORBA::ULong id_assignment_key_length = this->active_policy_strategies_.id_assignment_strategy()->key_type_length (); // Calculate the space required for the POA id. - CORBA::ULong const buffer_size = + CORBA::ULong buffer_size = prefix_size + this->root_key_type_length () + id_assignment_key_length + @@ -2000,6 +1992,7 @@ TAO_Root_POA::set_id (TAO_Root_POA *parent) int TAO_Root_POA::is_poa_generated_id (const PortableServer::ObjectId &id) { + #if defined (POA_NAME_IN_POA_GENERATED_ID) // Grab the buffer @@ -2011,6 +2004,7 @@ TAO_Root_POA::is_poa_generated_id (const PortableServer::ObjectId &id) ACE_OS::strncmp (id_buffer, this->name_.c_str (), this->name_.length ()) == 0; + #else /* POA_NAME_IN_POA_GENERATED_ID */ ACE_UNUSED_ARG (id); @@ -2056,9 +2050,9 @@ TAO_Root_POA::parse_ir_object_key (const TAO::ObjectKey &object_key, PortableServer::ObjectId &user_id) { TAO_Object_Adapter::poa_name poa_system_name; - CORBA::Boolean is_root = false; - CORBA::Boolean is_persistent = false; - CORBA::Boolean is_system_id = false; + CORBA::Boolean is_root = 0; + CORBA::Boolean is_persistent = 0; + CORBA::Boolean is_system_id = 0; TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; return TAO_Root_POA::parse_key (object_key, @@ -2143,7 +2137,7 @@ TAO_Root_POA::key_to_object (const TAO::ObjectKey &key, if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "IMR IOR = \n%s\n", - ACE_TEXT_CHAR_TO_TCHAR (imr_str.in ()))); + ACE_TEXT_TO_TCHAR_IN (imr_str.in ()))); // Search for "corbaloc:" alone, without the protocol. This code // should be protocol neutral. @@ -2176,7 +2170,7 @@ TAO_Root_POA::key_to_object (const TAO::ObjectKey &key, if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "ImR-ified IOR = \n%s\n", - ACE_TEXT_CHAR_TO_TCHAR (ior.c_str ()))); + ACE_TEXT_TO_TCHAR_IN (ior.c_str ()))); obj = this->orb_core_.orb ()->string_to_object (ior.c_str () @@ -2315,9 +2309,9 @@ save_ior_component_and_profile_id (const IOP::TaggedComponent &component, // this->tagged_component_id_ is increased, we need to increase the // size of this->profile_id_array_ also. - CORBA::ULong const old_len = this->tagged_component_id_.length (); + const CORBA::ULong old_len = this->tagged_component_id_.length (); - CORBA::ULong const new_len = old_len + 1; + const CORBA::ULong new_len = old_len + 1; this->tagged_component_id_.length (new_len); this->tagged_component_id_[old_len] = component; @@ -2337,7 +2331,7 @@ TAO_Root_POA::create_stub_object (const TAO::ObjectKey &object_key, int error = 0; // Count the number of endpoints. - size_t const profile_count = + size_t profile_count = acceptor_registry.endpoint_count (); // Create a profile container and have acceptor registries populate @@ -2471,18 +2465,6 @@ TAO_Root_POA::find_servant ( ACE_ENV_ARG_PARAMETER); } -int -TAO_Root_POA::find_servant_priority ( - const PortableServer::ObjectId &system_id, - CORBA::Short &priority - ACE_ENV_ARG_DECL) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - find_servant_priority (system_id, - priority - ACE_ENV_ARG_PARAMETER); -} - TAO::ORT_Adapter_Factory * TAO_Root_POA::ORT_adapter_factory (void) { @@ -2532,8 +2514,8 @@ TAO_Root_POA::ORT_adapter_i (void) ACE_CATCHANY { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Cannot initialize the " - "object_reference_template_adapter"); + "(%P|%t) Cannot initialize the " + "object_reference_template_adapter\n"); } ACE_ENDTRY; ACE_CHECK_RETURN (0); @@ -2910,28 +2892,3 @@ TAO_POA_Static_Resources::TAO_POA_Static_Resources (void) { } -void -TAO_Root_POA::poa_activated_hook () -{ -} - -void -TAO_Root_POA::poa_deactivated_hook () -{ -} - -void -TAO_Root_POA::servant_activated_hook (PortableServer::Servant, - const PortableServer::ObjectId& - ACE_ENV_ARG_DECL) -{ -} - -void -TAO_Root_POA::servant_deactivated_hook (PortableServer::Servant, - const PortableServer::ObjectId& - ACE_ENV_ARG_DECL) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL |