diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/tao/PortableServer | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tao/PortableServer')
282 files changed, 0 insertions, 34960 deletions
diff --git a/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp b/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp deleted file mode 100644 index 06c7b2c22b2..00000000000 --- a/TAO/tao/PortableServer/Acceptor_Filter_Factory.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// @(#) $Id$ - -#include "tao/PortableServer/Acceptor_Filter_Factory.h" -#include "tao/PortableServer/Default_Acceptor_Filter.h" - -ACE_RCSID(PortableServer, - Acceptor_Filter_Factory, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Acceptor_Filter_Factory::~TAO_Acceptor_Filter_Factory(void) -{ -} - -TAO_Acceptor_Filter* -TAO_Acceptor_Filter_Factory::create_object (TAO_POA_Manager& ) -{ - TAO_Acceptor_Filter *filter; - - ACE_NEW_RETURN (filter, - TAO_Default_Acceptor_Filter (), - 0); - - return filter; -} - - -int -TAO_Acceptor_Filter_Factory::initialize (void) -{ - return ACE_Service_Config::process_directive - (ace_svc_desc_TAO_Acceptor_Filter_Factory); -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_DEFINE (TAO_PortableServer, TAO_Acceptor_Filter_Factory) -ACE_STATIC_SVC_DEFINE (TAO_Acceptor_Filter_Factory, - ACE_TEXT ("TAO_Acceptor_Filter_Factory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (TAO_Acceptor_Filter_Factory), - ACE_Service_Type::DELETE_THIS - | ACE_Service_Type::DELETE_OBJ, - 0) diff --git a/TAO/tao/PortableServer/Acceptor_Filter_Factory.h b/TAO/tao/PortableServer/Acceptor_Filter_Factory.h deleted file mode 100644 index ae855be04da..00000000000 --- a/TAO/tao/PortableServer/Acceptor_Filter_Factory.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Acceptor_Filter_Factory.h - * - * $Id$ - * - * Provides default acceptor filters for use by the POA. - * - * @author Yan Dai <dai_y@ociweb.com> - * @author Phil Mesnier <mesnier_p@ociweb.com> - */ -//============================================================================= - - -#ifndef TAO_ACCEPTOR_FILTER_FACTORY_H -#define TAO_ACCEPTOR_FILTER_FACTORY_H - -#include /**/ "ace/pre.h" - -#include "portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Versioned_Namespace.h" - -#include "ace/Service_Object.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_POA_Manager; -class TAO_Acceptor_Filter; - -/** - * @class TAO_Acceptor_Filter_Factory - * - * @brief Default class for factories providing the endpoint acceptor - * filter objects. - * - * The TAO_Acceptor_Filter_Factory is a loadable service object. It exists - * to allow external application of filters used to control the assembly of - * object references and how endpoints are assigned. - */ -class TAO_PortableServer_Export TAO_Acceptor_Filter_Factory - : public ACE_Service_Object -{ -public: - virtual ~TAO_Acceptor_Filter_Factory(void); - - virtual TAO_Acceptor_Filter* create_object (TAO_POA_Manager& poamanager); - - /// Static initializer ensures the factory is loaded - static int initialize (void); - -}; - - -static int -TAO_Requires_Acceptor_Filter_Factory = -TAO_Acceptor_Filter_Factory::initialize (); - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE (TAO_Acceptor_Filter_Factory) -ACE_FACTORY_DECLARE (TAO_PortableServer, TAO_Acceptor_Filter_Factory) - -#include /**/ "ace/post.h" - -#endif /* TAO_ACCEPTOR_FILTER_FACTORY_H */ diff --git a/TAO/tao/PortableServer/Active_Object_Map.cpp b/TAO/tao/PortableServer/Active_Object_Map.cpp deleted file mode 100644 index 5699755a01b..00000000000 --- a/TAO/tao/PortableServer/Active_Object_Map.cpp +++ /dev/null @@ -1,938 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Active_Object_Map.h" -#include "tao/PortableServer/Active_Object_Map_Entry.h" -#include "tao/SystemException.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Active_Object_Map.i" -#endif /* __ACE_INLINE__ */ - -#include "ace/Auto_Ptr.h" - -ACE_RCSID(PortableServer, - Active_Object_Map, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/* static */ -size_t TAO_Active_Object_Map::system_id_size_ = 0; - -void -TAO_Active_Object_Map::set_system_id_size - (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters) -{ - if (TAO_Active_Object_Map::system_id_size_ == 0) - { - if (creation_parameters.allow_reactivation_of_system_ids_) - { - switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) - { -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - case TAO_LINEAR: - TAO_Active_Object_Map::system_id_size_ = - sizeof (CORBA::ULong); - break; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - case TAO_DYNAMIC_HASH: - default: - TAO_Active_Object_Map::system_id_size_ = sizeof (CORBA::ULong); - break; - } - - size_t hint_size = 0; - - if (creation_parameters.use_active_hint_in_ids_) - hint_size = ACE_Active_Map_Manager_Key::size (); - - TAO_Active_Object_Map::system_id_size_ += hint_size; - } - else - { - switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) - { -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - case TAO_LINEAR: - TAO_Active_Object_Map::system_id_size_ = - sizeof (CORBA::ULong); - break; - - case TAO_DYNAMIC_HASH: - TAO_Active_Object_Map::system_id_size_ = - sizeof (CORBA::ULong); - break; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - case TAO_ACTIVE_DEMUX: - default: - TAO_Active_Object_Map::system_id_size_ = - ACE_Active_Map_Manager_Key::size (); - break; - } - } - } -} - -TAO_Active_Object_Map::TAO_Active_Object_Map (int user_id_policy, - int unique_id_policy, - int persistent_id_policy, - const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters - ACE_ENV_ARG_DECL) - : user_id_map_ (0), - servant_map_ (0), - id_uniqueness_strategy_ (0), - lifespan_strategy_ (0), - id_assignment_strategy_ (0), - id_hint_strategy_ (0), - using_active_maps_ (0) -{ - TAO_Active_Object_Map::set_system_id_size (creation_parameters); - - TAO_Id_Uniqueness_Strategy *id_uniqueness_strategy = 0; - - if (unique_id_policy) - { - ACE_NEW_THROW_EX (id_uniqueness_strategy, - TAO_Unique_Id_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - else - { - ACE_NEW_THROW_EX (id_uniqueness_strategy, - TAO_Multiple_Id_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - - // Give ownership to the auto pointer. - auto_ptr<TAO_Id_Uniqueness_Strategy> new_id_uniqueness_strategy (id_uniqueness_strategy); - - TAO_Lifespan_Strategy *lifespan_strategy = 0; - - if (persistent_id_policy) - { - ACE_NEW_THROW_EX (lifespan_strategy, - TAO_Persistent_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - else - { - ACE_NEW_THROW_EX (lifespan_strategy, - TAO_Transient_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - - // Give ownership to the auto pointer. - auto_ptr<TAO_Lifespan_Strategy> new_lifespan_strategy (lifespan_strategy); - - TAO_Id_Assignment_Strategy *id_assignment_strategy = 0; - - if (user_id_policy) - { - ACE_NEW_THROW_EX (id_assignment_strategy, - TAO_User_Id_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - else if (unique_id_policy) - { - ACE_NEW_THROW_EX (id_assignment_strategy, - TAO_System_Id_With_Unique_Id_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - else - { - ACE_NEW_THROW_EX (id_assignment_strategy, - TAO_System_Id_With_Multiple_Id_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - - // Give ownership to the auto pointer. - auto_ptr<TAO_Id_Assignment_Strategy> new_id_assignment_strategy (id_assignment_strategy); - - TAO_Id_Hint_Strategy *id_hint_strategy = 0; - if ((user_id_policy - || creation_parameters.allow_reactivation_of_system_ids_) - && creation_parameters.use_active_hint_in_ids_) - { - this->using_active_maps_ = 1; - - ACE_NEW_THROW_EX (id_hint_strategy, - TAO_Active_Hint_Strategy (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - else - { - ACE_NEW_THROW_EX (id_hint_strategy, - TAO_No_Hint_Strategy, - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - - // Give ownership to the auto pointer. - auto_ptr<TAO_Id_Hint_Strategy> new_id_hint_strategy (id_hint_strategy); - - servant_map *sm = 0; - if (unique_id_policy) - { - switch (creation_parameters.reverse_object_lookup_strategy_for_unique_id_policy_) - { - case TAO_LINEAR: -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - ACE_NEW_THROW_EX (sm, - servant_linear_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; -#else - ACE_ERROR ((LM_ERROR, - "linear option for -ORBUniqueidPolicyReverseDemuxStrategy " - "not supported with minimum POA maps. " - "Ingoring option to use default... \n")); - /* FALL THROUGH */ -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - case TAO_DYNAMIC_HASH: - default: - ACE_NEW_THROW_EX (sm, - servant_hash_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; - } - } - - // Give ownership to the auto pointer. - auto_ptr<servant_map> new_servant_map (sm); - - user_id_map *uim = 0; - if (user_id_policy - || creation_parameters.allow_reactivation_of_system_ids_) - { - switch (creation_parameters.object_lookup_strategy_for_user_id_policy_) - { - case TAO_LINEAR: -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - ACE_NEW_THROW_EX (uim, - user_id_linear_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; -#else - ACE_ERROR ((LM_ERROR, - "linear option for -ORBUseridPolicyDemuxStrategy " - "not supported with minimum POA maps. " - "Ingoring option to use default... \n")); - /* FALL THROUGH */ -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - case TAO_DYNAMIC_HASH: - default: - ACE_NEW_THROW_EX (uim, - user_id_hash_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; - } - } - else - { - switch (creation_parameters.object_lookup_strategy_for_system_id_policy_) - { -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - case TAO_LINEAR: - ACE_NEW_THROW_EX (uim, - user_id_linear_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; - - case TAO_DYNAMIC_HASH: - ACE_NEW_THROW_EX (uim, - user_id_hash_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; -#else - case TAO_LINEAR: - case TAO_DYNAMIC_HASH: - ACE_ERROR ((LM_ERROR, - "linear and dynamic options for -ORBSystemidPolicyDemuxStrategy " - "are not supported with minimum POA maps. " - "Ingoring option to use default... \n")); - /* FALL THROUGH */ -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - case TAO_ACTIVE_DEMUX: - default: - - this->using_active_maps_ = 1; - - ACE_NEW_THROW_EX (uim, - user_id_active_map (creation_parameters.active_object_map_size_), - CORBA::NO_MEMORY ()); - ACE_CHECK; - break; - } - } - - // Give ownership to the auto pointer. - auto_ptr<user_id_map> new_user_id_map (uim); - - id_uniqueness_strategy->set_active_object_map (this); - lifespan_strategy->set_active_object_map (this); - id_assignment_strategy->set_active_object_map (this); - - // Finally everything is fine. Make sure to take ownership away - // from the auto pointer. - this->id_uniqueness_strategy_ = new_id_uniqueness_strategy.release (); - this->lifespan_strategy_ = new_lifespan_strategy.release (); - this->id_assignment_strategy_ = new_id_assignment_strategy.release (); - this->id_hint_strategy_ = new_id_hint_strategy.release (); - this->servant_map_ = new_servant_map.release (); - this->user_id_map_ = new_user_id_map.release (); -} - -TAO_Active_Object_Map::~TAO_Active_Object_Map (void) -{ - user_id_map::iterator iterator = this->user_id_map_->begin (); - user_id_map::iterator end = this->user_id_map_->end (); - - for (; - iterator != end; - ++iterator) - { - user_id_map::value_type map_entry = *iterator; - delete map_entry.second (); - } - - delete this->id_uniqueness_strategy_; - delete this->lifespan_strategy_; - delete this->id_assignment_strategy_; - delete this->id_hint_strategy_; - delete this->servant_map_; - delete this->user_id_map_; -} - -int -TAO_Active_Object_Map::is_user_id_in_map (const PortableServer::ObjectId &user_id, - CORBA::Short priority, - int &priorities_match, - int &deactivated) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->user_id_map_->find (user_id, - entry); - if (result == 0) - { - if (entry->servant_ == 0) - { - result = 0; - - if (entry->priority_ != priority) - priorities_match = 0; - } - else - { - result = 1; - if (entry->deactivated_) - { - deactivated = 1; - } - } - } - else - { - result = 0; - } - - return result; -} - -//////////////////////////////////////////////////////////////////////////////// - -TAO_Id_Uniqueness_Strategy::~TAO_Id_Uniqueness_Strategy (void) -{ -} - -void -TAO_Id_Uniqueness_Strategy::set_active_object_map (TAO_Active_Object_Map *active_object_map) -{ - this->active_object_map_ = active_object_map; -} - -int -TAO_Unique_Id_Strategy::is_servant_in_map (PortableServer::Servant servant, - int &deactivated) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_->servant_map_->find (servant, - entry); - if (result == 0) - { - result = 1; - if (entry->deactivated_) - { - deactivated = 1; - } - } - else - { - result = 0; - } - - return result; -} - -int -TAO_Unique_Id_Strategy::bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry) -{ - int result = this->active_object_map_->user_id_map_->find (user_id, - entry); - if (result == 0) - { - if (servant != 0) - { - entry->servant_ = servant; - - result = this->active_object_map_->servant_map_->bind (entry->servant_, - entry); - } - } - else - { - ACE_NEW_RETURN (entry, - TAO_Active_Object_Map_Entry, - -1); - entry->user_id_ = user_id; - entry->servant_ = servant; - entry->priority_ = priority; - - result = this->active_object_map_->id_hint_strategy_->bind (*entry); - - if (result == 0) - { - result = this->active_object_map_->user_id_map_->bind (entry->user_id_, - entry); - if (result == 0) - { - if (servant != 0) - result = this->active_object_map_->servant_map_->bind (entry->servant_, - entry); - if (result != 0) - { - this->active_object_map_->user_id_map_->unbind (entry->user_id_); - this->active_object_map_->id_hint_strategy_->unbind (*entry); - delete entry; - } - } - else - { - this->active_object_map_->id_hint_strategy_->unbind (*entry); - delete entry; - } - } - else - delete entry; - } - - return result; -} - -int -TAO_Unique_Id_Strategy::unbind_using_user_id (const PortableServer::ObjectId &user_id) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_->user_id_map_->unbind (user_id, - entry); - if (result == 0) - { - if (entry->servant_ != 0) - result = this->active_object_map_->servant_map_->unbind (entry->servant_); - - if (result == 0) - result = - this->active_object_map_->id_hint_strategy_->unbind (*entry); - - if (result == 0) - delete entry; - } - return result; -} - -int -TAO_Unique_Id_Strategy::find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_->servant_map_->find (servant, - entry); - if (result == 0) - { - if (entry->deactivated_) - result = -1; - else - ACE_NEW_RETURN (user_id, - PortableServer::ObjectId (entry->user_id_), - -1); - } - - return result; -} - -int -TAO_Unique_Id_Strategy::find_system_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_->servant_map_->find (servant, - entry); - if (result == 0) - { - if (entry->deactivated_) - result = -1; - else - { - result = this->active_object_map_->id_hint_strategy_->system_id (system_id, - *entry); - if (result == 0) - priority = entry->priority_; - } - } - - return result; -} - -CORBA::Boolean -TAO_Unique_Id_Strategy::remaining_activations (PortableServer::Servant servant) -{ - ACE_UNUSED_ARG (servant); - - // Since servant are always unique here, return false. - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// - -int -TAO_Multiple_Id_Strategy::is_servant_in_map (PortableServer::Servant, - int &) -{ - return -1; -} - -int -TAO_Multiple_Id_Strategy::bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry) -{ - int result = this->active_object_map_->user_id_map_->find (user_id, - entry); - if (result == 0) - { - if (servant != 0) - entry->servant_ = servant; - } - else - { - ACE_NEW_RETURN (entry, - TAO_Active_Object_Map_Entry, - -1); - entry->user_id_ = user_id; - entry->servant_ = servant; - entry->priority_ = priority; - - result = - this->active_object_map_->id_hint_strategy_->bind (*entry); - - if (result == 0) - { - result = this->active_object_map_->user_id_map_->bind (entry->user_id_, - entry); - if (result != 0) - { - this->active_object_map_->id_hint_strategy_->unbind (*entry); - delete entry; - } - } - else - delete entry; - } - - return result; -} - -int -TAO_Multiple_Id_Strategy::unbind_using_user_id (const PortableServer::ObjectId &user_id) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_->user_id_map_->unbind (user_id, - entry); - if (result == 0) - { - result = this->active_object_map_->id_hint_strategy_->unbind (*entry); - - if (result == 0) - delete entry; - } - - return result; -} - -int -TAO_Multiple_Id_Strategy::find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id) -{ - ACE_UNUSED_ARG (servant); - ACE_UNUSED_ARG (user_id); - - return -1; -} - -int -TAO_Multiple_Id_Strategy::find_system_id_using_servant (PortableServer::Servant, - PortableServer::ObjectId_out, - CORBA::Short &) -{ - return -1; -} - -CORBA::Boolean -TAO_Multiple_Id_Strategy::remaining_activations (PortableServer::Servant servant) -{ - TAO_Active_Object_Map::user_id_map::iterator end - = this->active_object_map_->user_id_map_->end (); - - for (TAO_Active_Object_Map::user_id_map::iterator iter - = this->active_object_map_->user_id_map_->begin (); - iter != end; - ++iter) - { - TAO_Active_Object_Map::user_id_map::value_type map_pair = *iter; - TAO_Active_Object_Map_Entry *entry = map_pair.second (); - - if (entry->servant_ == servant) - return 1; - } - - return 0; -} - -TAO_Lifespan_Strategy::~TAO_Lifespan_Strategy (void) -{ -} - -void -TAO_Lifespan_Strategy::set_active_object_map (TAO_Active_Object_Map *active_object_map) -{ - this->active_object_map_ = active_object_map; -} - -int -TAO_Transient_Strategy::find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry) -{ - int result = this->active_object_map_->id_hint_strategy_->find (system_id, - entry); - if (result == 0) - { - if (entry->deactivated_) - result = -1; - else if (entry->servant_ == 0) - result = -1; - else - servant = entry->servant_; - } - else - { - result = this->active_object_map_->user_id_map_->find (user_id, - entry); - if (result == 0) - { - if (entry->deactivated_) - result = -1; - else if (entry->servant_ == 0) - result = -1; - else - servant = entry->servant_; - } - } - - if (result == -1) - entry = 0; - - return result; -} - -//////////////////////////////////////////////////////////////////////////////// - -int -TAO_Persistent_Strategy::find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry) -{ - int result = this->active_object_map_->id_hint_strategy_->find (system_id, - entry); - if (result == 0 && - user_id == entry->user_id_) - { - if (entry->deactivated_) - result = -1; - else if (entry->servant_ == 0) - result = -1; - else - servant = entry->servant_; - } - else - { - result = this->active_object_map_->user_id_map_->find (user_id, - entry); - if (result == 0) - { - if (entry->deactivated_) - result = -1; - else if (entry->servant_ == 0) - result = -1; - else - servant = entry->servant_; - } - } - - if (result == -1) - entry = 0; - - return result; -} - -TAO_Id_Assignment_Strategy::~TAO_Id_Assignment_Strategy (void) -{ -} - -void -TAO_Id_Assignment_Strategy::set_active_object_map (TAO_Active_Object_Map *active_object_map) -{ - this->active_object_map_ = active_object_map; -} - -int -TAO_User_Id_Strategy::bind_using_system_id (PortableServer::Servant, - CORBA::Short, - TAO_Active_Object_Map_Entry *&) -{ - return -1; -} - -int -TAO_System_Id_With_Unique_Id_Strategy::bind_using_system_id (PortableServer::Servant servant, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry) -{ - ACE_NEW_RETURN (entry, - TAO_Active_Object_Map_Entry, - -1); - - int result = this->active_object_map_->user_id_map_->bind_create_key (entry, - entry->user_id_); - if (result == 0) - { - entry->servant_ = servant; - entry->priority_ = priority; - - result = this->active_object_map_->id_hint_strategy_->bind (*entry); - - if (result == 0) - { - if (servant != 0) - result = this->active_object_map_->servant_map_->bind (entry->servant_, - entry); - - if (result != 0) - { - this->active_object_map_->user_id_map_->unbind (entry->user_id_); - this->active_object_map_->id_hint_strategy_->unbind (*entry); - delete entry; - } - } - else - { - this->active_object_map_->user_id_map_->unbind (entry->user_id_); - delete entry; - } - } - else - delete entry; - - return result; -} - -int -TAO_System_Id_With_Multiple_Id_Strategy::bind_using_system_id (PortableServer::Servant servant, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry) -{ - ACE_NEW_RETURN (entry, - TAO_Active_Object_Map_Entry, - -1); - int result = this->active_object_map_->user_id_map_->bind_create_key (entry, - entry->user_id_); - if (result == 0) - { - entry->servant_ = servant; - entry->priority_ = priority; - - result = this->active_object_map_->id_hint_strategy_->bind (*entry); - - if (result != 0) - { - this->active_object_map_->user_id_map_->unbind (entry->user_id_); - delete entry; - } - } - else - delete entry; - - return result; -} - -//////////////////////////////////////////////////////////////////////////////// - -TAO_Id_Hint_Strategy::~TAO_Id_Hint_Strategy (void) -{ -} - -//////////////////////////////////////////////////////////////////////////////// - -TAO_Active_Hint_Strategy::TAO_Active_Hint_Strategy (CORBA::ULong map_size) - : system_id_map_ (map_size) -{ -} - -TAO_Active_Hint_Strategy::~TAO_Active_Hint_Strategy (void) -{ -} - -int -TAO_Active_Hint_Strategy::recover_key (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id) -{ - return this->system_id_map_.recover_key (system_id, - user_id); -} - -int -TAO_Active_Hint_Strategy::bind (TAO_Active_Object_Map_Entry &entry) -{ - entry.system_id_ = entry.user_id_; - - return this->system_id_map_.bind_modify_key (&entry, - entry.system_id_); -} - -int -TAO_Active_Hint_Strategy::unbind (TAO_Active_Object_Map_Entry &entry) -{ - return this->system_id_map_.unbind (entry.system_id_); -} - -int -TAO_Active_Hint_Strategy::find (const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry) -{ - return this->system_id_map_.find (system_id, - entry); -} - -size_t -TAO_Active_Hint_Strategy::hint_size (void) -{ - return ACE_Active_Map_Manager_Key::size (); -} - -int -TAO_Active_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id, - TAO_Active_Object_Map_Entry &entry) -{ - ACE_NEW_RETURN (system_id, - PortableServer::ObjectId (entry.system_id_), - -1); - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// - -TAO_No_Hint_Strategy::~TAO_No_Hint_Strategy (void) -{ -} - -int -TAO_No_Hint_Strategy::recover_key (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id) -{ - // Smartly copy all the data; <user_id does not own the data>. - user_id.replace (system_id.maximum (), - system_id.length (), - const_cast<CORBA::Octet *> (system_id.get_buffer ()), - 0); - - return 0; -} - -int -TAO_No_Hint_Strategy::bind (TAO_Active_Object_Map_Entry &entry) -{ - ACE_UNUSED_ARG (entry); - - return 0; -} - -int -TAO_No_Hint_Strategy::unbind (TAO_Active_Object_Map_Entry &entry) -{ - ACE_UNUSED_ARG (entry); - - return 0; -} - -int -TAO_No_Hint_Strategy::find (const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry) -{ - ACE_UNUSED_ARG (system_id); - ACE_UNUSED_ARG (entry); - - return -1; -} - -size_t -TAO_No_Hint_Strategy::hint_size (void) -{ - return 0; -} - -int -TAO_No_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id, - TAO_Active_Object_Map_Entry &entry) -{ - ACE_NEW_RETURN (system_id, - PortableServer::ObjectId (entry.user_id_), - -1); - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Active_Object_Map.h b/TAO/tao/PortableServer/Active_Object_Map.h deleted file mode 100644 index 65c614de389..00000000000 --- a/TAO/tao/PortableServer/Active_Object_Map.h +++ /dev/null @@ -1,626 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Active_Object_Map.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - - -#ifndef TAO_ACTIVE_OBJECT_MAP_H -#define TAO_ACTIVE_OBJECT_MAP_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Key_Adapters.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Base.h" -#include "tao/Server_Strategy_Factory.h" -#include "ace/Map_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declarations. -class TAO_Id_Uniqueness_Strategy; -class TAO_Lifespan_Strategy; -class TAO_Id_Assignment_Strategy; -class TAO_Id_Hint_Strategy; -struct TAO_Active_Object_Map_Entry; - -/** - * @class TAO_Active_Object_Map - * - * @brief Map of object ids to servants. - * - * Implementation to be used by the POA. - */ -class TAO_Active_Object_Map -{ -public: - - /// Constructor. - TAO_Active_Object_Map (int user_id_policy, - int unique_id_policy, - int persistent_id_policy, - const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters - ACE_ENV_ARG_DECL); - - /// Destructor. - ~TAO_Active_Object_Map (void); - - /// Must be used with UNIQUE_ID policy. - int is_servant_in_map (PortableServer::Servant servant, - int &deactivated); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int is_user_id_in_map (const PortableServer::ObjectId &user_id, - CORBA::Short priority, - int &priorities_match, - int &deactivated); - - /// Must be used with SYSTEM_ID policy. - int bind_using_system_id_returning_system_id (PortableServer::Servant servant, - CORBA::Short priority, - PortableServer::ObjectId_out system_id); - - /// Must be used with SYSTEM_ID policy. - int bind_using_system_id_returning_user_id (PortableServer::Servant servant, - CORBA::Short priority, - PortableServer::ObjectId_out user_id); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int find_system_id_using_user_id (const PortableServer::ObjectId &user_id, - CORBA::Short priority, - PortableServer::ObjectId_out system_id); - - /// Can be used with any policy. - int rebind_using_user_id_and_system_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int unbind_using_user_id (const PortableServer::ObjectId &user_id); - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id); - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int find_system_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// user_id is actually system_id. - int find_servant_using_user_id (const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant); - - /// Can be used with any policy. - int find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// @a user_id is identical to @a system_id. - int find_servant_and_system_id_using_user_id (const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is identical to <system_id>. - /** - * @retval -1 Entry is not found or is deactivated. - * @retval 0 Entry is found. - */ - int find_entry_using_user_id (const PortableServer::ObjectId &user_id, - TAO_Active_Object_Map_Entry *&entry); - - /// Can be used with any policy. When the SYSTEM_ID policy is used, - /// the <system_id> is identical to <user_id>. - int find_user_id_using_system_id (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId_out user_id); - - /// Can be used with any policy. When the SYSTEM_ID policy is used, - /// the <system_id> is identical to <user_id>. - int find_user_id_using_system_id (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id); - - /// Are there any remaining activations of @a servant in the active - /// object map? Can be used with any policy. - CORBA::Boolean remaining_activations (PortableServer::Servant servant); - - /// Size of the map. - size_t current_size (void); - - /// Can be used with any policy. - static size_t system_id_size (void); - - /// Set the system id size. - static void set_system_id_size (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters); - - /// Base class of the id map. - typedef ACE_Map< - PortableServer::ObjectId, - TAO_Active_Object_Map_Entry *> user_id_map; - - /// Id hash map. - typedef ACE_Hash_Map_Manager_Ex_Adapter< - PortableServer::ObjectId, - TAO_Active_Object_Map_Entry *, - TAO_ObjectId_Hash, - ACE_Equal_To<PortableServer::ObjectId>, - TAO_Incremental_Key_Generator> user_id_hash_map; - -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - /// Id linear map. - typedef ACE_Map_Manager_Adapter< - PortableServer::ObjectId, - TAO_Active_Object_Map_Entry *, - TAO_Incremental_Key_Generator> user_id_linear_map; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - /// Id active map. - typedef ACE_Active_Map_Manager_Adapter< - PortableServer::ObjectId, - TAO_Active_Object_Map_Entry *, - TAO_Ignore_Original_Key_Adapter> user_id_active_map; - - /// Base class of the servant map. - typedef ACE_Map< - PortableServer::Servant, - TAO_Active_Object_Map_Entry *> servant_map; - - /// Servant hash map. - typedef ACE_Hash_Map_Manager_Ex_Adapter< - PortableServer::Servant, - TAO_Active_Object_Map_Entry *, - TAO_Servant_Hash, - ACE_Equal_To<PortableServer::Servant>, - ACE_Noop_Key_Generator<PortableServer::Servant> > servant_hash_map; - -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - /// Servant linear map. - typedef ACE_Map_Manager_Adapter< - PortableServer::Servant, - TAO_Active_Object_Map_Entry *, - ACE_Noop_Key_Generator<PortableServer::Servant> > servant_linear_map; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - /// Id map. - user_id_map *user_id_map_; - - /// Servant map. - servant_map *servant_map_; - - /// Id uniqueness strategy. - TAO_Id_Uniqueness_Strategy *id_uniqueness_strategy_; - - /// Lifespan strategy. - TAO_Lifespan_Strategy *lifespan_strategy_; - - /// Id assignment strategy. - TAO_Id_Assignment_Strategy *id_assignment_strategy_; - - /// Id hint strategy. - TAO_Id_Hint_Strategy *id_hint_strategy_; - - /// Flag to see if we are using active maps in this active object - /// map. - int using_active_maps_; - - /// Size of the system id produced by the map. - static size_t system_id_size_; -}; - -/** - * @class TAO_Id_Uniqueness_Strategy - * - * @brief Id uniqueness strategy. - * - * Strategy for implementing points of variation between the - * UNIQUE_ID and the MULTIPLE_ID policies. - */ -class TAO_Id_Uniqueness_Strategy -{ -public: - /// Virtual destructor. - virtual ~TAO_Id_Uniqueness_Strategy (void); - - /// Must be used with UNIQUE_ID policy. - virtual int is_servant_in_map (PortableServer::Servant servant, - int &deactivated) = 0; - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id) = 0; - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id) = 0; - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int find_system_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority) = 0; - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry) = 0; - - /// Are there any remaining activations of <servant> in the active - /// object map? Can be used with any policy. - virtual CORBA::Boolean remaining_activations (PortableServer::Servant servant) = 0; - - /// Set the active map. - void set_active_object_map (TAO_Active_Object_Map *active_object_map); - -protected: - - /// Pointer to the active map. - TAO_Active_Object_Map *active_object_map_; -}; - -/** - * @class TAO_Unique_Id_Strategy - * - * @brief Unique id strategy. - * - * Strategy for the UNIQUE_ID policy. - */ -class TAO_Unique_Id_Strategy : public TAO_Id_Uniqueness_Strategy -{ -public: - - /// Must be used with UNIQUE_ID policy. - virtual int is_servant_in_map (PortableServer::Servant servant, - int &deactivated); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id); - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id); - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int find_system_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry); - - /// Are there any remaining activations of <servant> in the active - /// object map? Can be used with any policy. - virtual CORBA::Boolean remaining_activations (PortableServer::Servant servant); -}; - -/** - * @class TAO_Multiple_Id_Strategy - * - * @brief Multiple id strategy. - * - * Strategy for the MULTIPLE_ID policy. - */ -class TAO_Multiple_Id_Strategy : public TAO_Id_Uniqueness_Strategy -{ -public: - - /// Must be used with UNIQUE_ID policy. - virtual int is_servant_in_map (PortableServer::Servant servant, - int &deactivated); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int unbind_using_user_id (const PortableServer::ObjectId &user_id); - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id); - - /// Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int find_system_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority); - - /// Can be used with any policy. With the SYSTEM_ID policy, - /// <user_id> is actually <system_id>. - virtual int bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry); - - /// Are there any remaining activations of <servant> in the active - /// object map? Can be used with any policy. - virtual CORBA::Boolean remaining_activations (PortableServer::Servant servant); -}; - -/** - * @class TAO_Lifespan_Strategy - * - * @brief Lifespan strategy. - * - * Strategy for implementing points of variation between the - * TRANSIENT and the PERSISTENT policies. - */ -class TAO_Lifespan_Strategy -{ -public: - - /// Virtual destructor. - virtual ~TAO_Lifespan_Strategy (void); - - /// Can be used with any policy. - virtual int find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry) = 0; - - /// Set the active map. - void set_active_object_map (TAO_Active_Object_Map *active_object_map); - -protected: - - /// Pointer to the active map. - TAO_Active_Object_Map *active_object_map_; -}; - -/** - * @class TAO_Transient_Strategy - * - * @brief Transient strategy. - * - * Strategy for the TRANSIENT policy. - */ -class TAO_Transient_Strategy : public TAO_Lifespan_Strategy -{ -public: - /// Can be used with any policy. - virtual int find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry); -}; - -/** - * @class TAO_Persistent_Strategy - * - * @brief Persistent strategy. - * - * Strategy for the PERSISTENT policy. - */ -class TAO_Persistent_Strategy : public TAO_Lifespan_Strategy -{ -public: - /// Can be used with any policy. - virtual int find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry); - -}; - -/** - * @class TAO_Id_Assignment_Strategy - * - * @brief Id uniqueness strategy. - * - * Strategy for implementing points of variation between the - * USER_ID and the SYSTEM_ID policies. - */ -class TAO_Id_Assignment_Strategy -{ -public: - /// Virtual destructor. - virtual ~TAO_Id_Assignment_Strategy (void); - - /// Must be used with SYSTEM_ID policy. - virtual int bind_using_system_id (PortableServer::Servant servant, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry) = 0; - - /// Set the active map. - void set_active_object_map (TAO_Active_Object_Map *active_object_map); - -protected: - - /// Pointer to the active map. - TAO_Active_Object_Map *active_object_map_; -}; - -/** - * @class TAO_User_Id_Strategy - * - * @brief User id strategy. - * - * Strategy for the USER_ID policy. - */ -class TAO_User_Id_Strategy : public TAO_Id_Assignment_Strategy -{ -public: - /// Must be used with SYSTEM_ID policy. - virtual int bind_using_system_id (PortableServer::Servant servant, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry); -}; - -/** - * @class TAO_System_Id_With_Unique_Id_Strategy - * - * @brief System id strategy. - * - * Strategy for the SYSTEM_ID policy (with UNIQUE_ID policy). - */ -class TAO_System_Id_With_Unique_Id_Strategy : public TAO_Id_Assignment_Strategy -{ -public: - /// Must be used with SYSTEM_ID policy. - virtual int bind_using_system_id (PortableServer::Servant servant, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry); -}; - -/** - * @class TAO_System_Id_With_Multiple_Id_Strategy - * - * @brief System id strategy. - * - * Strategy for the SYSTEM_ID policy (with MULTIPLE_ID policy). - */ -class TAO_System_Id_With_Multiple_Id_Strategy : public TAO_Id_Assignment_Strategy -{ -public: - /// Must be used with SYSTEM_ID policy. - virtual int bind_using_system_id (PortableServer::Servant servant, - CORBA::Short priority, - TAO_Active_Object_Map_Entry *&entry); -}; - -/** - * @class TAO_Id_Hint_Strategy - * - * @brief Id uniqueness strategy. - * - * Strategy for implementing points of variation between the - * active hint and the no hint policies. - */ -class TAO_Id_Hint_Strategy -{ -public: - /// Virtual destructor. - virtual ~TAO_Id_Hint_Strategy (void); - - /// Find the user id from the system id. - virtual int recover_key (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id) = 0; - - /// Add to map. - virtual int bind (TAO_Active_Object_Map_Entry &entry) = 0; - - /// Remove from map. - virtual int unbind (TAO_Active_Object_Map_Entry &entry) = 0; - - /// Find system id. - virtual int find (const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry) = 0; - - /// How big is the hint generated by this strategy? - virtual size_t hint_size (void) = 0; - - /// Get the system id associated with this entry. - virtual int system_id (PortableServer::ObjectId_out system_id, - TAO_Active_Object_Map_Entry &entry) = 0; -}; - -/** - * @class TAO_Active_Hint_Strategy - * - * @brief Active hint strategy. - * - * Strategy for adding active hints to ids. - */ -class TAO_Active_Hint_Strategy : public TAO_Id_Hint_Strategy -{ -public: - TAO_Active_Hint_Strategy (CORBA::ULong map_size); - - /// Virtual destructor. - virtual ~TAO_Active_Hint_Strategy (void); - - virtual int recover_key (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id); - - virtual int bind (TAO_Active_Object_Map_Entry &entry); - - virtual int unbind (TAO_Active_Object_Map_Entry &entry); - - virtual int find (const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry); - - virtual size_t hint_size (void); - - virtual int system_id (PortableServer::ObjectId_out system_id, - TAO_Active_Object_Map_Entry &entry); - - typedef ACE_Active_Map_Manager_Adapter< - PortableServer::ObjectId, - TAO_Active_Object_Map_Entry *, - TAO_Preserve_Original_Key_Adapter> system_id_map; - - system_id_map system_id_map_; -}; - -/** - * @class TAO_No_Hint_Strategy - * - * @brief No hint strategy. - * - * Strategy for not adding active hints to ids. - */ -class TAO_No_Hint_Strategy : public TAO_Id_Hint_Strategy -{ -public: - /// Virtual destructor. - virtual ~TAO_No_Hint_Strategy (void); - - virtual int recover_key (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id); - - virtual int bind (TAO_Active_Object_Map_Entry &entry); - - virtual int unbind (TAO_Active_Object_Map_Entry &entry); - - virtual int find (const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry); - - virtual size_t hint_size (void); - - virtual int system_id (PortableServer::ObjectId_out system_id, - TAO_Active_Object_Map_Entry &entry); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Active_Object_Map.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_ACTIVE_OBJECT_MAP_H */ diff --git a/TAO/tao/PortableServer/Active_Object_Map.i b/TAO/tao/PortableServer/Active_Object_Map.i deleted file mode 100644 index 31b3326b811..00000000000 --- a/TAO/tao/PortableServer/Active_Object_Map.i +++ /dev/null @@ -1,264 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "tao/PortableServer/Active_Object_Map_Entry.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE int -TAO_Active_Object_Map::is_servant_in_map (PortableServer::Servant servant, - int &deactivated) -{ - return this->id_uniqueness_strategy_->is_servant_in_map (servant, - deactivated); -} - -ACE_INLINE int -TAO_Active_Object_Map::bind_using_system_id_returning_system_id (PortableServer::Servant servant, - CORBA::Short priority, - PortableServer::ObjectId_out system_id) -{ - if (servant == 0 && - !this->using_active_maps_) - { - PortableServer::ObjectId id; - - int result = - this->user_id_map_->create_key (id); - - if (result == 0) - { - ACE_NEW_RETURN (system_id, - PortableServer::ObjectId (id), - -1); - } - - return result; - } - - TAO_Active_Object_Map_Entry *entry = 0; - - int result = this->id_assignment_strategy_->bind_using_system_id (servant, - priority, - entry); - - if (result == 0) - result = this->id_hint_strategy_->system_id (system_id, - *entry); - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::bind_using_system_id_returning_user_id (PortableServer::Servant servant, - CORBA::Short priority, - PortableServer::ObjectId_out user_id) -{ - TAO_Active_Object_Map_Entry *entry = 0; - - int result = this->id_assignment_strategy_->bind_using_system_id (servant, - priority, - entry); - if (result == 0) - ACE_NEW_RETURN (user_id, - PortableServer::ObjectId (entry->user_id_), - -1); - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::bind_using_user_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - CORBA::Short priority) -{ - TAO_Active_Object_Map_Entry *entry = 0; - return this->id_uniqueness_strategy_->bind_using_user_id (servant, - user_id, - priority, - entry); -} - -ACE_INLINE int -TAO_Active_Object_Map::find_system_id_using_user_id (const PortableServer::ObjectId &user_id, - CORBA::Short priority, - PortableServer::ObjectId_out system_id) -{ - if (!this->using_active_maps_) - { - ACE_NEW_RETURN (system_id, - PortableServer::ObjectId (user_id), - -1); - - return 0; - } - - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->id_uniqueness_strategy_->bind_using_user_id (0, - user_id, - priority, - entry); - if (result == 0) - result = this->id_hint_strategy_->system_id (system_id, - *entry); - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::rebind_using_user_id_and_system_id (PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO_Active_Object_Map_Entry *&entry) -{ - ACE_UNUSED_ARG (system_id); - - return this->id_uniqueness_strategy_->bind_using_user_id (servant, - user_id, - -1, - entry); -} - -ACE_INLINE int -TAO_Active_Object_Map::unbind_using_user_id (const PortableServer::ObjectId &user_id) -{ - return this->id_uniqueness_strategy_->unbind_using_user_id (user_id); -} - -ACE_INLINE int -TAO_Active_Object_Map::find_user_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out user_id) -{ - return this->id_uniqueness_strategy_->find_user_id_using_servant (servant, - user_id); -} - -ACE_INLINE int -TAO_Active_Object_Map::find_system_id_using_servant (PortableServer::Servant servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority) -{ - return this->id_uniqueness_strategy_->find_system_id_using_servant (servant, - system_id, - priority); -} - -ACE_INLINE int -TAO_Active_Object_Map::find_servant_using_user_id (const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->user_id_map_->find (user_id, - entry); - if (result == 0) - { - if (entry->deactivated_) - result = -1; - else if (entry->servant_ == 0) - result = -1; - else - servant = entry->servant_; - } - - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::find_servant_using_system_id_and_user_id (const PortableServer::ObjectId &system_id, - const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - TAO_Active_Object_Map_Entry *&entry) -{ - return this->lifespan_strategy_->find_servant_using_system_id_and_user_id (system_id, - user_id, - servant, - entry); -} - -ACE_INLINE int -TAO_Active_Object_Map::find_entry_using_user_id (const PortableServer::ObjectId &user_id, - TAO_Active_Object_Map_Entry *&entry) -{ - int result = this->user_id_map_->find (user_id, - entry); - - if (result == 0) - { - if (entry->deactivated_) - result = -1; - } - - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::find_servant_and_system_id_using_user_id (const PortableServer::ObjectId &user_id, - PortableServer::Servant &servant, - PortableServer::ObjectId_out system_id, - CORBA::Short &priority) -{ - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->find_entry_using_user_id (user_id, - entry); - - if (result == 0) - { - if (entry->servant_ == 0) - { - result = -1; - } - else - { - result = this->id_hint_strategy_->system_id (system_id, - *entry); - if (result == 0) - { - servant = entry->servant_; - priority = entry->priority_; - } - } - } - - return result; -} - -ACE_INLINE int -TAO_Active_Object_Map::find_user_id_using_system_id (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId_out user_id) -{ - PortableServer::ObjectId id; - int result = this->id_hint_strategy_->recover_key (system_id, - id); - if (result == 0) - ACE_NEW_RETURN (user_id, - PortableServer::ObjectId (id), - -1); - return 0; -} - -ACE_INLINE int -TAO_Active_Object_Map::find_user_id_using_system_id (const PortableServer::ObjectId &system_id, - PortableServer::ObjectId &user_id) -{ - return this->id_hint_strategy_->recover_key (system_id, - user_id); -} - -ACE_INLINE CORBA::Boolean -TAO_Active_Object_Map::remaining_activations (PortableServer::Servant servant) -{ - return this->id_uniqueness_strategy_->remaining_activations (servant); -} - -ACE_INLINE size_t -TAO_Active_Object_Map::current_size (void) -{ - return this->user_id_map_->current_size (); -} - -/* static */ -ACE_INLINE size_t -TAO_Active_Object_Map::system_id_size (void) -{ - return TAO_Active_Object_Map::system_id_size_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Active_Object_Map_Entry.cpp b/TAO/tao/PortableServer/Active_Object_Map_Entry.cpp deleted file mode 100644 index fc29e9faec0..00000000000 --- a/TAO/tao/PortableServer/Active_Object_Map_Entry.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Active_Object_Map_Entry.h" - -ACE_RCSID(PortableServer, - Active_Object_Map_Entry, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Active_Object_Map_Entry::TAO_Active_Object_Map_Entry (void) - : user_id_ (), - system_id_ (), - servant_ (0), - reference_count_ (1), - deactivated_ (0), - priority_ (-1) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Active_Object_Map_Entry.h b/TAO/tao/PortableServer/Active_Object_Map_Entry.h deleted file mode 100644 index 75d2a3d2c40..00000000000 --- a/TAO/tao/PortableServer/Active_Object_Map_Entry.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Active_Object_Map_Entry.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - - -#ifndef TAO_ACTIVE_OBJECT_MAP_ENTRY_H -#define TAO_ACTIVE_OBJECT_MAP_ENTRY_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/PS_ForwardC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @struct TAO_Active_Object_Map_Entry - * - * @brief Value field of the active object map. - * - * We need a mapping from and to all of the following fields: - * user_id, system_id, and servant. Therefore, we keep - * all the fields together in the map. - */ -struct TAO_Active_Object_Map_Entry -{ - /// Default constructor. - TAO_Active_Object_Map_Entry (void); - - /// User id. - PortableServer::ObjectId user_id_; - - /// System id. - PortableServer::ObjectId system_id_; - - /// Servant. - PortableServer::Servant servant_; - - /// Reference count on outstanding requests on this servant. - CORBA::UShort reference_count_; - - /// Has this servant been deactivated already? - CORBA::Boolean deactivated_; - - /// Priority of this servant. - CORBA::Short priority_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_ACTIVE_OBJECT_MAP_ENTRY_H */ diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp deleted file mode 100644 index 33c267042ba..00000000000 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp +++ /dev/null @@ -1,241 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Active_Policy_Strategies.h" -#include "tao/PortableServer/POA_Cached_Policies.h" - -#include "tao/PortableServer/ThreadStrategy.h" -#include "tao/PortableServer/ThreadStrategyFactory.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "tao/PortableServer/IdAssignmentStrategyFactory.h" -#include "tao/PortableServer/LifespanStrategy.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "tao/PortableServer/IdUniquenessStrategyFactory.h" -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "tao/PortableServer/ImplicitActivationStrategyFactory.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -#include "tao/PortableServer/IdAssignmentPolicyC.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" -#include "tao/PortableServer/ImplicitActivationPolicyC.h" -#include "tao/PortableServer/LifespanPolicyC.h" -#include "tao/PortableServer/RequestProcessingPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" -#include "tao/PortableServer/ThreadPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" - -#include "ace/Dynamic_Service.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Active_Policy_Strategies.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(PortableServer, - Active_Policy_Strategies, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - Active_Policy_Strategies::Active_Policy_Strategies (void) - : thread_strategy_ (0), - request_processing_strategy_ (0), - id_assignment_strategy_ (0), - lifespan_strategy_ (0), - id_uniqueness_strategy_ (0), - implicit_activation_strategy_ (0), - servant_retention_strategy_ (0), - thread_strategy_factory_ (0), - servant_retention_strategy_factory_ (0), - request_processing_strategy_factory_ (0), - lifespan_strategy_factory_ (0), - implicit_activation_strategy_factory_ (0), - id_uniqueness_strategy_factory_ (0), - id_assignment_strategy_factory_ (0) - { - } - - void - Active_Policy_Strategies::update (Cached_Policies &policies, - ::TAO_Root_POA *poa - ACE_ENV_ARG_DECL) - { - this->thread_strategy_factory_ = - ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategyFactory"); - - if (this->thread_strategy_factory_ != 0) - this->thread_strategy_ = - this->thread_strategy_factory_->create (policies.thread()); - - /**/ - - this->id_assignment_strategy_factory_ = - ACE_Dynamic_Service<IdAssignmentStrategyFactory>::instance ("IdAssignmentStrategyFactory"); - - if (this->id_assignment_strategy_factory_ != 0) - this->id_assignment_strategy_ = - this->id_assignment_strategy_factory_->create (policies.id_assignment()); - - /**/ - - this->id_uniqueness_strategy_factory_ = - ACE_Dynamic_Service<IdUniquenessStrategyFactory>::instance ("IdUniquenessStrategyFactory"); - - if (this->id_uniqueness_strategy_factory_ != 0) - this->id_uniqueness_strategy_ = - this->id_uniqueness_strategy_factory_->create (policies.id_uniqueness()); - - /**/ - - this->servant_retention_strategy_factory_ = - ACE_Dynamic_Service<ServantRetentionStrategyFactory>::instance ("ServantRetentionStrategyFactory"); - - if (this->servant_retention_strategy_factory_ != 0) - this->servant_retention_strategy_ = - this->servant_retention_strategy_factory_->create (policies.servant_retention()); - - /**/ - - this->request_processing_strategy_factory_ = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyFactory"); - - if (this->request_processing_strategy_factory_ != 0) - this->request_processing_strategy_ = - this->request_processing_strategy_factory_->create (policies.request_processing(), policies.servant_retention()); - - /**/ - - this->lifespan_strategy_factory_ = - ACE_Dynamic_Service<LifespanStrategyFactory>::instance ("LifespanStrategyFactory"); - - if (this->lifespan_strategy_factory_ != 0) - this->lifespan_strategy_ = - this->lifespan_strategy_factory_->create (policies.lifespan()); - - /**/ - - this->implicit_activation_strategy_factory_ = - ACE_Dynamic_Service<ImplicitActivationStrategyFactory>::instance ("ImplicitActivationStrategyFactory"); - - if (this->implicit_activation_strategy_factory_ != 0) - this->implicit_activation_strategy_ = - this->implicit_activation_strategy_factory_->create (policies.implicit_activation()); - - /**/ - -// @todo, check if all pointers are != 0 - - if (this->lifespan_strategy_ != 0) - { - this->lifespan_strategy_->strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (this->request_processing_strategy_ != 0) - { - this->request_processing_strategy_->strategy_init (poa, policies.servant_retention() ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (this->id_uniqueness_strategy_ != 0) - { - this->id_uniqueness_strategy_->strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (this->implicit_activation_strategy_ != 0) - { - this->implicit_activation_strategy_->strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (this->thread_strategy_ != 0) - { - this->thread_strategy_->strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (this->servant_retention_strategy_ != 0) - { - this->servant_retention_strategy_->strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (this->id_assignment_strategy_ != 0) - { - this->id_assignment_strategy_->strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - void - Active_Policy_Strategies::cleanup (ACE_ENV_SINGLE_ARG_DECL) - { - - if (this->lifespan_strategy_ != 0) - { - this->lifespan_strategy_factory_->destroy (lifespan_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->lifespan_strategy_ = 0; - } - - if (this->request_processing_strategy_ != 0) - { - this->request_processing_strategy_factory_->destroy (request_processing_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->request_processing_strategy_ = 0; - } - - if (this->id_uniqueness_strategy_ != 0) - { - this->id_uniqueness_strategy_factory_->destroy (id_uniqueness_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->id_uniqueness_strategy_ = 0; - } - - if (this->implicit_activation_strategy_ != 0) - { - this->implicit_activation_strategy_factory_->destroy (implicit_activation_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->implicit_activation_strategy_ = 0; - } - - if (this->thread_strategy_ != 0) - { - this->thread_strategy_factory_->destroy (thread_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->thread_strategy_ = 0; - } - - if (this->servant_retention_strategy_ != 0) - { - this->servant_retention_strategy_factory_->destroy (servant_retention_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->servant_retention_strategy_ = 0; - } - - if (this->id_assignment_strategy_ != 0) - { - this->id_assignment_strategy_factory_->destroy (id_assignment_strategy_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->id_assignment_strategy_ = 0; - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.h b/TAO/tao/PortableServer/Active_Policy_Strategies.h deleted file mode 100644 index 685c6978c2b..00000000000 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.h +++ /dev/null @@ -1,107 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Active_Policy_Strategies.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H -#define TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H - -#include /**/ "ace/pre.h" - -#include "tao/Environment.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/CORBA_macros.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class Cached_Policies; - class ThreadStrategy; - class RequestProcessingStrategy; - class IdAssignmentStrategy; - class LifespanStrategy; - class IdUniquenessStrategy; - class ImplicitActivationStrategy; - class ServantRetentionStrategy; - - class ThreadStrategyFactory; - class ServantRetentionStrategyFactory; - class RequestProcessingStrategyFactory; - class LifespanStrategyFactory; - class ImplicitActivationStrategyFactory; - class IdUniquenessStrategyFactory; - class IdAssignmentStrategyFactory; - - /** - * This class stores the active policy strategies used for a certain POA. - */ - class Active_Policy_Strategies - { - public: - Active_Policy_Strategies (void); - - void update (Cached_Policies &policies, - TAO_Root_POA* poa - ACE_ENV_ARG_DECL); - - void cleanup (ACE_ENV_SINGLE_ARG_DECL); - - ThreadStrategy *thread_strategy (void) const; - - RequestProcessingStrategy *request_processing_strategy (void) const; - - IdAssignmentStrategy *id_assignment_strategy (void) const; - - IdUniquenessStrategy *id_uniqueness_strategy (void) const; - - LifespanStrategy *lifespan_strategy (void) const; - - ImplicitActivationStrategy *implicit_activation_strategy (void) const; - - ServantRetentionStrategy *servant_retention_strategy (void) const; - - private: - ThreadStrategy *thread_strategy_; - RequestProcessingStrategy *request_processing_strategy_; - IdAssignmentStrategy *id_assignment_strategy_; - LifespanStrategy *lifespan_strategy_; - IdUniquenessStrategy *id_uniqueness_strategy_; - ImplicitActivationStrategy *implicit_activation_strategy_; - ServantRetentionStrategy *servant_retention_strategy_; - - ThreadStrategyFactory *thread_strategy_factory_; - ServantRetentionStrategyFactory *servant_retention_strategy_factory_; - RequestProcessingStrategyFactory *request_processing_strategy_factory_; - LifespanStrategyFactory *lifespan_strategy_factory_; - ImplicitActivationStrategyFactory *implicit_activation_strategy_factory_; - IdUniquenessStrategyFactory *id_uniqueness_strategy_factory_; - IdAssignmentStrategyFactory *id_assignment_strategy_factory_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Active_Policy_Strategies.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H */ diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.inl b/TAO/tao/PortableServer/Active_Policy_Strategies.inl deleted file mode 100644 index ab606b04b1a..00000000000 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.inl +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ACE_INLINE - ThreadStrategy* - Active_Policy_Strategies::thread_strategy (void) const - { - return this->thread_strategy_; - } - - ACE_INLINE - RequestProcessingStrategy* - Active_Policy_Strategies::request_processing_strategy (void) const - { - return this->request_processing_strategy_; - } - - ACE_INLINE - IdAssignmentStrategy * - Active_Policy_Strategies::id_assignment_strategy (void) const - { - return this->id_assignment_strategy_; - } - - ACE_INLINE - IdUniquenessStrategy * - Active_Policy_Strategies::id_uniqueness_strategy (void) const - { - return this->id_uniqueness_strategy_; - } - - ACE_INLINE - LifespanStrategy* - Active_Policy_Strategies::lifespan_strategy (void) const - { - return this->lifespan_strategy_; - } - - ACE_INLINE - ImplicitActivationStrategy* - Active_Policy_Strategies::implicit_activation_strategy (void) const - { - return this->implicit_activation_strategy_; - } - - ACE_INLINE - ServantRetentionStrategy* - Active_Policy_Strategies::servant_retention_strategy (void) const - { - return this->servant_retention_strategy_; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/AdapterActivator.pidl b/TAO/tao/PortableServer/AdapterActivator.pidl deleted file mode 100644 index 40c13708947..00000000000 --- a/TAO/tao/PortableServer/AdapterActivator.pidl +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file AdapterActivator.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - * - */ - -#ifndef _PORTABLESERVER_ADAPTER_ACTIVATOR_IDL_ -#define _PORTABLESERVER_ADAPTER_ACTIVATOR_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/PortableServer/PS_Forward.pidl" - -#pragma prefix "omg.org" - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - -module PortableServer -{ - /// AdapterActivator interface. - local interface AdapterActivator - { -# pragma version AdapterActivator 2.3 - - boolean unknown_adapter (in POA parent, - in string name); - }; -}; - -#endif - -#endif // _PORTABLESERVER_ADAPTER_ACTIVATOR_IDL_ diff --git a/TAO/tao/PortableServer/Adapter_Activator.cpp b/TAO/tao/PortableServer/Adapter_Activator.cpp deleted file mode 100644 index 1b97b7269b8..00000000000 --- a/TAO/tao/PortableServer/Adapter_Activator.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Adapter_Activator.h" - -ACE_RCSID (PortableServer, - Adapter_Activator, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/AdapterActivatorC.h" -#include "tao/PortableServer/POAManagerC.h" -#include "tao/PortableServer/PortableServer.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - Adapter_Activator::Adapter_Activator ( - PortableServer::POAManager_ptr pm) - : poa_manager_ (PortableServer::POAManager::_duplicate (pm)) - { - } - - CORBA::Boolean - Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, - const char *name - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - // Default policies - CORBA::PolicyList default_policies; - - // This assumes that the lock on the parent is recursive - PortableServer::POA_var child = - parent->create_POA (name, - this->poa_manager_.in (), - default_policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ACE_TRY - { - child->the_activator (this ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - (void) child->destroy (1, - 1 - ACE_ENV_ARG_PARAMETER); - - return false; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (0); - - // Finally everything is fine - return true; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/Adapter_Activator.h b/TAO/tao/PortableServer/Adapter_Activator.h deleted file mode 100644 index 9d70eaabddf..00000000000 --- a/TAO/tao/PortableServer/Adapter_Activator.h +++ /dev/null @@ -1,66 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Adapter_Activator.h - * - * $Id$ - */ -//============================================================================= - -#ifndef TAO_ADAPTER_ACTIVATOR_H -#define TAO_ADAPTER_ACTIVATOR_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/AdapterActivatorC.h" - -#if (TAO_HAS_MINIMUM_POA == 0) -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - class POAManager; - - typedef POAManager *POAManager_ptr; - typedef TAO_Objref_Var_T<POAManager> POAManager_var; -} - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export Adapter_Activator - : public PortableServer::AdapterActivator - { - public: - - Adapter_Activator (PortableServer::POAManager_ptr poa_manager); - - CORBA::Boolean unknown_adapter (PortableServer::POA_ptr parent, - const char *name - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - protected: - - /// POA Manager - PortableServer::POAManager_var poa_manager_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_ADAPTER_ACTIVATOR_H */ diff --git a/TAO/tao/PortableServer/Any_SArg_Traits.h b/TAO/tao/PortableServer/Any_SArg_Traits.h deleted file mode 100644 index 94980dc0c0b..00000000000 --- a/TAO/tao/PortableServer/Any_SArg_Traits.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Any_SArg_Traits.h - * - * $Id$ - * - * @author Jeff Parsons - * @author Ossama Othman - */ -//============================================================================= - - -#ifndef TAO_ANY_SARG_TRAITS_H -#define TAO_ANY_SARG_TRAITS_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Var_Size_SArgument_T.h" -#include "tao/PortableServer/portableserver_export.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace CORBA -{ - class Any; -} - -namespace TAO -{ - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Any> - : public - Var_Size_SArg_Traits_T< - CORBA::Any, - TAO::Any_Insert_Policy_Stream <CORBA::Any> - > - { - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_ANY_ARG_TRAITS_H */ diff --git a/TAO/tao/PortableServer/BD_String_SArgument_T.cpp b/TAO/tao/PortableServer/BD_String_SArgument_T.cpp deleted file mode 100644 index a984d92b4c3..00000000000 --- a/TAO/tao/PortableServer/BD_String_SArgument_T.cpp +++ /dev/null @@ -1,154 +0,0 @@ -// $Id$ - -#ifndef TAO_BD_STRING_SARGUMENT_T_CPP -#define TAO_BD_STRING_SARGUMENT_T_CPP - -#include "tao/PortableServer/BD_String_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/BD_String_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -CORBA::Boolean -TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::demarshal ( - TAO_InputCDR & cdr - ) -{ - typedef typename S_var::s_traits::to_type to_type; - return cdr >> to_type (this->x_.out (), BOUND); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -void -TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - typedef typename S_var::s_traits::from_type from_type; - Insert_Policy::any_insert ( - any, - from_type (this->x_.in (), BOUND) - ); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - typedef typename S_var::s_traits::from_type from_type; - return cdr << from_type (this->x_.in (), BOUND); -} - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::demarshal ( - TAO_InputCDR & cdr - ) -{ - typedef typename S_var::s_traits::to_type to_type; - return cdr >> to_type (this->x_.out (), BOUND); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -void -TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - typedef typename S_var::s_traits::from_type from_type; - Insert_Policy::any_insert ( - any, - from_type (this->x_.in (), BOUND) - ); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -CORBA::Boolean -TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal ( - TAO_OutputCDR &cdr - ) -{ - typedef typename S_var::s_traits::from_type from_type; - return cdr << from_type (this->x_.in (), BOUND); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -void -TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - typedef typename S_var::s_traits::from_type from_type; - Insert_Policy::any_insert ( - any, - from_type (this->x_.in (), BOUND) - ); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - typedef typename S_var::s_traits::from_type from_type; - return cdr << from_type (this->x_.in (), BOUND); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -void -TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - typedef typename S_var::s_traits::from_type from_type; - Insert_Policy::any_insert ( - any, - from_type (this->x_.in (), BOUND) - ); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_BD_STRING_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/BD_String_SArgument_T.h b/TAO/tao/PortableServer/BD_String_SArgument_T.h deleted file mode 100644 index 4ef604e4453..00000000000 --- a/TAO/tao/PortableServer/BD_String_SArgument_T.h +++ /dev/null @@ -1,183 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file BD_String_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - - -#ifndef TAO_BD_STRING_SARGUMENT_T_H -#define TAO_BD_STRING_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "ace/CDR_Stream.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Argument.h" -#include "tao/Any_Insert_Policy_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_BD_String_SArgument_T - * - * @brief Template class for IN skeleton bd (w)string argument. - * - */ - template<typename S_var, - size_t BOUND, - class Insert_Policy> - class In_BD_String_SArgument_T : public InArgument - { - public: - In_BD_String_SArgument_T (void); - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - const typename S_var::s_traits::char_type * arg (void) const; - - private: - S_var x_; - }; - - /** - * @class Inout_BD_String_SArgument_T - * - * @brief Template class for INOUT skeleton bd (w)string argument. - * - */ - template<typename S_var, - size_t BOUND, - class Insert_Policy> - class Inout_BD_String_SArgument_T : public InoutArgument - { - public: - Inout_BD_String_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_var::s_traits::char_type *& arg (void); - - private: - S_var x_; - }; - - /** - * @class Out_BD_String_SArgument_T - * - * @brief Template class for INOUT skeleton bd (w)string argument. - * - */ - template<typename S_var, - size_t BOUND, - class Insert_Policy> - class Out_BD_String_SArgument_T : public OutArgument - { - public: - Out_BD_String_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_var::s_traits::char_type *& arg (void); - - private: - S_var x_; - }; - - /** - * @class Ret_BD_String_SArgument_T - * - * @brief Template class for return skeleton value of bd (w)string. - * - */ - template<typename S_var, - size_t BOUND, - class Insert_Policy> - class Ret_BD_String_SArgument_T : public RetArgument - { - public: - Ret_BD_String_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_var::s_traits::char_type *& arg (void); - - private: - S_var x_; - }; - - /** - * @struct Basic_SArg_Traits_T - * - * @brief Template class for skeleton argument traits of bounded (w)strings. - * - */ - template<typename T_var, - size_t BOUND, - class Insert_Policy> - struct BD_String_SArg_Traits_T - { - typedef typename T_var::s_traits::char_type * ret_type; - typedef const typename T_var::s_traits::char_type * in_type; - typedef typename T_var::s_traits::char_type *& inout_type; - typedef typename T_var::s_traits::string_out out_type; - - typedef In_BD_String_SArgument_T<T_var, - BOUND, - Insert_Policy> in_arg_val; - typedef Inout_BD_String_SArgument_T<T_var, - BOUND, - Insert_Policy> inout_arg_val; - typedef Out_BD_String_SArgument_T<T_var, - BOUND, - Insert_Policy> out_arg_val; - typedef Ret_BD_String_SArgument_T<T_var, - BOUND, - Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef in_type in_arg_type; - typedef inout_type inout_arg_type; - typedef inout_type out_arg_type; - typedef inout_type ret_arg_type; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/BD_String_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/BD_String_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("BD_String_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_BD_STRING_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/BD_String_SArgument_T.inl b/TAO/tao/PortableServer/BD_String_SArgument_T.inl deleted file mode 100644 index 1359afa5a9c..00000000000 --- a/TAO/tao/PortableServer/BD_String_SArgument_T.inl +++ /dev/null @@ -1,89 +0,0 @@ -// -*- C+ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -In_BD_String_SArgument_T (void) -{} - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -const typename S_var::s_traits::char_type * -TAO::In_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -arg (void) const -{ - return this->x_.in (); -} - -// ========================================================================== - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -Inout_BD_String_SArgument_T (void) -{} - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -typename S_var::s_traits::char_type *& -TAO::Inout_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -arg (void) -{ - return this->x_.inout (); -} - -// ========================================================================== - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -Out_BD_String_SArgument_T (void) -{} - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -typename S_var::s_traits::char_type *& -TAO::Out_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -arg (void) -{ - return this->x_.out (); -} - -// ========================================================================== - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -Ret_BD_String_SArgument_T (void) -{} - -template<typename S_var, - size_t BOUND, - class Insert_Policy> -ACE_INLINE -typename S_var::s_traits::char_type *& -TAO::Ret_BD_String_SArgument_T<S_var,BOUND,Insert_Policy>:: -arg (void) -{ - return this->x_.out (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Basic_SArgument_T.cpp b/TAO/tao/PortableServer/Basic_SArgument_T.cpp deleted file mode 100644 index 2065c8ed885..00000000000 --- a/TAO/tao/PortableServer/Basic_SArgument_T.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// $Id$ - -#ifndef TAO_BASIC_SARGUMENT_T_CPP -#define TAO_BASIC_SARGUMENT_T_CPP - -#include "tao/PortableServer/Basic_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Basic_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::In_Basic_SArgument_T<S,Insert_Policy>::demarshal (TAO_InputCDR &cdr) -{ - return cdr >> this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::In_Basic_SArgument_T<S,Insert_Policy>::interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Basic_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Basic_SArgument_T<S,Insert_Policy>::demarshal (TAO_InputCDR & cdr) -{ - return cdr >> this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Inout_Basic_SArgument_T<S,Insert_Policy>::interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Basic_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Out_Basic_SArgument_T<S,Insert_Policy>::interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Basic_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Ret_Basic_SArgument_T<S,Insert_Policy>::interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_BASIC_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Basic_SArgument_T.h b/TAO/tao/PortableServer/Basic_SArgument_T.h deleted file mode 100644 index 611c3d5b327..00000000000 --- a/TAO/tao/PortableServer/Basic_SArgument_T.h +++ /dev/null @@ -1,163 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Basic_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - - -#ifndef TAO_BASIC_SARGUMENT_T_H -#define TAO_BASIC_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_Basic_SArgument_T - * - * @brief Template class for IN skeleton argument of basic IDL types. - * - */ - template<typename S, class Insert_Policy> - class In_Basic_SArgument_T : public InArgument - { - public: - In_Basic_SArgument_T (void); - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S arg (void) const; - - private: - S x_; - }; - - /** - * @class Inout_Basic_SArgument_T - * - * @brief Template class for INOUT skeleton argument of basic IDL types. - * - */ - template<typename S, class Insert_Policy> - class Inout_Basic_SArgument_T : public InoutArgument - { - public: - Inout_Basic_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @class Out_Basic_SArgument_T - * - * @brief Template class for OUT skeleton argument of basic IDL types. - * - */ - template<typename S, class Insert_Policy> - class Out_Basic_SArgument_T : public OutArgument - { - public: - Out_Basic_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @class Ret_Basic_SArgument_T - * - * @brief Template class for return skeleton value of basic IDL types. - * - */ - template<typename S, class Insert_Policy> - class Ret_Basic_SArgument_T : public RetArgument - { - public: - Ret_Basic_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @struct Basic_SArg_Traits_T - * - * @brief Template class for skeleton argument traits of basic IDL types. - * - */ - template<typename T, class Insert_Policy> - struct Basic_SArg_Traits_T - { - typedef T ret_type; - typedef T in_type; - typedef T & inout_type; - typedef T & out_type; - - typedef In_Basic_SArgument_T<T, Insert_Policy> in_arg_val; - typedef Inout_Basic_SArgument_T<T, Insert_Policy> inout_arg_val; - typedef Out_Basic_SArgument_T<T, Insert_Policy> out_arg_val; - typedef Ret_Basic_SArgument_T<T, Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef in_type in_arg_type; - typedef inout_type inout_arg_type; - typedef out_type out_arg_type; - typedef out_type ret_arg_type; - - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Basic_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Basic_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Basic_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_BASIC_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Basic_SArgument_T.inl b/TAO/tao/PortableServer/Basic_SArgument_T.inl deleted file mode 100644 index 815328650ed..00000000000 --- a/TAO/tao/PortableServer/Basic_SArgument_T.inl +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::In_Basic_SArgument_T<S,Insert_Policy>::In_Basic_SArgument_T (void) -{} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S -TAO::In_Basic_SArgument_T<S,Insert_Policy>::arg (void) const -{ - return this->x_; -} - -// ================================================================ - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Basic_SArgument_T<S,Insert_Policy>::Inout_Basic_SArgument_T (void) -{} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Inout_Basic_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// ================================================================ - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Out_Basic_SArgument_T<S,Insert_Policy>::Out_Basic_SArgument_T (void) -{} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Out_Basic_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// ================================================================ - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Basic_SArgument_T<S,Insert_Policy>::Ret_Basic_SArgument_T (void) -{} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Ret_Basic_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Basic_SArguments.h b/TAO/tao/PortableServer/Basic_SArguments.h deleted file mode 100644 index 433002d391f..00000000000 --- a/TAO/tao/PortableServer/Basic_SArguments.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Basic_SArguments.h - * - * $Id$ - * - * @authors Jeff Parsons and Carlos O'Ryan - */ -//============================================================================= - - -#ifndef TAO_BASIC_SARGUMENTS_H -#define TAO_BASIC_SARGUMENTS_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Basic_SArgument_T.h" -#include "tao/PortableServer/SArg_Traits_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * - * @brief Specialization for void return type. - * - */ - template<> - class TAO_PortableServer_Export SArg_Traits<void> - { - public: - - typedef void ret_type; - typedef RetArgument ret_val; - - }; - - /** - * - * @brief Specializations for basic skeleton arg types, - * except (w)char/boolean/octet. - * - */ - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Short> - : public Basic_SArg_Traits_T<CORBA::Short, TAO::Any_Insert_Policy_Stream <CORBA::Short> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Long> - : public Basic_SArg_Traits_T<CORBA::Long, TAO::Any_Insert_Policy_Stream <CORBA::Long> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::UShort> - : public Basic_SArg_Traits_T<CORBA::UShort, TAO::Any_Insert_Policy_Stream <CORBA::UShort> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::ULong> - : public Basic_SArg_Traits_T<CORBA::ULong, TAO::Any_Insert_Policy_Stream <CORBA::ULong> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Float> - : public Basic_SArg_Traits_T<CORBA::Float, TAO::Any_Insert_Policy_Stream <CORBA::Float> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Double> - : public Basic_SArg_Traits_T<CORBA::Double, TAO::Any_Insert_Policy_Stream <CORBA::Double> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::LongLong> - : public Basic_SArg_Traits_T<CORBA::LongLong, TAO::Any_Insert_Policy_Stream <CORBA::LongLong> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::ULongLong> - : public Basic_SArg_Traits_T<CORBA::ULongLong, TAO::Any_Insert_Policy_Stream <CORBA::ULongLong> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::LongDouble> - : public Basic_SArg_Traits_T<CORBA::LongDouble, TAO::Any_Insert_Policy_Stream <CORBA::LongDouble> > - { - }; - -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_BASIC_SARGUMENTS_H */ diff --git a/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp b/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp deleted file mode 100644 index 26939a27be7..00000000000 --- a/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp +++ /dev/null @@ -1,330 +0,0 @@ -//$Id$ -// -- PortableServer Include -- -#include "tao/PortableServer/Collocated_Object_Proxy_Broker.h" -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/Servant_Base.h" - - -// -- TAO Include -- -#include "tao/Stub.h" -#include "tao/ORB_Core.h" -#include "tao/Profile.h" - -ACE_RCSID (PortableServer, - Collocated_Object_Proxy_Broker, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - CORBA::Boolean - Collocated_Object_Proxy_Broker::_is_a (CORBA::Object_ptr target, - const char *type_id - ACE_ENV_ARG_DECL) - { - TAO_Stub *stub = target->_stubobj (); - - // Which collocation strategy should we use? - if (stub != 0 && - stub->servant_orb_var ()->orb_core ()->get_collocation_strategy () - == TAO_ORB_Core::THRU_POA) - { - TAO::Portable_Server::Servant_Upcall servant_upcall ( - stub->servant_orb_var ()->orb_core () - ); - - CORBA::Object_var forward_to; - servant_upcall.prepare_for_upcall ( - stub->profile_in_use ()->object_key (), - "_is_a", - forward_to.out () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (0); - - servant_upcall.pre_invoke_collocated_request ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK_RETURN (0); - - return servant_upcall.servant ()->_is_a (type_id - ACE_ENV_ARG_PARAMETER); - } - - // Direct collocation strategy is used. - if (target->_servant () != 0) - { - return target->_servant ()->_is_a (type_id - ACE_ENV_ARG_PARAMETER); - } - - return 0; - } - -#if (TAO_HAS_MINIMUM_CORBA == 0) - - char * - Collocated_Object_Proxy_Broker::_repository_id (CORBA::Object_ptr target - ACE_ENV_ARG_DECL) - { - TAO_Stub *stub = target->_stubobj (); - char * _tao_retval = 0; - - ACE_TRY - { - // Which collocation strategy should we use? - if (stub != 0 && - stub->servant_orb_var ()->orb_core () - ->get_collocation_strategy () == TAO_ORB_Core::THRU_POA) - { - TAO::Portable_Server::Servant_Upcall servant_upcall ( - stub->servant_orb_var ()->orb_core () - ); - - CORBA::Object_var forward_to; - servant_upcall.prepare_for_upcall ( - stub->profile_in_use ()->object_key (), - "_repository_id", - forward_to.out () - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - _tao_retval = - servant_upcall.servant ()->_repository_id ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - } - // Direct collocation strategy is used. - else if (target->_servant () != 0) - { - _tao_retval = - target->_servant ()->_repository_id ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex) - { - // Ignore this exception. - } - ACE_CATCHANY - { - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (_tao_retval); - - return _tao_retval; - } - - CORBA::Boolean - Collocated_Object_Proxy_Broker::_non_existent (CORBA::Object_ptr target - ACE_ENV_ARG_DECL) - { - CORBA::Boolean _tao_retval = true; - - TAO_Stub *stub = target->_stubobj (); - - // Which collocation strategy should we use? - if (stub != 0 && - stub->servant_orb_var ()->orb_core () - ->get_collocation_strategy () == TAO_ORB_Core::THRU_POA) - { - TAO::Portable_Server::Servant_Upcall servant_upcall ( - target->_stubobj ()->servant_orb_var ()->orb_core () - ); - - CORBA::Object_var forward_to; - - servant_upcall.prepare_for_upcall ( - target->_stubobj ()->object_key (), - "_non_existent", - forward_to.out () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (_tao_retval); - - servant_upcall.pre_invoke_collocated_request ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK_RETURN (_tao_retval); - - _tao_retval = - servant_upcall.servant ()->_non_existent ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK_RETURN (_tao_retval); - } - // Direct collocation strategy is used. - else if (target->_servant () != 0) - { - _tao_retval = - target->_servant ()->_non_existent (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (_tao_retval); - } - - return _tao_retval; - } - - CORBA::Object_ptr - Collocated_Object_Proxy_Broker::_get_component (CORBA::Object_ptr target - ACE_ENV_ARG_DECL) - { - CORBA::Object_var _tao_retval (CORBA::Object::_nil ()); - - TAO_Stub *stub = target->_stubobj (); - - ACE_TRY - { - // Which collocation strategy should we use? - if (stub != 0 && - stub->servant_orb_var ()->orb_core () - ->get_collocation_strategy () == TAO_ORB_Core::THRU_POA) - { - TAO::Portable_Server::Servant_Upcall servant_upcall ( - stub->servant_orb_var ()->orb_core () - ); - - CORBA::Object_var forward_to; - servant_upcall.prepare_for_upcall ( - stub->profile_in_use ()->object_key (), - "_component", - forward_to.out () - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - _tao_retval = - servant_upcall.servant ()->_get_component ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - } - // Direct collocation strategy is used. - else if (target->_servant () != 0) - { - _tao_retval = - target->_servant ()->_get_component ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex) - { - // Ignore this exception. - } - ACE_CATCHANY - { - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (_tao_retval._retn ()); - - return _tao_retval._retn (); - } - - CORBA::InterfaceDef_ptr - Collocated_Object_Proxy_Broker::_get_interface ( - CORBA::Object_ptr target - ACE_ENV_ARG_DECL) - { - CORBA::InterfaceDef_ptr _tao_retval = 0; - - TAO_Stub *stub = target->_stubobj (); - - ACE_TRY - { - // Which collocation strategy should we use? - if (stub != 0 && - stub->servant_orb_var ()->orb_core ()->get_collocation_strategy () - == TAO_ORB_Core::THRU_POA) - { - TAO::Portable_Server::Servant_Upcall servant_upcall ( - target->_stubobj ()->servant_orb_var ()->orb_core () - ); - - CORBA::Object_var forward_to; - - servant_upcall.prepare_for_upcall ( - target->_stubobj ()->object_key (), - "_interface", - forward_to.out () - ACE_ENV_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - servant_upcall.pre_invoke_collocated_request ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - - _tao_retval = - servant_upcall.servant ()->_get_interface ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - } - // Direct collocation strategy is used. - else if (target->_servant () != 0) - { - _tao_retval = - target->_servant ()->_get_interface ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::OBJECT_NOT_EXIST, ex) - { - // Ignore this exception. - } - ACE_CATCHANY - { - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (_tao_retval); - - return _tao_retval; - } - -#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ - -} - -// ----------------------------------------------------- -TAO::Collocated_Object_Proxy_Broker * -the_tao_collocated_object_proxy_broker (void) -{ - static TAO::Collocated_Object_Proxy_Broker the_broker; - return &the_broker; -} - -TAO::Object_Proxy_Broker * _TAO_collocation_Object_Proxy_Broker_Factory (void) -{ - return the_tao_collocated_object_proxy_broker (); -} - -int -_TAO_collocation_Object_Proxy_Broker_Factory_Initializer (size_t) -{ - _TAO_Object_Proxy_Broker_Factory_function_pointer = - _TAO_collocation_Object_Proxy_Broker_Factory; - - return 0; -} - -static int -_TAO_collocation_Object_Proxy_Broker_Factory_Initializer_Scarecrow = -_TAO_collocation_Object_Proxy_Broker_Factory_Initializer ( - reinterpret_cast<size_t> (_TAO_collocation_Object_Proxy_Broker_Factory_Initializer - ) - ); - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.h b/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.h deleted file mode 100644 index cd28b880933..00000000000 --- a/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.h +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Collocated_Object_Proxy_Broker.h - * - * $Id$ - * - * This files contains the Collocated Proxy Broker implementation - * for the CORBA Object. - * - * @author Angelo Corsaro <corsaro@cs.wustl.edu> - * @author Balachandran Natarajan (modified the implementation) - */ -//============================================================================= - -#ifndef TAO_COLLOCATED_OBJECT_PROXY_BROKER_H -#define TAO_COLLOCATED_OBJECT_PROXY_BROKER_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Object_Proxy_Broker.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class Collocated_Object_Proxy_Broker - * - * @brief Collocated_Object_Proxy_Broker - * - * A broker for standard CORBA::Object calls that needs to be made - * on remote objects. - */ - class TAO_PortableServer_Export Collocated_Object_Proxy_Broker - : public Object_Proxy_Broker - { - public: - /// Please see the documentation in Object_Proxy_Broker.h for - /// details. - virtual CORBA::Boolean _is_a (CORBA::Object_ptr target, - const char *logical_type_id - ACE_ENV_ARG_DECL); - -#if (TAO_HAS_MINIMUM_CORBA == 0) - - virtual CORBA::Boolean _non_existent (CORBA::Object_ptr target - ACE_ENV_ARG_DECL); - - virtual CORBA::InterfaceDef * _get_interface ( - CORBA::Object_ptr target - ACE_ENV_ARG_DECL - ); - - virtual CORBA::Object_ptr _get_component (CORBA::Object_ptr target - ACE_ENV_ARG_DECL); - - virtual char * _repository_id (CORBA::Object_ptr target - ACE_ENV_ARG_DECL); - -#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ - - }; -} - -// ----------------------------------------------------- - -/// This function is used to access the unique instance of strategized -/// proxy broker. All the CORBA::Object share the proxy broker. -TAO::Collocated_Object_Proxy_Broker *the_tao_collocated_object_proxy_broker (void); - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_COLLOCATED_OBJECT_PROXY_BROKER_H*/ diff --git a/TAO/tao/PortableServer/Creation_Time.cpp b/TAO/tao/PortableServer/Creation_Time.cpp deleted file mode 100644 index 0156db0dec3..00000000000 --- a/TAO/tao/PortableServer/Creation_Time.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "tao/PortableServer/Creation_Time.h" - -ACE_RCSID (PortableServer, - Creation_Time, - "$Id$") - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Creation_Time.inl" -#endif /* ! __ACE_INLINE__ */ - diff --git a/TAO/tao/PortableServer/Creation_Time.h b/TAO/tao/PortableServer/Creation_Time.h deleted file mode 100644 index 5fb58f93e72..00000000000 --- a/TAO/tao/PortableServer/Creation_Time.h +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Creation_Time.h - * - * $Id$ - * - * Header file for Creation_Time and Temporary_Creation_Time - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_CREATION_TIME_H -#define TAO_CREATION_TIME_H - -#include /**/ "ace/pre.h" - -#include "ace/Time_Value.h" -#include "tao/Basic_Types.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class Temporary_Creation_Time; - - class Creation_Time - { - public: - explicit Creation_Time (const ACE_Time_Value &creation_time); - - Creation_Time (void); - - void creation_time (const void *creation_time); - - const void *creation_time (void) const; - - static CORBA::ULong creation_time_length (void); - - bool operator== (const Creation_Time &rhs) const; - - bool operator!= (const Creation_Time &rhs) const; - - bool operator== (const Temporary_Creation_Time &rhs) const; - - bool operator!= (const Temporary_Creation_Time &rhs) const; - - protected: - - enum - { - SEC_FIELD = 0, - USEC_FIELD = 1 - }; - - /// Timestamp - CORBA::ULong time_stamp_[2]; - - }; - - /** - * @class Temporary_Creation_Time - * - * @brief Special creation time only useful in the lifetime of the - * upcall. - * - * Special creation time only useful in the lifetime of the upcall. - */ - class Temporary_Creation_Time - { - public: - - Temporary_Creation_Time (void); - - void creation_time (const void *creation_time); - - bool operator== (const Creation_Time &rhs) const; - - bool operator!= (const Creation_Time &rhs) const; - - protected: - - void *time_stamp_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Creation_Time.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_CREATION_TIME_H */ diff --git a/TAO/tao/PortableServer/Creation_Time.inl b/TAO/tao/PortableServer/Creation_Time.inl deleted file mode 100644 index f629b10e91b..00000000000 --- a/TAO/tao/PortableServer/Creation_Time.inl +++ /dev/null @@ -1,126 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "tao/orbconf.h" /* For POA_NO_TIMESTAMP definition. */ -#include "ace/OS_NS_string.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ACE_INLINE CORBA::ULong - Creation_Time::creation_time_length (void) - { - return 2 * sizeof (CORBA::ULong); - } - - ACE_INLINE - Creation_Time::Creation_Time (const ACE_Time_Value &creation_time) - { - this->time_stamp_[Creation_Time::SEC_FIELD] = (CORBA::ULong) creation_time.sec (); - this->time_stamp_[Creation_Time::USEC_FIELD] = (CORBA::ULong) creation_time.usec (); - } - - ACE_INLINE - Creation_Time::Creation_Time (void) - { - this->time_stamp_[Creation_Time::SEC_FIELD] = 0; - this->time_stamp_[Creation_Time::USEC_FIELD] = 0; - } - - ACE_INLINE void - Creation_Time::creation_time (const void *creation_time) - { - ACE_OS::memcpy (&this->time_stamp_, - creation_time, - Creation_Time::creation_time_length ()); - } - - ACE_INLINE const void * - Creation_Time::creation_time (void) const - { - return &this->time_stamp_; - } - - ACE_INLINE bool - Creation_Time::operator== (const Creation_Time &rhs) const - { - #if (POA_NO_TIMESTAMP == 1) - ACE_UNUSED_ARG (rhs); - return true; - #else - return ACE_OS::memcmp (&this->time_stamp_, - &rhs.time_stamp_, - Creation_Time::creation_time_length ()) == 0; - #endif /* POA_NO_TIMESTAMP */ - } - - ACE_INLINE bool - Creation_Time::operator!= (const Creation_Time &rhs) const - { - #if (POA_NO_TIMESTAMP == 1) - ACE_UNUSED_ARG (rhs); - return false; - #else - return ACE_OS::memcmp (&this->time_stamp_, - &rhs.time_stamp_, - Creation_Time::creation_time_length ()) != 0; - #endif /* POA_NO_TIMESTAMP */ - } - - ACE_INLINE bool - Temporary_Creation_Time::operator== (const Creation_Time &rhs) const - { - #if (POA_NO_TIMESTAMP == 1) - ACE_UNUSED_ARG (rhs); - return true; - #else - return ACE_OS::memcmp (this->time_stamp_, - rhs.creation_time (), - Creation_Time::creation_time_length ()) == 0; - #endif /* POA_NO_TIMESTAMP */ - } - - ACE_INLINE bool - Temporary_Creation_Time::operator!= (const Creation_Time &rhs) const - { - #if (POA_NO_TIMESTAMP == 1) - ACE_UNUSED_ARG (rhs); - return false; - #else - return ACE_OS::memcmp (this->time_stamp_, - rhs.creation_time (), - Creation_Time::creation_time_length ()) != 0; - #endif /* POA_NO_TIMESTAMP */ - } - - ACE_INLINE bool - Creation_Time::operator== (const Temporary_Creation_Time &rhs) const - { - return rhs == *this; - } - - ACE_INLINE bool - Creation_Time::operator!= (const Temporary_Creation_Time &rhs) const - { - return rhs != *this; - } - - ACE_INLINE - Temporary_Creation_Time::Temporary_Creation_Time (void) - : time_stamp_ (0) - { - } - - ACE_INLINE void - Temporary_Creation_Time::creation_time (const void *creation_time) - { - this->time_stamp_ = (void *) creation_time; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp b/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp deleted file mode 100644 index 40177f90b27..00000000000 --- a/TAO/tao/PortableServer/Default_Acceptor_Filter.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// @(#) $Id$ - -#include "tao/PortableServer/Default_Acceptor_Filter.h" -#include "tao/Transport_Acceptor.h" -#include "tao/MProfile.h" -#include "tao/Profile.h" - -ACE_RCSID(PortableServer, - Default_Acceptor_Filter, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Default_Acceptor_Filter::TAO_Default_Acceptor_Filter (void) -{ -} - -int -TAO_Default_Acceptor_Filter::fill_profile (const TAO::ObjectKey &object_key, - TAO_MProfile &mprofile, - TAO_Acceptor **acceptors_begin, - TAO_Acceptor **acceptors_end, - CORBA::Short priority) -{ - // Go through all the acceptors. - for (TAO_Acceptor** acceptor = acceptors_begin; - acceptor != acceptors_end; - ++acceptor) - { - // Ask each acceptor to make a profile. - if ((*acceptor)->create_profile (object_key, - mprofile, - priority) == -1) - return -1; - } - - return 0; -} - -int -TAO_Default_Acceptor_Filter::encode_endpoints (TAO_MProfile &mprofile) -{ - // if -ORBUseSharedProfile is set, there may be multiple endpoints - // per profile, even without priority. - for (CORBA::ULong i = 0; - i < mprofile.profile_count (); - ++i) - { - TAO_Profile *profile = mprofile.get_profile (i); - if (profile->encode_alternate_endpoints () == -1) - return -1; - } - - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Default_Acceptor_Filter.h b/TAO/tao/PortableServer/Default_Acceptor_Filter.h deleted file mode 100644 index 3b1bca11b17..00000000000 --- a/TAO/tao/PortableServer/Default_Acceptor_Filter.h +++ /dev/null @@ -1,64 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Default_Acceptor_Filter.h - * - * $Id$ - * - * Default strategy for populating mprofile - * - * @author Marina Spivak <marina@cs.wustl.edu> - * @author Carlos O'Ryan <coryan@uci.edu> - */ -//============================================================================= - - -#ifndef TAO_DEFAULT_ACCEPTOR_FILTER_H -#define TAO_DEFAULT_ACCEPTOR_FILTER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Acceptor_Filter.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Acceptor; - -/** - * @class TAO_Default_Acceptor_Filter - * - * @brief Default Acceptor_Filter. - * - * Default strategy for populating mprofile: all available - * endpoints are included. - */ -class TAO_PortableServer_Export TAO_Default_Acceptor_Filter - : public TAO_Acceptor_Filter -{ -public: - TAO_Default_Acceptor_Filter (void); - - /// Populate @a mprofile with all available endpoints. - virtual int fill_profile (const TAO::ObjectKey &object_key, - TAO_MProfile &mprofile, - TAO_Acceptor **acceptors_begin, - TAO_Acceptor **acceptors_end, - CORBA::Short priority = TAO_INVALID_PRIORITY); - - /// Encodes the endpoints in the profiles into the TAO_TAG_ENDPOINTS - /// tag component of profiles. - int encode_endpoints (TAO_MProfile &mprofile); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_DEFAULT_ACCEPTOR_FILTER_H */ diff --git a/TAO/tao/PortableServer/Default_Policy_Validator.cpp b/TAO/tao/PortableServer/Default_Policy_Validator.cpp deleted file mode 100644 index 8152f2fb385..00000000000 --- a/TAO/tao/PortableServer/Default_Policy_Validator.cpp +++ /dev/null @@ -1,157 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Default_Policy_Validator.h" -#include "tao/ORB_Core.h" -#include "tao/Policy_Set.h" -#include "tao/PolicyFactory_Registry_Adapter.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - Default_Policy_Validator, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_POA_Default_Policy_Validator::TAO_POA_Default_Policy_Validator ( - TAO_ORB_Core &orb_core) - : TAO_Policy_Validator (orb_core) -{ -} - -TAO_POA_Default_Policy_Validator::~TAO_POA_Default_Policy_Validator (void) -{ -} - -void -TAO_POA_Default_Policy_Validator::validate_impl (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) -{ -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - CORBA::Policy_var policy = - policies.get_cached_policy (TAO_CACHED_POLICY_SERVANT_RETENTION - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableServer::ServantRetentionPolicy_var srp = - PortableServer::ServantRetentionPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::ServantRetentionPolicyValue servant_retention = - srp->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - policy = - policies.get_cached_policy (TAO_CACHED_POLICY_REQUEST_PROCESSING - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableServer::RequestProcessingPolicy_var rpp = - PortableServer::RequestProcessingPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::RequestProcessingPolicyValue request_processing = - rpp->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // The NON_RETAIN policy requires either the USE_DEFAULT_SERVANT or - // USE_SERVANT_MANAGER policies. - if (servant_retention == PortableServer::NON_RETAIN) - if (request_processing != PortableServer::USE_SERVANT_MANAGER && - request_processing != PortableServer::USE_DEFAULT_SERVANT) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); - - // USE_ACTIVE_OBJECT_MAP_ONLY requires the RETAIN policy. - if (request_processing == PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY) - if (servant_retention != PortableServer::RETAIN) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); - - policy = - policies.get_cached_policy (TAO_CACHED_POLICY_ID_UNIQUENESS - ACE_ENV_ARG_PARAMETER); - - ACE_CHECK; - - PortableServer::IdUniquenessPolicy_var iup = - PortableServer::IdUniquenessPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::IdUniquenessPolicyValue id_uniqueness = - iup->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - policy = - policies.get_cached_policy (TAO_CACHED_POLICY_IMPLICIT_ACTIVATION - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableServer::ImplicitActivationPolicy_var iap = - PortableServer::ImplicitActivationPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::ImplicitActivationPolicyValue implicit_activation = - iap->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - policy = - policies.get_cached_policy (TAO_CACHED_POLICY_ID_ASSIGNMENT - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - PortableServer::IdAssignmentPolicy_var idap = - PortableServer::IdAssignmentPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - PortableServer::IdAssignmentPolicyValue id_assignment = - idap->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // USE_DEFAULT_SERVANT requires the MULTIPLE_ID policy. - if (request_processing == PortableServer::USE_DEFAULT_SERVANT) - if (id_uniqueness != PortableServer::MULTIPLE_ID) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); - - // IMPLICIT_ACTIVATION requires the SYSTEM_ID and RETAIN policies. - if (implicit_activation == PortableServer::IMPLICIT_ACTIVATION) - if (servant_retention != PortableServer::RETAIN || - id_assignment != PortableServer::SYSTEM_ID) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); -#else /* TAO_HAS_MINIMUM_POA == 0 */ - ACE_UNUSED_ARG (policies); - ACE_ENV_ARG_NOT_USED; // FUZZ: ignore check_for_ace_check -#endif /* TAO_HAS_MINIMUM_POA == 0 */ -} - -CORBA::Boolean -TAO_POA_Default_Policy_Validator::legal_policy_impl (CORBA::PolicyType type) -{ - // Check known POA policies, or if given PolicyType has a - // corresponding PolicyFactory. The PolicyFactory check is mandated - // by the CORBA specification. - return - ( -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - type == PortableServer::THREAD_POLICY_ID || -# endif -# if ! defined (CORBA_E_MICRO) - type == PortableServer::LIFESPAN_POLICY_ID || - type == PortableServer::ID_UNIQUENESS_POLICY_ID || - type == PortableServer::ID_ASSIGNMENT_POLICY_ID || -# endif -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - type == PortableServer::IMPLICIT_ACTIVATION_POLICY_ID || - type == PortableServer::SERVANT_RETENTION_POLICY_ID || - type == PortableServer::REQUEST_PROCESSING_POLICY_ID || -# endif - (this->orb_core_.policy_factory_registry () != 0 && - this->orb_core_.policy_factory_registry ()->factory_exists (type))); -} - -void -TAO_POA_Default_Policy_Validator::merge_policies_impl ( - TAO_Policy_Set & - ACE_ENV_ARG_DECL_NOT_USED) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Default_Policy_Validator.h b/TAO/tao/PortableServer/Default_Policy_Validator.h deleted file mode 100644 index ce099b9d402..00000000000 --- a/TAO/tao/PortableServer/Default_Policy_Validator.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Default_Policy_Validator.h - * - * $Id$ - * - * This file contains the declaration for the default POA policy validator. - * - * @author Angelo Corsaro <corsaro@cs.wustl.edu> - * @author Frank Hunleth <fhuntleth@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_DEFAULT_POLICY_VALIDATOR_H_ -#define TAO_DEFAULT_POLICY_VALIDATOR_H_ - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Policy_Validator.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_PortableServer_Export TAO_POA_Default_Policy_Validator - : public TAO_Policy_Validator -{ -public: - - /// Constructor. - TAO_POA_Default_Policy_Validator (TAO_ORB_Core &orb_core); - - /// Destructor. - ~TAO_POA_Default_Policy_Validator (void); - -protected: - /** - * Validate that the policies in the specified set - * are consistent and legal. Throw an appropriate exception - * if that is not the case. - */ - void validate_impl (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL); - - /// Add/merge policies. - void merge_policies_impl (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL); - - /** - * Return whether the specified policy type is legal for the - * current configuration. This is needed since the user can - * potentially specify policies that are unknown to an - * validate () routine, and these need to be caught. - */ - virtual CORBA::Boolean legal_policy_impl (CORBA::PolicyType type); - -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_DEFAULT_POLICY_VALIDATOR_H_ */ diff --git a/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp b/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp deleted file mode 100644 index d964a4d4f90..00000000000 --- a/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Default_Servant_Dispatcher.h" -#include "tao/PortableServer/Root_POA.h" - -ACE_RCSID(PortableServer, - Default_Servant_Dispatcher, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Default_Servant_Dispatcher::~TAO_Default_Servant_Dispatcher (void) -{ -} - -TAO_Root_POA * -TAO_Default_Servant_Dispatcher::create_Root_POA (const ACE_CString &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL) -{ - TAO_Root_POA *poa = 0; - - ACE_NEW_THROW_EX (poa, - TAO_Root_POA (name, - poa_manager, - policies, - 0, - lock, - thread_lock, - orb_core, - object_adapter - ACE_ENV_ARG_PARAMETER), CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - return poa; -} - -void -TAO_Default_Servant_Dispatcher::pre_invoke_remote_request ( - TAO_Root_POA &, - CORBA::Short, - TAO_ServerRequest &, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State & - ACE_ENV_ARG_DECL_NOT_USED) -{ -} - -void -TAO_Default_Servant_Dispatcher::pre_invoke_collocated_request ( - TAO_Root_POA &, - CORBA::Short, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State & - ACE_ENV_ARG_DECL_NOT_USED) -{ -} - -void -TAO_Default_Servant_Dispatcher::post_invoke ( - TAO_Root_POA &, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Default_Servant_Dispatcher.h b/TAO/tao/PortableServer/Default_Servant_Dispatcher.h deleted file mode 100644 index e5f5f2b71db..00000000000 --- a/TAO/tao/PortableServer/Default_Servant_Dispatcher.h +++ /dev/null @@ -1,77 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Default_Servant_Dispatcher.h - * - * $Id$ - * - * @author Frank Hunleth (fhunleth@cs.wustl.edu) - */ -//============================================================================= - -#ifndef TAO_DEFAULT_SERVANT_DISPATCHER_H -#define TAO_DEFAULT_SERVANT_DISPATCHER_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Dispatcher.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Default_Servant_Dispatcher - * - * @brief Concrete instantiation of the Servant_Dispatcher strategy. - * - * This class just calls _dispatch on the servant_upcall. No extra - * processing is done or needed. - * - */ -class TAO_PortableServer_Export TAO_Default_Servant_Dispatcher - : public TAO_Servant_Dispatcher -{ -public: - virtual ~TAO_Default_Servant_Dispatcher (void); - - /// Pre_invoke remote request. - void pre_invoke_remote_request ( - TAO_Root_POA &poa, - CORBA::Short servant_priority, - TAO_ServerRequest &req, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state - ACE_ENV_ARG_DECL); - - /// Pre_invoke collocated request. - void pre_invoke_collocated_request ( - TAO_Root_POA &poa, - CORBA::Short servant_priority, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state - ACE_ENV_ARG_DECL); - - /// Post_invoke request. - void post_invoke ( - TAO_Root_POA &poa, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state); - - /// Factory method for creating new POA's. - TAO_Root_POA *create_Root_POA ( - const ACE_CString &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_DEFAULT_SERVANT_DISPATCHER_H */ diff --git a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp deleted file mode 100644 index d7ce947dbae..00000000000 --- a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h" - -#if (TAO_HAS_MINIMUM_CORBA == 0) -# include "tao/PortableServer/ForwardRequestC.h" -#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ - -#include "tao/Abstract_Servant_Base.h" -#include "tao/SystemException.h" -#include "tao/ORB_Constants.h" -#include "tao/Object.h" -#include "tao/Environment.h" - -ACE_RCSID (PortableServer, - Direct_Collocation_Upcall_Wrapper, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -void -TAO::Direct_Collocation_Upcall_Wrapper::upcall ( - CORBA::Object_ptr obj, - CORBA::Object_out forward_obj, - TAO::Argument ** args, - int num_args, - const char * op, - size_t op_len, - TAO::Collocation_Strategy strategy - ACE_ENV_ARG_DECL -) -ACE_THROW_SPEC ((CORBA::Exception)) -{ - TAO_Abstract_ServantBase * const servant = obj->_servant (); - - TAO_Collocated_Skeleton collocated_skel; - int const status = servant->_find (op, - collocated_skel, - strategy, - op_len); - - if (status == -1) - { - ACE_THROW (CORBA::BAD_OPERATION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO)); - } - - ACE_TRY - { - collocated_skel (servant, - args, - num_args - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } -#if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ACE_CATCH (PortableServer::ForwardRequest, forward_request) - { - forward_obj = - CORBA::Object::_duplicate (forward_request.forward_reference.in ()); - return; - } -#else - ACE_CATCHANY - { - ACE_UNUSED_ARG (forward_obj); - ACE_RE_THROW; - } -#endif /* TAO_HAS_MINIMUM_CORBA && !CORBA_E_COMPACT && !CORBA_E_MICRO*/ - ACE_ENDTRY; - ACE_CHECK; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h deleted file mode 100644 index edc4c39f479..00000000000 --- a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h +++ /dev/null @@ -1,78 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Direct_Collocation_Upcall_Wrapper.h - * - * $Id$ - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_DIRECT_COLLOCATION_UPCALL_WRAPPER_H -#define TAO_DIRECT_COLLOCATION_UPCALL_WRAPPER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#ifndef ACE_LACKS_PRAGMA_ONCE -# pragma once -#endif /* !ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Basic_Types.h" -#include "tao/orbconf.h" -#include "tao/Collocation_Strategy.h" -#include "tao/Exception.h" -#include "tao/CORBA_methods.h" -#include "tao/Pseudo_VarOut_T.h" -#include "ace/CORBA_macros.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace CORBA -{ - class Environment; - - class Object; - typedef Object *Object_ptr; - typedef TAO_Pseudo_Var_T<Object> Object_var; - typedef TAO_Pseudo_Out_T<Object> Object_out; -} - -namespace TAO -{ - class Argument; - - /** - * @class Direct_Collocation_Upcall_Wrapper - * - * @brief Wraps the activities direct collocation upcall - * - */ - class TAO_PortableServer_Export Direct_Collocation_Upcall_Wrapper - { - public: - - /// Perform the upcall - void upcall ( - CORBA::Object_ptr obj, - CORBA::Object_out forward_obj, - TAO::Argument ** args, - int num_args, - const char * op, - size_t op_len, - TAO::Collocation_Strategy strategy - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::Exception)); - }; - -} // End namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_DIRECT_COLLOCATION_UPCALL_WRAPPER_H */ diff --git a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.cpp b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.cpp deleted file mode 100644 index fd989f3ebf9..00000000000 --- a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// $Id$ - -#ifndef TAO_FIXED_ARRAY_SARGUMENT_T_CPP -#define TAO_FIXED_ARRAY_SARGUMENT_T_CPP - -#include "tao/PortableServer/Fixed_Array_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Fixed_Array_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::In_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::demarshal (TAO_InputCDR &cdr) -{ - S_forany tmp (this->x_); - return cdr >> tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_forany, - class Insert_Policy> -void -TAO::In_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << S_forany (this->x_); -} - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>:: -demarshal (TAO_InputCDR & cdr) -{ - S_forany tmp (this->x_); - return cdr >> tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_forany, - class Insert_Policy> -void -TAO::Inout_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << S_forany (this->x_); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_forany, - class Insert_Policy> -void -TAO::Out_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S_var, - typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Fixed_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - return cdr << S_forany (this->x_.inout ()); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - typename S_forany, - class Insert_Policy> -void -TAO::Ret_Fixed_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_.ptr ())); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_FIXED_ARRAY_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.h b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.h deleted file mode 100644 index eb280d5b838..00000000000 --- a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.h +++ /dev/null @@ -1,173 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Fixed_Array_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - - -#ifndef TAO_FIXED_ARRAY_SARGUMENT_T_H -#define TAO_FIXED_ARRAY_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_Fixed_Array_SArgument_T - * - * @brief IN skeleton argument of fixed size element array. - * - */ - template<typename S_forany, - class Insert_Policy> - class In_Fixed_Array_SArgument_T : public InArgument - { - public: - In_Fixed_Array_SArgument_T (void); - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type const * arg (void) const; - - private: - mutable typename S_forany::_array_type x_; - }; - - /** - * @class Inout_Fixed_Array_SArgument_T - * - * @brief INOUT skeleton argument of fixed size element array. - */ - template<typename S_forany, - class Insert_Policy> - class Inout_Fixed_Array_SArgument_T : public InoutArgument - { - public: - Inout_Fixed_Array_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type * arg (void); - - private: - mutable typename S_forany::_array_type x_; - }; - - /** - * @class Out_Fixed_Array_SArgument_T - * - * @brief OUT skeleton argument of fixed size element array. - */ - template<typename S_forany, - class Insert_Policy> - class Out_Fixed_Array_SArgument_T : public OutArgument - { - public: - Out_Fixed_Array_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type * arg (void); - - private: - mutable typename S_forany::_array_type x_; - }; - - /** - * @class Ret_Fixed_Array_SArgument_T - * - * @brief Skeleton value of fixed size element array. - * - */ - template<typename S_var, - typename S_forany, - class Insert_Policy> - class Ret_Fixed_Array_SArgument_T : public RetArgument - { - public: - Ret_Fixed_Array_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type *& arg (void); - - private: - S_var x_; - }; - - /** - * @struct Fixed_Array_Arg_Traits_T - * - * @brief Argument traits of fixed size element array. - * - */ - template<typename T_var, - typename T_forany, - class Insert_Policy> - struct Fixed_Array_SArg_Traits_T - { - typedef typename T_forany::_slice_type * ret_type; - typedef const typename T_forany::_array_type in_type; - typedef typename T_forany::_array_type inout_type; - typedef typename T_forany::_array_type out_type; - - typedef In_Fixed_Array_SArgument_T<T_forany, - Insert_Policy> in_arg_val; - typedef Inout_Fixed_Array_SArgument_T<T_forany, - Insert_Policy> inout_arg_val; - typedef Out_Fixed_Array_SArgument_T<T_forany, - Insert_Policy> out_arg_val; - typedef Ret_Fixed_Array_SArgument_T<T_var, - T_forany, - Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef typename T_forany::_slice_type const * in_arg_type; - typedef ret_type inout_arg_type; - typedef ret_type out_arg_type; - typedef ret_type & ret_arg_type; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Fixed_Array_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Fixed_Array_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Fixed_Array_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_FIXED_ARRAY_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.inl b/TAO/tao/PortableServer/Fixed_Array_SArgument_T.inl deleted file mode 100644 index f910e871d2d..00000000000 --- a/TAO/tao/PortableServer/Fixed_Array_SArgument_T.inl +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::In_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::In_Fixed_Array_SArgument_T (void) -{ -} - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -typename S_forany::_slice_type const * -TAO::In_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::arg (void) const -{ - S_forany tmp (this->x_); - return tmp.in (); -} - -// =========================================================================== - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>:: -Inout_Fixed_Array_SArgument_T (void) -{ -} - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -typename S_forany::_slice_type * -TAO::Inout_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::arg (void) -{ - S_forany tmp (this->x_); - return tmp.inout (); -} - -// =========================================================================== - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::Out_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>:: -Out_Fixed_Array_SArgument_T (void) -{ -} - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -typename S_forany::_slice_type * -TAO::Out_Fixed_Array_SArgument_T<S_forany, - Insert_Policy>::arg (void) -{ - S_forany tmp (this->x_); - return tmp.inout (); -} - -// =========================================================================== - -template<typename S_var, - typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Fixed_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>:: -Ret_Fixed_Array_SArgument_T (void) -{ -} - -template<typename S_var, - typename S_forany, - class Insert_Policy> -ACE_INLINE -typename S_forany::_slice_type *& -TAO::Ret_Fixed_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::arg (void) -{ - return this->x_._retn_arg (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Fixed_Size_SArgument_T.cpp b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.cpp deleted file mode 100644 index 33990ec3594..00000000000 --- a/TAO/tao/PortableServer/Fixed_Size_SArgument_T.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// $Id$ - -#ifndef TAO_FIXED_SIZE_SARGUMENT_T_CPP -#define TAO_FIXED_SIZE_SARGUMENT_T_CPP - -#include "tao/PortableServer/Fixed_Size_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Fixed_Size_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::In_Fixed_Size_SArgument_T<S,Insert_Policy>::demarshal (TAO_InputCDR & cdr) -{ - return cdr >> this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::In_Fixed_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Fixed_Size_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Fixed_Size_SArgument_T<S,Insert_Policy>::demarshal ( - TAO_InputCDR & cdr) -{ - return cdr >> this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Inout_Fixed_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Fixed_Size_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Out_Fixed_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Fixed_Size_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Ret_Fixed_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_FIXED_SIZE_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Fixed_Size_SArgument_T.h b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.h deleted file mode 100644 index 0912f64c017..00000000000 --- a/TAO/tao/PortableServer/Fixed_Size_SArgument_T.h +++ /dev/null @@ -1,234 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Fixed_Size_SArgument_T.h - * - * $Id$ - * - * @author Jeff Parsons - * @author Carlos O'Ryan - * @author Ossama Othman - */ -//============================================================================= - -#ifndef TAO_FIXED_SIZE_SARGUMENT_T_H -#define TAO_FIXED_SIZE_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_Fixed_Size_SArgument_T - * - * @brief Skeleton class template for operation "IN" arguments of - * fixed size IDL types. - * - * Skeleton class template for operation "IN" arguments of fixed - * size IDL types. - */ - template<typename S, class Insert_Policy> - class In_Fixed_Size_SArgument_T : public InArgument - { - public: - - /** - * @name @c TAO::Argument Method Overrides - * - * @c TAO::Argument method overrides specific to the type of - * operation argument represented by this class. - * - * @see @c TAO::Argument. - */ - //@{ - virtual CORBA::Boolean demarshal (TAO_InputCDR & cdr); - -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - //@} - - /// Retrieve underlying argument. - S const & arg (void) const; - - private: - - /// Reference to the "IN" argument. - S x_; - - }; - - // ------------------------------------------------------------ - - /** - * @class Inout_Fixed_Size_SArgument_T - * - * @brief Template class for INOUT skeleton arg of fixed size IDL types. - * - */ - template<typename S, class Insert_Policy> - class Inout_Fixed_Size_SArgument_T : public InoutArgument - { - public: - - /// Constructor. - Inout_Fixed_Size_SArgument_T (void); - - /** - * @name @c TAO::Argument Method Overrides - * - * @c TAO::Argument method overrides specific to the type of - * operation argument represented by this class. - * - * @see @c TAO::Argument. - */ - //@{ - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - //@} - - S & arg (void); - - private: - - S x_; - }; - - // ------------------------------------------------------------ - - /** - * @class Out_Fixed_Size_SArgument_T - * - * @brief Template class for OUT skeleton argument of fixed size IDL types. - * - */ - template<typename S, class Insert_Policy> - class Out_Fixed_Size_SArgument_T : public OutArgument - { - public: - - /// Constructor. - Out_Fixed_Size_SArgument_T (void); - - /** - * @name @c TAO::Argument Method Overrides - * - * @c TAO::Argument method overrides specific to the type of - * operation argument represented by this class. - * - * @see @c TAO::Argument. - */ - //@{ - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - //@} - - S & arg (void); - - private: - - S x_; - - }; - - // ------------------------------------------------------------ - - /** - * @class Ret_Fixed_Size_SArgument_T - * - * @brief Template class for return skeleton value of fixed size IDL types. - * - */ - template<typename S, class Insert_Policy> - class Ret_Fixed_Size_SArgument_T : public RetArgument - { - public: - - /// Constructor. - Ret_Fixed_Size_SArgument_T (void); - - /** - * @name @c TAO::Argument Method Overrides - * - * @c TAO::Argument method overrides specific to the type of - * operation argument represented by this class. - * - * @see @c TAO::Argument. - */ - //@{ - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - //@} - - S & arg (void); - - private: - - S x_; - - }; - - // ------------------------------------------------------------ - - /** - * @struct Fixed_Size_SArg_Traits_T - * - * @brief Template class for argument traits of fixed size IDL types. - * - */ - template<typename T, - class Insert_Policy> - struct Fixed_Size_SArg_Traits_T - { - typedef T ret_type; - typedef T const & in_type; - typedef T & inout_type; - typedef T & out_type; - - typedef In_Fixed_Size_SArgument_T<T,Insert_Policy> in_arg_val; - typedef Inout_Fixed_Size_SArgument_T<T,Insert_Policy> inout_arg_val; - typedef Out_Fixed_Size_SArgument_T<T,Insert_Policy> out_arg_val; - typedef Ret_Fixed_Size_SArgument_T<T,Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef in_type in_arg_type; - typedef inout_type inout_arg_type; - typedef out_type out_arg_type; - typedef out_type ret_arg_type; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Fixed_Size_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Fixed_Size_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Fixed_Size_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_FIXED_SIZE_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Fixed_Size_SArgument_T.inl b/TAO/tao/PortableServer/Fixed_Size_SArgument_T.inl deleted file mode 100644 index 367a060b576..00000000000 --- a/TAO/tao/PortableServer/Fixed_Size_SArgument_T.inl +++ /dev/null @@ -1,71 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - class Insert_Policy> -ACE_INLINE -S const & -TAO::In_Fixed_Size_SArgument_T<S,Insert_Policy>::arg (void) const -{ - return this->x_; -} - -// ========================================================================== - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Fixed_Size_SArgument_T<S,Insert_Policy>:: -Inout_Fixed_Size_SArgument_T (void) -{ -} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Inout_Fixed_Size_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// ========================================================================== - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Out_Fixed_Size_SArgument_T<S, - Insert_Policy>:: -Out_Fixed_Size_SArgument_T (void) -{} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Out_Fixed_Size_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// ========================================================================== - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Fixed_Size_SArgument_T<S,Insert_Policy>::Ret_Fixed_Size_SArgument_T (void) -{} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Ret_Fixed_Size_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ForwardRequest.pidl b/TAO/tao/PortableServer/ForwardRequest.pidl deleted file mode 100644 index 1752ac6eef2..00000000000 --- a/TAO/tao/PortableServer/ForwardRequest.pidl +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @file ForwardRequest.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_FORWARDREQUEST_IDL_ -#define _PORTABLESERVER_FORWARDREQUEST_IDL_ - -#pragma prefix "omg.org" - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - -module PortableServer -{ -# pragma version PortableServer 2.3 - - exception ForwardRequest - { - Object forward_reference; - }; -}; - -#endif - -#endif // _PORTABLESERVER_FORWARDREQUEST_IDL_ diff --git a/TAO/tao/PortableServer/IdAssignmentPolicy.cpp b/TAO/tao/PortableServer/IdAssignmentPolicy.cpp deleted file mode 100644 index 7d036f83c72..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentPolicy.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "tao/PortableServer/IdAssignmentPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - IdAssignmentPolicy, - "$Id$") - -#if !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdAssignmentPolicy::IdAssignmentPolicy ( - ::PortableServer::IdAssignmentPolicyValue value) : - value_ (value) - { - } - - CORBA::Policy_ptr - IdAssignmentPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - IdAssignmentPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - IdAssignmentPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - IdAssignmentPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::IdAssignmentPolicyValue - IdAssignmentPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return value_; - } - - CORBA::PolicyType - IdAssignmentPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::ID_ASSIGNMENT_POLICY_ID; - } - - TAO_Cached_Policy_Type - IdAssignmentPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_ID_ASSIGNMENT; - } - - TAO_Policy_Scope - IdAssignmentPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif diff --git a/TAO/tao/PortableServer/IdAssignmentPolicy.h b/TAO/tao/PortableServer/IdAssignmentPolicy.h deleted file mode 100644 index 83cec156f2c..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDASSIGNMENTPOLICY_H -#define TAO_PORTABLESERVER_IDASSIGNMENTPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdAssignmentPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdAssignmentPolicy - : public virtual ::PortableServer::IdAssignmentPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - IdAssignmentPolicy (::PortableServer::IdAssignmentPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::IdAssignmentPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::IdAssignmentPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDASSIGNMENTPOLICY_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentPolicy.pidl b/TAO/tao/PortableServer/IdAssignmentPolicy.pidl deleted file mode 100644 index af99fc0469c..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentPolicy.pidl +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @file IdAssignmentPolicy.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_IDASSIGNMENTPOLICY_IDL_ -#define _PORTABLESERVER_IDASSIGNMENTPOLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum IdAssignmentPolicyValue - { - USER_ID, - SYSTEM_ID - }; - -#if !defined (CORBA_E_MICRO) - - local interface IdAssignmentPolicy : CORBA::Policy - { - readonly attribute IdAssignmentPolicyValue value; - }; - -#endif -}; - -#endif // _PORTABLESERVER_IDASSIGNMENTPOLICY_IDL_ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategy.cpp b/TAO/tao/PortableServer/IdAssignmentStrategy.cpp deleted file mode 100644 index 969a6bfa112..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategy.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdAssignmentStrategy.h" - -ACE_RCSID (PortableServer, - IdAssignmentStrategy, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - IdAssignmentStrategy::strategy_init (TAO_Root_POA * /*poa*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - } - - void - IdAssignmentStrategy::strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - } - - char - IdAssignmentStrategy::key_type_length (void) const - { - return sizeof (char); - } - - void - IdAssignmentStrategy::create_key ( - CORBA::Octet *buffer, - CORBA::ULong& starting_at) - { - // Copy the system id byte. - buffer[starting_at] = (CORBA::Octet) this->id_assignment_key_type (); - starting_at += this->key_type_length (); - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategy.h b/TAO/tao/PortableServer/IdAssignmentStrategy.h deleted file mode 100644 index d53a67c62b3..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategy.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_ID_ASSIGNMENT_STRATEGY_H -#define TAO_ID_ASSIGNMENT_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Policy_Strategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Basic_Types.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdAssignmentStrategy - : public Policy_Strategy - { - public: - virtual void strategy_init(TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - /** - * Returns the key type the says which specific policy we have - */ - virtual char id_assignment_key_type (void) const = 0; - - /** - * Returns the length of the id_assignment type - */ - char key_type_length (void) const; - - void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); - - virtual bool has_system_id (void) const = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_ID_ASSIGNMENT_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h b/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h deleted file mode 100644 index 2d0dd83a80c..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/IdAssignmentPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdAssignmentStrategy; - - class TAO_PortableServer_Export IdAssignmentStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdAssignmentStrategy* create ( - ::PortableServer::IdAssignmentPolicyValue value) = 0; - - virtual void destroy ( - IdAssignmentStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp deleted file mode 100644 index 475632c8363..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdAssignmentStrategyFactoryImpl.h" -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Dynamic_Service.h" - -ACE_RCSID (PortableServer, - IdAssignmentStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdAssignmentStrategy* - IdAssignmentStrategyFactoryImpl::create ( - ::PortableServer::IdAssignmentPolicyValue value) - { - IdAssignmentStrategy* strategy = 0; - const char * strategy_name = 0; - - switch (value) - { - case ::PortableServer::SYSTEM_ID : - { - strategy_name = "IdAssignmentStrategySystem"; - break; - } - case ::PortableServer::USER_ID : - { - strategy_name = "IdAssignmentStrategyUser"; - break; - } - } - - strategy = - ACE_Dynamic_Service<IdAssignmentStrategy>::instance (strategy_name); - - if (strategy == 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %s\n"), - strategy_name)); - - return strategy; - } - - void - IdAssignmentStrategyFactoryImpl::destroy ( - IdAssignmentStrategy * /*strategy*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - // Noop because both types are singletons - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - IdAssignmentStrategyFactoryImpl, - ACE_TEXT ("IdAssignmentStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdAssignmentStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdAssignmentStrategyFactoryImpl, - TAO::Portable_Server::IdAssignmentStrategyFactoryImpl) diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h b/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h deleted file mode 100644 index 1e7cadb3267..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdAssignmentStrategyFactory.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdAssignmentStrategyFactoryImpl - : public IdAssignmentStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdAssignmentStrategy* create ( - ::PortableServer::IdAssignmentPolicyValue value); - - virtual void destroy ( - IdAssignmentStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategyFactoryImpl) - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp b/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp deleted file mode 100644 index d7775832e2c..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdAssignmentStrategySystem.h" - -ACE_RCSID (PortableServer, - Id_Assignment_Strategy, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - char - IdAssignmentStrategySystem::id_assignment_key_type (void) const - { - return 'S'; - } - - bool - IdAssignmentStrategySystem::has_system_id (void) const - { - return true; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdAssignmentStrategySystem, - TAO::Portable_Server::IdAssignmentStrategySystem) - -ACE_STATIC_SVC_DEFINE ( - IdAssignmentStrategySystem, - ACE_TEXT ("IdAssignmentStrategySystem"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdAssignmentStrategySystem), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - diff --git a/TAO/tao/PortableServer/IdAssignmentStrategySystem.h b/TAO/tao/PortableServer/IdAssignmentStrategySystem.h deleted file mode 100644 index e77cbc95b8f..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategySystem.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategySystem.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_IDASSIGNMENTSTRATEGYSYSTEM_H -#define TAO_IDASSIGNMENTSTRATEGYSYSTEM_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdAssignmentStrategySystem - : public IdAssignmentStrategy - { - public: - virtual char id_assignment_key_type (void) const; - - virtual bool has_system_id (void) const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategySystem) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategySystem) - -#include /**/ "ace/post.h" -#endif /* TAO_IDASSIGNMENTSTRATEGYSYSTEM_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp b/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp deleted file mode 100644 index 3cfa5cef85a..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdAssignmentStrategyUser.h" - -ACE_RCSID (PortableServer, - Id_Assignment_Strategy, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - char - IdAssignmentStrategyUser::id_assignment_key_type (void) const - { - return 'U'; - } - - bool - IdAssignmentStrategyUser::has_system_id (void) const - { - return false; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdAssignmentStrategyUser, - TAO::Portable_Server::IdAssignmentStrategyUser) - -ACE_STATIC_SVC_DEFINE ( - IdAssignmentStrategyUser, - ACE_TEXT ("IdAssignmentStrategyUser"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdAssignmentStrategyUser), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyUser.h b/TAO/tao/PortableServer/IdAssignmentStrategyUser.h deleted file mode 100644 index f3560cef1d5..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyUser.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @fileIdAssignmentStrategyUser.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_IDASSIGNMENTSTRATEGYUSER_H -#define TAO_IDASSIGNMENTSTRATEGYUSER_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdAssignmentStrategyUser - : public IdAssignmentStrategy - { - public: - virtual char id_assignment_key_type (void) const; - - virtual bool has_system_id (void) const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategyUser) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategyUser) - -#include /**/ "ace/post.h" -#endif /* TAO_IDASSIGNMENTSTRATEGYUSER_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.cpp b/TAO/tao/PortableServer/IdUniquenessPolicy.cpp deleted file mode 100644 index 8796492f65d..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "tao/PortableServer/IdUniquenessPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - IdUniquenessPolicy, - "$Id$") - -#if !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdUniquenessPolicy::IdUniquenessPolicy ( - ::PortableServer::IdUniquenessPolicyValue value) : - value_ (value) - { - } - - CORBA::Policy_ptr - IdUniquenessPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - IdUniquenessPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - IdUniquenessPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - IdUniquenessPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return value_; - } - - CORBA::PolicyType - IdUniquenessPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::ID_UNIQUENESS_POLICY_ID; - } - - TAO_Cached_Policy_Type - IdUniquenessPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_ID_UNIQUENESS; - } - - TAO_Policy_Scope - IdUniquenessPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.h b/TAO/tao/PortableServer/IdUniquenessPolicy.h deleted file mode 100644 index f1446d6e2fe..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSTPOLICY_H -#define TAO_PORTABLESERVER_IDUNIQUENESSTPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdUniquenessPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessPolicy - : public virtual ::PortableServer::IdUniquenessPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - IdUniquenessPolicy (::PortableServer::IdUniquenessPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::IdUniquenessPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::IdUniquenessPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSTPOLICY_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.pidl b/TAO/tao/PortableServer/IdUniquenessPolicy.pidl deleted file mode 100644 index ee9fe9a3e38..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.pidl +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file IdUniquenessPolicy.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_IDUNIQUENESSPOLICY_IDL_ -#define _PORTABLESERVER_IDUNIQUENESSPOLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum IdUniquenessPolicyValue - { - UNIQUE_ID, - MULTIPLE_ID - }; - -#if !defined (CORBA_E_MICRO) - - local interface IdUniquenessPolicy : CORBA::Policy - { - readonly attribute IdUniquenessPolicyValue value; - }; - -#endif -}; - - -#endif // _PORTABLESERVER_IDUNIQUENESSPOLICY_IDL_ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategy.h b/TAO/tao/PortableServer/IdUniquenessStrategy.h deleted file mode 100644 index de0fb20c737..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategy.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_ID_UNIQUENESS_STRATEGY_H -#define TAO_ID_UNIQUENESS_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Policy_Strategy.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" -#include "tao/PortableServer/PS_ForwardC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategy - : public Policy_Strategy - { - public: - /* - * Validate if the servant may be activated - * @retval true This servant may be activated - * @retval false This servant may not be activated - */ - virtual bool is_servant_activation_allowed ( - PortableServer::Servant s, - int &w) = 0; - - virtual bool allow_multiple_activations (void) const = 0; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_ID_UNIQUENESS_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h b/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h deleted file mode 100644 index b3f973ef19f..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class IdUniquenessStrategy; - - class TAO_PortableServer_Export IdUniquenessStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdUniquenessStrategy* create ( - ::PortableServer::IdUniquenessPolicyValue value) = 0; - - /// Cleanup the given strategy instance - virtual void destroy ( - IdUniquenessStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp deleted file mode 100644 index 47530f5a9a9..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdUniquenessStrategyFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Dynamic_Service.h" - -ACE_RCSID (PortableServer, - IdUniquenessStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdUniquenessStrategy* - IdUniquenessStrategyFactoryImpl::create ( - ::PortableServer::IdUniquenessPolicyValue value) - { - IdUniquenessStrategy* strategy = 0; - switch (value) - { - case ::PortableServer::MULTIPLE_ID : - { - strategy = - ACE_Dynamic_Service<IdUniquenessStrategy>::instance ("IdUniquenessStrategyMultiple"); - - if (strategy == 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("IdUniquenessStrategyMultiple"))); - - break; - } - case ::PortableServer::UNIQUE_ID : - { - IdUniquenessStrategyFactory *strategy_factory = - ACE_Dynamic_Service<IdUniquenessStrategyFactory>::instance ("IdUniquenessStrategyUniqueFactory"); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("IdUniquenessStrategyUniqueFactory"))); - - break; - } - } - - return strategy; - } - - void - IdUniquenessStrategyFactoryImpl::destroy ( - IdUniquenessStrategy *strategy - ACE_ENV_ARG_DECL) - { - switch (strategy->type ()) - { - case ::PortableServer::MULTIPLE_ID : - { - // Noop - break; - } - case ::PortableServer::UNIQUE_ID : - { - IdUniquenessStrategyFactory *strategy_factory = - ACE_Dynamic_Service<IdUniquenessStrategyFactory>::instance ("IdUniquenessStrategyUniqueFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - break; - } - } - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyFactoryImpl, - ACE_TEXT ("IdUniquenessStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyFactoryImpl, - TAO::Portable_Server::IdUniquenessStrategyFactoryImpl) diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h b/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h deleted file mode 100644 index 8846237437d..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/IdUniquenessStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategyFactoryImpl - : public IdUniquenessStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual IdUniquenessStrategy* create ( - ::PortableServer::IdUniquenessPolicyValue value); - - virtual void destroy ( - IdUniquenessStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE (IdUniquenessStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyFactoryImpl) - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp deleted file mode 100644 index d1071f1470c..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdUniquenessStrategyMultiple.h" - -ACE_RCSID (PortableServer, - Id_Uniqueness_Strategy, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - IdUniquenessStrategyMultiple::strategy_init ( - TAO_Root_POA * /*poa*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - } - - void - IdUniquenessStrategyMultiple::strategy_cleanup( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - } - - bool - IdUniquenessStrategyMultiple::is_servant_activation_allowed ( - PortableServer::Servant /*servant*/, - int & /*wait_occurred_restart_call*/) - { - // With the multiple id strategy we can always activate the servant - // another time - return true; - } - - bool - IdUniquenessStrategyMultiple::allow_multiple_activations (void) const - { - return true; - } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessStrategyMultiple::type() const - { - return ::PortableServer::MULTIPLE_ID; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyMultiple, - TAO::Portable_Server::IdUniquenessStrategyMultiple) - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyMultiple, - ACE_TEXT ("IdUniquenessStrategyMultiple"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyMultiple), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h deleted file mode 100644 index f3c2e405447..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyMultiple.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_ID_UNIQUENESSSTRATEGY_MULITPLE_H -#define TAO_ID_UNIQUENESSSTRATEGY_MULITPLE_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategyMultiple - : public IdUniquenessStrategy - { - public: - virtual void strategy_init (TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup (ACE_ENV_SINGLE_ARG_DECL); - - virtual bool is_servant_activation_allowed ( - PortableServer::Servant servant, - int &w); - - virtual bool allow_multiple_activations (void) const; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const; - }; - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyMultiple) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyMultiple) - - -#include /**/ "ace/post.h" -#endif /* TAO_ID_UNIQUENESSSTRATEGY_MULITPLE_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp deleted file mode 100644 index 3c5516d4956..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdUniquenessStrategyUnique.h" -#include "tao/PortableServer/Root_POA.h" - -ACE_RCSID (PortableServer, - Id_Uniqueness_Strategy, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdUniquenessStrategyUnique::IdUniquenessStrategyUnique (void) : - poa_ (0) - { - } - - void - IdUniquenessStrategyUnique::strategy_init ( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL_NOT_USED) - { - poa_ = poa; - } - - void - IdUniquenessStrategyUnique::strategy_cleanup ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - poa_ = 0; - } - - bool - IdUniquenessStrategyUnique::is_servant_activation_allowed ( - PortableServer::Servant servant, - int &wait_occurred_restart_call) - { - // If the specified servant is already in the Active Object Map, the - // ServantAlreadyActive exception is raised. - int result = - this->poa_->is_servant_active (servant, - wait_occurred_restart_call); - - return (!(result || wait_occurred_restart_call)); - } - - bool - IdUniquenessStrategyUnique::allow_multiple_activations (void) const - { - return false; - } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessStrategyUnique::type() const - { - return ::PortableServer::UNIQUE_ID; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyUnique, - TAO::Portable_Server::IdUniquenessStrategyUnique) - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyUnique, - ACE_TEXT ("IdUniquenessStrategyUnique"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyUnique), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h deleted file mode 100644 index 58bbf096de5..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyUnique.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_ID_UNIQUENESSSTRATEGYUNIQUE_H -#define TAO_ID_UNIQUENESSSTRATEGYUNIQUE_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategyUnique - : public IdUniquenessStrategy - { - public: - IdUniquenessStrategyUnique (void); - - virtual void strategy_init (TAO_Root_POA *poa - ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup (ACE_ENV_SINGLE_ARG_DECL); - - virtual bool is_servant_activation_allowed ( - PortableServer::Servant servant, - int &wait_occurred_restart_call); - - virtual bool allow_multiple_activations (void) const; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const; - - private: - TAO_Root_POA* poa_; - }; - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyUnique) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyUnique) - - -#include /**/ "ace/post.h" -#endif /* TAO_ID_UNIQUENESSSTRATEGYUNIQUE_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp deleted file mode 100644 index b29178c143f..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategyUnique.h" -#include "ace/Dynamic_Service.h" - -ACE_RCSID (PortableServer, - IdUniquenessStrategyUniqueFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - IdUniquenessStrategy* - IdUniquenessStrategyUniqueFactoryImpl::create ( - ::PortableServer::IdUniquenessPolicyValue value) - { - IdUniquenessStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::UNIQUE_ID : - { - ACE_NEW_RETURN (strategy, IdUniquenessStrategyUnique, 0); - break; - } - case ::PortableServer::MULTIPLE_ID : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in IdUniquenessStrategyUniqueFactoryImpl")); - break; - } - } - - return strategy; - } - - void - IdUniquenessStrategyUniqueFactoryImpl::destroy ( - IdUniquenessStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - IdUniquenessStrategyUniqueFactoryImpl, - ACE_TEXT ("IdUniquenessStrategyUniqueFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (IdUniquenessStrategyUniqueFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - IdUniquenessStrategyUniqueFactoryImpl, - TAO::Portable_Server::IdUniquenessStrategyUniqueFactoryImpl) - diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h deleted file mode 100644 index 721ae2a6eb9..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyUniqueFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H -#define TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/IdUniquenessStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export IdUniquenessStrategyUniqueFactoryImpl - : public IdUniquenessStrategyFactory - { - public: - /// Create a new strategy - virtual IdUniquenessStrategy* create ( - ::PortableServer::IdUniquenessPolicyValue value); - - virtual void destroy ( - IdUniquenessStrategy *strategy - ACE_ENV_ARG_DECL); - }; - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl) - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ImR_Client_Adapter.cpp b/TAO/tao/PortableServer/ImR_Client_Adapter.cpp deleted file mode 100644 index c5a9d148f85..00000000000 --- a/TAO/tao/PortableServer/ImR_Client_Adapter.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ImR_Client_Adapter.h" - -ACE_RCSID (tao, - ImR_Client_Adapter, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ImR_Client_Adapter::~ImR_Client_Adapter (void) - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImR_Client_Adapter.h b/TAO/tao/PortableServer/ImR_Client_Adapter.h deleted file mode 100644 index e5b55bd6077..00000000000 --- a/TAO/tao/PortableServer/ImR_Client_Adapter.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImR_Client_Adapter.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - - -#ifndef TAO_IMR_CLIENT_ADAPTER_H -#define TAO_IMR_CLIENT_ADAPTER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.h" -#include "ace/CORBA_macros.h" -#include "tao/orbconf.h" -#include "tao/Environment.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - /** - * @class ImR_Client_Adapter - * - * @brief IFR_Client_Adapter. - * - * Class that adapts various functions in the PortableServer library - * which use the Implementation Repository. This is a base class for - * the actual implementation in the TAO_IMR_Client library. - */ - class TAO_PortableServer_Export ImR_Client_Adapter : - public ACE_Service_Object - { - public: - virtual ~ImR_Client_Adapter (void); - - /// ImplRepo helper method, notify the ImplRepo on startup - virtual void imr_notify_startup (TAO_Root_POA* poa ACE_ENV_ARG_DECL) = 0; - - /// ImplRepo helper method, notify the ImplRepo on shutdown - virtual void imr_notify_shutdown (TAO_Root_POA* poa ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_IMR_CLIENT_ADAPTER_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationPolicy.cpp b/TAO/tao/PortableServer/ImplicitActivationPolicy.cpp deleted file mode 100644 index c683f2640c7..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationPolicy.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "tao/PortableServer/ImplicitActivationPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - ImplicitActivationPolicy, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ImplicitActivationPolicy::ImplicitActivationPolicy ( - ::PortableServer::ImplicitActivationPolicyValue value) : - value_ (value) - { - } - - CORBA::Policy_ptr - ImplicitActivationPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ImplicitActivationPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - ImplicitActivationPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - ImplicitActivationPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::ImplicitActivationPolicyValue - ImplicitActivationPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return value_; - } - - CORBA::PolicyType - ImplicitActivationPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::IMPLICIT_ACTIVATION_POLICY_ID; - } - - TAO_Cached_Policy_Type - ImplicitActivationPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_IMPLICIT_ACTIVATION; - } - - TAO_Policy_Scope - ImplicitActivationPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !CORBA_E_COMPACT && !CORBA_E_MICRO */ diff --git a/TAO/tao/PortableServer/ImplicitActivationPolicy.h b/TAO/tao/PortableServer/ImplicitActivationPolicy.h deleted file mode 100644 index fb0a3d99179..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IMPLICITACTIVATIONPOLICY_H -#define TAO_PORTABLESERVER_IMPLICITACTIVATIONPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ImplicitActivationPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ImplicitActivationPolicy - : public virtual ::PortableServer::ImplicitActivationPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - ImplicitActivationPolicy (::PortableServer::ImplicitActivationPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::ImplicitActivationPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::ImplicitActivationPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !CORBA_E_COMPACT && !CORBA_E_MICRO */ - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IMPLICITACTIVATIONPOLICY_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationPolicy.pidl b/TAO/tao/PortableServer/ImplicitActivationPolicy.pidl deleted file mode 100644 index 041c2344015..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationPolicy.pidl +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @file ImplicitActivationPolicy.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_IMPLICITACTIVATIONPOLICY_IDL_ -#define _PORTABLESERVER_IMPLICITACTIVATIONPOLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum ImplicitActivationPolicyValue - { - IMPLICIT_ACTIVATION, - NO_IMPLICIT_ACTIVATION - }; - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && ! defined (TAO_HAS_MINIMUM_POA) - local interface ImplicitActivationPolicy : CORBA::Policy - { - readonly attribute ImplicitActivationPolicyValue value; - }; -#endif -}; - - -#endif // _PORTABLESERVER_IMPLICITACTIVATIONPOLICY_IDL_ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp deleted file mode 100644 index f2761572e36..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// -*- C++ -*- - -#include "tao/PortableServer/ImplicitActivationStrategy.h" - -ACE_RCSID (PortableServer, - ImplicitActivationStrategy, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - ImplicitActivationStrategy::strategy_init ( - TAO_Root_POA * /*poa*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - // dependent on type create the correct strategy. - } - - void - ImplicitActivationStrategy::strategy_cleanup( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategy.h b/TAO/tao/PortableServer/ImplicitActivationStrategy.h deleted file mode 100644 index 22ca61b5cbf..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategy.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_ACTIVATION_STRATEGY_H -#define TAO_ACTIVATION_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Policy_Strategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ImplicitActivationStrategy - : public Policy_Strategy - { - public: - virtual void strategy_init(TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - virtual bool allow_implicit_activation (void) const = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_ACTIVATION_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp deleted file mode 100644 index 09ca4fb613e..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// -*- C++ -*- - -#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" - -ACE_RCSID (PortableServer, - ImplicitActivationStrategyExplicit, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - bool - ImplicitActivationStrategyExplicit::allow_implicit_activation (void) const - { - return false; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ImplicitActivationStrategyExplicit, - TAO::Portable_Server::ImplicitActivationStrategyExplicit) - -ACE_STATIC_SVC_DEFINE ( - ImplicitActivationStrategyExplicit, - ACE_TEXT ("ImplicitActivationStrategyExplicit"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ImplicitActivationStrategyExplicit), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h deleted file mode 100644 index af9e70e931e..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyExplicit.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_IMPLICITACTIVATIONSTRATEGYEXPLICIT_H -#define TAO_IMPLICITACTIVATIONSTRATEGYEXPLICIT_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ImplicitActivationStrategyExplicit : - public ImplicitActivationStrategy - { - public: - virtual bool allow_implicit_activation (void) const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyExplicit) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyExplicit) - -#include /**/ "ace/post.h" -#endif /* TAO_IMPLICITACTIVATIONSTRATEGYEXPLICIT_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h b/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h deleted file mode 100644 index f5d1a8aa5f4..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/ImplicitActivationPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ImplicitActivationStrategy; - - class TAO_PortableServer_Export ImplicitActivationStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ImplicitActivationStrategy* create ( - ::PortableServer::ImplicitActivationPolicyValue value) = 0; - - virtual void destroy ( - ImplicitActivationStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp deleted file mode 100644 index 0fa7771687c..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" -#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" - -ACE_RCSID (PortableServer, - ImplicitActivationStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ImplicitActivationStrategy* - ImplicitActivationStrategyFactoryImpl::create ( - ::PortableServer::ImplicitActivationPolicyValue value) - { - ImplicitActivationStrategy* strategy = 0; - const char * strategy_name = 0; - - switch (value) - { - case ::PortableServer::IMPLICIT_ACTIVATION : - { - strategy_name = "ImplicitActivationStrategyImplicit"; - break; - } - case ::PortableServer::NO_IMPLICIT_ACTIVATION : - { - strategy_name = "ImplicitActivationStrategyExplicit"; - break; - } - } - - strategy = - ACE_Dynamic_Service<ImplicitActivationStrategy>::instance (strategy_name); - - if (strategy == 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %s\n"), - strategy_name)); - - return strategy; - } - - void - ImplicitActivationStrategyFactoryImpl::destroy ( - ImplicitActivationStrategy * /*strategy*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - // Noop because both types are singletons - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ImplicitActivationStrategyFactoryImpl, - TAO_VERSIONED_NAMESPACE_NAME::TAO::Portable_Server::ImplicitActivationStrategyFactoryImpl) - - -ACE_STATIC_SVC_DEFINE ( - ImplicitActivationStrategyFactoryImpl, - ACE_TEXT ("ImplicitActivationStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ImplicitActivationStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h b/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h deleted file mode 100644 index 6b9e87ef7f3..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ImplicitActivationStrategyFactory.h" - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ImplicitActivationStrategyFactoryImpl - : public ImplicitActivationStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ImplicitActivationStrategy* create ( - ::PortableServer::ImplicitActivationPolicyValue value); - - virtual void destroy ( - ImplicitActivationStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyFactoryImpl) - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp deleted file mode 100644 index 551d6f45bdf..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// -*- C++ -*- - -#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" - -ACE_RCSID (PortableServer, - ImplicitActivationStrategyImplicit, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - bool - ImplicitActivationStrategyImplicit::allow_implicit_activation (void) const - { - return true; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ImplicitActivationStrategyImplicit, - TAO::Portable_Server::ImplicitActivationStrategyImplicit) - -ACE_STATIC_SVC_DEFINE ( - ImplicitActivationStrategyImplicit, - ACE_TEXT ("ImplicitActivationStrategyImplicit"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ImplicitActivationStrategyImplicit), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - - diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h deleted file mode 100644 index 92f9feab992..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyImplicit.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_IMPLICITACTIVATIONSTRATEGYIMPLICIT_H -#define TAO_IMPLICITACTIVATIONSTRATEGYIMPLICIT_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ImplicitActivationStrategyImplicit - : public ImplicitActivationStrategy - { - public: - virtual bool allow_implicit_activation (void) const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyImplicit) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyImplicit) - - -#include /**/ "ace/post.h" -#endif /* TAO_IMPLICITACTIVATIONSTRATEGYIMPLICIT_H */ diff --git a/TAO/tao/PortableServer/Key_Adapters.cpp b/TAO/tao/PortableServer/Key_Adapters.cpp deleted file mode 100644 index 9263e4470fc..00000000000 --- a/TAO/tao/PortableServer/Key_Adapters.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Key_Adapters.h" - -#include "ace/ACE.h" -#include "ace/OS_NS_string.h" -#include "ace/Map_T.h" - -ACE_RCSID (PortableServer, - Key_Adapters, - "$Id$") - -/////////////////////////////////////////////////////////////////////////////// - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Incremental_Key_Generator::TAO_Incremental_Key_Generator (void) - : counter_ (0) -{ -} - -int -TAO_Incremental_Key_Generator::operator() (PortableServer::ObjectId &id) -{ - // Resize to accommodate the counter. - id.length (sizeof this->counter_); - - // Add new key data. - ACE_OS::memcpy (id.get_buffer (), - &++this->counter_, - sizeof this->counter_); - - // Success. - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// - -u_long -TAO_ObjectId_Hash::operator () (const PortableServer::ObjectId &id) const -{ - return ACE::hash_pjw ((const char *) id.get_buffer (), - id.length ()); -} - -//////////////////////////////////////////////////////////////////////////////// - -int -TAO_Ignore_Original_Key_Adapter::encode (const PortableServer::ObjectId &original_key, - const ACE_Active_Map_Manager_Key &active_key, - PortableServer::ObjectId &modified_key) -{ - ACE_UNUSED_ARG (original_key); - - // Size of active key. - size_t active_key_size = active_key.size (); - - // Resize to accommodate both the original data and the new active key. - modified_key.length (static_cast <CORBA::ULong> (active_key_size)); - - // Copy active key data into user key. - active_key.encode (modified_key.get_buffer ()); - - // Success. - return 0; -} - -int -TAO_Ignore_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, - ACE_Active_Map_Manager_Key &active_key) -{ - // Read off value of index and generation. - active_key.decode (modified_key.get_buffer ()); - - // Success. - return 0; -} - -int -TAO_Ignore_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, - PortableServer::ObjectId &original_key) -{ - // Smartly copy all the data; <original_key does not own the data>. - original_key.replace (modified_key.maximum (), - modified_key.length (), - const_cast <CORBA::Octet *> - (modified_key.get_buffer ()), - 0); - - // Success. - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// - -int -TAO_Preserve_Original_Key_Adapter::encode (const PortableServer::ObjectId &original_key, - const ACE_Active_Map_Manager_Key &active_key, - PortableServer::ObjectId &modified_key) -{ - // Size of active key. - size_t active_key_size = active_key.size (); - - // Resize to accommodate both the original data and the new active key. - modified_key.length (static_cast <CORBA::ULong> (active_key_size) - + original_key.length ()); - - // Copy active key data into user key. - active_key.encode (modified_key.get_buffer ()); - - // Copy the original key after the active key. - ACE_OS::memcpy (modified_key.get_buffer () + active_key_size, - original_key.get_buffer (), - original_key.length ()); - - // Success. - return 0; -} - -int -TAO_Preserve_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, - ACE_Active_Map_Manager_Key &active_key) -{ - // Read off value of index and generation. - active_key.decode (modified_key.get_buffer ()); - - // Success. - return 0; -} - -int -TAO_Preserve_Original_Key_Adapter::decode (const PortableServer::ObjectId &modified_key, - PortableServer::ObjectId &original_key) -{ - // Size of active key. - size_t active_key_size = ACE_Active_Map_Manager_Key::size (); - - // Smartly copy all the data; <original_key does not own the data>. - original_key.replace (static_cast <CORBA::ULong> - (modified_key.maximum () - active_key_size), - static_cast <CORBA::ULong> - (modified_key.length () - active_key_size), - const_cast <CORBA::Octet *> - (modified_key.get_buffer ()) + active_key_size, - 0); - - // Success. - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/Key_Adapters.h b/TAO/tao/PortableServer/Key_Adapters.h deleted file mode 100644 index ac5881a10fa..00000000000 --- a/TAO/tao/PortableServer/Key_Adapters.h +++ /dev/null @@ -1,129 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file Key_Adapters.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_KEY_ADAPTERS_H -#define TAO_KEY_ADAPTERS_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PS_ForwardC.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Active_Map_Manager_Key; -ACE_END_VERSIONED_NAMESPACE_DECL - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/////////////////////////////////////////////////////////////////////////////// - -/** - * @class TAO_Incremental_Key_Generator - * - * @brief Defines a key generator. - * - * This class is used in adapters of maps that do not produce keys. - */ -class TAO_Incremental_Key_Generator -{ -public: - - TAO_Incremental_Key_Generator (void); - - int operator() (PortableServer::ObjectId &id); - -protected: - - CORBA::ULong counter_; -}; - -//////////////////////////////////////////////////////////////////////////////// - -/** - * @class TAO_ObjectId_Hash - * - * @brief Hashing class for Object Ids. - * - * Define the hash() method for Object Ids. - */ -class TAO_PortableServer_Export TAO_ObjectId_Hash -{ -public: - - /// Returns hash value. - u_long operator () (const PortableServer::ObjectId &id) const; -}; - -//////////////////////////////////////////////////////////////////////////////// - -/** - * @class TAO_Ignore_Original_Key_Adapter - * - * @brief A key adapter (encode/decode) class. - * - * Define the encoding and decoding methods for converting - * between Object Ids and active keys. This class ignores the - * <original_key> passed to it. - */ -class TAO_Ignore_Original_Key_Adapter -{ -public: - - int encode (const PortableServer::ObjectId &original_key, - const ACE_Active_Map_Manager_Key &active_key, - PortableServer::ObjectId &modified_key); - - int decode (const PortableServer::ObjectId &modified_key, - ACE_Active_Map_Manager_Key &active_key); - - int decode (const PortableServer::ObjectId &modified_key, - PortableServer::ObjectId &original_key); -}; - -//////////////////////////////////////////////////////////////////////////////// - -/** - * @class TAO_Preserve_Original_Key_Adapter - * - * @brief A key adapter (encode/decode) class. - * - * Define the encoding and decoding methods for converting - * between Object Ids and active keys. This class remembers the - * <original_key> passed to it. - */ -class TAO_Preserve_Original_Key_Adapter -{ -public: - - int encode (const PortableServer::ObjectId &original_key, - const ACE_Active_Map_Manager_Key &active_key, - PortableServer::ObjectId &modified_key); - - int decode (const PortableServer::ObjectId &modified_key, - ACE_Active_Map_Manager_Key &active_key); - - int decode (const PortableServer::ObjectId &modified_key, - PortableServer::ObjectId &original_key); -}; - -/////////////////////////////////////////////////////////////////////////////// - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_KEY_ADAPTERS_H */ diff --git a/TAO/tao/PortableServer/LifespanPolicy.cpp b/TAO/tao/PortableServer/LifespanPolicy.cpp deleted file mode 100644 index b61dd7b3cbb..00000000000 --- a/TAO/tao/PortableServer/LifespanPolicy.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "tao/PortableServer/LifespanPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - LifespanPolicy, - "$Id$") - -#if !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanPolicy::LifespanPolicy ( - ::PortableServer::LifespanPolicyValue value) : - value_ (value) - { - } - - CORBA::Policy_ptr - LifespanPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - LifespanPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - LifespanPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - LifespanPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::LifespanPolicyValue - LifespanPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return value_; - } - - CORBA::PolicyType - LifespanPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::LIFESPAN_POLICY_ID; - } - - TAO_Cached_Policy_Type - LifespanPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_LIFESPAN; - } - - TAO_Policy_Scope - LifespanPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif diff --git a/TAO/tao/PortableServer/LifespanPolicy.h b/TAO/tao/PortableServer/LifespanPolicy.h deleted file mode 100644 index 8782763623f..00000000000 --- a/TAO/tao/PortableServer/LifespanPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_POA_LIFESPANPOLICY_H -#define TAO_POA_LIFESPANPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/LifespanPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanPolicy - : public virtual ::PortableServer::LifespanPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - LifespanPolicy (::PortableServer::LifespanPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::LifespanPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::LifespanPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_POA_LIFESPANPOLICY_H */ diff --git a/TAO/tao/PortableServer/LifespanPolicy.pidl b/TAO/tao/PortableServer/LifespanPolicy.pidl deleted file mode 100644 index 9283b9415f1..00000000000 --- a/TAO/tao/PortableServer/LifespanPolicy.pidl +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file LifespanPolicy.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_LIFESPANPOLICY_IDL_ -#define _PORTABLESERVER_LIFESPANPOLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum LifespanPolicyValue - { - TRANSIENT, - PERSISTENT - }; - -#if !defined (CORBA_E_MICRO) - - local interface LifespanPolicy : CORBA::Policy - { - readonly attribute LifespanPolicyValue value; - }; - -#endif -}; - - -#endif // _PORTABLESERVER_LIFESPANPOLICY_IDL_ diff --git a/TAO/tao/PortableServer/LifespanStrategy.cpp b/TAO/tao/PortableServer/LifespanStrategy.cpp deleted file mode 100644 index aea66e7161c..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategy.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategy.cpp - * - * $Id$ - * - */ -//============================================================================= - -#include "tao/PortableServer/LifespanStrategy.h" - -ACE_RCSID (PortableServer, - LifespanStrategy, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy::LifespanStrategy () : - poa_ (0) - { - } - - void - LifespanStrategy::strategy_init ( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL_NOT_USED) - { - poa_ = poa; - } - - void - LifespanStrategy::strategy_cleanup( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - poa_ = 0; - } - - CORBA::ULong - LifespanStrategy::key_type_length (void) const - { - return sizeof (char); - } - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategy.h b/TAO/tao/PortableServer/LifespanStrategy.h deleted file mode 100644 index 895c20335d8..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategy.h +++ /dev/null @@ -1,89 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFESPANPOLICY_H -#define TAO_PORTABLESERVER_LIFESPANPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Policy_Strategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/LifespanPolicyC.h" -#include "tao/Object_KeyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class Temporary_Creation_Time; - - class LifespanStrategy - : public Policy_Strategy - { - public: - LifespanStrategy (void); - - virtual void strategy_init(TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - void create (const char *name, const TAO::ObjectKey &key); - - virtual void notify_startup (ACE_ENV_SINGLE_ARG_DECL) = 0; - - virtual void notify_shutdown (ACE_ENV_SINGLE_ARG_DECL) = 0; - - /** - * Validate the passed object key if it belongs to this POA. - */ - bool validate (TAO::ObjectKey_var& key); - - /** - * Returns the length of the key type - */ - virtual CORBA::ULong key_length (void) const = 0; - - CORBA::ULong key_type_length (void) const; - - /// Do we have set persistent or not, - virtual CORBA::Boolean is_persistent (void) const = 0; - - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) = 0; - - /// Validate whether this matches the set lifespan strategy - virtual bool validate ( - CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const = 0; - - /// Check the state of the POA. - virtual void check_state (ACE_ENV_SINGLE_ARG_DECL) = 0; - - virtual ::PortableServer::LifespanPolicyValue type() const = 0; - - virtual bool use_imr () const = 0; - - protected: - TAO_Root_POA *poa_; - }; - - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFESPANPOLICY_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyFactory.h b/TAO/tao/PortableServer/LifespanStrategyFactory.h deleted file mode 100644 index 085e2c75228..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactory.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/LifespanPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class LifespanStrategy; - - class TAO_PortableServer_Export LifespanStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual LifespanStrategy* create ( - ::PortableServer::LifespanPolicyValue value) = 0; - - /// Cleanup the given strategy instance - virtual void destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp deleted file mode 100644 index 07e24aebc59..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp +++ /dev/null @@ -1,101 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/LifespanStrategyFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategy.h" -#include "ace/Dynamic_Service.h" - -ACE_RCSID (PortableServer, - LifespanStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy *strategy = 0; - const char *strategy_name = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - strategy_name = "LifespanStrategyPersistentFactory"; - break; - } - case ::PortableServer::TRANSIENT : - { - strategy_name = "LifespanStrategyTransientFactory"; - break; - } - } - - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service<LifespanStrategyFactory>::instance (strategy_name); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %s\n"), - strategy_name)); - - - return strategy; - } - - void - LifespanStrategyFactoryImpl::destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL) - { - switch (strategy->type ()) - { - case ::PortableServer::PERSISTENT : - { - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service<LifespanStrategyFactory>::instance ("LifespanStrategyPersistentFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - break; - } - case ::PortableServer::TRANSIENT : - { - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service<LifespanStrategyFactory>::instance ("LifespanStrategyTransientFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - break; - } - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - LifespanStrategyFactoryImpl, - ACE_TEXT ("LifespanStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (LifespanStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - LifespanStrategyFactoryImpl, - TAO::Portable_Server::LifespanStrategyFactoryImpl) diff --git a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h deleted file mode 100644 index e0ece8266bb..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanStrategyFactoryImpl - : public LifespanStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual LifespanStrategy* create ( - ::PortableServer::LifespanPolicyValue value); - - /// Cleanup the given strategy instance - virtual void destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyFactoryImpl) - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp deleted file mode 100644 index 6b2e3420c14..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// -*- C++ -*- - -#include "tao/PortableServer/LifespanStrategyPersistent.h" - -ACE_RCSID (PortableServer, - Lifespan_Strategy, - "$Id$") - -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/POAManager.h" -#include "tao/PortableServer/ImR_Client_Adapter.h" -#include "tao/ORB_Core.h" -#include "ace/OS_NS_sys_time.h" -#include "ace/Dynamic_Service.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - LifespanStrategyPersistent::strategy_init ( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL) - { - LifespanStrategy::strategy_init (poa ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->use_imr_ = this->poa_->orb_core ().use_implrepo (); - } - - bool - LifespanStrategyPersistent::validate ( - CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& /*creation_time*/) const - { - return is_persistent; - } - - char - LifespanStrategyPersistent::key_type (void) const - { - return 'P'; - } - - CORBA::Boolean - LifespanStrategyPersistent::is_persistent (void) const - { - return true; - } - - void - LifespanStrategyPersistent::create_key ( - CORBA::Octet *buffer, - CORBA::ULong& starting_at) - { - // Copy the persistence byte. - buffer[starting_at] = static_cast<CORBA::Octet> (this->key_type ()); - starting_at += this->key_type_length (); - } - - CORBA::ULong - LifespanStrategyPersistent::key_length () const - { - return this->key_type_length (); - } - - void - LifespanStrategyPersistent::notify_startup (ACE_ENV_SINGLE_ARG_DECL) - { - if (this->use_imr_) - { - // The user specified that the ImR should be used. - ImR_Client_Adapter *adapter = - ACE_Dynamic_Service<ImR_Client_Adapter>::instance ( - TAO_Root_POA::imr_client_adapter_name () - ); - -#if !defined (TAO_AS_STATIC_LIBS) - // In case we build shared, try to load the ImR Client library, in a - // static build we just can't do this, so don't try it, lower layers - // output an error then. - if (adapter == 0) - { - ACE_Service_Config::process_directive ( - ACE_DYNAMIC_SERVICE_DIRECTIVE( - "ImR_Client_Adapter", "TAO_ImR_Client", - "_make_ImR_Client_Adapter_Impl", "")); - - adapter = - ACE_Dynamic_Service<ImR_Client_Adapter>::instance ( - TAO_Root_POA::imr_client_adapter_name ()); - } -#endif /* !TAO_AS_STATIC_LIBS */ - - if (adapter != 0) - { - adapter->imr_notify_startup (this->poa_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - // When we don't have a ImR_Client adapter, but the user - // has specified that the ImR has to be used we have an - // error situation which has to be reported. - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR: No ImR_Client library ") - ACE_TEXT ("available but use IMR has been specified.\n"))); - - ACE_THROW (CORBA::INTERNAL ()); - } - } - } - - void - LifespanStrategyPersistent::notify_shutdown (ACE_ENV_SINGLE_ARG_DECL) - { - ImR_Client_Adapter *adapter = - ACE_Dynamic_Service<ImR_Client_Adapter>::instance ( - TAO_Root_POA::imr_client_adapter_name () - ); - - if (adapter != 0) - { - adapter->imr_notify_shutdown (this->poa_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - LifespanStrategyPersistent::LifespanStrategyPersistent() : - use_imr_ (true) - { - } - - void - LifespanStrategyPersistent::check_state (ACE_ENV_SINGLE_ARG_DECL) - { - this->poa_->tao_poa_manager().check_state (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - ::PortableServer::LifespanPolicyValue - LifespanStrategyPersistent::type() const - { - return ::PortableServer::PERSISTENT; - } - - bool - LifespanStrategyPersistent::use_imr () const - { - return use_imr_; - } - } /* namespace Portable_Server */ -} /* namespace TAO */ - - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.h b/TAO/tao/PortableServer/LifespanStrategyPersistent.h deleted file mode 100644 index 01634563c72..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.h +++ /dev/null @@ -1,73 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyPersistent.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_LIFESPANSTRATEGYPERSISTENT_H -#define TAO_LIFESPANSTRATEGYPERSISTENT_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/LifespanStrategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Object_KeyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class ServerObject_i; - -namespace TAO -{ - namespace Portable_Server - { - class LifespanStrategyPersistent - : public LifespanStrategy - { - public: - LifespanStrategyPersistent (); - - virtual void strategy_init(TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void notify_startup (ACE_ENV_SINGLE_ARG_DECL); - - virtual void notify_shutdown (ACE_ENV_SINGLE_ARG_DECL); - - char key_type (void) const; - - virtual CORBA::Boolean is_persistent (void) const; - - CORBA::ULong key_length (void) const; - - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); - - virtual bool - validate (CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; - - /// Check the state of the POA. - virtual void check_state (ACE_ENV_SINGLE_ARG_DECL); - - virtual ::PortableServer::LifespanPolicyValue type() const; - - virtual bool use_imr () const; - - private: - bool use_imr_; - }; - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_LIFESPANSTRATEGYPERSISTENT_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp deleted file mode 100644 index ab24406bf5f..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/LifespanStrategyPersistent.h" - -ACE_RCSID (PortableServer, - LifespanStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyPersistentFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - ACE_NEW_RETURN (strategy, LifespanStrategyPersistent, 0); - break; - } - case ::PortableServer::TRANSIENT : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in LifespanStrategyPersistentFactoryImpl")); - break; - } - } - - return strategy; - } - - void - LifespanStrategyPersistentFactoryImpl::destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - LifespanStrategyPersistentFactoryImpl, - ACE_TEXT ("LifespanStrategyPersistentFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (LifespanStrategyPersistentFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - LifespanStrategyPersistentFactoryImpl, - TAO::Portable_Server::LifespanStrategyPersistentFactoryImpl) - diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h deleted file mode 100644 index b32a3c63440..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyPersistentFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanStrategyPersistentFactoryImpl - : public LifespanStrategyFactory - { - public: - /// Create a new strategy - virtual LifespanStrategy* create ( - ::PortableServer::LifespanPolicyValue value); - - /// Cleanup the given strategy instance - virtual void destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyPersistentFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyPersistentFactoryImpl) - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.cpp b/TAO/tao/PortableServer/LifespanStrategyTransient.cpp deleted file mode 100644 index d1859883dac..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// -*- C++ -*- - -#include "tao/PortableServer/LifespanStrategyTransient.h" - -ACE_RCSID (PortableServer, - Lifespan_Strategy, - "$Id$") - -#include "ace/OS_NS_sys_time.h" -#include "ace/OS_NS_string.h" -#include "tao/PortableServer/POAManager.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/ORB_Constants.h" -#include "tao/PortableServer/Creation_Time.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategyTransient::LifespanStrategyTransient () : - creation_time_ (ACE_OS::gettimeofday ()) - { - } - - void - LifespanStrategyTransient::notify_startup (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - } - - void - LifespanStrategyTransient::notify_shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - } - - CORBA::Boolean - LifespanStrategyTransient::is_persistent (void) const - { - return false; - } - - bool - LifespanStrategyTransient::validate ( - CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time &creation_time) const - { - return (!is_persistent && this->creation_time_ == creation_time); - } - - CORBA::ULong - LifespanStrategyTransient::key_length (void) const - { - CORBA::ULong keylength = sizeof (char); - - #if (POA_NO_TIMESTAMP == 0) - // Calculate the space required for the timestamp. - keylength += TAO::Portable_Server::Creation_Time::creation_time_length (); - #endif /* POA_NO_TIMESTAMP */ - - return keylength; - } - - void - LifespanStrategyTransient::create_key ( - CORBA::Octet *buffer, - CORBA::ULong& starting_at) - { - // Copy the persistence byte. - buffer[starting_at] = (CORBA::Octet) this->key_type (); - starting_at += this->key_type_length (); - - #if (POA_NO_TIMESTAMP == 0) - // Then copy the timestamp for transient POAs. - ACE_OS::memcpy (&buffer[starting_at], - this->creation_time_.creation_time (), - TAO::Portable_Server::Creation_Time::creation_time_length ()); - starting_at += TAO::Portable_Server::Creation_Time::creation_time_length (); - #endif /* POA_NO_TIMESTAMP */ - } - - char - LifespanStrategyTransient::key_type (void) const - { - return 'T'; - } - - void - LifespanStrategyTransient::check_state (ACE_ENV_SINGLE_ARG_DECL) - { - if (this->poa_->tao_poa_manager().get_state_i () == - PortableServer::POAManager::INACTIVE) - { - ACE_THROW (CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 4, - CORBA::COMPLETED_NO)); - } - else - { - this->poa_->tao_poa_manager().check_state (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - } - - bool - LifespanStrategyTransient::use_imr () const - { - return false; - } - - ::PortableServer::LifespanPolicyValue - LifespanStrategyTransient::type() const - { - return ::PortableServer::TRANSIENT; - } - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.h b/TAO/tao/PortableServer/LifespanStrategyTransient.h deleted file mode 100644 index 6638973712f..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.h +++ /dev/null @@ -1,70 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyTransient.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_LIFESPANSTRATEGYTRANSIENT_H -#define TAO_LIFESPANSTRATEGYTRANSIENT_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/LifespanStrategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Creation_Time.h" -#include "tao/Object_KeyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class LifespanStrategyTransient - : public LifespanStrategy - { - public: - LifespanStrategyTransient (void); - - virtual void notify_startup (ACE_ENV_SINGLE_ARG_DECL); - - virtual void notify_shutdown (ACE_ENV_SINGLE_ARG_DECL); - - char key_type (void) const; - - virtual CORBA::Boolean is_persistent (void) const; - - CORBA::ULong key_length (void) const; - - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); - - virtual - bool validate (CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; - - /// Check the state of the POA. - virtual void check_state (ACE_ENV_SINGLE_ARG_DECL); - - virtual ::PortableServer::LifespanPolicyValue type() const; - - virtual bool use_imr () const; - - private: - TAO::Portable_Server::Creation_Time creation_time_; - }; - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_LIFESPANSTRATEGYTRANSIENT_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp deleted file mode 100644 index 896745f0846..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/LifespanStrategyTransientFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/LifespanStrategyTransient.h" - -ACE_RCSID (PortableServer, - LifespanStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyTransientFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in LifespanStrategyTransientFactoryImpl")); - break; - } - case ::PortableServer::TRANSIENT : - { - ACE_NEW_RETURN (strategy, LifespanStrategyTransient, 0); - break; - } - } - - return strategy; - } - - void - LifespanStrategyTransientFactoryImpl::destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - LifespanStrategyTransientFactoryImpl, - ACE_TEXT ("LifespanStrategyTransientFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (LifespanStrategyTransientFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - LifespanStrategyTransientFactoryImpl, - TAO::Portable_Server::LifespanStrategyTransientFactoryImpl) - - diff --git a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h deleted file mode 100644 index e3a8c076934..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyTransientFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H -#define TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/LifespanStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export LifespanStrategyTransientFactoryImpl - : public LifespanStrategyFactory - { - public: - /// Create a new strategy - virtual LifespanStrategy* create ( - ::PortableServer::LifespanPolicyValue value); - - /// Cleanup the given strategy instance - virtual void destroy ( - LifespanStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyTransientFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyTransientFactoryImpl) - - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/Local_Servant_Base.cpp b/TAO/tao/PortableServer/Local_Servant_Base.cpp deleted file mode 100644 index 007b1ca5e05..00000000000 --- a/TAO/tao/PortableServer/Local_Servant_Base.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Local_Servant_Base.h" -#include "tao/SystemException.h" - -ACE_RCSID (PortableServer, - Local_Servant_Base, - "$Id$") - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Local_Servant_Base.inl" -#endif /* ! __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -void -TAO_Local_ServantBase::_dispatch (TAO_ServerRequest &, - void * - ACE_ENV_ARG_DECL) -{ - ACE_THROW (CORBA::BAD_OPERATION ()); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Local_Servant_Base.h b/TAO/tao/PortableServer/Local_Servant_Base.h deleted file mode 100644 index dd3d9447932..00000000000 --- a/TAO/tao/PortableServer/Local_Servant_Base.h +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Local_Servant_Base.h - * - * $Id$ - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_LOCAL_SERVANT_BASE_H -#define TAO_LOCAL_SERVANT_BASE_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Base.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Local_ServantBase - * - * @brief Base class for local servants. - * - * This servant does not register with the POA and does not - * produce a valid stub, i.e., object references of this servant - * cannot be exported. The (collocated) stubs of these servants - * will always be direct, i.e., call directly to the servant and - * don't call through the POA since this servant is not - * registered with the POA. - */ -class TAO_PortableServer_Export TAO_Local_ServantBase - : public virtual TAO_ServantBase -{ -protected: - /// This is an auxiliary method for _this(). Make sure *not* to - /// register with the default POA. - TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); - - /// Throws CORBA::BAD_OPERATION exception. - void _dispatch (TAO_ServerRequest &request, - void *servant_upcall - ACE_ENV_ARG_DECL); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Local_Servant_Base.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_LOCAL_SERVANT_BASE_H */ diff --git a/TAO/tao/PortableServer/Local_Servant_Base.inl b/TAO/tao/PortableServer/Local_Servant_Base.inl deleted file mode 100644 index f811de25b9f..00000000000 --- a/TAO/tao/PortableServer/Local_Servant_Base.inl +++ /dev/null @@ -1,13 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE TAO_Stub * -TAO_Local_ServantBase::_create_stub (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Non_Servant_Upcall.cpp b/TAO/tao/PortableServer/Non_Servant_Upcall.cpp deleted file mode 100644 index 2660f700538..00000000000 --- a/TAO/tao/PortableServer/Non_Servant_Upcall.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/PortableServer/Root_POA.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Non_Servant_Upcall.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (PortableServer, - Non_Servant_Upcall, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - Non_Servant_Upcall::Non_Servant_Upcall (::TAO_Root_POA &poa) - : object_adapter_ (poa.object_adapter ()), - poa_ (poa), - previous_ (0) - { - // Check if this is a nested non_servant_upcall. - if (this->object_adapter_.non_servant_upcall_nesting_level_ != 0) - { - // Remember previous instance of non_servant_upcall. - this->previous_ = this->object_adapter_.non_servant_upcall_in_progress_; - - // Assert that the thread is the same as the one before. - ACE_ASSERT (ACE_OS::thr_equal (this->object_adapter_.non_servant_upcall_thread_, - ACE_OS::thr_self ())); - } - - // Remember which thread is calling the adapter activators. - this->object_adapter_.non_servant_upcall_thread_ = ACE_OS::thr_self (); - - // Mark the fact that a non-servant upcall is in progress. - this->object_adapter_.non_servant_upcall_in_progress_ = this; - - // Adjust the nesting level. - this->object_adapter_.non_servant_upcall_nesting_level_++; - - // We always release - this->object_adapter_.lock ().release (); - } - - Non_Servant_Upcall::~Non_Servant_Upcall (void) - { - // Reacquire the Object Adapter lock. - this->object_adapter_.lock ().acquire (); - - // Adjust the nesting level. - this->object_adapter_.non_servant_upcall_nesting_level_--; - - // We are done with this nested upcall. - this->object_adapter_.non_servant_upcall_in_progress_ = this->previous_; - - // If we are at the outer nested upcall. - if (this->object_adapter_.non_servant_upcall_nesting_level_ == 0) - { - // Reset thread id. - this->object_adapter_.non_servant_upcall_thread_ = - ACE_OS::NULL_thread; - - // Check if all pending requests are over. - if (this->poa_.waiting_destruction () && - this->poa_.outstanding_requests () == 0) - { - ACE_TRY_NEW_ENV - { - this->poa_.complete_destruction_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // Ignore exceptions - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "TAO_POA::complete_destruction_i"); - } - ACE_ENDTRY; - } - - // If locking is enabled. - if (this->object_adapter_.enable_locking_) - // Wakeup all waiting threads. - this->object_adapter_.non_servant_upcall_condition_.broadcast (); - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Non_Servant_Upcall.h b/TAO/tao/PortableServer/Non_Servant_Upcall.h deleted file mode 100644 index 92b05194d9d..00000000000 --- a/TAO/tao/PortableServer/Non_Servant_Upcall.h +++ /dev/null @@ -1,79 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Non_Servant_Upcall.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_NONSERVANT_UPCALL_H -#define TAO_NONSERVANT_UPCALL_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/orbconf.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration -class TAO_Root_POA; -class TAO_Object_Adapter; - -namespace TAO -{ - namespace Portable_Server - { - /** - * @class Non_Servant_Upcall - * - * @brief This class helps us with a recursive thread lock without - * using a recursive thread lock. Non_Servant_Upcall has a - * magic constructor and destructor. We unlock the - * Object_Adapter lock for the duration of the non-servant - * (i.e., adapter activator and servant activator) upcalls; - * reacquiring once the upcalls complete. Even though we are - * releasing the lock, other threads will not be able to make - * progress since - * <Object_Adapter::non_servant_upcall_in_progress_> has been - * set. - */ - class TAO_PortableServer_Export Non_Servant_Upcall - { - public: - - /// Constructor. - Non_Servant_Upcall (::TAO_Root_POA &poa); - - /// Destructor. - ~Non_Servant_Upcall (void); - - ::TAO_Root_POA &poa (void) const; - - protected: - - TAO_Object_Adapter &object_adapter_; - TAO_Root_POA &poa_; - Non_Servant_Upcall *previous_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Non_Servant_Upcall.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_NONSERVANT_UPCALL_H */ diff --git a/TAO/tao/PortableServer/Non_Servant_Upcall.inl b/TAO/tao/PortableServer/Non_Servant_Upcall.inl deleted file mode 100644 index 0a9b6f2e8de..00000000000 --- a/TAO/tao/PortableServer/Non_Servant_Upcall.inl +++ /dev/null @@ -1,19 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ACE_INLINE ::TAO_Root_POA & - Non_Servant_Upcall::poa (void) const - { - return this->poa_; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ORT_Adapter.h b/TAO/tao/PortableServer/ORT_Adapter.h deleted file mode 100644 index 34d89eb42db..00000000000 --- a/TAO/tao/PortableServer/ORT_Adapter.h +++ /dev/null @@ -1,117 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ORT_Adapter.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= -#ifndef TAO_ORT_ADAPTER_H -#define TAO_ORT_ADAPTER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/SystemException.h" -#include "tao/PI_ForwardC.h" -#include "ace/Service_Object.h" -#include "ace/Array_Base.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace CORBA -{ - class Object; - typedef Object *Object_ptr; -} - -namespace PortableInterceptor -{ - class ObjectReferenceTemplate; - class ObjectReferenceFactory; -} - -namespace PortableServer -{ - class POA; - typedef POA* POA_ptr; -} - -namespace TAO -{ - /** - * @class ORT_Adapter - * - * @brief ORT_Adapter - * - * Class that offers an interface to the POA to load and manipulate - * ORT library. - */ - class TAO_PortableServer_Export ORT_Adapter - : public ACE_Service_Object - { - public: - /// Activate the ORT library - virtual int activate (const char *server_id, - const char *orb_id, - PortableInterceptor::AdapterName *, - PortableServer::POA_ptr poa - ACE_ENV_ARG_DECL) = 0; - - /// Set a different ort_factory to be used. - virtual int set_obj_ref_factory ( - PortableInterceptor::ObjectReferenceFactory *current_factory - ACE_ENV_ARG_DECL_WITH_DEFAULTS) = 0; - - /// Accessor methods to ObjectReferenceTemplate template - virtual PortableInterceptor::ObjectReferenceTemplate * - get_adapter_template (void) = 0; - - /// Accessor methods to PortableInterceptor::ObjectReferenceFactory - virtual PortableInterceptor::ObjectReferenceFactory * - get_obj_ref_factory (void) = 0; - - /// Release any references on @c ObjectReferenceTemplate @a t. - virtual void release ( - PortableInterceptor::ObjectReferenceTemplate * t) = 0; - - /** - * @name PortableInterceptor::ObjectReferenceFactory Methods - * - * Methods required by the - * PortableInterceptor::ObjectReferenceFactory ValueType. - * - * @todo - * @@ Johnny, we won't be needing the exception specification - * below for long. Once bug 1852 is fixed, we can the - * exception specification and the "tao/SystemException.h" - * include above. - */ - //@{ - virtual CORBA::Object_ptr make_object ( - const char * repository_id, - const PortableInterceptor::ObjectId & id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - //@} - }; - - typedef - ACE_Array_Base<PortableInterceptor::ObjectReferenceTemplate*> ORT_Array; - -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_ORT_ADAPTER_H */ diff --git a/TAO/tao/PortableServer/ORT_Adapter_Factory.cpp b/TAO/tao/PortableServer/ORT_Adapter_Factory.cpp deleted file mode 100644 index 7d4a85297b8..00000000000 --- a/TAO/tao/PortableServer/ORT_Adapter_Factory.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ORT_Adapter_Factory.h" - -ACE_RCSID (PortableServer, - ORT_Adapter_Factory, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - ORT_Adapter_Factory::~ORT_Adapter_Factory (void) - { - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ORT_Adapter_Factory.h b/TAO/tao/PortableServer/ORT_Adapter_Factory.h deleted file mode 100644 index d5c7570f93f..00000000000 --- a/TAO/tao/PortableServer/ORT_Adapter_Factory.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ORT_Adapter_Factory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - - -#ifndef TAO_ORT_ADAPTER_FACTORY_H -#define TAO_ORT_ADAPTER_FACTORY_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Versioned_Namespace.h" -#include "ace/Service_Object.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - class ORT_Adapter; -} - -namespace TAO -{ - /** - * @class ORT_Adapter_Factory - * - * @brief ORT_Adapter_Factory - * - * Class that creates one instance of TAO::ORT_Adapter per - * POA on the POA's first usage of its objectreferencetemplate_adapter. - * This is a base class for the actual implementation in the - * TAO_ObjectReferenceTemplate library. - */ - class TAO_PortableServer_Export ORT_Adapter_Factory - : public ACE_Service_Object - { - public: - - /// Destructor. - /** - * @note Even though this class only defines an interface, a - * destructor is necessary to avoid dynamic_cast<> failures - * when using g++ 4.0's -fvisibility-inlines-hidden command - * line option. Apparently the compiler generated - * destructor is inlined. - */ - virtual ~ORT_Adapter_Factory (void); - - /// Create a new adapter, in case not possible to allocate, returns 0 - virtual TAO::ORT_Adapter * create () = 0; - - /// Destroy the passed adapter - virtual void destroy (TAO::ORT_Adapter * adapter) = 0; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_ORT_ADAPTER_FACTORY_H */ diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp deleted file mode 100644 index 2f2305ec233..00000000000 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ /dev/null @@ -1,1289 +0,0 @@ -// $Id$ - -// -- PortableServer Include -- -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/Regular_POA.h" -#include "tao/PortableServer/Creation_Time.h" -#include "tao/PortableServer/POA_Guard.h" -#include "tao/PortableServer/Default_Servant_Dispatcher.h" -#include "tao/PortableServer/Collocated_Object_Proxy_Broker.h" -#include "tao/PortableServer/POAManager.h" -#include "tao/PortableServer/POAManagerFactory.h" -#include "tao/PortableServer/Servant_Base.h" - -// -- ACE Include -- -#include "ace/Auto_Ptr.h" -#include "ace/Log_Msg.h" -#include "ace/OS_NS_string.h" - -// -- TAO Include -- -#include "tao/PortableInterceptorC.h" -#include "tao/ORB.h" -#include "tao/ORB_Core.h" -#include "tao/TSS_Resources.h" -#include "tao/TAO_Server_Request.h" -#include "tao/Stub.h" -#include "tao/Profile.h" -#include "tao/MProfile.h" -#include "tao/debug.h" -#include "tao/PortableInterceptor.h" -#include "tao/ORBInitializer_Registry.h" -#include "tao/Thread_Lane_Resources_Manager.h" -#include "tao/Thread_Lane_Resources.h" -#include "tao/Protocols_Hooks.h" -#include "tao/ServerRequestInterceptor_Adapter.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Object_Adapter.i" -#endif /* __ACE_INLINE__ */ - -#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" - -ACE_RCSID (PortableServer, - Object_Adapter, - "$Id$") - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) -namespace PortableServer -{ - class POAManagerFactory; - typedef POAManagerFactory *POAManagerFactory_ptr; -} -#endif - -// Timeprobes class -#include "tao/Timeprobe.h" - -#if defined (ACE_ENABLE_TIMEPROBES) - -static const char *TAO_Object_Adapter_Timeprobe_Description[] = -{ - "Object_Adapter::dispatch_servant - start", - "Object_Adapter::dispatch_servant - end", - - "POA::parse_key - start", - "POA::parse_key - end", - - "Object_Adapter::find_poa - start", - "Object_Adapter::find_poa - end", - - "POA::locate_servant - start", - "POA::locate_servant - end", - - "Servant::_dispatch - start", - "Servant::_dispatch - end", -}; - -enum -{ - // Timeprobe description table start key - TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START = 200, - TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_END, - - TAO_POA_PARSE_KEY_START, - TAO_POA_PARSE_KEY_END, - - TAO_OBJECT_ADAPTER_FIND_POA_START, - TAO_OBJECT_ADAPTER_FIND_POA_END, - - TAO_POA_LOCATE_SERVANT_START, - TAO_POA_LOCATE_SERVANT_END, - - TAO_SERVANT_DISPATCH_START, - TAO_SERVANT_DISPATCH_END -}; - -// Setup Timeprobes -ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Object_Adapter_Timeprobe_Description, - TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START); - -#endif /* ACE_ENABLE_TIMEPROBES */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/* static */ -CORBA::ULong TAO_Object_Adapter::transient_poa_name_size_ = 0; - -void -TAO_Object_Adapter::set_transient_poa_name_size (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters) -{ - if (TAO_Object_Adapter::transient_poa_name_size_ == 0) - { - switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_) - { -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - case TAO_LINEAR: - TAO_Object_Adapter::transient_poa_name_size_ = - sizeof (CORBA::ULong); - break; - case TAO_DYNAMIC_HASH: - TAO_Object_Adapter::transient_poa_name_size_ = - sizeof (CORBA::ULong); - break; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - case TAO_ACTIVE_DEMUX: - default: - TAO_Object_Adapter::transient_poa_name_size_ = - static_cast <CORBA::ULong>( - ACE_Active_Map_Manager_Key::size ()); - break; - } - } -} - -TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters, - TAO_ORB_Core &orb_core) - : hint_strategy_ (0), - servant_dispatcher_ (0), - persistent_poa_name_map_ (0), - transient_poa_map_ (0), - orb_core_ (orb_core), - enable_locking_ (orb_core_.server_factory ()->enable_poa_locking ()), - thread_lock_ (), - lock_ (TAO_Object_Adapter::create_lock (enable_locking_, - thread_lock_)), - reverse_lock_ (*lock_), - non_servant_upcall_condition_ (thread_lock_), - non_servant_upcall_in_progress_ (0), - non_servant_upcall_nesting_level_ (0), - non_servant_upcall_thread_ (ACE_OS::NULL_thread), - root_ (0), - default_validator_ (orb_core), - default_poa_policies_ () -{ - TAO_Object_Adapter::set_transient_poa_name_size (creation_parameters); - - Hint_Strategy *hint_strategy = 0; - if (creation_parameters.use_active_hint_in_poa_names_) - ACE_NEW (hint_strategy, - Active_Hint_Strategy (creation_parameters.poa_map_size_)); - else - ACE_NEW (hint_strategy, - No_Hint_Strategy); - - // Give ownership to the auto pointer. - auto_ptr<Hint_Strategy> new_hint_strategy (hint_strategy); - - new_hint_strategy->object_adapter (this); - - persistent_poa_name_map *ppnm = 0; - switch (creation_parameters.poa_lookup_strategy_for_persistent_id_policy_) - { - case TAO_LINEAR: -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - ACE_NEW (ppnm, - persistent_poa_name_linear_map (creation_parameters.poa_map_size_)); - - break; -#else - ACE_ERROR ((LM_ERROR, - "linear option for -ORBPersistentidPolicyDemuxStrategy " - "not supported with minimum POA maps. " - "Ingoring option to use default... \n")); - /* FALL THROUGH */ -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - case TAO_DYNAMIC_HASH: - default: - ACE_NEW (ppnm, - persistent_poa_name_hash_map (creation_parameters.poa_map_size_)); - break; - } - // Give ownership to the auto pointer. - auto_ptr<persistent_poa_name_map> new_persistent_poa_name_map (ppnm); - - transient_poa_map *tpm = 0; - switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_) - { -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - case TAO_LINEAR: - ACE_NEW (tpm, - transient_poa_linear_map (creation_parameters.poa_map_size_)); - break; - case TAO_DYNAMIC_HASH: - ACE_NEW (tpm, - transient_poa_hash_map (creation_parameters.poa_map_size_)); - break; -#else - case TAO_LINEAR: - case TAO_DYNAMIC_HASH: - ACE_ERROR ((LM_ERROR, - "linear and dynamic options for -ORBTransientidPolicyDemuxStrategy " - "are not supported with minimum POA maps. " - "Ingoring option to use default... \n")); - /* FALL THROUGH */ -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - case TAO_ACTIVE_DEMUX: - default: - ACE_NEW (tpm, - transient_poa_active_map (creation_parameters.poa_map_size_)); - break; - } - // Give ownership to the auto pointer. - auto_ptr<transient_poa_map> new_transient_poa_map (tpm); - - this->hint_strategy_ = - new_hint_strategy.release (); - this->persistent_poa_name_map_ = - new_persistent_poa_name_map.release (); - this->transient_poa_map_ = - new_transient_poa_map.release (); -} - -void -TAO_Object_Adapter::init_default_policies (TAO_POA_Policy_Set &policies - ACE_ENV_ARG_DECL) -{ - // Initialize the default policies. -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - - TAO::Portable_Server::ThreadPolicy thread_policy (PortableServer::ORB_CTRL_MODEL); - policies.merge_policy (&thread_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#if !defined (CORBA_E_MICRO) - // Lifespan policy. - TAO::Portable_Server::LifespanPolicy lifespan_policy (PortableServer::TRANSIENT); - policies.merge_policy (&lifespan_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#endif - -#if !defined (CORBA_E_MICRO) - // ID uniqueness policy. - TAO::Portable_Server::IdUniquenessPolicy id_uniqueness_policy (PortableServer::UNIQUE_ID); - policies.merge_policy (&id_uniqueness_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#endif - -#if !defined (CORBA_E_MICRO) - // ID assignment policy. - TAO::Portable_Server::IdAssignmentPolicy id_assignment_policy (PortableServer::SYSTEM_ID); - policies.merge_policy (&id_assignment_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#endif - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - // Implicit activation policy. - TAO::Portable_Server::ImplicitActivationPolicy implicit_activation_policy - (PortableServer::NO_IMPLICIT_ACTIVATION); - policies.merge_policy (&implicit_activation_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Servant retention policy. - TAO::Portable_Server::ServantRetentionPolicy servant_retention_policy - (PortableServer::RETAIN); - policies.merge_policy (&servant_retention_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Request processing policy. - TAO::Portable_Server::RequestProcessingPolicy request_processing_policy - (PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY); - policies.merge_policy (&request_processing_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#endif /* TAO_HAS_MINIMUM_POA == 0 */ -#if defined (CORBA_E_MICRO) - ACE_UNUSED_ARG (policies); -#endif -} - -TAO_Object_Adapter::~TAO_Object_Adapter (void) -{ - delete this->hint_strategy_; - delete this->persistent_poa_name_map_; - delete this->transient_poa_map_; - delete this->lock_; - - delete this->servant_dispatcher_; -} - -/* static */ -ACE_Lock * -TAO_Object_Adapter::create_lock (int enable_locking, - TAO_SYNCH_MUTEX &thread_lock) -{ -#if defined (ACE_HAS_THREADS) - if (enable_locking) - { - ACE_Lock *the_lock = 0; - ACE_NEW_RETURN (the_lock, - ACE_Lock_Adapter<TAO_SYNCH_MUTEX> (thread_lock), - 0); - return the_lock; - } -#else - ACE_UNUSED_ARG (enable_locking); - ACE_UNUSED_ARG (thread_lock); -#endif /* ACE_HAS_THREADS */ - - ACE_Lock *the_lock = 0; - ACE_NEW_RETURN (the_lock, - ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> (), - 0); - return the_lock; -} - -int -TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key, - TAO_ServerRequest &req, - CORBA::Object_out forward_to - ACE_ENV_ARG_DECL) -{ - ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START); - - // This object is magical, i.e., it has a non-trivial constructor - // and destructor. - TAO::Portable_Server::Servant_Upcall servant_upcall (&this->orb_core_); - - // Set up state in the POA et al (including the POA Current), so - // that we know that this servant is currently in an upcall. - const char *operation = req.operation (); - int result = - servant_upcall.prepare_for_upcall (key, - operation, - forward_to - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result); - - if (result != TAO_Adapter::DS_OK) - return result; - - // Preprocess request. - if (req.collocated ()) - { - servant_upcall.pre_invoke_collocated_request ( - ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (result); - } - else - { - servant_upcall.pre_invoke_remote_request (req - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result); - } - - // Servant dispatch. - { - ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_DISPATCH_START); - - do_dispatch (req, servant_upcall ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result); - } - - return result; -} - -void -TAO_Object_Adapter::locate_poa (const TAO::ObjectKey &key, - PortableServer::ObjectId &system_id, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) -{ - TAO_Object_Adapter::poa_name poa_system_name; - CORBA::Boolean is_root = false; - CORBA::Boolean is_persistent = false; - CORBA::Boolean is_system_id = false; - TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; - - int result = 0; - - { - ACE_FUNCTION_TIMEPROBE (TAO_POA_PARSE_KEY_START); - - result = TAO_Root_POA::parse_key (key, - poa_system_name, - system_id, - is_root, - is_persistent, - is_system_id, - poa_creation_time); - } - - if (result != 0) - ACE_THROW (CORBA::OBJ_ADAPTER ()); - - { - ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_FIND_POA_START); - - result = this->find_poa (poa_system_name, - is_persistent, - is_root, - poa_creation_time, - poa - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (result != 0) - ACE_THROW (CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 2, - CORBA::COMPLETED_NO)); -} - -int -TAO_Object_Adapter::activate_poa (const poa_name &folded_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) -{ - int result = -1; - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) - - iteratable_poa_name ipn (folded_name); - iteratable_poa_name::iterator iterator = ipn.begin (); - iteratable_poa_name::iterator end = ipn.end (); - - TAO_Root_POA *parent = this->root_; - if (parent == 0 || parent->name () != *iterator) - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - -1); - else - ++iterator; - - for (; - iterator != end; - ++iterator) - { - TAO_Root_POA *current = 0; - - ACE_TRY - { - current = parent->find_POA_i (*iterator, - 1 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (PortableServer::POA::AdapterNonExistent, ex) - { - return -1; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - parent = current; - } - - poa = parent; - result = 0; -#else - ACE_UNUSED_ARG (folded_name); - ACE_UNUSED_ARG (poa); - ACE_ENV_ARG_NOT_USED; // FUZZ: ignore check_for_ace_check -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - return result; -} - -int -TAO_Object_Adapter::find_transient_poa (const poa_name &system_name, - CORBA::Boolean root, - const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL_NOT_USED) -{ - int result = 0; - - if (root) - { - poa = this->root_; - } - else - { - result = this->transient_poa_map_->find (system_name, - poa); - } - - if (poa == 0 - || (result == 0 && !poa->validate_lifespan (false, poa_creation_time))) - result = -1; - - return result; -} - -int -TAO_Object_Adapter::bind_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name) -{ - if (poa->persistent ()) - return this->bind_persistent_poa (folded_name, - poa, - system_name); - else - return this->bind_transient_poa (poa, - system_name); -} - -int -TAO_Object_Adapter::unbind_poa (TAO_Root_POA *poa, - const poa_name &folded_name, - const poa_name &system_name) -{ - if (poa->persistent ()) - return this->unbind_persistent_poa (folded_name, - system_name); - else - return this->unbind_transient_poa (system_name); -} - -int -TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key - ACE_ENV_ARG_DECL) -{ - ACE_FUNCTION_TIMEPROBE (TAO_POA_LOCATE_SERVANT_START); - - PortableServer::ObjectId id; - TAO_Root_POA *poa = 0; - - this->locate_poa (key, - id, - poa - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - PortableServer::Servant servant = 0; - TAO_SERVANT_LOCATION servant_location = - poa->locate_servant_i (id, - servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - switch (servant_location) - { - case TAO_SERVANT_FOUND: - // Optimistic attitude - case TAO_DEFAULT_SERVANT: - case TAO_SERVANT_MANAGER: - return 0; - - case TAO_SERVANT_NOT_FOUND: - return -1; - } - - return -1; -} - -TAO_SERVANT_LOCATION -TAO_Object_Adapter::find_servant_i (const TAO::ObjectKey &key, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) -{ - PortableServer::ObjectId id; - TAO_Root_POA *poa = 0; - - this->locate_poa (key, - id, - poa - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND); - - TAO_SERVANT_LOCATION servant_location = poa->locate_servant_i (id, - servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND); - - return servant_location; -} - -void -TAO_Object_Adapter::open (ACE_ENV_SINGLE_ARG_DECL) -{ - // Add in the default POA policies to the default list. - this->init_default_policies (this->default_poa_policies () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // If a POA extension hasn't changed the servant dispatcher, initialize the - // default one. - if (this->servant_dispatcher_ == 0) - { - ACE_NEW (this->servant_dispatcher_, - TAO_Default_Servant_Dispatcher); - } - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ACE_NEW_THROW_EX (this->poa_manager_factory_, - TAO_POAManager_Factory (*this), - CORBA::NO_MEMORY ()); - - ::CORBA::PolicyList policy; - PortableServer::POAManager_var poa_manager - = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME, - policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#else - PortableServer::POAManager_var poa_manager; - PortableServer::POAManager_ptr pm = PortableServer::POAManager::_nil (); - ::CORBA::PolicyList policy_list; - ACE_NEW_THROW_EX (pm, - TAO_POA_Manager (*this, 0, policy_list, 0), - CORBA::NO_MEMORY - (CORBA::SystemException::_tao_minor_code (0, ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (::PortableServer::POAManager::_nil ()); - poa_manager = pm; -#endif - - // This makes sure that the default resources are open when the Root - // POA is created. - this->orb_core_.thread_lane_resources_manager ().open_default_resources (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - TAO_POA_Policy_Set policies (this->default_poa_policies ()); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - // Specify the implicit activation policy since it should - // be different from the default. Note that merge_policy - // takes a const reference and makes its own copy of the - // policy. (Otherwise, we'd have to allocate the policy - // on the heap.) - // Implicit activation policy. - TAO::Portable_Server::ImplicitActivationPolicy implicit_activation_policy - (PortableServer::IMPLICIT_ACTIVATION); - policies.merge_policy (&implicit_activation_policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // Merge policies from the ORB level. - this->validator ().merge_policies (policies.policies () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // If any of the policy objects specified are not valid for the ORB - // implementation, if conflicting policy objects are specified, or - // if any of the specified policy objects require prior - // administrative action that has not been performed, an - // InvalidPolicy exception is raised containing the index in the - // policies parameter value of the first offending policy object. - policies.validate_policies (this->validator (), - this->orb_core_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Construct a new POA - TAO_Root_POA::String root_poa_name (TAO_DEFAULT_ROOTPOA_NAME); - this->root_ = - this->servant_dispatcher_->create_Root_POA (root_poa_name, - poa_manager.in (), - policies, - this->lock (), - this->thread_lock (), - this->orb_core_, - this - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // The Object_Adapter will keep a reference to the Root POA so that - // on its destruction, it can check whether the Root POA has been - // destroyed yet or not. - this->root_->_add_ref (); - - // Lock access for the duration of this transaction. - TAO::Portable_Server::POA_Guard poa_guard (*this->root_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Iterate over the registered IOR interceptors so that they may be - // given the opportunity to add tagged components to the profiles - // for this servant. - this->root_->establish_components (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_Object_Adapter::close (int wait_for_completion - ACE_ENV_ARG_DECL) -{ - this->check_close (wait_for_completion ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Shutting down the ORB causes all object adapters to be destroyed, - // since they cannot exist in the absence of an ORB. Shut down is - // complete when all ORB processing (including request processing - // and object deactivation or other operations associated with - // object adapters) has completed and the object adapters have been - // destroyed. In the case of the POA, this means that all object - // etherealizations have finished and root POA has been destroyed - // (implying that all descendent POAs have also been destroyed). - TAO_Root_POA *root = 0; - TAO_POAManager_Factory* factory = 0; - { - ACE_GUARD (ACE_Lock, ace_mon, this->lock ()); - if (this->root_ == 0) - return; - root = this->root_; - this->root_ = 0; - if (this->poa_manager_factory_ == 0) - return; - factory = this->poa_manager_factory_; - this->poa_manager_factory_ = 0; - } - CORBA::Boolean etherealize_objects = 1; - root->destroy (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - ::CORBA::release (root); -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ::CORBA::release (factory); -#endif -} - -void -TAO_Object_Adapter::check_close (int wait_for_completion - ACE_ENV_ARG_DECL) -{ - TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (), - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -int -TAO_Object_Adapter::priority (void) const -{ - return 0; -} - -int -TAO_Object_Adapter::dispatch (TAO::ObjectKey &key, - TAO_ServerRequest &request, - CORBA::Object_out forward_to - ACE_ENV_ARG_DECL) -{ - if (key.length() < TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE - || ACE_OS::memcmp (key.get_buffer (), - &TAO_Root_POA::objectkey_prefix[0], - TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE) != 0) - { - return TAO_Adapter::DS_MISMATCHED_KEY; - } - - int result = 0; - -#if TAO_HAS_INTERCEPTORS == 1 - TAO::ServerRequestInterceptor_Adapter *sri_adapter = - orb_core_.serverrequestinterceptor_adapter (); - - ACE_TRY - { - if (sri_adapter != 0) - { -#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1 - CORBA::OctetSeq_var ocs; - sri_adapter->tao_ft_interception_point (request, - 0, // args - 0, // nargs - 0, // servant_upcall - 0, // exceptions - 0, // nexceptions - ocs.out () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - /// If we have a cached result, just go ahead and send the reply - /// and let us return - if (ocs.ptr () != 0) - { - // request.result_seq ( - request.send_cached_reply (ocs.inout ()); - - return TAO_Adapter::DS_OK; - } - - // If a PortableInterceptor::ForwardRequest exception was - // thrown, then set the forward_to object reference and return - // with the appropriate return status. - forward_to.ptr () = request.forward_location (); - if (!CORBA::is_nil (request.forward_location ())) - { - return TAO_Adapter::DS_FORWARD; - } -#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/ - - // The receive_request_service_contexts() interception point - // must be invoked before the operation is dispatched to the - // servant. - sri_adapter->receive_request_service_contexts (request, - 0, // args - 0, // nargs - 0, // servant_upcall - 0, // exceptions - 0 // nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If a PortableInterceptor::ForwardRequest exception was - // thrown, then set the forward_to object reference and return - // with the appropriate return status. - forward_to.ptr () = request.forward_location (); - if (!CORBA::is_nil (request.forward_location ())) - { - return TAO_Adapter::DS_FORWARD; - } - } -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - result = this->dispatch_servant (key, - request, - forward_to - ACE_ENV_ARG_PARAMETER); - -#if TAO_HAS_INTERCEPTORS == 1 - ACE_TRY_CHECK; - - if (result == TAO_Adapter::DS_FORWARD) - { - request.forward_location (forward_to.ptr ()); - if (sri_adapter != 0) - { - sri_adapter->send_other (request, - 0, // args - 0, // nargs - 0, // servant_upcall - 0, // exceptions - 0 // nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - } - ACE_CATCHANY - { - // Just assume the current exception is a system exception, the - // status can only change when the interceptor changes this - // and this is only done when the sri_adapter is available. If we - // don't have an sri_adapter we just rethrow the exception - PortableInterceptor::ReplyStatus status = - PortableInterceptor::SYSTEM_EXCEPTION; - - if (sri_adapter != 0) - { - request.caught_exception (&ACE_ANY_EXCEPTION); - - sri_adapter->send_exception (request, - 0, // args - 0, // nargs - 0, // servant_upcall - 0, // exceptions - 0 // nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - status = - request.reply_status (); - } - - // Only re-throw the exception if it hasn't been transformed by - // the send_exception() interception point (e.g. to a - // LOCATION_FORWARD). - if (status == PortableInterceptor::SYSTEM_EXCEPTION - || status == PortableInterceptor::USER_EXCEPTION) - { - ACE_RE_THROW; - } - } - ACE_ENDTRY; - ACE_CHECK_RETURN (result); -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - return result; -} - -const char * -TAO_Object_Adapter::name (void) const -{ - return TAO_OBJID_ROOTPOA; -} - -CORBA::Object_ptr -TAO_Object_Adapter::root (void) -{ - return CORBA::Object::_duplicate (this->root_); -} - -CORBA::Object_ptr -TAO_Object_Adapter::create_collocated_object (TAO_Stub *stub, - const TAO_MProfile &mp) -{ - TAO_ServantBase *sb = this->get_collocated_servant (mp); - - // Set the servant ORB. Do not duplicate the ORB here since - // TAO_Stub::servant_orb() duplicates it. - stub->servant_orb (this->orb_core_.orb ()); - - // It is ok to create a collocated object even when <sb> is - // zero. This constructor will set the stub collocated indicator and - // the strategized proxy broker if required. - CORBA::Object_ptr x; - ACE_NEW_RETURN (x, - CORBA::Object (stub, - 1, - sb), - CORBA::Object::_nil ()); - - // Success. - return x; -} - -CORBA::Long -TAO_Object_Adapter::initialize_collocated_object (TAO_Stub *stub) -{ - // If we have been forwarded: use the forwarded profiles - const TAO_MProfile &mp = stub->forward_profiles () ? *(stub->forward_profiles ()) - : stub->base_profiles (); - - TAO_ServantBase *sb = this->get_collocated_servant (mp); - - // Set the servant ORB. Do not duplicate the ORB here since - // TAO_Stub::servant_orb() duplicates it. - stub->servant_orb (this->orb_core_.orb ()); - - // It is ok to set the object as a collocated object even when - // <sb> is zero. - stub->collocated_servant (sb); - - // Mark the stub as collocated. This will set the strategized object - // proxy broker if required. - stub->is_collocated (true); - - // Return 0 (success) iff we found a servant. - return ! sb; -} - -TAO_ServantBase * -TAO_Object_Adapter::get_collocated_servant (const TAO_MProfile &mp) -{ - for (TAO_PHandle j = 0; - j != mp.profile_count (); - ++j) - { - const TAO_Profile *profile = mp.get_profile (j); - TAO::ObjectKey_var objkey = profile->_key (); - - if (objkey->length() < TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE - || ACE_OS::memcmp (objkey->get_buffer (), - &TAO_Root_POA::objectkey_prefix[0], - TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE) != 0) - continue; - - TAO_ServantBase *servant = 0; - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - this->find_servant (objkey.in (), - servant - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - return servant; - } - - return 0; -} - -// **************************************************************** - -TAO_Object_Adapter::Hint_Strategy::~Hint_Strategy (void) -{ -} - -void -TAO_Object_Adapter::Hint_Strategy::object_adapter (TAO_Object_Adapter *oa) -{ - this->object_adapter_ = oa; -} - -TAO_Object_Adapter::Active_Hint_Strategy::Active_Hint_Strategy (CORBA::ULong map_size) - : persistent_poa_system_map_ (map_size) -{ -} - -TAO_Object_Adapter::Active_Hint_Strategy::~Active_Hint_Strategy (void) -{ -} - -int -TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa ( - const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) -{ - poa_name folded_name; - int result = this->persistent_poa_system_map_.recover_key (system_name, - folded_name); - - if (result == 0) - { - result = this->persistent_poa_system_map_.find (system_name, - poa); - if (result != 0 - || folded_name != poa->folded_name ()) - { - result = - this->object_adapter_->persistent_poa_name_map_->find (folded_name, - poa); - if (result != 0) - { - result = - this->object_adapter_->activate_poa (folded_name, - poa - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - } - } - } - - return result; -} - -int -TAO_Object_Adapter::Active_Hint_Strategy::bind_persistent_poa ( - const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name) -{ - poa_name name = folded_name; - int result = this->persistent_poa_system_map_.bind_modify_key (poa, - name); - - if (result == 0) - { - result = - this->object_adapter_->persistent_poa_name_map_->bind (folded_name, - poa); - - if (result != 0) - this->persistent_poa_system_map_.unbind (name); - else - ACE_NEW_RETURN (system_name, - poa_name (name), - -1); - } - - return result; -} - -int -TAO_Object_Adapter::Active_Hint_Strategy::unbind_persistent_poa ( - const poa_name &folded_name, - const poa_name &system_name) -{ - int result = this->persistent_poa_system_map_.unbind (system_name); - - if (result == 0) - result = - this->object_adapter_->persistent_poa_name_map_->unbind (folded_name); - - return result; -} - -TAO_Object_Adapter::No_Hint_Strategy::~No_Hint_Strategy (void) -{ -} - -int -TAO_Object_Adapter::No_Hint_Strategy::find_persistent_poa ( - const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) -{ - int result = - this->object_adapter_->persistent_poa_name_map_->find (system_name, - poa); - if (result != 0) - { - result = - this->object_adapter_->activate_poa (system_name, - poa - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - } - - return result; -} - -int -TAO_Object_Adapter::No_Hint_Strategy::bind_persistent_poa ( - const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name) -{ - int result = - this->object_adapter_->persistent_poa_name_map_->bind (folded_name, - poa); - if (result == 0) - ACE_NEW_RETURN (system_name, - poa_name (folded_name), - -1); - return result; -} - -int -TAO_Object_Adapter::No_Hint_Strategy::unbind_persistent_poa ( - const poa_name & folded_name, - const poa_name & /* system_name */) -{ - return this->object_adapter_->persistent_poa_name_map_->unbind (folded_name); -} - -TAO_Object_Adapter::poa_name_iterator::poa_name_iterator ( - int begin, - CORBA::ULong size, - const CORBA::Octet *folded_buffer) - : size_ (size), - folded_buffer_ (folded_buffer), - last_separator_ ((CORBA::ULong) ~0) -{ - if (begin) - { - this->position_ = (CORBA::ULong) ~0; - this->operator++ (); - } - else - this->position_ = this->size_; -} - -bool -TAO_Object_Adapter::poa_name_iterator::operator== (const poa_name_iterator &rhs) const -{ - return this->position_ == rhs.position_; -} - -bool -TAO_Object_Adapter::poa_name_iterator::operator!= (const poa_name_iterator &rhs) const -{ - return !this->operator== (rhs); -} - -ACE_CString -TAO_Object_Adapter::poa_name_iterator::operator* () const -{ - CORBA::ULong start_at = - this->last_separator_ + - TAO_Root_POA::name_separator_length (); - - CORBA::ULong how_many = - this->position_ - - this->last_separator_ - - TAO_Root_POA::name_separator_length (); - - return ACE_CString (reinterpret_cast <const char *> - (&this->folded_buffer_[start_at]), - how_many); -} - -TAO_Object_Adapter::poa_name_iterator & -TAO_Object_Adapter::poa_name_iterator::operator++ (void) -{ - for (this->last_separator_ = this->position_; - ; - ) - { - ++this->position_; - if (this->position_ < this->size_) - { - if (this->folded_buffer_[this->position_] == TAO_Root_POA::name_separator ()) - break; - } - else - break; - } - - return *this; -} - -TAO_Object_Adapter::iteratable_poa_name::iteratable_poa_name ( - const poa_name &folded_name) - : folded_name_ (folded_name) -{ -} - -TAO_Object_Adapter::iteratable_poa_name::iterator -TAO_Object_Adapter::iteratable_poa_name::begin (void) const -{ - return iterator (1, - this->folded_name_.length (), - this->folded_name_.get_buffer ()); -} - -TAO_Object_Adapter::iteratable_poa_name::iterator -TAO_Object_Adapter::iteratable_poa_name::end (void) const -{ - return iterator (0, - this->folded_name_.length (), - this->folded_name_.get_buffer ()); -} - -void -TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete (ACE_ENV_SINGLE_ARG_DECL) -{ - // Check if a non-servant upcall is in progress. If a non-servant - // upcall is in progress, wait for it to complete. Unless of - // course, the thread making the non-servant upcall is this thread. - while (this->enable_locking_ && - this->non_servant_upcall_in_progress_ && - ! ACE_OS::thr_equal (this->non_servant_upcall_thread_, - ACE_OS::thr_self ())) - { - // If so wait... - int result = - this->non_servant_upcall_condition_.wait (); - if (result == -1) - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } -} - -void -TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete_no_throw (void) -{ - // Non-exception throwing version. - ACE_TRY_NEW_ENV - { - this->wait_for_non_servant_upcalls_to_complete (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_ERROR ((LM_ERROR, - "TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete " - "threw exception it should not have!\n")); - } - ACE_ENDTRY; -} - -void -TAO_Object_Adapter::servant_dispatcher (TAO_Servant_Dispatcher *dispatcher) -{ - if (this->servant_dispatcher_) - delete this->servant_dispatcher_; - - this->servant_dispatcher_ = dispatcher; -} - -void -TAO_Object_Adapter::do_dispatch (TAO_ServerRequest& req, - TAO::Portable_Server::Servant_Upcall& upcall - ACE_ENV_ARG_DECL) -{ - upcall.servant ()->_dispatch(req, - &upcall - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Object_Adapter.h b/TAO/tao/PortableServer/Object_Adapter.h deleted file mode 100644 index 59f40a596b5..00000000000 --- a/TAO/tao/PortableServer/Object_Adapter.h +++ /dev/null @@ -1,521 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Object_Adapter.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_OBJECT_ADAPTER_H -#define TAO_OBJECT_ADAPTER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Key_Adapters.h" -#include "tao/PortableServer/poa_macros.h" -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/Default_Policy_Validator.h" -#include "tao/PortableServer/POA_Policy_Set.h" - -#include "tao/Adapter.h" -#include "tao/Adapter_Factory.h" -#include "tao/Server_Strategy_Factory.h" -#include "tao/LocalObject.h" - -#include "ace/Reverse_Lock_T.h" -#include "ace/Condition_Thread_Mutex.h" -#include "ace/Map_T.h" - -#include "tao/PortableServer/Servant_Location.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; -class TAO_POA_Manager; -class TAO_TSS_Resources; -class TAO_Transport; -class TAO_Servant_Dispatcher; -class TAO_POAManager_Factory; - -namespace TAO -{ - namespace Portable_Server - { - class Non_Servant_Upcall; - class Servant_Upcall; - class POA_Current_Impl; - class Temporary_Creation_Time; - } -} - -/** - * @class TAO_Object_Adapter - * - * @brief Defines the Object Adapter abstraction. - * - * This class will be used as a facade for the POAs in a server - */ -class TAO_PortableServer_Export TAO_Object_Adapter - : public TAO_Adapter -{ -public: - - friend class TAO_Root_POA; - - typedef PortableServer::ObjectId poa_name; - typedef PortableServer::ObjectId_var poa_name_var; - typedef PortableServer::ObjectId_out poa_name_out; - - /// Constructor. - TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters, - TAO_ORB_Core &orb_core); - - /// Destructor. - ~TAO_Object_Adapter (void); - - int dispatch_servant (const TAO::ObjectKey &key, - TAO_ServerRequest &req, - CORBA::Object_out forward_to - ACE_ENV_ARG_DECL); - - int locate_servant (const TAO::ObjectKey &key - ACE_ENV_ARG_DECL); - - TAO_SERVANT_LOCATION find_servant (const TAO::ObjectKey &key, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - int find_poa (const poa_name &system_name, - CORBA::Boolean activate_it, - CORBA::Boolean root, - const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - int bind_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name); - - int unbind_poa (TAO_Root_POA *poa, - const poa_name &folded_name, - const poa_name &system_name); - - int activate_poa (const poa_name &folded_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - ACE_Lock &lock (void); - - TAO_SYNCH_MUTEX &thread_lock (void); - - ACE_Reverse_Lock<ACE_Lock> &reverse_lock (void); - - /// Access the root poa. - TAO_Root_POA *root_poa (void) const; - - /// Access to ORB Core. - TAO_ORB_Core &orb_core (void) const; - - /// Wait for non-servant upcalls to complete. - void wait_for_non_servant_upcalls_to_complete (ACE_ENV_SINGLE_ARG_DECL); - - /// Non-exception throwing version. - void wait_for_non_servant_upcalls_to_complete_no_throw (void); - - static CORBA::ULong transient_poa_name_size (void); - - /// Return the validator. - TAO_Policy_Validator &validator (void); - - int enable_locking() const; - - /// Return the set of default policies. - TAO_POA_Policy_Set &default_poa_policies (void); - - /// Set the servant dispatcher method. Ownership is transferred to - /// this Object Adapter. Note: This should only be called - /// at initialization. - void servant_dispatcher (TAO_Servant_Dispatcher *dispatcher); - - /// Initialize the default set of POA policies. - void init_default_policies (TAO_POA_Policy_Set &policies - ACE_ENV_ARG_DECL); - - // = The TAO_Adapter methods, please check tao/Adapter.h for the - // documentation - virtual void open (ACE_ENV_SINGLE_ARG_DECL); - virtual void close (int wait_for_completion - ACE_ENV_ARG_DECL); - virtual void check_close (int wait_for_completion - ACE_ENV_ARG_DECL); - virtual int priority (void) const; - virtual int dispatch (TAO::ObjectKey &key, - TAO_ServerRequest &request, - CORBA::Object_out forward_to - ACE_ENV_ARG_DECL); - 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 *); - -protected: - - int locate_servant_i (const TAO::ObjectKey &key - ACE_ENV_ARG_DECL); - - TAO_SERVANT_LOCATION find_servant_i (const TAO::ObjectKey &key, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - void dispatch_servant_i (const TAO::ObjectKey &key, - TAO_ServerRequest &req, - void *context - ACE_ENV_ARG_DECL); - - void locate_poa (const TAO::ObjectKey &key, - PortableServer::ObjectId &id, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - int find_transient_poa (const poa_name &system_name, - CORBA::Boolean root, - const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - int find_persistent_poa (const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - int bind_transient_poa (TAO_Root_POA *poa, - poa_name_out system_name); - - int bind_persistent_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name); - - int unbind_transient_poa (const poa_name &system_name); - - int unbind_persistent_poa (const poa_name &folded_name, - const poa_name &system_name); - - static ACE_Lock *create_lock (int enable_locking, - TAO_SYNCH_MUTEX &thread_lock); - - virtual void do_dispatch (TAO_ServerRequest& req, - TAO::Portable_Server::Servant_Upcall& upcall - ACE_ENV_ARG_DECL); - -public: - - /** - * @class Hint_Strategy - * - * @brief Base class for POA active hint strategy. - * - * This class also provides for common structures used by all - * the derived classes. - */ - class TAO_PortableServer_Export Hint_Strategy - { - public: - - virtual ~Hint_Strategy (void); - - virtual int find_persistent_poa (const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) = 0; - - virtual int bind_persistent_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name) = 0; - - virtual int unbind_persistent_poa (const poa_name &folded_name, - const poa_name &system_name) = 0; - - void object_adapter (TAO_Object_Adapter *oa); - - protected: - - TAO_Object_Adapter *object_adapter_; - }; - - /** - * @class Active_Hint_Strategy - * - * @brief This class uses active demux hint for POA active hint - * strategy. - * - * This class will append an active hint to the POA name, - * making the POA lookups fast and predictable. - */ - class TAO_PortableServer_Export Active_Hint_Strategy : public Hint_Strategy - { - public: - - Active_Hint_Strategy (CORBA::ULong map_size); - - virtual ~Active_Hint_Strategy (void); - - virtual int find_persistent_poa (const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - virtual int bind_persistent_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name); - - virtual int unbind_persistent_poa (const poa_name &folded_name, - const poa_name &system_name); - - protected: - - typedef ACE_Active_Map_Manager_Adapter< - poa_name, - TAO_Root_POA *, - TAO_Preserve_Original_Key_Adapter> persistent_poa_system_map; - - persistent_poa_system_map persistent_poa_system_map_; - }; - - friend class Active_Hint_Strategy; - - /** - * @class No_Hint_Strategy - * - * @brief This class doesn't use any hints for POA active hint - * strategy. - * - * This class will simply use the POA names as is. And since - * no hint is added, the IORs will be smaller. - */ - class TAO_PortableServer_Export No_Hint_Strategy : public Hint_Strategy - { - public: - - virtual ~No_Hint_Strategy (void); - - virtual int find_persistent_poa (const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL); - - virtual int bind_persistent_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name); - - virtual int unbind_persistent_poa (const poa_name &folded_name, - const poa_name &system_name); - - }; - - friend class No_Hint_Strategy; - -protected: - - Hint_Strategy *hint_strategy_; - - /// Base class of the id map. - typedef ACE_Map< - poa_name, - TAO_Root_POA *> transient_poa_map; - -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - /// Id hash map. - typedef ACE_Hash_Map_Manager_Ex_Adapter< - poa_name, - TAO_Root_POA *, - TAO_ObjectId_Hash, - ACE_Equal_To<poa_name>, - TAO_Incremental_Key_Generator> transient_poa_hash_map; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - /// Id linear map. - typedef ACE_Map_Manager_Adapter< - poa_name, - TAO_Root_POA *, - TAO_Incremental_Key_Generator> transient_poa_linear_map; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - /// Id active map. - typedef ACE_Active_Map_Manager_Adapter< - poa_name, - TAO_Root_POA *, - TAO_Ignore_Original_Key_Adapter> transient_poa_active_map; - - /// Base class of the name map. - typedef ACE_Map< - poa_name, - TAO_Root_POA *> persistent_poa_name_map; - - /// Id hash map. - typedef ACE_Hash_Map_Manager_Ex_Adapter< - poa_name, - TAO_Root_POA *, - TAO_ObjectId_Hash, - ACE_Equal_To<PortableServer::ObjectId>, - ACE_Noop_Key_Generator<poa_name> > persistent_poa_name_hash_map; - -#if (TAO_HAS_MINIMUM_POA_MAPS == 0) - /// Id linear map. - typedef ACE_Map_Manager_Adapter< - poa_name, - TAO_Root_POA *, - ACE_Noop_Key_Generator<poa_name> > persistent_poa_name_linear_map; -#endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */ - - /// Strategy for dispatching a request to a servant. - TAO_Servant_Dispatcher *servant_dispatcher_; - - /// Persistent POA map - persistent_poa_name_map *persistent_poa_name_map_; - - /// Transient POA map - transient_poa_map *transient_poa_map_; - -protected: - - static CORBA::ULong transient_poa_name_size_; - - static void set_transient_poa_name_size (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters); - - TAO_ORB_Core &orb_core_; - - int enable_locking_; - - TAO_SYNCH_MUTEX thread_lock_; - - ACE_Lock *lock_; - - ACE_Reverse_Lock<ACE_Lock> reverse_lock_; - -public: - - /** - * @class poa_name_iterator - * - * @brief Iterator for a folded poa name. - */ - class poa_name_iterator - { - public: - - /// Constructor. - poa_name_iterator (int begin, - CORBA::ULong size, - const CORBA::Octet *folded_buffer); - - /// Comparison operators. - bool operator== (const poa_name_iterator &rhs) const; - bool operator!= (const poa_name_iterator &rhs) const; - - /// Dereference operator. - ACE_CString operator* () const; - - /// Prefix advance. - poa_name_iterator &operator++ (void); - - protected: - - CORBA::ULong size_; - CORBA::ULong position_; - const CORBA::Octet *folded_buffer_; - CORBA::ULong last_separator_; - }; - - /** - * @class iteratable_poa_name - * - * @brief This class allows iteration over a folded poa name. - */ - class iteratable_poa_name - { - public: - - typedef poa_name_iterator iterator; - - iteratable_poa_name (const poa_name &folded_name); - - iterator begin (void) const; - iterator end (void) const; - - protected: - - const poa_name &folded_name_; - }; - - friend class TAO::Portable_Server::Non_Servant_Upcall; - - friend class TAO::Portable_Server::Servant_Upcall; - -public: - - /// Pointer to the non-servant upcall in progress. If no non-servant - /// upcall is in progress, this pointer is zero. - TAO::Portable_Server::Non_Servant_Upcall *non_servant_upcall_in_progress (void) const; - -private: - - /// Helper method to get collocated servant - TAO_ServantBase *get_collocated_servant (const TAO_MProfile &mp); - -private: - - /// Condition variable for waiting on non-servant upcalls to end. - TAO_SYNCH_CONDITION non_servant_upcall_condition_; - - /// Pointer to the non-servant upcall in progress. If no non-servant - /// upcall is in progress, this pointer is zero. - TAO::Portable_Server::Non_Servant_Upcall *non_servant_upcall_in_progress_; - - /// Current nesting level of non_servant_upcalls. - unsigned int non_servant_upcall_nesting_level_; - - /// Id of thread making the non-servant upcall. - ACE_thread_t non_servant_upcall_thread_; - - /// The Root POA - TAO_Root_POA *root_; - - /// The POAManager factory. - TAO_POAManager_Factory *poa_manager_factory_; - - /// The default validator and the beginning of the chain of - /// policy validators. - TAO_POA_Default_Policy_Validator default_validator_; - - /// Save a list of default policies that should be included in - /// every POA (unless overridden). - TAO_POA_Policy_Set default_poa_policies_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Object_Adapter.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_OBJECT_ADAPTER_H */ diff --git a/TAO/tao/PortableServer/Object_Adapter.i b/TAO/tao/PortableServer/Object_Adapter.i deleted file mode 100644 index 2fe048e9a5e..00000000000 --- a/TAO/tao/PortableServer/Object_Adapter.i +++ /dev/null @@ -1,170 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "tao/SystemException.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE TAO_Policy_Validator & -TAO_Object_Adapter::validator (void) -{ - return this->default_validator_; -} - -ACE_INLINE int -TAO_Object_Adapter::enable_locking (void) const -{ - return this->enable_locking_; -} - -ACE_INLINE TAO_POA_Policy_Set & -TAO_Object_Adapter::default_poa_policies (void) -{ - return this->default_poa_policies_; -} - -ACE_INLINE ACE_Lock & -TAO_Object_Adapter::lock (void) -{ - return *this->lock_; -} - -ACE_INLINE TAO_SYNCH_MUTEX & -TAO_Object_Adapter::thread_lock (void) -{ - return this->thread_lock_; -} - -ACE_INLINE ACE_Reverse_Lock<ACE_Lock> & -TAO_Object_Adapter::reverse_lock (void) -{ - return this->reverse_lock_; -} - -/* static */ -ACE_INLINE CORBA::ULong -TAO_Object_Adapter::transient_poa_name_size () -{ - return TAO_Object_Adapter::transient_poa_name_size_; -} - -ACE_INLINE int -TAO_Object_Adapter::locate_servant (const TAO::ObjectKey &key - ACE_ENV_ARG_DECL) -{ - // Lock access for the duration of this transaction. - TAO_OBJECT_ADAPTER_GUARD_RETURN (-1); - - return this->locate_servant_i (key - ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE TAO_SERVANT_LOCATION -TAO_Object_Adapter::find_servant (const TAO::ObjectKey &key, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) -{ - // Lock access for the duration of this transaction. - TAO_OBJECT_ADAPTER_GUARD_RETURN (TAO_SERVANT_NOT_FOUND); - - return this->find_servant_i (key, - servant - ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE int -TAO_Object_Adapter::find_persistent_poa (const poa_name &system_name, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) -{ - return this->hint_strategy_->find_persistent_poa (system_name, - poa - ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE int -TAO_Object_Adapter::find_poa (const poa_name &system_name, - CORBA::Boolean activate_it, - CORBA::Boolean root, - const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time, - TAO_Root_POA *&poa - ACE_ENV_ARG_DECL) -{ - if (activate_it) - { - return this->find_persistent_poa (system_name, - poa - ACE_ENV_ARG_PARAMETER); - } - else - { - return this->find_transient_poa (system_name, - root, - poa_creation_time, - poa - ACE_ENV_ARG_PARAMETER); - } -} - -ACE_INLINE int -TAO_Object_Adapter::bind_transient_poa (TAO_Root_POA *poa, - poa_name_out system_name) -{ - poa_name name; - int result = this->transient_poa_map_->bind_create_key (poa, - name); - - if (result == 0) - { - ACE_NEW_RETURN (system_name, - poa_name (name), - -1); - } - - return result; -} - -ACE_INLINE int -TAO_Object_Adapter::bind_persistent_poa (const poa_name &folded_name, - TAO_Root_POA *poa, - poa_name_out system_name) -{ - return this->hint_strategy_->bind_persistent_poa (folded_name, - poa, - system_name); -} - -ACE_INLINE int -TAO_Object_Adapter::unbind_transient_poa (const poa_name &system_name) -{ - return this->transient_poa_map_->unbind (system_name); -} - -ACE_INLINE int -TAO_Object_Adapter::unbind_persistent_poa (const poa_name &folded_name, - const poa_name &system_name) -{ - return this->hint_strategy_->unbind_persistent_poa (folded_name, - system_name); -} - -ACE_INLINE TAO_Root_POA * -TAO_Object_Adapter::root_poa (void) const -{ - return this->root_; -} - -ACE_INLINE TAO_ORB_Core & -TAO_Object_Adapter::orb_core (void) const -{ - return this->orb_core_; -} - -ACE_INLINE TAO::Portable_Server::Non_Servant_Upcall * -TAO_Object_Adapter::non_servant_upcall_in_progress (void) const -{ - return this->non_servant_upcall_in_progress_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Object_Adapter_Factory.cpp b/TAO/tao/PortableServer/Object_Adapter_Factory.cpp deleted file mode 100644 index 0e2859d333c..00000000000 --- a/TAO/tao/PortableServer/Object_Adapter_Factory.cpp +++ /dev/null @@ -1,30 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Object_Adapter_Factory.h" -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/ORB_Core.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Adapter* -TAO_Object_Adapter_Factory::create (TAO_ORB_Core *orb_core) -{ - TAO_Adapter* adapter = 0; - ACE_NEW_RETURN (adapter, - TAO_Object_Adapter (orb_core->server_factory ()-> - active_object_map_creation_parameters (), - *orb_core), - 0); - return adapter; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_DEFINE (TAO_PortableServer, TAO_Object_Adapter_Factory) -ACE_STATIC_SVC_DEFINE (TAO_Object_Adapter_Factory, - ACE_TEXT ("TAO_Object_Adapter_Factory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (TAO_Object_Adapter_Factory), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - diff --git a/TAO/tao/PortableServer/Object_Adapter_Factory.h b/TAO/tao/PortableServer/Object_Adapter_Factory.h deleted file mode 100644 index 77266900e27..00000000000 --- a/TAO/tao/PortableServer/Object_Adapter_Factory.h +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Object_Adapter_Factory.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_OBJECT_ADAPTER_FACTORY_H -#define TAO_OBJECT_ADAPTER_FACTORY_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Adapter_Factory.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_PortableServer_Export TAO_Object_Adapter_Factory - : public TAO_Adapter_Factory -{ -public: - - // = The TAO_Adapter_Factory methods, please read tao/Adapter.h for - // details. - virtual TAO_Adapter *create (TAO_ORB_Core *orb_core); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE (TAO_Object_Adapter_Factory) -ACE_FACTORY_DECLARE (TAO_PortableServer, TAO_Object_Adapter_Factory) - -#include /**/ "ace/post.h" - -#endif /* TAO_OBJECT_ADAPTER_FACTORY_H */ diff --git a/TAO/tao/PortableServer/Object_SArg_Traits.h b/TAO/tao/PortableServer/Object_SArg_Traits.h deleted file mode 100644 index 0145ec7909e..00000000000 --- a/TAO/tao/PortableServer/Object_SArg_Traits.h +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Object_SArg_Traits.h - * - * $Id$ - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef TAO_OBJECT_SARG_TRAITS_H -#define TAO_OBJECT_SARG_TRAITS_H - -#include /**/ "ace/pre.h" - -#include "tao/CORBA_methods.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Object_SArgument_T.h" -#include "tao/PortableServer/SArg_Traits_T.h" -#include "tao/Pseudo_VarOut_T.h" -#include "tao/Any_Insert_Policy_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace CORBA -{ - class Object; - typedef Object *Object_ptr; - - typedef TAO_Pseudo_Var_T<Object> Object_var; - typedef TAO_Pseudo_Out_T<Object> Object_out; -} - -// -------------------------------------------------------------- - -namespace TAO -{ - /// Used in generated code if CORBA::Object is an argument or - /// return type. - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Object> - : public Object_SArg_Traits_T<CORBA::Object_ptr, - CORBA::Object_var, - CORBA::Object_out, - TAO::Any_Insert_Policy_Stream <CORBA::Object_ptr> - > - { - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_OBJECT_SARG_TRAITS_H */ diff --git a/TAO/tao/PortableServer/Object_SArgument_T.cpp b/TAO/tao/PortableServer/Object_SArgument_T.cpp deleted file mode 100644 index 9bdc6b3bcae..00000000000 --- a/TAO/tao/PortableServer/Object_SArgument_T.cpp +++ /dev/null @@ -1,125 +0,0 @@ -// $Id$ - -#ifndef TAO_OBJECT_SARGUMENT_T_CPP -#define TAO_OBJECT_SARGUMENT_T_CPP - -#include "tao/PortableServer/Object_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Object_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -CORBA::Boolean -TAO::In_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::demarshal (TAO_InputCDR &cdr) -{ - return cdr >> this->x_.out (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -void -TAO::In_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::demarshal (TAO_InputCDR & cdr) -{ - return cdr >> this->x_.out (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -void -TAO::Inout_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S_ptr, - typename S_var, - typename S_out, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Object_SArgument_T<S_ptr,S_var,S_out,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_ptr, - typename S_var, - typename S_out, - class Insert_Policy> -void -TAO::Out_Object_SArgument_T<S_ptr,S_var,S_out,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -void -TAO::Ret_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_OBJECT_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Object_SArgument_T.h b/TAO/tao/PortableServer/Object_SArgument_T.h deleted file mode 100644 index 2274a22c781..00000000000 --- a/TAO/tao/PortableServer/Object_SArgument_T.h +++ /dev/null @@ -1,187 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Object_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - - -#ifndef TAO_OBJECT_SARGUMENT_T_H -#define TAO_OBJECT_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// This set of classes is also used by valuetype arguments. If the -// specialization is done using S * for the parameter, the semantics -// are the same as for interfaces, so there's no need for another -// set of classes. - -namespace TAO -{ - /** - * @class In_Object_SArgument_T - * - * @brief Template class for IN skeleton object argument. - * - */ - template<typename S_ptr, - typename S_var, - class Insert_Policy> - class In_Object_SArgument_T : public InArgument - { - public: - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S_ptr arg (void) const; - - private: - S_var x_; - }; - - /** - * @class Inout_Object_SArgument_T - * - * @brief Template class for INOUT skeleton object argument. - * - */ - template<typename S_ptr, - typename S_var, - class Insert_Policy> - class Inout_Object_SArgument_T : public InoutArgument - { - public: - Inout_Object_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S_ptr & arg (void); - - private: - S_var x_; - }; - - /** - * @class Out_Object_SArgument_T - * - * @brief Template class for INOUT skeleton object argument. - * - */ - template<typename S_ptr, - typename S_var, - typename S_out, - class Insert_Policy> - class Out_Object_SArgument_T : public OutArgument - { - public: - Out_Object_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S_out arg (void); - - private: - S_var x_; - }; - - /** - * @class Ret_Object_SArgument_T - * - * @brief Template class for return skeleton value of object. - * - */ - template<typename S_ptr, - typename S_var, - class Insert_Policy> - class Ret_Object_SArgument_T : public RetArgument - { - public: - Ret_Object_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S_ptr & arg (void); - - private: - S_var x_; - }; - - /** - * @struct Object_SArg_Traits_T - * - * @brief Template class for skeleton argument traits of objects. - * - */ - template<typename T_ptr, - typename T_var, - typename T_out, - class Insert_Policy> - struct Object_SArg_Traits_T - { - typedef T_ptr ret_type; - typedef T_ptr in_type; - typedef T_ptr & inout_type; - typedef T_out out_type; - - typedef In_Object_SArgument_T<T_ptr, - T_var, - Insert_Policy> in_arg_val; - typedef Inout_Object_SArgument_T<T_ptr, - T_var, - Insert_Policy> inout_arg_val; - typedef Out_Object_SArgument_T<T_ptr, - T_var, - T_out, - Insert_Policy> out_arg_val; - typedef Ret_Object_SArgument_T<T_ptr, - T_var, - Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef in_type in_arg_type; - typedef inout_type inout_arg_type; - typedef out_type out_arg_type; - typedef inout_type ret_arg_type; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Object_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Object_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Object_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_OBJECT_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Object_SArgument_T.inl b/TAO/tao/PortableServer/Object_SArgument_T.inl deleted file mode 100644 index d6392bc972f..00000000000 --- a/TAO/tao/PortableServer/Object_SArgument_T.inl +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -ACE_INLINE -S_ptr -TAO::In_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::arg (void) const -{ - return this->x_.in (); -} - -// ========================================================================== - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Object_SArgument_T<S_ptr,S_var,Insert_Policy>:: -Inout_Object_SArgument_T (void) -{ -} - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -ACE_INLINE -S_ptr& -TAO::Inout_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::arg (void) -{ - return this->x_.inout (); -} - -// ========================================================================== - -template<typename S_ptr, - typename S_var, - typename S_out, - class Insert_Policy> -ACE_INLINE -TAO::Out_Object_SArgument_T<S_ptr,S_var,S_out,Insert_Policy>:: -Out_Object_SArgument_T (void) -{ -} - -template<typename S_ptr, - typename S_var, - typename S_out, - class Insert_Policy> -ACE_INLINE -S_out -TAO::Out_Object_SArgument_T<S_ptr,S_var,S_out,Insert_Policy>::arg (void) -{ - return this->x_.out (); -} - -// ========================================================================== - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Object_SArgument_T<S_ptr,S_var,Insert_Policy>:: -Ret_Object_SArgument_T (void) -{ -} - -template<typename S_ptr, - typename S_var, - class Insert_Policy> -ACE_INLINE -S_ptr & -TAO::Ret_Object_SArgument_T<S_ptr,S_var,Insert_Policy>::arg (void) -{ - return this->x_.out (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Operation_Table.cpp b/TAO/tao/PortableServer/Operation_Table.cpp deleted file mode 100644 index bf8be18d80d..00000000000 --- a/TAO/tao/PortableServer/Operation_Table.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Operation_Table.h" -#include "tao/ORB.h" - -ACE_RCSID(PortableServer, - Operation_Table, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// destructor -TAO_Operation_Table::~TAO_Operation_Table (void) -{ -} - -/**************************************************************/ -TAO::Operation_Skeletons::Operation_Skeletons (void) - : skel_ptr (0) - , thruPOA_skel_ptr (0) - , direct_skel_ptr (0) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Operation_Table.h b/TAO/tao/PortableServer/Operation_Table.h deleted file mode 100644 index d573d2c9f8e..00000000000 --- a/TAO/tao/PortableServer/Operation_Table.h +++ /dev/null @@ -1,139 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Operation_Table.h - * - * $Id$ - * - * @author Aniruddha Gokhale - */ -//============================================================================= - -#ifndef TAO_OPTABLE_H -#define TAO_OPTABLE_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Object.h" -#include "tao/Collocation_Strategy.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_ServerRequest; -class TAO_Abstract_ServantBase; - -namespace CORBA -{ - class Environment; -} - -typedef void (*TAO_Skeleton)( - TAO_ServerRequest &, - void *, - void * -#if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) - , CORBA::Environment & -#endif - ); - -typedef void (*TAO_Collocated_Skeleton)( - TAO_Abstract_ServantBase *, - TAO::Argument **, - int -#if !defined (TAO_HAS_EXCEPTIONS) || defined (ACE_ENV_BKWD_COMPAT) - , CORBA::Environment & -#endif - ); - -/** - * @struct TAO_operation_db_entry - * - * @brief Define a table entry that holds an operation name and its - * corresponding skeleton. A table of such entries is used to - * initialize the different lookup strategies. - */ -struct TAO_operation_db_entry -{ - /// Operation name - char const * opname; - - /// Remote/thru-POA skeleton pointer - TAO_Skeleton skel_ptr; - - /// Collocated skeleton pointers. - TAO_Collocated_Skeleton direct_skel_ptr; -}; - -// -------------------------- - -namespace TAO -{ - /** - * @class Operation_Skeleton_Ptr - * - * @brief A logical aggregation of all the operation skeleton pointers - * in use. - * - * This is not used by the IDL compiler. This is used internally - * within different strategies. - */ - struct Operation_Skeletons - { - Operation_Skeletons (void); - - /// Remote skeleton pointer - TAO_Skeleton skel_ptr; - - /// Collocated skeleton pointers. - TAO_Skeleton thruPOA_skel_ptr; - TAO_Collocated_Skeleton direct_skel_ptr; - }; -} - -/** - * @class TAO_Operation_Table - * - * @brief Abstract class for maintaining and lookup of CORBA IDL - * operation names. - */ -class TAO_PortableServer_Export TAO_Operation_Table -{ -public: - /** - * Uses @a opname to look up the skeleton function and pass it back - * in @a skelfunc. Returns non-negative integer on success, or -1 - * on failure. - */ - virtual int find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length = 0) = 0; - - /** - * Uses @a opname to look up the collocated skeleton function and - * pass it back in @a skelfunc. Returns non-negative integer on - * success, or -1 on failure. - */ - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0) = 0; - - /// Associate the skeleton @a skel_ptr with an operation named - /// @a opname. Returns -1 on failure, 0 on success, 1 on duplicate. - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr) = 0; - - virtual ~TAO_Operation_Table (void); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_OPTABLE_H */ diff --git a/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp b/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp deleted file mode 100644 index 0df9e27630a..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Binary_Search.cpp +++ /dev/null @@ -1,91 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Operation_Table_Binary_Search.h" -#include "tao/Timeprobe.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(PortableServer, - Operation_Table_Binary_Search, - "$Id$") - -#if defined (ACE_ENABLE_TIMEPROBES) - -static const char *TAO_Operation_Table_Timeprobe_Description[] = - { - "TAO_Binary_Search_OpTable::find - start", - "TAO_Binary_Search_OpTable::find - end" - }; - -enum - { - // Timeprobe description table start key - TAO_BINARY_SEARCH_OPTABLE_FIND_START = 608, - TAO_BINARY_SEARCH_OPTABLE_FIND_END - }; - -// Setup Timeprobes -ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description, - TAO_BINARY_SEARCH_OPTABLE_FIND_START); - -#endif /* ACE_ENABLE_TIMEPROBES */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Binary_Search_OpTable::~TAO_Binary_Search_OpTable (void) -{ -} - -int -TAO_Binary_Search_OpTable::find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int /* length */) -{ - ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START); - - TAO_operation_db_entry const * const entry = lookup (opname); - - if (entry == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_Binary_Search_Table:find failed\n")), - -1); - // Valid entry. Figure out the skel_ptr. - skelfunc = entry->skel_ptr; - - return 0; -} - -int -TAO_Binary_Search_OpTable::find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy st, - const unsigned int /* length */) -{ - ACE_FUNCTION_TIMEPROBE (TAO_BINARY_SEARCH_OPTABLE_FIND_START); - - TAO_operation_db_entry const * const entry = lookup (opname); - - if (entry == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_Binary_Search_Table:find failed\n")), - -1); - - switch (st) - { - case TAO::TAO_CS_DIRECT_STRATEGY: - skelfunc = entry->direct_skel_ptr; - break; - default: - return -1; - } - - return 0; -} - -int -TAO_Binary_Search_OpTable::bind (const char *, - const TAO::Operation_Skeletons) -{ - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Operation_Table_Binary_Search.h b/TAO/tao/PortableServer/Operation_Table_Binary_Search.h deleted file mode 100644 index 1d8d0a11c02..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Binary_Search.h +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Operation_Table_Binary_Search.h - * - * $Id$ - * - * @author Aniruddha Gokhale - */ -//============================================================================= - -#ifndef TAO_OPERATION_TABLE_BINARY_SEARCH_H -#define TAO_OPERATION_TABLE_BINARY_SEARCH_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Operation_Table.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Binary_Search_OpTable - * - * @brief Helper class for using binary search operatin lookup strategy - * in the server skeletons. - * - * This class declares pure virtual method called 'lookup ()' - * which will be generated by the GPERF program. This method is - * used by 'bind ()' and 'find ()' methods. Subclasses will - * define the lookup method. - */ -class TAO_PortableServer_Export TAO_Binary_Search_OpTable - : public TAO_Operation_Table -{ -public: - - /// Do nothing destrctor. - virtual ~TAO_Binary_Search_OpTable (void); - - /// See the documentation in the base class for details. - virtual int find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length = 0); - - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0); - - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr); - -private: - /// Method that should defined by the subclasses. GPERF program - /// will generate this routine routines. - virtual const TAO_operation_db_entry* lookup (const char *str) = 0; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_OPERATION_TABLE_BINARY_SEARCH_H */ diff --git a/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.cpp b/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.cpp deleted file mode 100644 index 21a206d9fba..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.cpp +++ /dev/null @@ -1,133 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Operation_Table_Dynamic_Hash.h" -#include "tao/Timeprobe.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(PortableServer, - Operation_Table_Dynamic_Hash, - "$Id$") - -#if defined (ACE_ENABLE_TIMEPROBES) - -static const char *TAO_Operation_Table_Timeprobe_Description[] = - { - "TAO_Dynamic_Hash_OpTable::find - start", - "TAO_Dynamic_Hash_OpTable::find - end", - }; - -enum - { - // Timeprobe description table start key - TAO_DYNAMIC_HASH_OPTABLE_FIND_START = 600, - TAO_DYNAMIC_HASH_OPTABLE_FIND_END, - }; - -// Setup Timeprobes -ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description, - TAO_DYNAMIC_HASH_OPTABLE_FIND_START); - -#endif /* ACE_ENABLE_TIMEPROBES */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// constructor -TAO_Dynamic_Hash_OpTable::TAO_Dynamic_Hash_OpTable ( - TAO_operation_db_entry const * db, - CORBA::ULong dbsize, - CORBA::ULong hashtblsize, - ACE_Allocator *alloc) - : hash_ (hashtblsize, alloc) -{ - // Iterate thru each entry in the database and bind the operation - // name to its corresponding skeleton. - for (CORBA::ULong i = 0; i < dbsize; ++i) - { - TAO::Operation_Skeletons s; - s.skel_ptr = db[i].skel_ptr; - s.thruPOA_skel_ptr = db[i].skel_ptr; - s.direct_skel_ptr = db[i].direct_skel_ptr; - - // @@ (ASG): what happens if bind fails ??? - if (this->bind (db[i].opname, s) == -1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("bind failed"))); - } -} - -TAO_Dynamic_Hash_OpTable::~TAO_Dynamic_Hash_OpTable (void) -{ - // Initialize an iterator. We need to go thru each entry and free - // up storage allocated to hold the external ids. In this case, - // these are strings. - OP_MAP_MANAGER::ITERATOR iterator (this->hash_); - - for (OP_MAP_MANAGER::ENTRY *entry = 0; - iterator.next (entry) != 0; - iterator.advance ()) - { - // We had allocated memory and stored the string. So we free the - // memory. - CORBA::string_free ((char *) entry->ext_id_); - entry->ext_id_ = 0; - } -} - -int -TAO_Dynamic_Hash_OpTable::bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr) -{ - return this->hash_.bind (CORBA::string_dup (opname), - skel_ptr); -} - -int -TAO_Dynamic_Hash_OpTable::find (const char *opname, - TAO_Skeleton& skel_ptr, - const unsigned int ) -{ - ACE_FUNCTION_TIMEPROBE (TAO_DYNAMIC_HASH_OPTABLE_FIND_START); - TAO::Operation_Skeletons s; - - int retval = - this->hash_.find ((const char *)opname, - s); - - if (retval != -1) - { - skel_ptr = s.skel_ptr; - } - - return retval; -} - -int -TAO_Dynamic_Hash_OpTable::find (const char *opname, - TAO_Collocated_Skeleton& skel_ptr, - TAO::Collocation_Strategy s, - const unsigned int ) -{ - ACE_FUNCTION_TIMEPROBE (TAO_DYNAMIC_HASH_OPTABLE_FIND_START); - - TAO::Operation_Skeletons skel; - - int retval = - this->hash_.find ((const char *)opname, skel); - - if (retval != -1) - { - switch (s) - { - case TAO::TAO_CS_DIRECT_STRATEGY: - skel_ptr = skel.direct_skel_ptr; - break; - default: - return -1; - } - } - - return retval; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h b/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h deleted file mode 100644 index 40973757eba..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Dynamic_Hash.h +++ /dev/null @@ -1,84 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Operation_Table_Dynamic_Hash.h - * - * $Id$ - * - * @author Aniruddha Gokhale - */ -//============================================================================= - -#ifndef TAO_OPERATION_TABLE_DYNAMIC_HASH_H -#define TAO_OPERATION_TABLE_DYNAMIC_HASH_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Operation_Table.h" -#include "ace/Hash_Map_Manager.h" -#include "ace/Synch_Traits.h" -#include "ace/Null_Mutex.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Dynamic_Hash_OpTable - * - * @brief Dynamic Hashing scheme for CORBA IDL operation name lookup. - */ -class TAO_PortableServer_Export TAO_Dynamic_Hash_OpTable - : public TAO_Operation_Table -{ -public: - // = Initialization and termination methods. - /** - * Initialize the dynamic hash operation table with a database of - * operation names. The hash table size may be different from the - * size of the database. Hence we use the third argument to specify - * the size of the internal hash table. The <alloc> argument is - * used to determine where the memory comes from (usually from - * <ACE_Static_Allocator_Base>). - */ - TAO_Dynamic_Hash_OpTable (const TAO_operation_db_entry *db, - CORBA::ULong dbsize, - CORBA::ULong hashtblsize, - ACE_Allocator *alloc); - - /// Destructor - ~TAO_Dynamic_Hash_OpTable (void); - - /// See the documentation in the base class for details. - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr); - - virtual int find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length = 0); - - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0); -private: - typedef ACE_Hash_Map_Manager_Ex<const char *, - TAO::Operation_Skeletons, - ACE_Hash<const char *>, - ACE_Equal_To<const char *>, - ACE_Null_Mutex> - OP_MAP_MANAGER; - - /// The hash table data structure. - OP_MAP_MANAGER hash_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_OPERATION_TABLE_DYNAMIC_HASH_H */ diff --git a/TAO/tao/PortableServer/Operation_Table_Linear_Search.cpp b/TAO/tao/PortableServer/Operation_Table_Linear_Search.cpp deleted file mode 100644 index 0ad27a2c2c8..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Linear_Search.cpp +++ /dev/null @@ -1,93 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Operation_Table_Linear_Search.h" -#include "tao/Timeprobe.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(PortableServer, - Operation_Table_Linear_Searc, - "$Id$") - -#if defined (ACE_ENABLE_TIMEPROBES) - -static const char *TAO_Operation_Table_Timeprobe_Description[] = - { - "TAO_Linear_Search_OpTable::find - start", - "TAO_Linear_Search_OpTable::find - end", - }; - -enum - { - // Timeprobe description table start key - TAO_LINEAR_SEARCH_OPTABLE_FIND_START = 602, - TAO_LINEAR_SEARCH_OPTABLE_FIND_END, - }; - -// Setup Timeprobes -ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description, - TAO_LINEAR_SEARCH_OPTABLE_FIND_START); - -#endif /* ACE_ENABLE_TIMEPROBES */ - -/***************************************************************/ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Linear_Search_OpTable::~TAO_Linear_Search_OpTable (void) -{ -} - -int -TAO_Linear_Search_OpTable::bind (const char *, - const TAO::Operation_Skeletons ) -{ - return 0; -} - -int -TAO_Linear_Search_OpTable::find (const char *opname, - TAO_Skeleton& skelfunc, - const unsigned int ) -{ - ACE_FUNCTION_TIMEPROBE (TAO_LINEAR_SEARCH_OPTABLE_FIND_START); - - TAO_operation_db_entry const * const entry = lookup (opname); - if (entry == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_Linear_Search_Table:find failed\n")), - -1); - - // Valid entry. Figure out the skel_ptr. - skelfunc = entry->skel_ptr; - - return 0; -} - - -int -TAO_Linear_Search_OpTable::find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy st, - const unsigned int ) -{ - ACE_FUNCTION_TIMEPROBE (TAO_LINEAR_SEARCH_OPTABLE_FIND_START); - - TAO_operation_db_entry const * const entry = lookup (opname); - if (entry == 0) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_Linear_Search_Table:find failed\n")), - -1); - - switch (st) - { - case TAO::TAO_CS_DIRECT_STRATEGY: - skelfunc = entry->direct_skel_ptr; - break; - default: - return -1; - } - - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Operation_Table_Linear_Search.h b/TAO/tao/PortableServer/Operation_Table_Linear_Search.h deleted file mode 100644 index 1f26bc71a2f..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Linear_Search.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Operation_Table_Linear_Search.h - * - * $Id$ - * - * @author Aniruddha Gokhale - */ -//============================================================================= - -#ifndef TAO_OPERATION_TABLE_LINEAR_SEARCH_H -#define TAO_OPERATION_TABLE_LINEAR_SEARCH_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Operation_Table.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Linear_Search_OpTable - * - * @brief Operation table lookup strategy based on - * linear search. Not efficient, but it works. - */ -class TAO_PortableServer_Export TAO_Linear_Search_OpTable - : public TAO_Operation_Table -{ -public: - // = Initialization and termination methods. - - /// Destructor. - ~TAO_Linear_Search_OpTable (void); - - /// See the documentation in the base class for details. - virtual int find (const char *opname, - TAO_Skeleton &skel_ptr, - const unsigned int length = 0); - - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0); - - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skelptr); - -private: - // = Method that should defined by the subclasses. GPERF program - // will generate this routine routines. - virtual const TAO_operation_db_entry* lookup (const char *str) = 0; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_OPERATION_TABLE_LINEAR_SEARCH_H */ diff --git a/TAO/tao/PortableServer/Operation_Table_Perfect_Hash.cpp b/TAO/tao/PortableServer/Operation_Table_Perfect_Hash.cpp deleted file mode 100644 index c0b75b8b6fe..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Perfect_Hash.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Operation_Table_Perfect_Hash.h" -#include "tao/Timeprobe.h" -#include "ace/Log_Msg.h" - -ACE_RCSID(PortableServer, - Operation_Table_Perfect_Hash, - "$Id$") - -#if defined (ACE_ENABLE_TIMEPROBES) - -static const char *TAO_Operation_Table_Timeprobe_Description[] = - { - "TAO_Perfect_Hash_OpTable::find - start", - "TAO_Perfect_Hash_OpTable::find - end", - }; - -enum - { - // Timeprobe description table start key - TAO_PERFECT_HASH_OPTABLE_FIND_START = 606, - TAO_PERFECT_HASH_OPTABLE_FIND_END, - }; - -// Setup Timeprobes -ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Operation_Table_Timeprobe_Description, - TAO_PERFECT_HASH_OPTABLE_FIND_START); - -#endif /* ACE_ENABLE_TIMEPROBES */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Do nothing destrctor. -TAO_Perfect_Hash_OpTable::~TAO_Perfect_Hash_OpTable (void) -{ -} - -int -TAO_Perfect_Hash_OpTable::find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length) -{ - ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START); - - TAO_operation_db_entry const * const entry = lookup (opname, - length); - if (entry == 0) - { - skelfunc = 0; // insure that somebody can't call a wrong function! - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_Perfect_Hash_OpTable:find for ") - ACE_TEXT ("operation '%s' (length=%d) failed\n"), - ACE_TEXT_CHAR_TO_TCHAR (opname ? opname : "<null string>"), length), - -1); - } - - // Valid entry. Figure out the skel_ptr. - skelfunc = entry->skel_ptr; - - return 0; -} - -int -TAO_Perfect_Hash_OpTable::find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy st, - const unsigned int length) -{ - ACE_FUNCTION_TIMEPROBE (TAO_PERFECT_HASH_OPTABLE_FIND_START); - - TAO_operation_db_entry const * const entry = lookup (opname, - length); - if (entry == 0) - { - skelfunc = 0; // insure that somebody can't call a wrong function! - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO_Perfect_Hash_OpTable:find for ") - ACE_TEXT ("operation '%s' (length=%d) failed\n"), - ACE_TEXT_CHAR_TO_TCHAR (opname ? opname : "<null string>"), length), - -1); - } - - switch (st) - { - case TAO::TAO_CS_DIRECT_STRATEGY: - skelfunc = entry->direct_skel_ptr; - break; - default: - return -1; - } - - return 0; -} - -int -TAO_Perfect_Hash_OpTable::bind (const char *, - const TAO::Operation_Skeletons) -{ - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Operation_Table_Perfect_Hash.h b/TAO/tao/PortableServer/Operation_Table_Perfect_Hash.h deleted file mode 100644 index 00338dcc2c7..00000000000 --- a/TAO/tao/PortableServer/Operation_Table_Perfect_Hash.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Operation_Table_Perfect_Hash.h - * - * $Id$ - * - * @author Aniruddha Gokhale - */ -//============================================================================= - -#ifndef TAO_OPERATION_TABLE_PERFECT_HASH_H -#define TAO_OPERATION_TABLE_PERFECT_HASH_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Operation_Table.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Perfect_Hash_OpTable - * - * @brief Helper class for use of perfect hashing operation lookup - * strategy. - * - * This class declares pure virtual methods called 'lookup ()' - * and 'hash ()' which will be generated by the GPERF - * program. These methods are used by 'bind ()' and 'find ()' - * methods. Subclasses will define the lookup and hash - * functions. - */ -class TAO_PortableServer_Export TAO_Perfect_Hash_OpTable - : public TAO_Operation_Table -{ -public: - - /// Do nothing destrctor. - virtual ~TAO_Perfect_Hash_OpTable (void); - - /// See the documentation in the base class for details. - virtual int find (const char *opname, - TAO_Skeleton &skelfunc, - const unsigned int length = 0); - - virtual int find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy s, - const unsigned int length = 0); - - virtual int bind (const char *opname, - const TAO::Operation_Skeletons skel_ptr); - -private: - // = Methods that should defined by the subclasses. GPERF program - // will generate these routines. - - virtual unsigned int hash (const char *str, unsigned int len) = 0; - - virtual const TAO_operation_db_entry* lookup (const char *str, - unsigned int len) = 0; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_OPERATION_TABLE_PERFECT_HASH_H */ diff --git a/TAO/tao/PortableServer/POA.pidl b/TAO/tao/PortableServer/POA.pidl deleted file mode 100644 index 43a0791f165..00000000000 --- a/TAO/tao/PortableServer/POA.pidl +++ /dev/null @@ -1,255 +0,0 @@ -/** - * @file POA.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * This file was used to generate the code in - * PortableServerC.{h,inl,cpp}, using the following command: - * - * tao_idl.exe \ - * -o orig -Sci -Gp -Gd -Ge 1 -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * PortableServer.pidl - * - * After the file is generated a patch from the diffs directory must - * be applied. The patch: - * - * - Disables parts of the code under certain configurations. - * - * - Eliminates cycles in the include dependencies. - * - * - Adds non-idl components of PortableServer to the namespace. - * This includes (a) Servant (b) ServantBase (c) RefCountServantBase - * (d) Cookie (e) ObjectId_to_string (f) string_to_ObjectId (g) - * ObjectId_to_wstring (h) wstring_to_ObjectId (i) ServantBase_var - * (j) DynamicImplementation (k) LocalServantBase - * - * Apply patches using the following command: - * - * patch < diffs/PortableServer.diff - * - * Note: The diffs were generated using: - * - * rm diffs/PortableServer.diff - * for i in PortableServerC.{h,i,cpp}; do - * diff -wub orig/$i $i >> diffs/PortableServer.diff - * done - */ - -#ifndef _POA_SERVER_IDL_ -#define _POA_SERVER_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/Policy_Forward.pidl" -#include "tao/OctetSeq.pidl" -#include "tao/orb_types.pidl" -#include "tao/PortableServer/PS_Forward.pidl" -#include "tao/PortableServer/IdAssignmentPolicy.pidl" -#include "tao/PortableServer/IdUniquenessPolicy.pidl" -#include "tao/PortableServer/ImplicitActivationPolicy.pidl" -#include "tao/PortableServer/LifespanPolicy.pidl" -#include "tao/PortableServer/RequestProcessingPolicy.pidl" -#include "tao/PortableServer/ServantRetentionPolicy.pidl" -#include "tao/PortableServer/ThreadPolicy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - typedef sequence<POA> POAList; - - // Policy IDs -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - const CORBA::PolicyType THREAD_POLICY_ID = 16; -# endif -# if ! defined (CORBA_E_MICRO) - const CORBA::PolicyType LIFESPAN_POLICY_ID = 17; - const CORBA::PolicyType ID_UNIQUENESS_POLICY_ID = 18; - const CORBA::PolicyType ID_ASSIGNMENT_POLICY_ID = 19; -# endif -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - const CORBA::PolicyType IMPLICIT_ACTIVATION_POLICY_ID = 20; - const CORBA::PolicyType SERVANT_RETENTION_POLICY_ID = 21; - const CORBA::PolicyType REQUEST_PROCESSING_POLICY_ID = 22; -# endif - - // Forward declaration POAManager interface. - local interface POAManager; - -#if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - // Forward declaration POAManagerFactory interface. - local interface POAManagerFactory; -#endif - -#if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && ! defined (TAO_HAS_MINIMUM_POA) - // Forward declaration AdapterActivator interface. - local interface AdapterActivator; -#endif - -#if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - // Forward declaration servantManager interface. - local interface ServantManager; -#endif - - local interface POA - { -# pragma version POA 2.3 - -# if ! defined (CORBA_E_MICRO) - exception AdapterAlreadyExists {}; - exception AdapterNonExistent {}; - exception InvalidPolicy {unsigned short index;}; -#if !defined (TAO_HAS_MINIMUM_POA) - exception NoServant {}; -#endif - exception ObjectAlreadyActive {}; -# endif - exception ObjectNotActive {}; - exception ServantAlreadyActive {}; - exception ServantNotActive {}; - exception WrongAdapter {}; - exception WrongPolicy {}; - - -# if ! defined (CORBA_E_MICRO) - /// POA creation and destruction. - POA create_POA (in string adapter_name, - in POAManager a_POAManager, - in CORBA::PolicyList policies) - raises (AdapterAlreadyExists, - InvalidPolicy); - - POA find_POA (in string adapter_name, - in boolean activate_it) - raises (AdapterNonExistent); -#endif - - void destroy (in boolean etherealize_objects, - in boolean wait_for_completion); - - // Factories for Policy objects. - -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - ThreadPolicy create_thread_policy (in ThreadPolicyValue value); -#endif -# if ! defined (CORBA_E_MICRO) - LifespanPolicy create_lifespan_policy ( - in LifespanPolicyValue value - ); - - IdUniquenessPolicy create_id_uniqueness_policy ( - in IdUniquenessPolicyValue value - ); - - IdAssignmentPolicy create_id_assignment_policy ( - in IdAssignmentPolicyValue value - ); -#endif -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - ImplicitActivationPolicy create_implicit_activation_policy ( - in ImplicitActivationPolicyValue value - ); - - ServantRetentionPolicy create_servant_retention_policy ( - in ServantRetentionPolicyValue value - ); - - RequestProcessingPolicy create_request_processing_policy ( - in RequestProcessingPolicyValue value - ); -# endif - - // POA attributes - readonly attribute string the_name; - readonly attribute POA the_parent; -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - readonly attribute POAList the_children; -# endif - readonly attribute POAManager the_POAManager; -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) - readonly attribute POAManagerFactory the_POAManagerFactory; -#endif -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - attribute AdapterActivator the_activator; -# endif - -# if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - // Servant Manager registration: - - ServantManager get_servant_manager () - raises (WrongPolicy); - - void set_servant_manager (in ServantManager imgr) - raises (WrongPolicy); - - // Operations for the USE_DEFAULT_SERVANT policy. - - Servant get_servant () - raises (NoServant, - WrongPolicy); - - void set_servant (in Servant p_servant) - raises (WrongPolicy); -# endif - - // Object activation and deactivation. - - ObjectId activate_object (in Servant p_servant) - raises (ServantAlreadyActive, - WrongPolicy); - -#if !defined (CORBA_E_MICRO) - void activate_object_with_id (in ObjectId id, - in Servant p_servant) - raises (ServantAlreadyActive, - ObjectAlreadyActive, - WrongPolicy); -#endif - - void deactivate_object (in ObjectId oid) - raises (ObjectNotActive, WrongPolicy); - - // Reference creation operations. - - Object create_reference (in CORBA::RepositoryId intf) - raises (WrongPolicy); - - Object create_reference_with_id (in ObjectId oid, - in CORBA::RepositoryId intf); - - // Identity mapping operations:. - ObjectId servant_to_id (in Servant p_servant) - raises (ServantNotActive, - WrongPolicy); - - Object servant_to_reference (in Servant p_servant) - raises (ServantNotActive, WrongPolicy); - - Servant reference_to_servant (in Object reference) - raises (ObjectNotActive, - WrongAdapter, - WrongPolicy); - - ObjectId reference_to_id (in Object reference) - raises (WrongAdapter, - WrongPolicy); - - Servant id_to_servant (in ObjectId oid) - raises (ObjectNotActive, WrongPolicy); - - Object id_to_reference (in ObjectId oid) - raises (ObjectNotActive, - WrongPolicy); - - readonly attribute CORBA::OctetSeq id; - }; -}; - -#endif // _PORTABLE_SERVER_IDL_ diff --git a/TAO/tao/PortableServer/POAManager.cpp b/TAO/tao/PortableServer/POAManager.cpp deleted file mode 100644 index 26519a791ee..00000000000 --- a/TAO/tao/PortableServer/POAManager.cpp +++ /dev/null @@ -1,413 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/POAManager.h" -#include "tao/PortableServer/POAManagerFactory.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/poa_macros.h" -#include "tao/Server_Strategy_Factory.h" -#include "tao/ORB_Core.h" -#include "tao/IORInterceptor_Adapter.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/POAManager.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID (PortableServer, - POAManager, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_POA_Manager::TAO_POA_Manager ( - TAO_Object_Adapter &object_adapter, - const char * id, - const ::CORBA::PolicyList &policies, - PortableServer::POAManagerFactory_ptr poa_manager_factory) - : state_ (PortableServer::POAManager::HOLDING), - lock_ (object_adapter.lock ()), - poa_collection_ (), - object_adapter_ (object_adapter), - id_ (id == 0 ? this->generate_manager_id () : CORBA::string_dup (id)), -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - poa_manager_factory_ (* dynamic_cast <TAO_POAManager_Factory*> (poa_manager_factory)), -#endif - policies_ (policies) -{ -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - poa_manager_factory_._add_ref (); -#endif -} - -TAO_POA_Manager::~TAO_POA_Manager (void) -{ -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - poa_manager_factory_._remove_ref (); -#endif -} - -char * -TAO_POA_Manager::get_id (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->id_.in ()); -} - -void -TAO_POA_Manager::activate_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // This operation changes the state of the POA manager to active. If - // issued while the POA manager is in the inactive state, the - // AdapterInactive exception is raised. Entering the active state - // enables the associated POAs to process requests. - - if (this->state_ == PortableServer::POAManager::INACTIVE) - { - ACE_THROW (PortableServer::POAManager::AdapterInactive ()); - } - else - { - this->state_ = PortableServer::POAManager::ACTIVE; - // Find the poas that applied the custom servant dispatching - // strategy to launch the dispatching threads. - - for (POA_COLLECTION::iterator iterator = this->poa_collection_.begin (); - iterator != this->poa_collection_.end (); - ++iterator) - { - (*iterator)->poa_activated_hook (); - } - } - - this->adapter_manager_state_changed (this->state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_POA_Manager::deactivate_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Is the <wait_for_completion> semantics for this thread correct? - TAO_Root_POA::check_for_valid_wait_for_completions (this->object_adapter_.orb_core (), - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // This operation changes the state of the POA manager to - // inactive. If issued while the POA manager is in the inactive - // state, the AdapterInactive exception is raised. Entering the - // inactive state causes the associated POAs to reject requests that - // have not begun to be executed as well as any new requests. - - if (this->state_ == PortableServer::POAManager::INACTIVE) - { - ACE_THROW (PortableServer::POAManager::AdapterInactive ()); - } - else - { - this->state_ = PortableServer::POAManager::INACTIVE; - } - - // After changing the state, if the etherealize_objects parameter is: - // - // a) TRUE - the POA manager will cause all associated POAs that - // have the RETAIN and USE_SERVANT_MANAGER policies to perform the - // etherealize operation on the associated servant manager for all - // active objects. - // - // b) FALSE - the etherealize operation is not called. The purpose - // is to provide developers with a means to shut down POAs in a - // crisis (for example, unrecoverable error) situation. - - // If the wait_for_completion parameter is FALSE, this operation - // will return immediately after changing the state. If the - // parameter is TRUE and the current thread is not in an invocation - // context dispatched by some POA belonging to the same ORB as this - // POA, this operation does not return until there are no actively - // executing requests in any of the POAs associated with this POA - // manager (that is, all requests that were started prior to the - // state change have completed) and, in the case of a TRUE - // etherealize_objects, all invocations of etherealize have - // completed for POAs having the RETAIN and USE_SERVANT_MANAGER - // policies. If the parameter is TRUE and the current thread is in - // an invocation context dispatched by some POA belonging to the - // same ORB as this POA the BAD_INV_ORDER exception is raised and - // the state is not changed. - - for (POA_COLLECTION::iterator iterator = this->poa_collection_.begin (); - iterator != this->poa_collection_.end (); - ++iterator) - { - TAO_Root_POA *poa = *iterator; - // Notify the poas that applied the custom servant dispatching - // strategy to stop the dispatching threads. - poa->poa_deactivated_hook (); - - poa->deactivate_all_objects_i (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - // If the ORB::shutdown operation is called, it makes a call on - // deactivate with a TRUE etherealize_objects parameter for each POA - // manager known in the process; the wait_for_completion parameter - // to deactivate will be the same as the similarly named parameter - // of ORB::shutdown. - - this->adapter_manager_state_changed (this->state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_POA_Manager::adapter_manager_state_changed (PortableServer::POAManager::State state - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::AdapterState adapter_state = - static_cast<PortableInterceptor::AdapterState> (state); - - TAO_IORInterceptor_Adapter *ior_adapter = - this->object_adapter_.orb_core ().ior_interceptor_adapter (); - - if (ior_adapter) - { - ior_adapter->adapter_manager_state_changed (this->id_.in (), - adapter_state - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -} - -#if (TAO_HAS_MINIMUM_POA == 0) - -void -TAO_POA_Manager::hold_requests_i (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Is the <wait_for_completion> semantics for this thread correct? - TAO_Root_POA::check_for_valid_wait_for_completions (this->object_adapter_.orb_core (), - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // This operation changes the state of the POA manager to - // holding. If issued while the POA manager is in the inactive - // state, the AdapterInactive exception is raised. Entering the - // holding state causes the associated POAs to queue incoming - // requests. Any requests that have been queued but have not - // started executing will continue to be queued while in the holding - // state. - - if (this->state_ == PortableServer::POAManager::INACTIVE) - { - ACE_THROW (PortableServer::POAManager::AdapterInactive ()); - } - else - { - this->state_ = PortableServer::POAManager::HOLDING; - } - - // If the wait_for_completion parameter is FALSE, this operation - // returns immediately after changing the state. If the parameter is - // TRUE and the current thread is not in an invocation context - // dispatched by some POA belonging to the same ORB as this POA, - // this operation does not return until either there are no actively - // executing requests in any of the POAs associated with this POA - // manager (that is, all requests that were started prior to the - // state change have completed) or the state of the POA manager is - // changed to a state other than holding. If the parameter is TRUE - // and the current thread is in an invocation context dispatched by - // some POA belonging to the same ORB as this POA the BAD_INV_ORDER - // exception is raised and the state is not changed. - - if (wait_for_completion) - { - for (POA_COLLECTION::iterator iterator = this->poa_collection_.begin (); - iterator != this->poa_collection_.end (); - ++iterator) - { - TAO_Root_POA *poa = *iterator; - poa->wait_for_completions (wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - this->adapter_manager_state_changed (this->state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_POA_Manager::discard_requests_i (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Is the <wait_for_completion> semantics for this thread correct? - TAO_Root_POA::check_for_valid_wait_for_completions (this->object_adapter_.orb_core (), - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // This operation changes the state of the POA manager to - // discarding. If issued while the POA manager is in the inactive - // state, the AdapterInactive exception is raised. Entering the - // discarding state causes the associated POAs to discard incoming - // requests. In addition, any requests that have been queued but - // have not started executing are discarded. When a request is - // discarded, a TRANSIENT system exception is returned to the - // client. - - if (this->state_ == PortableServer::POAManager::INACTIVE) - { - ACE_THROW (PortableServer::POAManager::AdapterInactive ()); - } - else - { - this->state_ = PortableServer::POAManager::DISCARDING; - } - - // If the wait_for_completion parameter is FALSE, this operation - // returns immediately after changing the state. If the - // parameter is TRUE and the current thread is not in an - // invocation context dispatched by some POA belonging to the - // same ORB as this POA, this operation does not return until - // either there are no actively executing requests in any of the - // POAs associated with this POA manager (that is, all requests - // that were started prior to the state change have completed) - // or the state of the POA manager is changed to a state other - // than discarding. If the parameter is TRUE and the current - // thread is in an invocation context dispatched by some POA - // belonging to the same ORB as this POA the BAD_INV_ORDER - // exception is raised and the state is not changed. - - if (wait_for_completion) - { - for (POA_COLLECTION::iterator iterator = this->poa_collection_.begin (); - iterator != this->poa_collection_.end (); - ++iterator) - { - TAO_Root_POA *poa = *iterator; - poa->wait_for_completions (wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - this->adapter_manager_state_changed (this->state_ - ACE_ENV_ARG_PARAMETER); -} - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -int -TAO_POA_Manager::remove_poa (TAO_Root_POA *poa) -{ - int const result = this->poa_collection_.remove (poa); - - if (result == 0) - { - if (this->poa_collection_.is_empty ()) - { -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - this->poa_manager_factory_.remove_poamanager (this); -#endif - } - } - - return result; -} - -int -TAO_POA_Manager::register_poa (TAO_Root_POA *poa) -{ - return this->poa_collection_.insert (poa); -} - -void -TAO_POA_Manager::check_state (ACE_ENV_SINGLE_ARG_DECL) -{ - if (state_ == PortableServer::POAManager::ACTIVE) - { - // When a POA manager is in the active state, the associated - // POAs will receive and start processing requests (assuming - // that appropriate thread resources are available). - return; - } - - if (state_ == PortableServer::POAManager::DISCARDING) - { - // When a POA manager is in the discarding state, the associated - // POAs will discard all incoming requests (whose processing has - // not yet begun). When a request is discarded, the TRANSIENT - // system exception, with standard minor code 1, must be - // returned to the client-side to indicate that the request - // should be re-issued. (Of course, an ORB may always reject a - // request for other reasons and raise some other system - // exception.) - ACE_THROW ( - CORBA::TRANSIENT ( - CORBA::SystemException::_tao_minor_code ( - TAO_POA_DISCARDING, - 1), - CORBA::COMPLETED_NO)); - } - - if (state_ == PortableServer::POAManager::HOLDING) - { - // When a POA manager is in the holding state, the associated - // POAs will queue incoming requests. The number of requests - // that can be queued is an implementation limit. If this limit - // is reached, the POAs may discard requests and return the - // TRANSIENT system exception, with standard minor code 1, to - // the client to indicate that the client should reissue the - // request. (Of course, an ORB may always reject a request for - // other reasons and raise some other system exception.) - - // Since there is no queuing in TAO, we immediately raise a - // TRANSIENT exception. - ACE_THROW (CORBA::TRANSIENT ( - CORBA::SystemException::_tao_minor_code ( - TAO_POA_HOLDING, - 1), - CORBA::COMPLETED_NO)); - } - - if (state_ == PortableServer::POAManager::INACTIVE) - { - // The inactive state is entered when the associated POAs are to - // be shut down. Unlike the discarding state, the inactive state - // is not a temporary state. When a POA manager is in the - // inactive state, the associated POAs will reject new - // requests. The rejection mechanism used is specific to the - // vendor. The GIOP location forwarding mechanism and - // CloseConnection message are examples of mechanisms that could - // be used to indicate the rejection. If the client is - // co-resident in the same process, the ORB could raise the - // OBJ_ADAPTER system exception, with standard minor code 1, to - // indicate that the object implementation is unavailable. - ACE_THROW (CORBA::OBJ_ADAPTER ( - CORBA::SystemException::_tao_minor_code ( - TAO_POA_INACTIVE, - 1), - CORBA::COMPLETED_NO)); - } -} - -CORBA::ORB_ptr -TAO_POA_Manager::_get_orb (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return CORBA::ORB::_duplicate (this->object_adapter_.orb_core ().orb ()); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POAManager.h b/TAO/tao/PortableServer/POAManager.h deleted file mode 100644 index bf5d217f335..00000000000 --- a/TAO/tao/PortableServer/POAManager.h +++ /dev/null @@ -1,191 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POAManager.h - * - * $Id$ - * - * POAManager - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_POAMANAGER_H -#define TAO_POAMANAGER_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/poa_macros.h" -#include "tao/PortableServer/POAManagerC.h" - -// Local Object -#include "tao/LocalObject.h" -#include "tao/PI_ForwardC.h" -#include "ace/Unbounded_Set.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward decl. -class TAO_Root_POA; -class TAO_Object_Adapter; -class TAO_POAManager_Factory; - -namespace PortableServer -{ - class POAManagerFactory; - typedef POAManagerFactory *POAManagerFactory_ptr; -} - -class TAO_PortableServer_Export TAO_POA_Manager : - public PortableServer::POAManager, - public TAO_Local_RefCounted_Object -{ - friend class TAO_Root_POA; - friend class TAO_Object_Adapter; - -public: - - void activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - -#if (TAO_HAS_MINIMUM_POA == 0) - - void hold_requests (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - - void discard_requests (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - - void deactivate (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - PortableServer::POAManager::State get_state (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - char *get_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - TAO_POA_Manager (TAO_Object_Adapter &object_adapter, - const char * id, - const ::CORBA::PolicyList & policies, - PortableServer::POAManagerFactory_ptr poa_manager_factory); - - ~TAO_POA_Manager (void); - - /// Check the state of this POA manager - void check_state (ACE_ENV_SINGLE_ARG_DECL); - - PortableServer::POAManager::State get_state_i () - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual CORBA::ORB_ptr _get_orb ( - ACE_ENV_SINGLE_ARG_DECL - ); - - CORBA::PolicyList& get_policies (); - -protected: - - void activate_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - - void deactivate_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - - /// Method needed for notifying the IORInterceptors that the state - /// of POAManager changed. - void adapter_manager_state_changed (PortableServer::POAManager::State state - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - -#if (TAO_HAS_MINIMUM_POA == 0) - - void hold_requests_i (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - - void discard_requests_i (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)); - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Lock &lock (void); - - int remove_poa (TAO_Root_POA *poa); - - int register_poa (TAO_Root_POA *poa); - -protected: - - PortableServer::POAManager::State state_; - - ACE_Lock &lock_; - - typedef ACE_Unbounded_Set<TAO_Root_POA *> POA_COLLECTION; - - POA_COLLECTION poa_collection_; - - TAO_Object_Adapter &object_adapter_; - - CORBA::String_var id_; - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - TAO_POAManager_Factory& poa_manager_factory_; -#endif - - CORBA::PolicyList policies_; - -private : - - /** - * Generate an id for this POAManager. - * @return A value that uniquely identifies the POAManager within a - * given process. - * @note: The id_ has the ownership of the memory allocated in this method. - */ - char* generate_manager_id (void) const; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/POAManager.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* TAO_POAMANAGER_H */ diff --git a/TAO/tao/PortableServer/POAManager.i b/TAO/tao/PortableServer/POAManager.i deleted file mode 100644 index 5dad4c14de5..00000000000 --- a/TAO/tao/PortableServer/POAManager.i +++ /dev/null @@ -1,137 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "tao/Environment.h" -#include "tao/SystemException.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE ACE_Lock & -TAO_POA_Manager::lock (void) -{ - return this->lock_; -} - -ACE_INLINE void -TAO_POA_Manager::activate (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Lock access to the POAManager for the duration of this transaction - TAO_OBJECT_ADAPTER_GUARD; - - this->activate_i (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -#if (TAO_HAS_MINIMUM_POA == 0) - -ACE_INLINE void -TAO_POA_Manager::hold_requests (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Lock access to the POAManager for the duration of this transaction - TAO_OBJECT_ADAPTER_GUARD; - - this->hold_requests_i (wait_for_completion ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE void -TAO_POA_Manager::discard_requests (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Lock access to the POAManager for the duration of this transaction - TAO_OBJECT_ADAPTER_GUARD; - - this->discard_requests_i (wait_for_completion ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE void -TAO_POA_Manager::deactivate (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POAManager::AdapterInactive)) -{ - // Lock access to the POAManager for the duration of this transaction - TAO_OBJECT_ADAPTER_GUARD; - - this->deactivate_i (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); -} - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -ACE_INLINE PortableServer::POAManager::State -TAO_POA_Manager::get_state_i (void) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->state_; -} - -ACE_INLINE PortableServer::POAManager::State -TAO_POA_Manager::get_state (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Lock access to the POAManager for the duration of this transaction - TAO_OBJECT_ADAPTER_GUARD_RETURN (this->state_); - - return this->get_state_i (); -} - -ACE_INLINE char* -TAO_POA_Manager::generate_manager_id (void) const -{ - // The AdapterManagerId must be unique across all Adapter Managers - // (e.g. POAManagers) within a given process. To avoid locking - // overhead, the address of the POAManager object is used as the - // AdapterManagerId. This guarantees that the AdapterManagerId is - // unique. - // - // For 64-bit platforms, only the lower 32 bits are used. Hopefully - // that will be enough to ensure uniqueness. - - // This is basically the same trick used in - // TAO_GIOP_Invocation::generate_request_id(). However, no right - // shifting of 64 bit addresses is performed since the - // TAO_POA_Manager object is not large enough to allow that trick. - - CORBA::Long id = 0; - - // Note that we reinterpret_cast to an "unsigned long" instead of - // CORBA::ULong since we need to first cast to an integer large - // enough to hold an address to avoid compile-time warnings on some - // 64-bit platforms. - - if (sizeof (this) == 4) // 32 bit address - id = reinterpret_cast <ptrdiff_t> (this); - - else if (sizeof (this) == 8) // 64 bit address -- use lower 32 bits - id = reinterpret_cast <ptrdiff_t> (this) & 0xFFFFFFFFu; - - // @@ If we ever hit a platform where neither of the above cases are - // satisfied, we're up the creek! - -// else -// // Fallback on an atomically incremented variable specific to the -// // ORB, or perhaps specific to the process. -// id = ...GENERATE_ID_ATOMICALLY...; // Fallback - - char* buf = new char [25]; - ACE_OS::sprintf (buf, "POAManager%d", id); - return buf; -} - -ACE_INLINE -CORBA::PolicyList& TAO_POA_Manager::get_policies () -{ - return this->policies_; -} - - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POAManager.pidl b/TAO/tao/PortableServer/POAManager.pidl deleted file mode 100644 index 05f2e737550..00000000000 --- a/TAO/tao/PortableServer/POAManager.pidl +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file POAManager.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_POA_MANAGER_IDL_ -#define _PORTABLESERVER_POA_MANAGER_IDL_ - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - // POAManager interface - local interface POAManager - { - exception AdapterInactive {}; - - enum State - { - HOLDING, - ACTIVE, - DISCARDING, - INACTIVE - }; - - void activate () - raises(AdapterInactive); - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - void hold_requests (in boolean wait_for_completion) - raises(AdapterInactive); - - void discard_requests (in boolean wait_for_completion) - raises(AdapterInactive); - - void deactivate (in boolean etherealize_objects, - in boolean wait_for_completion) - raises(AdapterInactive); -#endif - - State get_state (); - - string get_id(); - }; -}; - -#endif // _PORTABLESERVER_POA_MANAGER_IDL_ diff --git a/TAO/tao/PortableServer/POAManagerFactory.cpp b/TAO/tao/PortableServer/POAManagerFactory.cpp deleted file mode 100644 index 49c02bf3808..00000000000 --- a/TAO/tao/PortableServer/POAManagerFactory.cpp +++ /dev/null @@ -1,165 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/POAManagerFactory.h" -#include "tao/PortableServer/POAManager.h" -#include "tao/EndpointPolicy/EndpointPolicyTypeC.h" - -#include "ace/OS_NS_string.h" - -ACE_RCSID (PortableServer, - POAManagerFactory, - "$Id$") - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_POAManager_Factory::TAO_POAManager_Factory (TAO_Object_Adapter &object_adapter) : - object_adapter_ (object_adapter) -{ -} - -TAO_POAManager_Factory::~TAO_POAManager_Factory (void) -{ - for (POAMANAGERSET::iterator iterator = this->poamanager_set_.begin (); - iterator != this->poamanager_set_.end (); - ++iterator) - { - ::PortableServer::POAManager_ptr poamanager = (*iterator); - CORBA::release (poamanager); - } -} - -::PortableServer::POAManager_ptr -TAO_POAManager_Factory::create_POAManager ( - const char * id, - const ::CORBA::PolicyList & policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - ::PortableServer::POAManagerFactory::ManagerAlreadyExists, - ::CORBA::PolicyError)) -{ - if (policies.length () > 1 - || (policies.length () == 1 && - policies[0]->policy_type () != EndpointPolicy::ENDPOINT_POLICY_TYPE)) - { - ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY), - ::PortableServer::POAManager::_nil ()); - } - - PortableServer::POAManager_var poamanager = - PortableServer::POAManager::_nil (); - if (id != 0) - { - poamanager = this->find (id ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (::PortableServer::POAManager::_nil ()); - - // If we already have a manager with the same name throw an exception - if (!CORBA::is_nil (poamanager.in())) - { - ACE_THROW_RETURN ( - ::PortableServer::POAManagerFactory::ManagerAlreadyExists (), - ::PortableServer::POAManager::_nil ()); - } - } - - // this indirection brought to you by borland's compiler and its refusal - // to directly assign the newly created TAO_POA_Manager to a POAManager_var. - { - PortableServer::POAManager_ptr pm = 0; - ACE_NEW_THROW_EX (pm, - TAO_POA_Manager (object_adapter_, id, policies, this), - CORBA::NO_MEMORY - (CORBA::SystemException::_tao_minor_code (0, ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (::PortableServer::POAManager::_nil ()); - poamanager = pm; - } - - this->register_poamanager (poamanager.in ()); - - return PortableServer::POAManager::_duplicate (poamanager.in ()); -} - -::PortableServer::POAManagerFactory::POAManagerSeq * -TAO_POAManager_Factory::list ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ::PortableServer::POAManagerFactory::POAManagerSeq_var poamanagers; - CORBA::ULong number_of_poamanagers = static_cast <CORBA::ULong> - (this->poamanager_set_.size ()); - ACE_NEW_THROW_EX (poamanagers, - PortableServer::POAManagerFactory::POAManagerSeq ( - number_of_poamanagers), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - poamanagers->length (number_of_poamanagers); - - CORBA::ULong index = 0; - for (POAMANAGERSET::iterator iterator = this->poamanager_set_.begin (); - iterator != this->poamanager_set_.end (); - ++iterator, ++index) - { - ::PortableServer::POAManager_ptr poamanager = (*iterator); - poamanagers[index] = - PortableServer::POAManager::_duplicate (poamanager); - } - - return poamanagers._retn (); -} - -::PortableServer::POAManager_ptr -TAO_POAManager_Factory::find ( - const char * id ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ::PortableServer::POAManager_ptr poamanager = - ::PortableServer::POAManager::_nil(); - - for (POAMANAGERSET::iterator iterator = this->poamanager_set_.begin (); - iterator != this->poamanager_set_.end (); - ++iterator) - { - CORBA::String_var poamanagerid = - (*iterator)->get_id (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (::PortableServer::POAManager::_nil()); - - if (ACE_OS::strcmp (id, poamanagerid.in()) == 0) - { - poamanager = PortableServer::POAManager::_duplicate (*iterator); - break; - } - } - - return poamanager; -} - -int -TAO_POAManager_Factory::remove_poamanager ( - ::PortableServer::POAManager_ptr poamanager) -{ - int retval = 0; - retval = this->poamanager_set_.remove (poamanager); - - if (retval == 0) - { - CORBA::release (poamanager); - } - - return retval; -} - -int -TAO_POAManager_Factory::register_poamanager ( - ::PortableServer::POAManager_ptr poamanager) -{ - return this->poamanager_set_.insert ( - PortableServer::POAManager::_duplicate (poamanager)); -} - - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif diff --git a/TAO/tao/PortableServer/POAManagerFactory.h b/TAO/tao/PortableServer/POAManagerFactory.h deleted file mode 100644 index ab2b6da2b19..00000000000 --- a/TAO/tao/PortableServer/POAManagerFactory.h +++ /dev/null @@ -1,87 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POAManagerFactory.h - * - * $Id$ - * - * POAManagerFactory - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_POAMANAGERFACTORY_H -#define TAO_POAMANAGERFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/POAManagerFactoryC.h" -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/LocalObject.h" -#include "ace/Unbounded_Set.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_PortableServer_Export TAO_POAManager_Factory : - public ::PortableServer::POAManagerFactory, - public TAO_Local_RefCounted_Object -{ -public: - TAO_POAManager_Factory (TAO_Object_Adapter &object_adapter); - - virtual ~TAO_POAManager_Factory (void); - - virtual ::PortableServer::POAManager_ptr create_POAManager ( - const char * id, - const ::CORBA::PolicyList & policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - ::PortableServer::POAManagerFactory::ManagerAlreadyExists, - ::CORBA::PolicyError)); - - virtual ::PortableServer::POAManagerFactory::POAManagerSeq * list ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::PortableServer::POAManager_ptr find ( - const char * id ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - int remove_poamanager (::PortableServer::POAManager_ptr poamanager); - - int register_poamanager (::PortableServer::POAManager_ptr poamanager); - -private: - TAO_Object_Adapter &object_adapter_; - - typedef ACE_Unbounded_Set < ::PortableServer::POAManager_ptr> POAMANAGERSET; - - POAMANAGERSET poamanager_set_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_POAMANAGERFACTORY_H */ diff --git a/TAO/tao/PortableServer/POAManagerFactory.pidl b/TAO/tao/PortableServer/POAManagerFactory.pidl deleted file mode 100644 index 56d5315bcba..00000000000 --- a/TAO/tao/PortableServer/POAManagerFactory.pidl +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file POAManagerFactory.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - $ACE_ROOT/bin/tao_idl \ - -Gp -Gd -Ge 1 -Sci -I$TAO_ROOT \ - -Wb,export_macro=TAO_PortableServer_Export \ - -Wb,export_include="tao/PortableServer/portableserver_export.h" \ - -Wb,pre_include="ace/pre.h" \ - -Wb,post_include="ace/post.h" \ - POAManagerFactory.pidl - */ - -#ifndef _PORTABLESERVER_POAMANAGER_FACTORY_IDL -#define _PORTABLESERVER_POAMANAGER_FACTORY_IDL - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -module PortableServer -{ -# pragma version PortableServer 2.3 - - local interface POAManager; - - local interface POAManagerFactory - { - typedef sequence<POAManager> POAManagerSeq; - - exception ManagerAlreadyExists {}; - - POAManager create_POAManager( - in string id, - in CORBA::PolicyList policies - ) raises(ManagerAlreadyExists, CORBA::PolicyError); - - POAManagerSeq list(); - - POAManager find(in string id); - }; -}; - -#endif - -#endif // _PORTABLESERVER_POAMANAGER_FACTORY_IDL diff --git a/TAO/tao/PortableServer/POA_Cached_Policies.cpp b/TAO/tao/PortableServer/POA_Cached_Policies.cpp deleted file mode 100644 index beff73439c1..00000000000 --- a/TAO/tao/PortableServer/POA_Cached_Policies.cpp +++ /dev/null @@ -1,174 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/POA_Cached_Policies.h" -#include "tao/PortableServer/POA_Policy_Set.h" -#include "tao/PortableServer/IdAssignmentPolicyC.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" -#include "tao/PortableServer/ImplicitActivationPolicyC.h" -#include "tao/PortableServer/LifespanPolicyC.h" -#include "tao/PortableServer/RequestProcessingPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" -#include "tao/PortableServer/ThreadPolicyC.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/POA_Cached_Policies.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID(PortableServer, - POA_Cached_Policies, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - Cached_Policies::Cached_Policies () : - thread_ (::PortableServer::ORB_CTRL_MODEL), - lifespan_ (::PortableServer::TRANSIENT), - id_uniqueness_ (::PortableServer::UNIQUE_ID), - id_assignment_ (::PortableServer::SYSTEM_ID), - implicit_activation_ (::PortableServer::NO_IMPLICIT_ACTIVATION), - servant_retention_ (::PortableServer::RETAIN), - request_processing_ (::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY), - priority_model_ (Cached_Policies::NOT_SPECIFIED), - server_priority_ (TAO_INVALID_PRIORITY) - { - } - - - Cached_Policies::~Cached_Policies (void) - { - } - - void - Cached_Policies::update (TAO_POA_Policy_Set &policy_set - ACE_ENV_ARG_DECL) - { - for (CORBA::ULong i = 0; i < policy_set.num_policies (); i++) - { - CORBA::Policy_var policy = policy_set.get_policy_by_index (i); - - this->update_policy (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - void - Cached_Policies::update_policy (const CORBA::Policy_ptr policy - ACE_ENV_ARG_DECL) - { - - #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ::PortableServer::ThreadPolicy_var thread - = ::PortableServer::ThreadPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (thread.in ())) - { - this->thread_ = thread->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - #endif /* TAO_HAS_MINIMUM_POA == 0 */ - - #if !defined (CORBA_E_MICRO) - ::PortableServer::LifespanPolicy_var lifespan - = ::PortableServer::LifespanPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (lifespan.in ())) - { - this->lifespan_ = lifespan->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - #endif - - #if !defined (CORBA_E_MICRO) - ::PortableServer::IdUniquenessPolicy_var id_uniqueness - = ::PortableServer::IdUniquenessPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (id_uniqueness.in ())) - { - this->id_uniqueness_ = id_uniqueness->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - #endif - - #if !defined (CORBA_E_MICRO) - ::PortableServer::IdAssignmentPolicy_var id_assignment - = ::PortableServer::IdAssignmentPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (id_assignment.in ())) - { - this->id_assignment_ = id_assignment->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - #endif - - #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - - ::PortableServer::ImplicitActivationPolicy_var implicit_activation - = ::PortableServer::ImplicitActivationPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (implicit_activation.in ())) - { - this->implicit_activation_ = implicit_activation->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - - ::PortableServer::ServantRetentionPolicy_var servant_retention - = ::PortableServer::ServantRetentionPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (servant_retention.in ())) - { - this->servant_retention_ = servant_retention->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - - ::PortableServer::RequestProcessingPolicy_var request_processing - = ::PortableServer::RequestProcessingPolicy::_narrow (policy - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (!CORBA::is_nil (request_processing.in ())) - { - this->request_processing_ = request_processing->value (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - return; - } - - #endif /* TAO_HAS_MINIMUM_POA == 0 */ - - #if defined (CORBA_E_MICRO) - ACE_UNUSED_ARG (policy); - #endif - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Cached_Policies.h b/TAO/tao/PortableServer/POA_Cached_Policies.h deleted file mode 100644 index a756f101782..00000000000 --- a/TAO/tao/PortableServer/POA_Cached_Policies.h +++ /dev/null @@ -1,114 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POA_Cached_Policies.h - * - * $Id$ - * - * POA - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_POA_CACHED_POLICIES_H -#define TAO_POA_CACHED_POLICIES_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadPolicyC.h" -#include "tao/PortableServer/LifespanPolicyC.h" -#include "tao/PortableServer/IdUniquenessPolicyC.h" -#include "tao/PortableServer/IdAssignmentPolicyC.h" -#include "tao/PortableServer/ImplicitActivationPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" -#include "tao/PortableServer/RequestProcessingPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward references. -class TAO_POA_Policy_Set; - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export Cached_Policies - { - public: - - enum PriorityModel - { - CLIENT_PROPAGATED, - SERVER_DECLARED, - NOT_SPECIFIED - }; - - Cached_Policies (); - - ~Cached_Policies (void); - - /// Update the cached policy values. - void update (TAO_POA_Policy_Set &policy_set - ACE_ENV_ARG_DECL); - - /** - * @name Accessor methods to cached values. - */ - //@{ - ::PortableServer::ThreadPolicyValue thread (void) const; - ::PortableServer::LifespanPolicyValue lifespan (void) const; - ::PortableServer::IdUniquenessPolicyValue id_uniqueness (void) const; - ::PortableServer::IdAssignmentPolicyValue id_assignment (void) const; - ::PortableServer::ImplicitActivationPolicyValue implicit_activation (void) const; - ::PortableServer::ServantRetentionPolicyValue servant_retention (void) const; - ::PortableServer::RequestProcessingPolicyValue request_processing (void) const; - PriorityModel priority_model (void) const; - CORBA::Short server_priority (void) const; - - void priority_model (PriorityModel priority_model); - void server_priority (CORBA::Short priority); - void implicit_activation (::PortableServer::ImplicitActivationPolicyValue value); - //@} - - protected: - - /// Helper method to update a particular policy. - void update_policy (const CORBA::Policy_ptr policy - ACE_ENV_ARG_DECL); - - ::PortableServer::ThreadPolicyValue thread_; - - ::PortableServer::LifespanPolicyValue lifespan_; - - ::PortableServer::IdUniquenessPolicyValue id_uniqueness_; - - ::PortableServer::IdAssignmentPolicyValue id_assignment_; - - ::PortableServer::ImplicitActivationPolicyValue implicit_activation_; - - ::PortableServer::ServantRetentionPolicyValue servant_retention_; - - ::PortableServer::RequestProcessingPolicyValue request_processing_; - - PriorityModel priority_model_; - - CORBA::Short server_priority_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/POA_Cached_Policies.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* TAO_POA_CACHED_POLICIES_H */ diff --git a/TAO/tao/PortableServer/POA_Cached_Policies.i b/TAO/tao/PortableServer/POA_Cached_Policies.i deleted file mode 100644 index b3699fe3e7d..00000000000 --- a/TAO/tao/PortableServer/POA_Cached_Policies.i +++ /dev/null @@ -1,85 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ACE_INLINE ::PortableServer::ThreadPolicyValue - Cached_Policies::thread (void) const - { - return this->thread_; - } - - ACE_INLINE ::PortableServer::LifespanPolicyValue - Cached_Policies::lifespan (void) const - { - return this->lifespan_; - } - - ACE_INLINE ::PortableServer::IdUniquenessPolicyValue - Cached_Policies::id_uniqueness (void) const - { - return this->id_uniqueness_; - } - - ACE_INLINE ::PortableServer::IdAssignmentPolicyValue - Cached_Policies::id_assignment (void) const - { - return this->id_assignment_; - } - - ACE_INLINE ::PortableServer::ImplicitActivationPolicyValue - Cached_Policies::implicit_activation (void) const - { - return this->implicit_activation_; - } - - ACE_INLINE ::PortableServer::ServantRetentionPolicyValue - Cached_Policies::servant_retention (void) const - { - return this->servant_retention_; - } - - ACE_INLINE ::PortableServer::RequestProcessingPolicyValue - Cached_Policies::request_processing (void) const - { - return this->request_processing_; - } - - ACE_INLINE Cached_Policies::PriorityModel - Cached_Policies::priority_model (void) const - { - return this->priority_model_; - } - - ACE_INLINE CORBA::Short - Cached_Policies::server_priority (void) const - { - return this->server_priority_; - } - - ACE_INLINE void - Cached_Policies::priority_model (PriorityModel priority_model) - { - this->priority_model_ = priority_model; - } - - ACE_INLINE void - Cached_Policies::server_priority (CORBA::Short priority) - { - this->server_priority_ = priority; - } - - ACE_INLINE void - Cached_Policies::implicit_activation (PortableServer::ImplicitActivationPolicyValue value) - { - this->implicit_activation_ = value; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Current.cpp b/TAO/tao/PortableServer/POA_Current.cpp deleted file mode 100644 index a1e30c3faed..00000000000 --- a/TAO/tao/PortableServer/POA_Current.cpp +++ /dev/null @@ -1,94 +0,0 @@ -// $Id$ - -// -- PortableServer Include -- -#include "tao/PortableServer/POA_Current.h" -#include "tao/PortableServer/POA_Current_Impl.h" - -// -- TAO Include -- -#include "tao/TSS_Resources.h" - -ACE_RCSID (PortableServer, - POA_Current, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - PortableServer::POA_ptr - POA_Current::get_POA (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)) - { - POA_Current_Impl *impl = this->implementation (); - - if (impl == 0) - ACE_THROW_RETURN (PortableServer::Current::NoContext (), - 0); - return impl->get_POA (); - } - - PortableServer::ObjectId * - POA_Current::get_object_id (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)) - { - POA_Current_Impl *impl = this->implementation (); - - if (impl == 0) - ACE_THROW_RETURN (PortableServer::Current::NoContext (), - 0); - return impl->get_object_id (); - } - - PortableServer::Servant - POA_Current::get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)) - { - POA_Current_Impl *impl = this->implementation (); - - if (impl == 0) - ACE_THROW_RETURN (PortableServer::Current::NoContext (), - 0); - return impl->get_servant (); - } - - CORBA::Object_ptr - POA_Current::get_reference (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)) - { - POA_Current_Impl *impl = this->implementation (); - - if (impl == 0) - ACE_THROW_RETURN (PortableServer::Current::NoContext (), - 0); - return impl->get_reference (); - } - - POA_Current_Impl * - POA_Current::implementation (void) - { - return static_cast <POA_Current_Impl *> - (TAO_TSS_Resources::instance ()->poa_current_impl_); - } - - POA_Current_Impl * - POA_Current::implementation (POA_Current_Impl *new_current) - { - TAO_TSS_Resources *tss = - TAO_TSS_Resources::instance (); - - POA_Current_Impl *old = - static_cast <POA_Current_Impl *> - (tss->poa_current_impl_); - tss->poa_current_impl_ = new_current; - return old; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Current.h b/TAO/tao/PortableServer/POA_Current.h deleted file mode 100644 index 4af15a2b241..00000000000 --- a/TAO/tao/PortableServer/POA_Current.h +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POA_Current.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_POA_CURRENT_H -#define TAO_POA_CURRENT_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PS_CurrentC.h" -#include "tao/LocalObject.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class POA_Current_Impl; - - class TAO_PortableServer_Export POA_Current - : public PortableServer::Current - , public TAO_Local_RefCounted_Object - { - public: - - /** - * Returns the POA on which the current request is being invoked. - * Can raise the @c NoContext exception if this function is - * not invoked in the context of an upcall. - */ - PortableServer::POA_ptr get_POA (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)); - - /** - * Returns the object id of the current request being invoked. Can - * raise the @c NoContext exception if this function is not - * invoked in the context of an upcall. - */ - PortableServer::ObjectId *get_object_id (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)); - - /** - * This operation returns a locally manufactured reference to the object - * in the context of which it is called. If called outside the context - * of a POA dispatched operation, a NoContext exception is raised. - * @note This reference is not guaranteed to be identical to the original - * reference the client used to make the invocation, and calling the - * Object::is_equivalent operation to compare the two references may not - * necessarily return true. - */ - CORBA::Object_ptr get_reference (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)); - - /** - * Returns a reference to the servant that hosts the object in whose - * context it is called. If called outside the context of the POA - * dispatched operation, a NoContext exception is raised - */ - PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::Current::NoContext)); - - /// Returns the class that implements this interface. - POA_Current_Impl *implementation (void); - - /// Sets the thread-specific pointer to the new POA Current state, - /// returning a pointer to the existing POA Current state. - POA_Current_Impl *implementation (POA_Current_Impl *new_current); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" - -#endif /* TAO_POA_CURRENT_H */ diff --git a/TAO/tao/PortableServer/POA_Current_Factory.cpp b/TAO/tao/PortableServer/POA_Current_Factory.cpp deleted file mode 100644 index 081147aad3c..00000000000 --- a/TAO/tao/PortableServer/POA_Current_Factory.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/POA_Current_Factory.h" -#include "tao/PortableServer/POA_Current.h" -#include "tao/ORB_Core.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -CORBA::Object_ptr -TAO_POA_Current_Factory::create_object (CORBA::ORB_ptr, - int, - ACE_TCHAR * [] - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::POA_Current* adapter = 0; - ACE_NEW_RETURN (adapter, - TAO::Portable_Server::POA_Current (), - 0); - return adapter; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_DEFINE (TAO_PortableServer, TAO_POA_Current_Factory) -ACE_STATIC_SVC_DEFINE (TAO_POA_Current_Factory, - ACE_TEXT ("TAO_POA_Current_Factory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (TAO_POA_Current_Factory), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - diff --git a/TAO/tao/PortableServer/POA_Current_Factory.h b/TAO/tao/PortableServer/POA_Current_Factory.h deleted file mode 100644 index 6ef224d32fd..00000000000 --- a/TAO/tao/PortableServer/POA_Current_Factory.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POA_Current_Factory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_POA_CURRENT_FACTORY_H -#define TAO_POA_CURRENT_FACTORY_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Object_Loader.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_PortableServer_Export TAO_POA_Current_Factory - : public TAO_Object_Loader -{ -public: - - /// Creates a PICurrent and returns it. - virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb, - int argc, - ACE_TCHAR *argv [] - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE (TAO_POA_Current_Factory) -ACE_FACTORY_DECLARE (TAO_PortableServer, TAO_POA_Current_Factory) - -#include /**/ "ace/post.h" - -#endif /* TAO_OBJECT_ADAPTER_FACTORY_H */ diff --git a/TAO/tao/PortableServer/POA_Current_Impl.cpp b/TAO/tao/PortableServer/POA_Current_Impl.cpp deleted file mode 100644 index eab3e4d0e4f..00000000000 --- a/TAO/tao/PortableServer/POA_Current_Impl.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// $Id$ - -// -- PortableServer Include -- -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/PortableServer/POA_Current_Impl.h" -#include "tao/PortableServer/Root_POA.h" - -#include "tao/TSS_Resources.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/POA_Current_Impl.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID (PortableServer, - POA_Current_IMpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - POA_Current_Impl::POA_Current_Impl (void) - : poa_ (0), - object_id_ (TAO_POA_OBJECT_ID_BUF_SIZE, 0, object_id_buf_), - object_key_ (0), - servant_ (0), - priority_ (TAO_INVALID_PRIORITY), - previous_current_impl_ (0), - setup_done_ (0) - { - } - - void - POA_Current_Impl::setup (::TAO_Root_POA *p, - const TAO::ObjectKey &key) - { - // Remember information about this upcall. - this->poa_ = p; - this->object_key_ = &key; - - // Set the current context and remember the old one. - this->tss_resources_ = TAO_TSS_Resources::instance (); - - this->previous_current_impl_ = - static_cast <POA_Current_Impl *> - (this->tss_resources_->poa_current_impl_); - this->tss_resources_->poa_current_impl_ = this; - - // Setup is complete. - this->setup_done_ = 1; - } - - POA_Current_Impl * - POA_Current_Impl::previous (void) const - { - return this->previous_current_impl_; - } - - void - POA_Current_Impl::teardown (void) - { - if (this->setup_done_) - { - // Reset the old context. - this->tss_resources_->poa_current_impl_ = this->previous_current_impl_; - } - } - - PortableServer::POA_ptr - POA_Current_Impl::get_POA (void) - { - return PortableServer::POA::_duplicate (this->poa_); - } - - PortableServer::ObjectId * - POA_Current_Impl::get_object_id (void) - { - PortableServer::ObjectId *objid = 0; - - // Create a new one and pass it back - ACE_NEW_RETURN (objid, - PortableServer::ObjectId (this->object_id_), - 0); - return objid; - } - - CORBA::Object_ptr - POA_Current_Impl::get_reference (void) - { - return this->poa_->id_to_reference (this->object_id_); - } - - PortableServer::Servant - POA_Current_Impl::get_servant (void) - { - return this->servant_; - } - - TAO_ORB_Core & - POA_Current_Impl::orb_core (void) const - - { - return this->poa_->orb_core (); - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Current_Impl.h b/TAO/tao/PortableServer/POA_Current_Impl.h deleted file mode 100644 index c14df79916d..00000000000 --- a/TAO/tao/PortableServer/POA_Current_Impl.h +++ /dev/null @@ -1,194 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POA_Current_Impl.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_POA_CURRENT_IMPL_H -#define TAO_POA_CURRENT_IMPL_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PS_ForwardC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -#ifndef TAO_POA_OBJECT_ID_BUF_SIZE -#define TAO_POA_OBJECT_ID_BUF_SIZE 512 -#endif /* TAO_POA_OBJECT_ID_BUF_SIZE */ - -namespace TAO -{ - namespace Portable_Server - { - class Non_Servant_Upcall; - class Servant_Upcall; - } - - class ObjectKey; -} - -class TAO_TSS_Resources; - -namespace TAO -{ - namespace Portable_Server - { - /** - * @class POA_Current_Impl - * - * @brief Implementation of the PortableServer::Current object. - * - * Objects of this class hold state information regarding the - * current POA invocation. Savvy readers will notice that this - * contains substantially more methods than the POA spec shows; - * they exist because the ORB either (a) needs them or (b) finds - * them useful for implementing a more efficient ORB. - * The intent is that instances of this class are held in - * Thread-Specific Storage so that upcalls can get context - * information regarding their invocation. The POA itself must - * insure that all <set_*> operations are performed in the - * execution thread so that the proper <TAO_POA_Current> pointer - * is obtained from TSS. - */ - class TAO_PortableServer_Export POA_Current_Impl - { - public: - friend class ::TAO_Root_POA; - - /// Return pointer to the invoking POA. Raises the - /// <CORBA::NoContext> exception. - PortableServer::POA_ptr get_POA (void); - - /** - * Return pointer to the object id through which this was invoked. - * This may be necessary in cases where a <Servant> is serving under - * the guise of multiple object ids. - */ - PortableServer::ObjectId *get_object_id (void); - - /** - * Returns a reference to the servant that hosts the object in whose - * context it is called. - */ - PortableServer::Servant get_servant (void); - - /** - * This operation returns a locally manufactured reference to the object - * in the context of which it is called. - */ - CORBA::Object_ptr get_reference (void); - - /// Set the POA implementation. - void poa (::TAO_Root_POA *); - - /// Get the POA implemantation - ::TAO_Root_POA *poa (void) const; - - /// ORB Core for this current. - TAO_ORB_Core &orb_core (void) const; - - /// Set the object ID. - void object_id (const PortableServer::ObjectId &id); - - /// Get the object ID. - const PortableServer::ObjectId &object_id (void) const; - - /// Just replace the object id smartly - void replace_object_id (const PortableServer::ObjectId &system_id); - - /// Set the object key. - void object_key (const TAO::ObjectKey &key); - - /// Get the object key. - const TAO::ObjectKey &object_key (void) const; - - /// Set the servant for the current upcall. - void servant (PortableServer::Servant servant); - - /// Get the servant for the current upcall. - PortableServer::Servant servant (void) const; - - /// Set the priority for the current upcall. - void priority (CORBA::Short priority); - - /// Get the priority for the current upcall. - CORBA::Short priority (void) const; - - /// Convenience constructor combining construction & initialization. - POA_Current_Impl (void); - - /// Return the previous current implementation. - POA_Current_Impl *previous (void) const; - - /// Teardown the current for this request. - void teardown (void); - - /// Setup the current. - void setup (::TAO_Root_POA *impl, - const TAO::ObjectKey &key); - - private: - - // = Hidden because we don't allow these - POA_Current_Impl (const POA_Current_Impl &); - void operator= (const POA_Current_Impl &); - - protected: - /// The POA implementation invoking an upcall - ::TAO_Root_POA *poa_; - - /// In order to avoid memory allocations, we will populate - /// the object id with this buffer. - CORBA::Octet object_id_buf_[TAO_POA_OBJECT_ID_BUF_SIZE]; - - /** - * The object ID of the current context. This is the user id and - * not the id the goes into the IOR. Note also that unlike the - * <object_key>, this field is stored by value. - */ - PortableServer::ObjectId object_id_; - - /// The object key of the current context. - const TAO::ObjectKey *object_key_; - - /// The servant for the current upcall. - PortableServer::Servant servant_; - - /// The priority for the current upcall. - CORBA::Short priority_; - - /// Current previous from <this>. - POA_Current_Impl *previous_current_impl_; - - /// Is setup complete? - int setup_done_; - - /// Pointer to tss resources. - TAO_TSS_Resources *tss_resources_; - - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/POA_Current_Impl.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_POA_CURRENT_IMPL_H */ diff --git a/TAO/tao/PortableServer/POA_Current_Impl.inl b/TAO/tao/PortableServer/POA_Current_Impl.inl deleted file mode 100644 index cf3fee49d65..00000000000 --- a/TAO/tao/PortableServer/POA_Current_Impl.inl +++ /dev/null @@ -1,103 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "tao/SystemException.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ACE_INLINE void - POA_Current_Impl::poa (::TAO_Root_POA *p) - { - this->poa_ = p; - } - - ACE_INLINE ::TAO_Root_POA * - POA_Current_Impl::poa (void) const - { - return this->poa_; - } - - ACE_INLINE void - POA_Current_Impl::object_id (const PortableServer::ObjectId &id) - { - if (this->object_id_.release () || - this->object_id_.get_buffer() == this->object_id_buf_) - { - // Resize the current object_id_. If it is less than the - // length of the current buffer, no allocation will take place. - size_t id_size = id.length (); - this->object_id_.length (id_size); - - // Get the buffer and copy the new object id in it's place. - ACE_OS::memcpy (this->object_id_.get_buffer (), - id.get_buffer (), id_size); - } - else - { - this->object_id_ = id; - } - } - - ACE_INLINE const PortableServer::ObjectId & - POA_Current_Impl::object_id (void) const - { - return this->object_id_; - } - - ACE_INLINE void - POA_Current_Impl::replace_object_id ( - const PortableServer::ObjectId &system_id) - { - // This has the effect of replacing the underlying buffer - // with that of another object id without copying. - object_id_.replace (system_id.maximum (), - system_id.length (), - const_cast <CORBA::Octet *> (system_id.get_buffer ()), - 0); - } - - ACE_INLINE void - POA_Current_Impl::object_key (const TAO::ObjectKey &key) - { - this->object_key_ = &key; - } - - ACE_INLINE const TAO::ObjectKey & - POA_Current_Impl::object_key (void) const - { - return *this->object_key_; - } - - ACE_INLINE void - POA_Current_Impl::servant (PortableServer::Servant servant) - { - this->servant_ = servant; - } - - ACE_INLINE PortableServer::Servant - POA_Current_Impl::servant (void) const - { - return this->servant_; - } - - ACE_INLINE void - POA_Current_Impl::priority (CORBA::Short priority) - { - this->priority_ = priority; - } - - ACE_INLINE CORBA::Short - POA_Current_Impl::priority (void) const - { - return this->priority_; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Guard.cpp b/TAO/tao/PortableServer/POA_Guard.cpp deleted file mode 100644 index a2943714015..00000000000 --- a/TAO/tao/PortableServer/POA_Guard.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/POA_Guard.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/ORB_Constants.h" - -ACE_RCSID(PortableServer, - POA_Guard, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - POA_Guard::POA_Guard (::TAO_Root_POA &poa - ACE_ENV_ARG_DECL, - int check_for_destruction) - : guard_ (poa.lock ()) - { - if (!this->guard_.locked ()) - ACE_THROW ( - CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO_GUARD_FAILURE, - 0), - CORBA::COMPLETED_NO)); - - // Check if a non-servant upcall is in progress. If a non-servant - // upcall is in progress, wait for it to complete. Unless of - // course, the thread making the non-servant upcall is this thread. - poa.object_adapter ().wait_for_non_servant_upcalls_to_complete (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (check_for_destruction && - poa.cleanup_in_progress ()) - ACE_THROW ( - CORBA::BAD_INV_ORDER ( - CORBA::SystemException::_tao_minor_code ( - TAO_POA_BEING_DESTROYED, - 0), - CORBA::COMPLETED_NO)); - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Guard.h b/TAO/tao/PortableServer/POA_Guard.h deleted file mode 100644 index da0f74dedae..00000000000 --- a/TAO/tao/PortableServer/POA_Guard.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POA_Guard.h - * - * $Id$ - */ -//============================================================================= - -#ifndef TAO_POA_GUARD_H -#define TAO_POA_GUARD_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Environment.h" -#include "ace/Guard_T.h" -#include "ace/CORBA_macros.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - /** - * @class POA_Guard - * - * @brief POA_Guard - * - * POA_Guard - */ - class TAO_PortableServer_Export POA_Guard - { - public: - POA_Guard (::TAO_Root_POA &poa - ACE_ENV_ARG_DECL, - int check_for_destruction = 1); - - private: - ACE_Guard<ACE_Lock> guard_; - }; - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_POA_GUARD_H */ diff --git a/TAO/tao/PortableServer/POA_Policy_Set.cpp b/TAO/tao/PortableServer/POA_Policy_Set.cpp deleted file mode 100644 index c3200dbe136..00000000000 --- a/TAO/tao/PortableServer/POA_Policy_Set.cpp +++ /dev/null @@ -1,98 +0,0 @@ -// @(#) $Id$ - -#include "tao/PortableServer/POA_Policy_Set.h" -#include "tao/PortableServer/POA_Cached_Policies.h" -#include "tao/PortableServer/PortableServer.h" - -#include "tao/Policy_Validator.h" -#include "tao/ORB_Core.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/POA_Policy_Set.i" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID (PortableServer, - POA_Policy_Set, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_POA_Policy_Set::TAO_POA_Policy_Set (void) - : impl_ (TAO_POLICY_POA_SCOPE) -{ -} - -TAO_POA_Policy_Set::TAO_POA_Policy_Set (const TAO_POA_Policy_Set &rhs) - : - impl_ (rhs.impl_) -{ -} - -TAO_POA_Policy_Set::~TAO_POA_Policy_Set (void) -{ -} - -void -TAO_POA_Policy_Set::add_client_exposed_fixed_policies (CORBA::PolicyList *client_exposed_policies - ACE_ENV_ARG_DECL) -{ - CORBA::ULong cep_index = client_exposed_policies->length (); - - for (CORBA::ULong i = 0; - i < this->num_policies (); - ++i) - { - CORBA::Policy_var policy = this->get_policy_by_index (i); - - // If this policy is client exposed, add it to the list. - if (policy->_tao_scope () & TAO_POLICY_CLIENT_EXPOSED) - { - client_exposed_policies->length (cep_index + 1); - (*client_exposed_policies)[cep_index] = - policy->copy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - cep_index++; - } - } -} - -void -TAO_POA_Policy_Set::validate_policies (TAO_Policy_Validator &validator, - TAO_ORB_Core &orb_core - ACE_ENV_ARG_DECL) -{ - // Just give a last chance for all the unloaded validators in other - // libraries to be registered - orb_core.load_policy_validators (validator ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Validate that all of the specified policies make sense. - validator.validate (this->impl_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Verify that all policies are legal for the currently loaded - // POA extensions. - for (CORBA::ULong i = 0; - i < this->impl_.num_policies (); - i++) - { - CORBA::Policy_var policy = this->impl_.get_policy_by_index (i); - - CORBA::PolicyType type = policy->policy_type (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (validator.legal_policy (type) == 0) - { -#if ! defined (CORBA_E_MICRO) - // An invalid policy was specified. Let the user know about - // it. - ACE_THROW (PortableServer::POA::InvalidPolicy ()); -#else - ACE_ERROR ((LM_ERROR, "Invalid policy\n")); -#endif - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/POA_Policy_Set.h b/TAO/tao/PortableServer/POA_Policy_Set.h deleted file mode 100644 index 182ad836a8f..00000000000 --- a/TAO/tao/PortableServer/POA_Policy_Set.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file POA_Policy_Set.h - * - * $Id$ - * - * POA - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_POA_POLICY_SET_H -#define TAO_POA_POLICY_SET_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Policy_Set.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Policy_Validator; - -class TAO_PortableServer_Export TAO_POA_Policy_Set -{ -public: - - TAO_POA_Policy_Set (void); - - TAO_POA_Policy_Set (const TAO_POA_Policy_Set &rhs); - - ~TAO_POA_Policy_Set (void); - - /// Returns the policy at the specified index. - /// CORBA::Policy::_nil () is returned if the policy doesn't exist - CORBA::Policy *get_policy_by_index (CORBA::ULong index); - - /// Get the number of policies - CORBA::ULong num_policies (void) const; - - /// Obtain a single cached policy. - CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type - ACE_ENV_ARG_DECL); - - void merge_policies (const CORBA::PolicyList &policies - ACE_ENV_ARG_DECL); - - void merge_policy (const CORBA::Policy_ptr policy - ACE_ENV_ARG_DECL); - - void validate_policies (TAO_Policy_Validator &validator, - TAO_ORB_Core &orb_core - ACE_ENV_ARG_DECL); - - /// Add all of the client exposed policies to the specified list. - void add_client_exposed_fixed_policies (CORBA::PolicyList *client_exposed_policies - ACE_ENV_ARG_DECL); - - TAO_Policy_Set &policies (void); - - /// Obtain a single policy. - CORBA::Policy_ptr get_policy (CORBA::PolicyType policy - ACE_ENV_ARG_DECL); - -protected: - TAO_Policy_Set impl_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/POA_Policy_Set.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif /* TAO_POA_POLICY_SET_H */ diff --git a/TAO/tao/PortableServer/POA_Policy_Set.i b/TAO/tao/PortableServer/POA_Policy_Set.i deleted file mode 100644 index 4181baecf48..00000000000 --- a/TAO/tao/PortableServer/POA_Policy_Set.i +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE CORBA::ULong -TAO_POA_Policy_Set::num_policies (void) const -{ - return this->impl_.num_policies (); -} - -ACE_INLINE CORBA::Policy * -TAO_POA_Policy_Set::get_policy_by_index (CORBA::ULong index) -{ - return this->impl_.get_policy_by_index (index); -} - -ACE_INLINE CORBA::Policy_ptr -TAO_POA_Policy_Set::get_cached_policy (TAO_Cached_Policy_Type type - ACE_ENV_ARG_DECL) -{ - return this->impl_.get_cached_policy (type - ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE void -TAO_POA_Policy_Set::merge_policies (const CORBA::PolicyList &policies - ACE_ENV_ARG_DECL) -{ - // Add the policies if they don't exist, override them if they do. - this->impl_.set_policy_overrides (policies, - CORBA::ADD_OVERRIDE - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -ACE_INLINE void -TAO_POA_Policy_Set::merge_policy (const CORBA::Policy_ptr policy - ACE_ENV_ARG_DECL) -{ - this->impl_.set_policy (policy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -ACE_INLINE CORBA::Policy_ptr -TAO_POA_Policy_Set::get_policy (CORBA::PolicyType policy - ACE_ENV_ARG_DECL) -{ - return this->impl_.get_policy (policy ACE_ENV_ARG_PARAMETER); -} - -ACE_INLINE TAO_Policy_Set & -TAO_POA_Policy_Set::policies (void) -{ - return this->impl_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PS_Current.pidl b/TAO/tao/PortableServer/PS_Current.pidl deleted file mode 100644 index 3d7a646ced7..00000000000 --- a/TAO/tao/PortableServer/PS_Current.pidl +++ /dev/null @@ -1,43 +0,0 @@ -/** - * @file PS_Current.pidl - * - * $Id$ - * - * @brief PIDL source for the PortableServer module. - */ - -#ifndef _PORTABLESERVER_CURRENT_IDL_ -#define _PORTABLESERVER_CURRENT_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/PortableServer/PS_Forward.pidl" -#include "tao/Current.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - // Current interface. - local interface Current : CORBA::Current - { -# pragma version Current 2.3 - - exception NoContext {}; - - POA get_POA () - raises (NoContext); - - ObjectId get_object_id () - raises (NoContext); - - Object get_reference () - raises (NoContext); - - Servant get_servant () - raises (NoContext); - }; -}; - -#endif // _PORTABLESERVER_CURRENT_IDL_ diff --git a/TAO/tao/PortableServer/PS_Forward.pidl b/TAO/tao/PortableServer/PS_Forward.pidl deleted file mode 100644 index 408fd7360ad..00000000000 --- a/TAO/tao/PortableServer/PS_Forward.pidl +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file PS_Forward.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * This file was used to generate the code in - * PS_ForwardC.{h,inl,cpp}, using the following command: - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * PS_Forward.pidl - * - * Apply patches using the following command: - * - * patch < diffs/PS_Forward.diff - */ - -#ifndef _PORTABLESERVER_PS_FORWARD_IDL_ -#define _PORTABLESERVER_PS_FORWARD_IDL_ - -#include "tao/OctetSeq.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - typedef CORBA::OctetSeq ObjectId; - - local interface POA; - - native Servant; -}; - -#endif // _PORTABLESERVER_PS_FORWARD_IDL_ diff --git a/TAO/tao/PortableServer/PS_ForwardA.cpp b/TAO/tao/PortableServer/PS_ForwardA.cpp deleted file mode 100644 index efaca76332e..00000000000 --- a/TAO/tao/PortableServer/PS_ForwardA.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -#include "tao/AnyTypeCode/Null_RefCount_Policy.h" -#include "tao/AnyTypeCode/TypeCode_Constants.h" -#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" -#include "tao/PortableServer/PS_ForwardA.h" -#include "tao/CDR.h" -#include "tao/AnyTypeCode/Any.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// TAO_IDL - Generated from -// be\be_visitor_typecode/alias_typecode.cpp:50 - -static TAO::TypeCode::Alias<char const *, - CORBA::TypeCode_ptr const *, - TAO::Null_RefCount_Policy> - _tao_tc_PortableServer_ObjectId ( - CORBA::tk_alias, - "IDL:omg.org/PortableServer/ObjectId:2.3", - "ObjectId", - &CORBA::_tc_OctetSeq); - -namespace PortableServer -{ - ::CORBA::TypeCode_ptr const _tc_ObjectId = - &_tao_tc_PortableServer_ObjectId; -} - - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PS_ForwardA.h b/TAO/tao/PortableServer/PS_ForwardA.h deleted file mode 100644 index 047e66c649b..00000000000 --- a/TAO/tao/PortableServer/PS_ForwardA.h +++ /dev/null @@ -1,63 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:754 - -#ifndef _TAO_IDL_PS_FORWARDA_H_ -#define _TAO_IDL_PS_FORWARDA_H_ - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" -#include "tao/PortableServer/PS_ForwardC.h" -#include "tao/AnyTypeCode/OctetSeqA.h" - - -// TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:59 - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - - // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:49 - - extern TAO_PortableServer_Export ::CORBA::TypeCode_ptr const _tc_ObjectId; - -// TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:86 - -} // module PortableServer - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ifndef */ diff --git a/TAO/tao/PortableServer/PS_ForwardC.cpp b/TAO/tao/PortableServer/PS_ForwardC.cpp deleted file mode 100644 index d23e1ebf431..00000000000 --- a/TAO/tao/PortableServer/PS_ForwardC.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:277 - - -#include "tao/PortableServer/PS_ForwardC.h" -#include "tao/CDR.h" -#include "tao/ORB_Core.h" - -// TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:70 - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Arg traits specializations. -namespace TAO -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PS_ForwardC.h b/TAO/tao/PortableServer/PS_ForwardC.h deleted file mode 100644 index 4d4aa7d4ddc..00000000000 --- a/TAO/tao/PortableServer/PS_ForwardC.h +++ /dev/null @@ -1,128 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:154 - -#ifndef _TAO_IDL_PS_FORWARDC_H_ -#define _TAO_IDL_PS_FORWARDC_H_ - -#include /**/ "ace/pre.h" - - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/portableserver_export.h" -#include "tao/ORB.h" -#include "tao/Environment.h" -#include "tao/Objref_VarOut_T.h" - -#include "tao/OctetSeqC.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_ServantBase; -class TAO_Local_ServantBase; -class TAO_Root_POA; -class TAO_DynamicImplementation; - -// TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:49 - -namespace PortableServer -{ - typedef TAO_ServantBase ServantBase; - struct RefCountServantBase {}; - template <class T> class Servant_var; - typedef Servant_var<TAO_ServantBase> ServantBase_var; - typedef ServantBase *Servant; - - typedef TAO_Local_ServantBase LocalServantBase; - typedef TAO_DynamicImplementation DynamicImplementation; - - // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:472 - - typedef CORBA::OctetSeq ObjectId; - typedef CORBA::OctetSeq_var ObjectId_var; - typedef CORBA::OctetSeq_out ObjectId_out; - - // TAO_IDL - Generated from - // be\be_interface.cpp:598 - -#if !defined (_PORTABLESERVER_POA__VAR_OUT_CH_) -#define _PORTABLESERVER_POA__VAR_OUT_CH_ - - class POA; - typedef POA *POA_ptr; - - typedef - TAO_Objref_Var_T< - POA - > - POA_var; - - typedef - TAO_Objref_Out_T< - POA - > - POA_out; - -#endif /* end #if !defined */ - -// TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:78 - -} // module PortableServer - -// TAO_IDL - Generated from -// be\be_visitor_traits.cpp:61 - -// Traits specializations. -namespace TAO -{ -} - -// TAO_IDL - Generated from -// be\be_codegen.cpp:1028 - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* ifndef */ - - diff --git a/TAO/tao/PortableServer/PolicyS.cpp b/TAO/tao/PortableServer/PolicyS.cpp deleted file mode 100644 index 9eae2512e9b..00000000000 --- a/TAO/tao/PortableServer/PolicyS.cpp +++ /dev/null @@ -1,1088 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - - -// TAO_IDL - Generated from -// be\be_codegen.cpp:599 - -#ifndef _TAO_IDL_ORIG_POLICYS_CPP_ -#define _TAO_IDL_ORIG_POLICYS_CPP_ - - -#include "tao/AnyTypeCode/TypeCode.h" -#include "tao/AnyTypeCode/Any.h" -#include "tao/PortableServer/PolicyS.h" -#include "tao/PortableServer/Operation_Table_Perfect_Hash.h" -#include "tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h" -#include "tao/PortableServer/Upcall_Command.h" -#include "tao/PortableServer/Upcall_Wrapper.h" -#include "tao/PortableServer/Basic_SArguments.h" -#include "tao/PortableServer/Object_SArgument_T.h" -#include "tao/PortableServer/Special_Basic_SArguments.h" -#include "tao/PortableServer/UB_String_SArguments.h" -#include "tao/PortableServer/TypeCode_SArg_Traits.h" -#include "tao/PortableServer/Object_SArg_Traits.h" -#include "tao/PortableServer/get_arg.h" -#include "tao/Special_Basic_Arguments.h" -#include "tao/UB_String_Arguments.h" -#include "tao/TAO_Server_Request.h" -#include "tao/ORB_Core.h" -#include "tao/Profile.h" -#include "tao/Stub.h" -#include "tao/IFR_Client_Adapter.h" -#include "tao/Object_T.h" -#include "tao/CDR.h" -#include "tao/operation_details.h" -#include "tao/PortableInterceptor.h" -#include "tao/Basic_Arguments.h" -#include "tao/Object_Argument_T.h" -#include "ace/Dynamic_Service.h" -#include "ace/Malloc_Allocator.h" - -// TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:69 - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Arg traits specializations. -namespace TAO -{ - -#if !defined (_CORBA_POLICY__SARG_TRAITS_SS_) -#define _CORBA_POLICY__SARG_TRAITS_SS_ - - template<> - class SArg_Traits<CORBA::Policy> - : public - Object_SArg_Traits_T< - CORBA::Policy_ptr, - CORBA::Policy_var, - CORBA::Policy_out, - TAO::Any_Insert_Policy_Stream <CORBA::Policy_ptr> - > - { - }; - -#endif /* end #if !defined */ -} - - -// TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:69 - -// Arg traits specializations. -namespace TAO -{ - -#if !defined (_CORBA_POLICY__ARG_TRAITS_SS_) -#define _CORBA_POLICY__ARG_TRAITS_SS_ - - template<> - class Arg_Traits<CORBA::Policy> - : public - Object_Arg_Traits_T< - CORBA::Policy_ptr, - CORBA::Policy_var, - CORBA::Policy_out, - TAO::Objref_Traits<CORBA::Policy>, - TAO::Any_Insert_Policy_Stream <CORBA::Policy_ptr> - > - { - }; - -#endif /* end #if !defined */ -} - - -// TAO_IDL - Generated from -// be\be_interface.cpp:1455 - -class TAO_CORBA_Policy_Perfect_Hash_OpTable - : public TAO_Perfect_Hash_OpTable -{ -private: - unsigned int hash (const char *str, unsigned int len); - -public: - const TAO_operation_db_entry * lookup (const char *str, unsigned int len); -}; - -/* C++ code produced by gperf version 2.8 (ACE version) */ -/* Command-line: c:\ACE\latest\ACE_wrappers\bin\gperf.exe -m -M -J -c -C -D -E -T -f 0 -F 0,0 -a -o -t -p -K opname -L C++ -Z TAO_CORBA_Policy_Perfect_Hash_OpTable -N lookup */ -unsigned int -TAO_CORBA_Policy_Perfect_Hash_OpTable::hash (const char *str, unsigned int len) -{ - static const unsigned char asso_values[] = - { -#if defined (ACE_MVS) - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 0, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 0, - 22, 0, 0, 5, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 0, 22, 22, 22, 22, 0, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, -#else - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 0, 22, 0, 22, 0, - 0, 5, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 0, 22, 22, 22, - 22, 0, 22, 22, 22, 22, 22, 22, -#endif /* ACE_MVS */ - }; - return len + asso_values[(int) str[len - 1]] + asso_values[(int) str[0]]; -} - -const TAO_operation_db_entry * -TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len) -{ - enum - { - TOTAL_KEYWORDS = 7, - MIN_WORD_LENGTH = 4, - MAX_WORD_LENGTH = 16, - MIN_HASH_VALUE = 4, - MAX_HASH_VALUE = 21, - HASH_VALUE_RANGE = 18, - DUPLICATES = 0, - WORDLIST_SIZE = 11 - }; - - static const TAO_operation_db_entry wordlist[] = - { - {"",0,0},{"",0,0},{"",0,0},{"",0,0}, - {"copy", &POA_CORBA::Policy::copy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy}, - {"_is_a", &POA_CORBA::Policy::_is_a_skel, 0}, - {"",0,0}, - {"destroy", &POA_CORBA::Policy::destroy_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy}, - {"",0,0},{"",0,0}, - {"_component", &POA_CORBA::Policy::_component_skel, 0}, - {"",0,0},{"",0,0}, - {"_non_existent", &POA_CORBA::Policy::_non_existent_skel, 0}, - {"",0,0}, - {"_interface", &POA_CORBA::Policy::_interface_skel, 0}, - {"",0,0},{"",0,0},{"",0,0},{"",0,0},{"",0,0}, - {"_get_policy_type", &POA_CORBA::Policy::_get_policy_type_skel, &POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type}, - }; - - if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) - { - unsigned int key = hash (str, len); - - if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) - { - const char *s = wordlist[key].opname; - - if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) - return &wordlist[key]; - } - } - return 0; -} - -static TAO_CORBA_Policy_Perfect_Hash_OpTable tao_CORBA_Policy_optable; -/////////////////////////////////////////////////////////////////////// -// Strategized Proxy Broker Implementation -// - -// TAO_IDL - Generated from -// be\be_visitor_interface/strategized_proxy_broker_ss.cpp:40 - -// Factory function Implementation. -POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker * -POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::the_TAO_Policy_Strategized_Proxy_Broker (void) -{ - static POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker - strategized_proxy_broker; - - return &strategized_proxy_broker; -} - -POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::_TAO_Policy_Strategized_Proxy_Broker (void) -{ -} - -POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::~_TAO_Policy_Strategized_Proxy_Broker (void) -{ -} - -TAO::Collocation_Strategy -POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::get_strategy ( - CORBA::Object_ptr obj - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Collocation_Strategy strategy = - TAO_ORB_Core::collocation_strategy (obj ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO::TAO_CS_REMOTE_STRATEGY); - - return strategy; -} - -void -POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch ( - CORBA::Object_ptr obj, - CORBA::Object_out forward_obj, - TAO::Argument ** args, - int num_args, - const char * op, - size_t op_len, - TAO::Collocation_Strategy strategy - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::Exception)) -{ - TAO::Direct_Collocation_Upcall_Wrapper collocation_upcall_wrapper; - collocation_upcall_wrapper.upcall ( - obj, - forward_obj, - args, - num_args, - op, - op_len, - strategy - ACE_ENV_ARG_PARAMETER); -} - -// -// End Strategized Proxy Broker Implementation -/////////////////////////////////////////////////////////////////////// - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:999 - -TAO::Collocation_Proxy_Broker * -CORBA__TAO_Policy_Proxy_Broker_Factory_function (CORBA::Object_ptr) -{ - return - ::POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::the_TAO_Policy_Strategized_Proxy_Broker (); -} - -int -CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer (size_t) -{ - CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer = - CORBA__TAO_Policy_Proxy_Broker_Factory_function; - - return 0; -} - -static int -CORBA__TAO_Policy_Proxy_Broker_Stub_Factory_Initializer_Scarecrow = - CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer ( - reinterpret_cast<size_t> (CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer) - ); - - - -/////////////////////////////////////////////////////////////////////// -// Direct Proxy Implementation -// - -POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_TAO_Policy_Direct_Proxy_Impl (void) -{} - -POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::~_TAO_Policy_Direct_Proxy_Impl (void) -{} - -// TAO_IDL - Generated from -// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42 - -void -POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - ((TAO::Arg_Traits< ::CORBA::PolicyType>::ret_val *) args[0])->arg () = - dynamic_cast<POA_CORBA::Policy_ptr> - (servant) - ->policy_type ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; -} -// TAO_IDL - Generated from -// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42 - -void -POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - ((TAO::Arg_Traits< CORBA::Policy>::ret_val *) args[0])->arg () = - dynamic_cast<POA_CORBA::Policy_ptr> - (servant) - ->copy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; -} -// TAO_IDL - Generated from -// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42 - -void -POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument **, - int - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - dynamic_cast<POA_CORBA::Policy_ptr> - (servant) - ->destroy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); - ACE_CHECK; -} - - -// -// End Direct Proxy Implementation -/////////////////////////////////////////////////////////////////////// - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:103 - -POA_CORBA::Policy::Policy (void) - : TAO_ServantBase () -{ - this->optable_ = &tao_CORBA_Policy_optable; -} - -POA_CORBA::Policy::Policy (const Policy& rhs) - : TAO_Abstract_ServantBase (rhs), - TAO_ServantBase (rhs) -{ -} - -POA_CORBA::Policy::~Policy (void) -{ -} -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_operation/upcall_command_ss.cpp:127 - - class _get_policy_type_Policy - : public TAO::Upcall_Command - { - public: - inline _get_policy_type_Policy ( - POA_CORBA::Policy * servant, - TAO_Operation_Details const * operation_details, - TAO::Argument * const args[]) - : servant_ (servant) - , operation_details_ (operation_details) - , args_ (args) - { - } - - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) - { - TAO::SArg_Traits< ::CORBA::PolicyType>::ret_arg_type retval = - TAO::Portable_Server::get_ret_arg< ::CORBA::PolicyType> ( - this->operation_details_, - this->args_); - - - retval = - this->servant_->policy_type ( - ACE_ENV_SINGLE_ARG_PARAMETER); - - } - - private: - POA_CORBA::Policy * const servant_; - TAO_Operation_Details const * const operation_details_; - TAO::Argument * const * const args_; - }; - -} - - -// TAO_IDL - Generated from -// be\be_visitor_operation/operation_ss.cpp:192 - -void POA_CORBA::Policy::_get_policy_type_skel ( - TAO_ServerRequest & server_request, - void * TAO_INTERCEPTOR (servant_upcall), - void * servant - ACE_ENV_ARG_DECL - ) -{ - - -#if TAO_HAS_INTERCEPTORS == 1 - static CORBA::TypeCode_ptr const * const exceptions = 0; - static CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - - TAO::SArg_Traits< ::CORBA::PolicyType>::ret_val retval; - - TAO::Argument * const args[] = - { - &retval - }; - - static size_t const nargs = 1; - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - - _get_policy_type_Policy command ( - impl, - server_request.operation_details (), - args); - - TAO::Upcall_Wrapper upcall_wrapper; - upcall_wrapper.upcall (server_request - , args - , nargs - , command -#if TAO_HAS_INTERCEPTORS == 1 - , servant_upcall - , exceptions - , nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_operation/upcall_command_ss.cpp:127 - - class copy_Policy - : public TAO::Upcall_Command - { - public: - inline copy_Policy ( - POA_CORBA::Policy * servant, - TAO_Operation_Details const * operation_details, - TAO::Argument * const args[]) - : servant_ (servant) - , operation_details_ (operation_details) - , args_ (args) - { - } - - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) - { - TAO::SArg_Traits< CORBA::Policy>::ret_arg_type retval = - TAO::Portable_Server::get_ret_arg< CORBA::Policy> ( - this->operation_details_, - this->args_); - - - retval = - this->servant_->copy ( - ACE_ENV_SINGLE_ARG_PARAMETER); - - } - - private: - POA_CORBA::Policy * const servant_; - TAO_Operation_Details const * const operation_details_; - TAO::Argument * const * const args_; - }; - -} - - -// TAO_IDL - Generated from -// be\be_visitor_operation/operation_ss.cpp:192 - -void POA_CORBA::Policy::copy_skel ( - TAO_ServerRequest & server_request, - void * TAO_INTERCEPTOR (servant_upcall), - void * servant - ACE_ENV_ARG_DECL - ) -{ - - -#if TAO_HAS_INTERCEPTORS == 1 - static CORBA::TypeCode_ptr const * const exceptions = 0; - static CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - - TAO::SArg_Traits< CORBA::Policy>::ret_val retval; - - TAO::Argument * const args[] = - { - &retval - }; - - static size_t const nargs = 1; - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - - copy_Policy command ( - impl, - server_request.operation_details (), - args); - - TAO::Upcall_Wrapper upcall_wrapper; - upcall_wrapper.upcall (server_request - , args - , nargs - , command -#if TAO_HAS_INTERCEPTORS == 1 - , servant_upcall - , exceptions - , nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_operation/upcall_command_ss.cpp:127 - - class destroy_Policy - : public TAO::Upcall_Command - { - public: - inline destroy_Policy ( - POA_CORBA::Policy * servant) - : servant_ (servant) - { - } - - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) - { - this->servant_->destroy ( - ACE_ENV_SINGLE_ARG_PARAMETER); - - } - - private: - POA_CORBA::Policy * const servant_; - }; - -} - - -// TAO_IDL - Generated from -// be\be_visitor_operation/operation_ss.cpp:192 - -void POA_CORBA::Policy::destroy_skel ( - TAO_ServerRequest & server_request, - void * TAO_INTERCEPTOR (servant_upcall), - void * servant - ACE_ENV_ARG_DECL - ) -{ - - -#if TAO_HAS_INTERCEPTORS == 1 - static CORBA::TypeCode_ptr const * const exceptions = 0; - static CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - - TAO::SArg_Traits< void>::ret_val retval; - - TAO::Argument * const args[] = - { - &retval - }; - - static size_t const nargs = 1; - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - - destroy_Policy command ( - impl); - - TAO::Upcall_Wrapper upcall_wrapper; - upcall_wrapper.upcall (server_request - , args - , nargs - , command -#if TAO_HAS_INTERCEPTORS == 1 - , servant_upcall - , exceptions - , nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:169 - -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_operation/upcall_command_ss.cpp:127 - - class _is_a_Policy_Upcall_Command - : public TAO::Upcall_Command - { - public: - inline _is_a_Policy_Upcall_Command ( - POA_CORBA::Policy * servant, - TAO_Operation_Details const * operation_details, - TAO::Argument * const args[]) - : servant_ (servant) - , operation_details_ (operation_details) - , args_ (args) - { - } - - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) - { - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval = - TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> ( - this->operation_details_, - this->args_); - - TAO::SArg_Traits< CORBA::Char *>::in_arg_type arg_1 = - TAO::Portable_Server::get_in_arg< CORBA::Char *> ( - this->operation_details_, - this->args_, - 1); - - - retval = - this->servant_-> _is_a ( - arg_1 - ACE_ENV_ARG_PARAMETER); - - } - - private: - POA_CORBA::Policy * const servant_; - TAO_Operation_Details const * const operation_details_; - TAO::Argument * const * const args_; - }; - -} -void POA_CORBA::Policy::_is_a_skel ( - TAO_ServerRequest & server_request, - void * TAO_INTERCEPTOR (servant_upcall), - void * servant - ACE_ENV_ARG_DECL - ) -{ - - -#if TAO_HAS_INTERCEPTORS == 1 - static CORBA::TypeCode_ptr const * const exceptions = 0; - static CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; - TAO::SArg_Traits< CORBA::Char *>::in_arg_val _tao_repository_id; - - TAO::Argument * const args[] = - { - &retval, - &_tao_repository_id - }; - - static size_t const nargs = 2; - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - - _is_a_Policy_Upcall_Command command ( - impl, - server_request.operation_details (), - args); - - TAO::Upcall_Wrapper upcall_wrapper; - upcall_wrapper.upcall (server_request - , args - , nargs - , command -#if TAO_HAS_INTERCEPTORS == 1 - , servant_upcall - , exceptions - , nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_operation/upcall_command_ss.cpp:127 - - class _non_existent_Policy_Upcall_Command - : public TAO::Upcall_Command - { - public: - inline _non_existent_Policy_Upcall_Command ( - POA_CORBA::Policy * servant, - TAO_Operation_Details const * operation_details, - TAO::Argument * const args[]) - : servant_ (servant) - , operation_details_ (operation_details) - , args_ (args) - { - } - - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) - { - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_arg_type retval = - TAO::Portable_Server::get_ret_arg< ::ACE_InputCDR::to_boolean> ( - this->operation_details_, - this->args_); - - - retval = - this->servant_-> _non_existent ( - ACE_ENV_SINGLE_ARG_PARAMETER); - - } - - private: - POA_CORBA::Policy * const servant_; - TAO_Operation_Details const * const operation_details_; - TAO::Argument * const * const args_; - }; - -} -void POA_CORBA::Policy::_non_existent_skel ( - TAO_ServerRequest & server_request, - void * TAO_INTERCEPTOR (servant_upcall), - void * servant - ACE_ENV_ARG_DECL - ) -{ - - -#if TAO_HAS_INTERCEPTORS == 1 - static CORBA::TypeCode_ptr const * const exceptions = 0; - static CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - - TAO::SArg_Traits< ::ACE_InputCDR::to_boolean>::ret_val retval; - - TAO::Argument * const args[] = - { - &retval - }; - - static size_t const nargs = 1; - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - - _non_existent_Policy_Upcall_Command command ( - impl, - server_request.operation_details (), - args); - - TAO::Upcall_Wrapper upcall_wrapper; - upcall_wrapper.upcall (server_request - , args - , nargs - , command -#if TAO_HAS_INTERCEPTORS == 1 - , servant_upcall - , exceptions - , nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - - - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:393 - - - -void POA_CORBA::Policy::_interface_skel ( - TAO_ServerRequest & server_request, - void * /* servant_upcall */, - void * servant - ACE_ENV_ARG_DECL - ) -{ - TAO_IFR_Client_Adapter *_tao_adapter = - ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance ( - TAO_ORB_Core::ifr_client_adapter_name () - ); - - if (_tao_adapter == 0) - { - ACE_THROW (CORBA::INTF_REPOS (CORBA::OMGVMCID | 1, - CORBA::COMPLETED_NO)); - } - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - CORBA::InterfaceDef_ptr _tao_retval = - impl->_get_interface (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - server_request.init_reply (); - TAO_OutputCDR &_tao_out = *server_request.outgoing (); - - CORBA::Boolean const _tao_result = - _tao_adapter->interfacedef_cdr_insert ( - _tao_out, - _tao_retval - ); - - _tao_adapter->dispose (_tao_retval); - - if (_tao_result == 0) - { - ACE_THROW (CORBA::MARSHAL ()); - } -} - -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_operation/upcall_command_ss.cpp:127 - - class _get_component_Policy_Upcall_Command - : public TAO::Upcall_Command - { - public: - inline _get_component_Policy_Upcall_Command ( - POA_CORBA::Policy * servant, - TAO_Operation_Details const * operation_details, - TAO::Argument * const args[]) - : servant_ (servant) - , operation_details_ (operation_details) - , args_ (args) - { - } - - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) - { - TAO::SArg_Traits< ::CORBA::Object>::ret_arg_type retval = - TAO::Portable_Server::get_ret_arg< ::CORBA::Object> ( - this->operation_details_, - this->args_); - - - retval = - this->servant_-> _get_component ( - ACE_ENV_SINGLE_ARG_PARAMETER); - - } - - private: - POA_CORBA::Policy * const servant_; - TAO_Operation_Details const * const operation_details_; - TAO::Argument * const * const args_; - }; - -} -void POA_CORBA::Policy::_component_skel ( - TAO_ServerRequest & server_request, - void * TAO_INTERCEPTOR (servant_upcall), - void * servant - ACE_ENV_ARG_DECL - ) -{ - - -#if TAO_HAS_INTERCEPTORS == 1 - static CORBA::TypeCode_ptr const * const exceptions = 0; - static CORBA::ULong const nexceptions = 0; -#endif /* TAO_HAS_INTERCEPTORS */ - - TAO::SArg_Traits< ::CORBA::Object>::ret_val retval; - - TAO::Argument * const args[] = - { - &retval - }; - - static size_t const nargs = 1; - - POA_CORBA::Policy * const impl = - static_cast<POA_CORBA::Policy *> (servant); - - _get_component_Policy_Upcall_Command command ( - impl, - server_request.operation_details (), - args); - - TAO::Upcall_Wrapper upcall_wrapper; - upcall_wrapper.upcall (server_request - , args - , nargs - , command -#if TAO_HAS_INTERCEPTORS == 1 - , servant_upcall - , exceptions - , nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -} - -CORBA::Boolean POA_CORBA::Policy::_is_a ( - const char* value - ACE_ENV_ARG_DECL_NOT_USED - ) -{ - return - ( - !ACE_OS::strcmp ( - value, - "IDL:omg.org/CORBA/Policy:1.0" - ) || - !ACE_OS::strcmp ( - value, - "IDL:omg.org/CORBA/Object:1.0" - ) - ); -} - -const char* POA_CORBA::Policy::_interface_repository_id (void) const -{ - return "IDL:omg.org/CORBA/Policy:1.0"; -} - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:940 - -void POA_CORBA::Policy::_dispatch ( - TAO_ServerRequest & req, - void * servant_upcall - ACE_ENV_ARG_DECL - ) -{ - this->synchronous_upcall_dispatch (req, - servant_upcall, - this - ACE_ENV_ARG_PARAMETER); -} - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_ss.cpp:891 - -CORBA::Policy * -POA_CORBA::Policy::_this (ACE_ENV_SINGLE_ARG_DECL) -{ - TAO_Stub *stub = this->_create_stub (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - TAO_Stub_Auto_Ptr safe_stub (stub); - CORBA::Object_ptr tmp = CORBA::Object::_nil (); - - CORBA::Boolean _tao_opt_colloc = - stub->servant_orb_var ()->orb_core ()->optimize_collocation_objects (); - - ACE_NEW_RETURN ( - tmp, - CORBA::Object (stub, _tao_opt_colloc, this), - 0 - ); - - CORBA::Object_var obj = tmp; - (void) safe_stub.release (); - - typedef ::CORBA::Policy STUB_SCOPED_NAME; - return - TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow ( - obj.in (), - CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer - ); -} - -#endif /* ifndef */ - - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PolicyS.h b/TAO/tao/PortableServer/PolicyS.h deleted file mode 100644 index 91d1c44b232..00000000000 --- a/TAO/tao/PortableServer/PolicyS.h +++ /dev/null @@ -1,326 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:391 - -#ifndef _TAO_IDL_ORIG_POLICYS_H_ -#define _TAO_IDL_ORIG_POLICYS_H_ - -#include /**/ "ace/pre.h" - -#include "tao/PolicyC.h" -#include "tao/UShortSeqS.h" -#include "tao/CurrentS.h" -#include "tao/Policy_ForwardS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Collocation_Proxy_Broker.h" -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/Servant_Base.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if defined (__BORLANDC__) -#pragma option push -w-rvl -w-rch -w-ccc -w-inl -#endif /* __BORLANDC__ */ - -#include "tao/PortableServer/portableserver_export.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export - -// TAO_IDL - Generated from -// be\be_visitor_module/module_sh.cpp:49 - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace POA_CORBA -{ - - - // TAO_IDL - Generated from - // be\be_visitor_interface/interface_sh.cpp:87 - - class Policy; - typedef Policy *Policy_ptr; - - class _TAO_Policy_Direct_Proxy_Impl; - class _TAO_Policy_Strategized_Proxy_Broker; - - class TAO_PortableServer_Export Policy - : public virtual PortableServer::ServantBase - { - protected: - Policy (void); - - public: - // Useful for template programming. - typedef ::CORBA::Policy _stub_type; - typedef ::CORBA::Policy_ptr _stub_ptr_type; - typedef ::CORBA::Policy_var _stub_var_type; - - Policy (const Policy& rhs); - virtual ~Policy (void); - - virtual CORBA::Boolean _is_a ( - const char* logical_type_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - static void _is_a_skel ( - TAO_ServerRequest & req, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - - static void _non_existent_skel ( - TAO_ServerRequest & req, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - - static void _interface_skel ( - TAO_ServerRequest & req, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - - static void _component_skel ( - TAO_ServerRequest & req, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - - virtual void _dispatch ( - TAO_ServerRequest & req, - void * servant_upcall - ACE_ENV_ARG_DECL - ); - - ::CORBA::Policy *_this ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - virtual const char* _interface_repository_id (void) const; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_sh.cpp:45 - - virtual CORBA::PolicyType policy_type ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - static void _get_policy_type_skel ( - TAO_ServerRequest & server_request, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_sh.cpp:45 - - virtual ::CORBA::Policy_ptr copy ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - static void copy_skel ( - TAO_ServerRequest & server_request, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_sh.cpp:45 - - virtual void destroy ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - static void destroy_skel ( - TAO_ServerRequest & server_request, - void * servant_upcall, - void * servant - ACE_ENV_ARG_DECL - ); - }; - - /////////////////////////////////////////////////////////////////////// - // Strategized Proxy Broker Declaration - // - - // TAO_IDL - Generated from - // be\be_visitor_interface/strategized_proxy_broker_sh.cpp:36 - - class TAO_PortableServer_Export _TAO_Policy_Strategized_Proxy_Broker - : public virtual TAO::Collocation_Proxy_Broker - { - public: - _TAO_Policy_Strategized_Proxy_Broker (void); - - virtual ~_TAO_Policy_Strategized_Proxy_Broker (void); - - TAO::Collocation_Strategy - get_strategy ( - CORBA::Object_ptr obj - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void - dispatch ( - CORBA::Object_ptr obj, - CORBA::Object_out forward_obj, - TAO::Argument ** args, - int num_args, - const char * op, - size_t op_len, - TAO::Collocation_Strategy strategy - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::Exception)); - - static _TAO_Policy_Strategized_Proxy_Broker * - the_TAO_Policy_Strategized_Proxy_Broker (void); - }; - - // - // End Strategized Proxy Broker Declaration - /////////////////////////////////////////////////////////////////////// - - - - // TAO_IDL - Generated from - // be\be_visitor_interface/direct_proxy_impl_sh.cpp:31 - - /////////////////////////////////////////////////////////////////////// - // Direct Impl. Declaration - // - - class TAO_PortableServer_Export _TAO_Policy_Direct_Proxy_Impl - { - public: - _TAO_Policy_Direct_Proxy_Impl (void); - - virtual ~_TAO_Policy_Direct_Proxy_Impl (void); - - // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 - - static void - _get_policy_type ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int num_args - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 - - static void - copy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int num_args - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - // TAO_IDL - Generated from - // be\be_visitor_operation/proxy_impl_xh.cpp:24 - - static void - destroy ( - TAO_Abstract_ServantBase *servant, - TAO::Argument ** args, - int num_args - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - }; - - // - // Direct Proxy Impl. Declaration - /////////////////////////////////////////////////////////////////////// - - - -// TAO_IDL - Generated from -// be\be_visitor_module/module_sh.cpp:80 - -} // module CORBA - -// TAO_IDL - Generated from -// be\be_codegen.cpp:995 - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include "tao/PortableServer/PolicyS_T.h" - - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__BORLANDC__) -#pragma option pop -#endif /* __BORLANDC__ */ - -#include /**/ "ace/post.h" -#endif /* ifndef */ - diff --git a/TAO/tao/PortableServer/PolicyS_T.cpp b/TAO/tao/PortableServer/PolicyS_T.cpp deleted file mode 100644 index dfe7cbabbdd..00000000000 --- a/TAO/tao/PortableServer/PolicyS_T.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:677 - -#ifndef _TAO_IDL_ORIG_POLICYS_T_CPP_ -#define _TAO_IDL_ORIG_POLICYS_T_CPP_ - -#include "tao/PortableServer/PolicyS_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/PolicyS_T.inl" -#endif /* !defined INLINE */ - - -#endif /* ifndef */ diff --git a/TAO/tao/PortableServer/PolicyS_T.h b/TAO/tao/PortableServer/PolicyS_T.h deleted file mode 100644 index 6bf094e5c33..00000000000 --- a/TAO/tao/PortableServer/PolicyS_T.h +++ /dev/null @@ -1,154 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:536 - -#ifndef _TAO_IDL_ORIG_POLICYS_T_H_ -#define _TAO_IDL_ORIG_POLICYS_T_H_ - -#include /**/ "ace/pre.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// TAO_IDL - Generated from -// be\be_visitor_root/root_sth.cpp:116 - -namespace POA_CORBA -{ - - // TAO_IDL - Generated from - // be\be_visitor_interface/tie_sh.cpp:87 - - // TIE class: Refer to CORBA v2.2, Section 20.34.4 - template <class T> - class Policy_tie : public Policy - { - public: - Policy_tie (T &t); - // the T& ctor - Policy_tie (T &t, PortableServer::POA_ptr poa); - // ctor taking a POA - Policy_tie (T *tp, CORBA::Boolean release = true); - // ctor taking pointer and an ownership flag - Policy_tie ( - T *tp, - PortableServer::POA_ptr poa, - CORBA::Boolean release = true - ); - // ctor with T*, ownership flag and a POA - ~Policy_tie (void); - // dtor - - // TIE specific functions - T *_tied_object (void); - // return the underlying object - void _tied_object (T &obj); - // set the underlying object - void _tied_object (T *obj, CORBA::Boolean release = true); - // set the underlying object and the ownership flag - CORBA::Boolean _is_owner (void); - // do we own it - void _is_owner (CORBA::Boolean b); - // set the ownership - - // overridden ServantBase operations - PortableServer::POA_ptr _default_POA ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - // TAO_IDL - Generated from - // be\be_visitor_operation/tie_sh.cpp:60 - - CORBA::PolicyType policy_type ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - // TAO_IDL - Generated from - // be\be_visitor_operation/tie_sh.cpp:60 - - ::CORBA::Policy_ptr copy ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - // TAO_IDL - Generated from - // be\be_visitor_operation/tie_sh.cpp:60 - - void destroy ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - private: - T *ptr_; - PortableServer::POA_var poa_; - CORBA::Boolean rel_; - - // copy and assignment are not allowed - Policy_tie (const Policy_tie &); - void operator= (const Policy_tie &); - }; -} // module CORBA - -// TAO_IDL - Generated from -// be\be_codegen.cpp:1096 - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/PolicyS_T.inl" -#endif /* defined INLINE */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/PolicyS_T.cpp" -#endif /* defined REQUIRED SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("PolicyS_T.cpp") -#endif /* defined REQUIRED PRAGMA */ - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* ifndef */ - diff --git a/TAO/tao/PortableServer/PolicyS_T.inl b/TAO/tao/PortableServer/PolicyS_T.inl deleted file mode 100644 index 4bccdaee36d..00000000000 --- a/TAO/tao/PortableServer/PolicyS_T.inl +++ /dev/null @@ -1,172 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// TAO_IDL - Generated from -// be\be_visitor_interface/tie_si.cpp:96 - -template <class T> ACE_INLINE -POA_CORBA::Policy_tie<T>::Policy_tie (T &t) - : ptr_ (&t), - poa_ (PortableServer::POA::_nil ()), - rel_ (0) -{} - -template <class T> ACE_INLINE -POA_CORBA::Policy_tie<T>::Policy_tie (T &t, PortableServer::POA_ptr poa) - : ptr_ (&t), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (0) -{} - -template <class T> ACE_INLINE -POA_CORBA::Policy_tie<T>::Policy_tie (T *tp, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_nil ()), - rel_ (release) -{} - -template <class T> ACE_INLINE -POA_CORBA::Policy_tie<T>::Policy_tie (T *tp, PortableServer::POA_ptr poa, CORBA::Boolean release) - : ptr_ (tp), - poa_ (PortableServer::POA::_duplicate (poa)), - rel_ (release) -{} - -template <class T> ACE_INLINE -POA_CORBA::Policy_tie<T>::~Policy_tie (void) -{ - if (this->rel_) - { - delete this->ptr_; - } -} - -template <class T> ACE_INLINE T * -POA_CORBA::Policy_tie<T>::_tied_object (void) -{ - return this->ptr_; -} - -template <class T> ACE_INLINE void -POA_CORBA::Policy_tie<T>::_tied_object (T &obj) -{ - if (this->rel_) - { - delete this->ptr_; - } - - this->ptr_ = &obj; - this->rel_ = 0; -} - -template <class T> ACE_INLINE void -POA_CORBA::Policy_tie<T>::_tied_object (T *obj, CORBA::Boolean release) -{ - if (this->rel_) - { - delete this->ptr_; - } - - this->ptr_ = obj; - this->rel_ = release; -} - -template <class T> ACE_INLINE CORBA::Boolean -POA_CORBA::Policy_tie<T>::_is_owner (void) -{ - return this->rel_; -} - -template <class T> ACE_INLINE void -POA_CORBA::Policy_tie<T>::_is_owner (CORBA::Boolean b) -{ - this->rel_ = b; -} - -template <class T> ACE_INLINE PortableServer::POA_ptr -POA_CORBA::Policy_tie<T>::_default_POA (ACE_ENV_SINGLE_ARG_DECL) -{ - if (!CORBA::is_nil (this->poa_.in ())) - { - return PortableServer::POA::_duplicate (this->poa_.in ()); - } - - return this->Policy::_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/tie_si.cpp:68 - -template <class T> ACE_INLINE -CORBA::PolicyType POA_CORBA::Policy_tie<T>::policy_type ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - return this->ptr_->policy_type ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/tie_si.cpp:68 - -template <class T> ACE_INLINE -::CORBA::Policy_ptr POA_CORBA::Policy_tie<T>::copy ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - return this->ptr_->copy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); -} - -// TAO_IDL - Generated from -// be\be_visitor_operation/tie_si.cpp:68 - -template <class T> ACE_INLINE -void POA_CORBA::Policy_tie<T>::destroy ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - this->ptr_->destroy ( - ACE_ENV_SINGLE_ARG_PARAMETER - ); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Policy_Strategy.h b/TAO/tao/PortableServer/Policy_Strategy.h deleted file mode 100644 index d0854a95849..00000000000 --- a/TAO/tao/PortableServer/Policy_Strategy.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Policy_Strategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_POLICY_STRATEGY_H -#define TAO_POLICY_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/Environment.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.h" -#include "ace/CORBA_macros.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class Policy_Strategy - : public ACE_Service_Object - { - public: - virtual void strategy_init(TAO_Root_POA *poa ACE_ENV_ARG_DECL) = 0; - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL) = 0; - - virtual ~Policy_Strategy (void) {}; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_POLICY_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/PortableServer.cpp b/TAO/tao/PortableServer/PortableServer.cpp deleted file mode 100644 index ea45384c804..00000000000 --- a/TAO/tao/PortableServer/PortableServer.cpp +++ /dev/null @@ -1,177 +0,0 @@ -// $Id$ -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/PortableServer/Object_Adapter_Factory.h" -#include "tao/PortableServer/POA_Current_Factory.h" - -#include "tao/PortableServer/ThreadStrategyFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategyFactoryImpl.h" -#include "tao/PortableServer/IdAssignmentStrategyFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategyFactoryImpl.h" -#include "tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategyFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategyFactoryImpl.h" - -#include "tao/PortableServer/ThreadStrategyORBControl.h" -#include "tao/PortableServer/ThreadStrategySingle.h" -#include "tao/PortableServer/ThreadStrategySingleFactoryImpl.h" - -#include "tao/PortableServer/IdAssignmentStrategySystem.h" -#include "tao/PortableServer/IdAssignmentStrategyUser.h" - -#include "tao/PortableServer/IdUniquenessStrategyMultiple.h" -#include "tao/PortableServer/IdUniquenessStrategyUnique.h" - -#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" -#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" - -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "tao/PortableServer/RequestProcessingStrategyServantManager.h" - -#include "tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h" - -#include "tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h" - -#include "tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h" - -#include "tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategyTransientFactoryImpl.h" - -ACE_RCSID (PortableServer, - PortableServer, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -int -TAO_POA_Initializer::init (void) -{ - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategySystem - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategyUser - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyMultiple - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyUnique - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyUniqueFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyExplicit - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyImplicit - ); - - // Strategy factories - - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategyFactoryImpl - ); - -#if (TAO_HAS_MINIMUM_POA == 0) - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategySingleFactoryImpl - ); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyPersistentFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyTransientFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategyFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyAOMOnlyFactoryImpl - ); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyDefaultServantFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyServantActivatorFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_RequestProcessingStrategyServantLocatorFactoryImpl - ); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_ServantRetentionStrategyFactoryImpl - ); - - ACE_Service_Config::process_directive ( - ace_svc_desc_ServantRetentionStrategyRetainFactoryImpl - ); - -#if (TAO_HAS_MINIMUM_POA == 0) - ACE_Service_Config::process_directive ( - ace_svc_desc_ServantRetentionStrategyNonRetainFactoryImpl - ); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // Strategy implementations - - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategyORBControl - ); - -#if (TAO_HAS_MINIMUM_POA == 0) - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategySingle - ); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_TAO_POA_Current_Factory - ); - - return - ACE_Service_Config::process_directive ( - ace_svc_desc_TAO_Object_Adapter_Factory - ); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PortableServer.h b/TAO/tao/PortableServer/PortableServer.h deleted file mode 100644 index 256499a7456..00000000000 --- a/TAO/tao/PortableServer/PortableServer.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- C++ -*- */ - -//============================================================================= -/** - * @file PortableServer.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@uci.edu> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_H -#define TAO_PORTABLESERVER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Versioned_Namespace.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_PortableServer_Export TAO_POA_Initializer -{ -public: - /// Used to force the initialization of the ORB code. - static int init (void); -}; - -static int -TAO_Requires_POA_Initializer = TAO_POA_Initializer::init (); - -TAO_END_VERSIONED_NAMESPACE_DECL - -#define TAO_PORTABLESERVER_SAFE_INCLUDE -#include "tao/PortableServer/PortableServerC.h" -#undef TAO_PORTABLESERVER_SAFE_INCLUDE -#include "tao/PortableServer/POAManagerC.h" -#include "tao/PortableServer/POAManagerFactoryC.h" -#include "tao/PortableServer/PS_CurrentC.h" -#include "tao/PortableServer/PortableServer_Functions.h" -#include "tao/PortableServer/PortableServer_WFunctions.h" -#include "tao/PortableServer/PS_ForwardA.h" -#include "tao/PortableServer/IdUniquenessPolicyA.h" -#include "tao/PortableServer/ImplicitActivationPolicyA.h" -#include "tao/PortableServer/RequestProcessingPolicyA.h" -#include "tao/PortableServer/ServantRetentionPolicyA.h" -#include "tao/PortableServer/ThreadPolicyA.h" -#include "tao/PortableServer/IdAssignmentPolicyA.h" -#include "tao/PortableServer/LifespanPolicyA.h" - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_H */ diff --git a/TAO/tao/PortableServer/PortableServer.pidl b/TAO/tao/PortableServer/PortableServer.pidl deleted file mode 100644 index 14a8e4afdfc..00000000000 --- a/TAO/tao/PortableServer/PortableServer.pidl +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file PortableServer.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * This file was used to generate the code in - * PortableServerC.{h,inl,cpp}, using the following command: - * - * tao_idl.exe \ - * -o orig -Sci -Gp -Gd -Ge 1 -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * PortableServer.pidl - * - * After the file is generated a patch from the diffs directory must - * be applied. The patch: - * - * - Disables parts of the code under certain configurations. - * - * - Eliminates cycles in the include dependencies. - * - * - Adds non-idl components of PortableServer to the namespace. - * This includes (a) Servant (b) ServantBase (c) RefCountServantBase - * (d) Cookie (e) ObjectId_to_string (f) string_to_ObjectId (g) - * ObjectId_to_wstring (h) wstring_to_ObjectId (i) ServantBase_var - * (j) DynamicImplementation (k) LocalServantBase - * - * Apply patches using the following command: - * - * patch < diffs/PortableServer.diff - * - * Note: The diffs were generated using: - * - * rm diffs/PortableServer.diff - * for i in PortableServerC.{h,i,cpp}; do - * diff -wub orig/$i $i >> diffs/PortableServer.diff - * done - */ - -#ifndef _PORTABLE_SERVER_IDL_ -#define _PORTABLE_SERVER_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/PortableServer/POA.pidl" - -#endif // _POA_SERVER_IDL_ diff --git a/TAO/tao/PortableServer/PortableServerA.h b/TAO/tao/PortableServer/PortableServerA.h deleted file mode 100644 index e543e41332e..00000000000 --- a/TAO/tao/PortableServer/PortableServerA.h +++ /dev/null @@ -1,3 +0,0 @@ -// $Id$ -// This file deliberately empty. See bugzilla #2549. - diff --git a/TAO/tao/PortableServer/PortableServerC.cpp b/TAO/tao/PortableServer/PortableServerC.cpp deleted file mode 100644 index 0f3e5f7d0f5..00000000000 --- a/TAO/tao/PortableServer/PortableServerC.cpp +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:282 - - -#include "PortableServer.h" -#include "tao/AnyTypeCode/Null_RefCount_Policy.h" -#include "tao/AnyTypeCode/TypeCode_Constants.h" -#include "tao/AnyTypeCode/Alias_TypeCode_Static.h" -#include "tao/AnyTypeCode/String_TypeCode_Static.h" -#include "tao/CDR.h" - -// TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:71 -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - - - -// Arg traits specializations. -namespace TAO -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL - - - diff --git a/TAO/tao/PortableServer/PortableServerC.h b/TAO/tao/PortableServer/PortableServerC.h deleted file mode 100644 index 6c461a182f1..00000000000 --- a/TAO/tao/PortableServer/PortableServerC.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:154 - -#ifndef _TAO_IDL_PORTABLESERVER_PORTABLESERVERC_H_ -#define _TAO_IDL_PORTABLESERVER_PORTABLESERVERC_H_ - -#include /**/ "ace/pre.h" - - -#include "ace/config-all.h" - -#ifndef TAO_PORTABLESERVER_SAFE_INCLUDE -#error "You should not include PortableServerC.h directly, use PortableServer.h" -#endif /* !TAO_PORTABLESERVER_SAFE_INCLUDE */ - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/portableserver_export.h" -#include "tao/AnyTypeCode/AnyTypeCode_methods.h" -#include "tao/ORB.h" -#include "tao/SystemException.h" -#include "tao/Environment.h" -#include "tao/Versioned_Namespace.h" - -#include "tao/PortableServer/POAC.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export - -// TAO_IDL - Generated from -// be\be_visitor_traits.cpp:63 -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - - - -// Traits specializations. -namespace TAO -{ -} -TAO_END_VERSIONED_NAMESPACE_DECL - - - -// TAO_IDL - Generated from -// be\be_codegen.cpp:1092 -#include /**/ "ace/post.h" - -#endif /* ifndef */ - - diff --git a/TAO/tao/PortableServer/PortableServerS.h b/TAO/tao/PortableServer/PortableServerS.h deleted file mode 100644 index 17b1360599e..00000000000 --- a/TAO/tao/PortableServer/PortableServerS.h +++ /dev/null @@ -1,28 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// Skeleton file generation suppressed with command line option -SS diff --git a/TAO/tao/PortableServer/PortableServer_Functions.cpp b/TAO/tao/PortableServer/PortableServer_Functions.cpp deleted file mode 100644 index ac70be706c3..00000000000 --- a/TAO/tao/PortableServer/PortableServer_Functions.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "tao/PortableServer/PortableServer_Functions.h" - -ACE_RCSID (PortableServer, - PortableServer_Functions, - "$Id$") - -#include "ace/OS_NS_string.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - PortableServer::ObjectId * - string_to_ObjectId (const char *string) - { - // Size of string - // - // We DO NOT include the zero terminator, as this is simply an - // artifact of the way strings are stored in C. - // - CORBA::ULong buffer_size = static_cast <CORBA::ULong> - (ACE_OS::strlen (string)); - - // Create the buffer for the Id - CORBA::Octet *buffer = PortableServer::ObjectId::allocbuf (buffer_size); - - // Copy the contents - ACE_OS::memcpy (buffer, string, buffer_size); - - // Create and return a new ID - PortableServer::ObjectId *id = 0; - ACE_NEW_RETURN (id, - PortableServer::ObjectId (buffer_size, - buffer_size, - buffer, - 1), - 0); - - return id; - } - - char * - ObjectId_to_string (const PortableServer::ObjectId &id) - { - // Create space - char * string = CORBA::string_alloc (id.length ()); - - // Copy the data - ACE_OS::memcpy (string, id.get_buffer (), id.length ()); - - // Null terminate the string - string[id.length ()] = '\0'; - - // Return string - return string; - } -} - - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PortableServer_Functions.h b/TAO/tao/PortableServer/PortableServer_Functions.h deleted file mode 100644 index e14222ac6b9..00000000000 --- a/TAO/tao/PortableServer/PortableServer_Functions.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file PortableServer_Functions.h - * - * $Id$ - * - * PortableServer helper functions - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_FUNCTIONS_H -#define TAO_PORTABLESERVER_FUNCTIONS_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/orbconf.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export - -#if defined (TAO_EXPORT_NESTED_CLASSES) -# if defined (TAO_EXPORT_NESTED_MACRO) -# undef TAO_EXPORT_NESTED_MACRO -# endif /* defined (TAO_EXPORT_NESTED_MACRO) */ -# define TAO_EXPORT_NESTED_MACRO TAO_PortableServer_Export -#endif /* TAO_EXPORT_NESTED_CLASSES */ - -#include "tao/PortableServer/PS_ForwardC.h" -#include "ace/OS_NS_wchar.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - /// Utility functions for the other - TAO_NAMESPACE_STORAGE_CLASS char* ObjectId_to_string ( - const PortableServer::ObjectId &id); - - TAO_NAMESPACE_STORAGE_CLASS PortableServer::ObjectId *string_to_ObjectId ( - const char *id); -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_FUNCTIONS_H */ diff --git a/TAO/tao/PortableServer/PortableServer_WFunctions.cpp b/TAO/tao/PortableServer/PortableServer_WFunctions.cpp deleted file mode 100644 index d980f303b74..00000000000 --- a/TAO/tao/PortableServer/PortableServer_WFunctions.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "tao/PortableServer/PortableServer_WFunctions.h" - -ACE_RCSID (PortableServer, - PortableServer_WFunctions, - "$Id$") - -#include "ace/OS_NS_string.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - PortableServer::ObjectId * - wstring_to_ObjectId (const CORBA::WChar *string) - { - // Size of Id - // - // We DO NOT include the zero terminator, as this is simply an - // artifact of the way strings are stored in C. - // - u_int string_length = ACE_OS::wslen (string); - - CORBA::ULong buffer_size = string_length * sizeof (CORBA::WChar); - - // Create the buffer for the Id - CORBA::Octet *buffer = PortableServer::ObjectId::allocbuf (buffer_size); - - // Copy contents - ACE_OS::memcpy (buffer, string, buffer_size); - - // Create a new ID - PortableServer::ObjectId *id = 0; - ACE_NEW_RETURN (id, - PortableServer::ObjectId (buffer_size, - buffer_size, - buffer, - 1), - 0); - - return id; - } - - CORBA::WChar * - ObjectId_to_wstring (const PortableServer::ObjectId &id) - { - // Compute resulting wide string's length. - CORBA::ULong string_length = - id.length () / sizeof (CORBA::WChar); - - // Allocate an extra slot if the id's length is not "aligned" on a - // CORBA::WChar. - if (id.length () % sizeof (CORBA::WChar)) - string_length++; - - // Create space - note that this method adds + 1 for the '\0'. - CORBA::WChar* string = CORBA::wstring_alloc (string_length); - - // Copy the data - ACE_OS::memcpy (string, - id.get_buffer (), - id.length ()); - - // Null terminate the string - string[string_length] = '\0'; - - // Return string. - return string; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/PortableServer_WFunctions.h b/TAO/tao/PortableServer/PortableServer_WFunctions.h deleted file mode 100644 index 2d6cdcbabb4..00000000000 --- a/TAO/tao/PortableServer/PortableServer_WFunctions.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file PortableServer_WFunctions.h - * - * $Id$ - * - * PortableServer helper functions - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_WFUNCTIONS_H -#define TAO_PORTABLESERVER_WFUNCTIONS_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/orbconf.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export - -#if defined (TAO_EXPORT_NESTED_CLASSES) -# if defined (TAO_EXPORT_NESTED_MACRO) -# undef TAO_EXPORT_NESTED_MACRO -# endif /* defined (TAO_EXPORT_NESTED_MACRO) */ -# define TAO_EXPORT_NESTED_MACRO TAO_PortableServer_Export -#endif /* TAO_EXPORT_NESTED_CLASSES */ - -#include "tao/PortableServer/PS_ForwardC.h" -#include "ace/OS_NS_wchar.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - TAO_NAMESPACE_STORAGE_CLASS CORBA::WChar* ObjectId_to_wstring ( - const PortableServer::ObjectId &id); - - TAO_NAMESPACE_STORAGE_CLASS PortableServer::ObjectId *wstring_to_ObjectId ( - const CORBA::WChar *id); -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_WFUNCTIONS_H */ diff --git a/TAO/tao/PortableServer/PortableServer_include.pidl b/TAO/tao/PortableServer/PortableServer_include.pidl deleted file mode 100644 index 95d7690fc8d..00000000000 --- a/TAO/tao/PortableServer/PortableServer_include.pidl +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @file PortableServer_include.pidl - * - * $Id$ - * - * @brief Include file for use in applications that need PortableServer.pidl. - * - * This file just includes PortableServer.pidl. The *C.h file generated from - * this is hand-crafted to itself include PortableServer.h instead of - * PortableServerC.h (which will produce a compiler error message if - * included directly). The PortableServer_includeC.h file can then be - * included directly and automatically by the IDL compiler when - * building the application. - * - * 1. Run the tao_idl compiler on the pidl file. The command used for - * this is: - * - * tao_idl -o orig -St -Sp -Sci -SS - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" - * -Wb,post_include="ace/post.h" - * PortableServer_include.pidl - * - * 2. Then change this line in PortableServer_includeC.h: - * - * #include "PortableServerC.h" - * - * to - * - * #include "PortableServer.h" - */ - -#ifndef _PORTABLESERVER_INCLUDE_IDL_ -#define _PORTABLESERVER_INCLUDE_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/PortableServer/PortableServer.pidl" - -#endif /* _PORTABLESERVER_INCLUDE_IDL_ */ diff --git a/TAO/tao/PortableServer/PortableServer_includeA.h b/TAO/tao/PortableServer/PortableServer_includeA.h deleted file mode 100644 index 2874993878d..00000000000 --- a/TAO/tao/PortableServer/PortableServer_includeA.h +++ /dev/null @@ -1,44 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:390 - -#ifndef _TAO_IDL_ORIG_PORTABLESERVER_INCLUDEA_H_ -#define _TAO_IDL_ORIG_PORTABLESERVER_INCLUDEA_H_ - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/PortableServer_includeC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include /**/ "ace/post.h" -#endif /* ifndef */ - diff --git a/TAO/tao/PortableServer/PortableServer_includeC.h b/TAO/tao/PortableServer/PortableServer_includeC.h deleted file mode 100644 index 8f2a1503f6c..00000000000 --- a/TAO/tao/PortableServer/PortableServer_includeC.h +++ /dev/null @@ -1,74 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be\be_codegen.cpp:154 - -#ifndef _TAO_IDL_PORTABLESERVER_INCLUDEC_H_ -#define _TAO_IDL_PORTABLESERVER_INCLUDEC_H_ - -#include /**/ "ace/pre.h" - - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/portableserver_export.h" -#include "tao/ORB.h" -#include "tao/SystemException.h" -#include "tao/Environment.h" - -#include "tao/PortableServer/PortableServer.h" - -#if defined (TAO_EXPORT_MACRO) -#undef TAO_EXPORT_MACRO -#endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export - -// TAO_IDL - Generated from -// be\be_visitor_traits.cpp:61 - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Traits specializations. -namespace TAO -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -// TAO_IDL - Generated from -// be\be_codegen.cpp:1028 - -#include /**/ "ace/post.h" - -#endif /* ifndef */ - - diff --git a/TAO/tao/PortableServer/PortableServer_includeS.h b/TAO/tao/PortableServer/PortableServer_includeS.h deleted file mode 100644 index 17b1360599e..00000000000 --- a/TAO/tao/PortableServer/PortableServer_includeS.h +++ /dev/null @@ -1,28 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt University -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// Skeleton file generation suppressed with command line option -SS diff --git a/TAO/tao/PortableServer/Regular_POA.cpp b/TAO/tao/PortableServer/Regular_POA.cpp deleted file mode 100644 index 08f4965c8e7..00000000000 --- a/TAO/tao/PortableServer/Regular_POA.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "tao/PortableServer/Regular_POA.h" - -ACE_RCSID (PortableServer, - POA, - "$Id$") - -// -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Regular_POA.inl" -#endif /* ! __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Regular_POA::TAO_Regular_POA (const TAO_Root_POA::String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL) - : TAO_Root_POA (name, - poa_manager, - policies, - parent, - lock, - thread_lock, - orb_core, - object_adapter - ACE_ENV_ARG_PARAMETER), - parent_ (parent) -{ -} - -TAO_Regular_POA::~TAO_Regular_POA (void) -{ -} - -void -TAO_Regular_POA::remove_from_parent_i (ACE_ENV_SINGLE_ARG_DECL) -{ - // Remove POA from the parent - if (this->parent_ != 0) - { - int result = this->parent_->delete_child (this->name_); - if (result != 0) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - } -} - -CORBA::Boolean -TAO_Regular_POA::root (void) const -{ - return (parent_ == 0); -} - -char -TAO_Regular_POA::root_key_type (void) -{ - if (this->parent_ != 0) - { - return TAO_Root_POA::non_root_key_char (); - } - else - { - return TAO_Root_POA::root_key_type (); - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Regular_POA.h b/TAO/tao/PortableServer/Regular_POA.h deleted file mode 100644 index eddd7bf3205..00000000000 --- a/TAO/tao/PortableServer/Regular_POA.h +++ /dev/null @@ -1,79 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Regular_POA.h - * - * $Id$ - * - * Header file for CORBA's ORB type. - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_REGULAR_POA_H -#define TAO_REGULAR_POA_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Root_POA.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_Regular_POA - * - * @brief Implementation of the PortableServer::POA interface. - * - * Implementation of the PortableServer::POA interface. - */ -class TAO_PortableServer_Export TAO_Regular_POA - : public TAO_Root_POA -{ -public: - TAO_Regular_POA (const String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL); - - virtual ~TAO_Regular_POA (void); - - PortableServer::POA_ptr the_parent (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -protected: - virtual void remove_from_parent_i (ACE_ENV_SINGLE_ARG_DECL); - - virtual CORBA::Boolean root (void) const; - - virtual char root_key_type (void); - - /// The parent of this POA, be aware that in case this pointer is nill, - /// we are a parent. This can be achieved by deriving from this Regular_POA - /// and pass a nill pointer as parent with the constructor. - TAO_Root_POA *parent_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -// **************************************************************** - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Regular_POA.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_REGULAR_POA_H */ diff --git a/TAO/tao/PortableServer/Regular_POA.inl b/TAO/tao/PortableServer/Regular_POA.inl deleted file mode 100644 index 04b4b4b091b..00000000000 --- a/TAO/tao/PortableServer/Regular_POA.inl +++ /dev/null @@ -1,14 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE PortableServer::POA_ptr -TAO_Regular_POA::the_parent (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return PortableServer::POA::_duplicate (this->parent_); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingPolicy.cpp b/TAO/tao/PortableServer/RequestProcessingPolicy.cpp deleted file mode 100644 index 7b55a084199..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingPolicy.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "tao/PortableServer/RequestProcessingPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - RequestProcessingPolicy, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingPolicy::RequestProcessingPolicy ( - ::PortableServer::RequestProcessingPolicyValue value) : - value_ (value) - { - } - - CORBA::Policy_ptr - RequestProcessingPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - RequestProcessingPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - RequestProcessingPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - RequestProcessingPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return value_; - } - - CORBA::PolicyType - RequestProcessingPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::REQUEST_PROCESSING_POLICY_ID; - } - - TAO_Cached_Policy_Type - RequestProcessingPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_REQUEST_PROCESSING; - } - - TAO_Policy_Scope - RequestProcessingPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/RequestProcessingPolicy.h b/TAO/tao/PortableServer/RequestProcessingPolicy.h deleted file mode 100644 index 34f850757f1..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGPOLICY_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/RequestProcessingPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingPolicy : - public virtual ::PortableServer::RequestProcessingPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - RequestProcessingPolicy (::PortableServer::RequestProcessingPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::RequestProcessingPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::RequestProcessingPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGPOLICY_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingPolicy.pidl b/TAO/tao/PortableServer/RequestProcessingPolicy.pidl deleted file mode 100644 index a7d47f4747c..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingPolicy.pidl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file RequestProcessingPolicy.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * RequestProcessingPolicy.pidl - */ - -#ifndef _PORTABLESERVER_REQUESTPROCESSINGPOLICY_IDL_ -#define _PORTABLESERVER_REQUESTPROCESSINGPOLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum RequestProcessingPolicyValue - { - USE_ACTIVE_OBJECT_MAP_ONLY, - USE_DEFAULT_SERVANT, - USE_SERVANT_MANAGER - }; - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - - local interface RequestProcessingPolicy : CORBA::Policy - { - readonly attribute RequestProcessingPolicyValue value; - }; - -#endif - -}; - -#endif // _PORTABLESERVER_REQUESTPROCESSINGPOLICY_IDL_ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategy.cpp b/TAO/tao/PortableServer/RequestProcessingStrategy.cpp deleted file mode 100644 index 535faabda48..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategy.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategy.cpp - * - * $Id$ - */ -//============================================================================= - -#include "tao/PortableServer/RequestProcessingStrategy.h" - -ACE_RCSID (PortableServer, - RequestProcessingStrategy, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy::RequestProcessingStrategy (void) - : poa_ (0) - { - } - - void - RequestProcessingStrategy::strategy_init( - TAO_Root_POA *poa, - ::PortableServer::ServantRetentionPolicyValue sr_value - ACE_ENV_ARG_DECL_NOT_USED) - { - poa_ = poa; - sr_value_ = sr_value; - } - - void - RequestProcessingStrategy::strategy_init( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL_NOT_USED) - { - poa_ = poa; - } - - void - RequestProcessingStrategy::strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - poa_ = 0; - } - - ::PortableServer::ServantRetentionPolicyValue - RequestProcessingStrategy::sr_type() const - { - return sr_value_; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingStrategy.h b/TAO/tao/PortableServer/RequestProcessingStrategy.h deleted file mode 100644 index 8c767103d0b..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategy.h +++ /dev/null @@ -1,145 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_REQUEST_PROCESSING_STRATEGY_H -#define TAO_REQUEST_PROCESSING_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Policy_Strategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/Servant_Location.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - class ServantManager; - typedef ServantManager *ServantManager_ptr; -} - -namespace TAO -{ - namespace Portable_Server - { - class Servant_Upcall; - class POA_Current_Impl; - } -} - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategy - : public Policy_Strategy - { - public: - RequestProcessingStrategy (void); - - virtual void strategy_init( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL); - - virtual void strategy_init( - TAO_Root_POA *poa, - ::PortableServer::ServantRetentionPolicyValue - ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - -#if (TAO_HAS_MINIMUM_POA == 0) - - virtual PortableServer::ServantManager_ptr get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) = 0; - - virtual void set_servant_manager ( - PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) = 0; - - virtual void set_servant (PortableServer::Servant servant ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) = 0; - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - virtual PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) = 0; - - virtual TAO_SERVANT_LOCATION locate_servant ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::Servant locate_servant ( - const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) = 0; - - virtual void cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) = 0; - - virtual void etherealize_objects (CORBA::Boolean etherealize_objects) = 0; - - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) = 0; - - virtual void post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall) = 0; - - virtual ::PortableServer::RequestProcessingPolicyValue type() const = 0; - - virtual ::PortableServer::ServantRetentionPolicyValue sr_type() const; - - protected: - TAO_Root_POA* poa_; - ::PortableServer::ServantRetentionPolicyValue sr_value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_REQUEST_PROCESSING_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp deleted file mode 100644 index 877f8033219..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp +++ /dev/null @@ -1,185 +0,0 @@ -// -*- C++ -*- - -#include "tao/ORB_Constants.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "tao/PortableServer/ServantManagerC.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Servant_Base.h" -#include "tao/PortableServer/Root_POA.h" - -ACE_RCSID (PortableServer, - Request_Processing, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategyAOMOnly::RequestProcessingStrategyAOMOnly() - { - } - -#if (TAO_HAS_MINIMUM_POA == 0) - - PortableServer::ServantManager_ptr - RequestProcessingStrategyAOMOnly::get_servant_manager (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - PortableServer::ServantManager::_nil ()); - } - - void - RequestProcessingStrategyAOMOnly::set_servant_manager ( - PortableServer::ServantManager_ptr /*imgr*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW (PortableServer::POA::WrongPolicy ()); - } - - void - RequestProcessingStrategyAOMOnly::set_servant ( - PortableServer::Servant /*servant*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW (PortableServer::POA::WrongPolicy ()); - } - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - PortableServer::Servant - RequestProcessingStrategyAOMOnly::get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - TAO_SERVANT_LOCATION - RequestProcessingStrategyAOMOnly::locate_servant ( - const PortableServer::ObjectId & system_id, - PortableServer::Servant & servant - ACE_ENV_ARG_DECL) - { - return this->poa_->servant_present (system_id, - servant - ACE_ENV_ARG_PARAMETER); - } - - PortableServer::Servant - RequestProcessingStrategyAOMOnly::locate_servant ( - const char * /*operation*/, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int & /*wait_occurred_restart_call*/ - ACE_ENV_ARG_DECL) - { - PortableServer::Servant servant = 0; - - servant = this->poa_->find_servant (system_id, - servant_upcall, - poa_current_impl - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant == 0) - { - ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 2, - CORBA::COMPLETED_NO), - 0); - } - - return servant; - } - - PortableServer::Servant - RequestProcessingStrategyAOMOnly::system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - { - return this->poa_->find_servant (system_id - ACE_ENV_ARG_PARAMETER); - } - - PortableServer::Servant - RequestProcessingStrategyAOMOnly::id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - return this->poa_->user_id_to_servant_i (id - ACE_ENV_ARG_PARAMETER); - } - - void - RequestProcessingStrategyAOMOnly::cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL) - { - if (servant) - { - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - servant->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - // This operation causes the association of the Object Id specified - // by the oid parameter and its servant to be removed from the - // Active Object Map. - int result = this->poa_->unbind_using_user_id (user_id); - - if (result != 0) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - } - - void - RequestProcessingStrategyAOMOnly::etherealize_objects ( - CORBA::Boolean /*etherealize_objects*/) - { - } - - PortableServer::ObjectId * - RequestProcessingStrategyAOMOnly::servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - return this->poa_->servant_to_user_id (servant ACE_ENV_ARG_PARAMETER); - } - - void - RequestProcessingStrategyAOMOnly::post_invoke_servant_cleanup( - const PortableServer::ObjectId &/*system_id*/, - const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) - { - } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyAOMOnly::type() const - { - return ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h deleted file mode 100644 index b8b1b493ad4..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h +++ /dev/null @@ -1,121 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyAOMOnly.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_REQUESTPROCESSINGSTRATEGYAOMONLY_H -#define TAO_REQUESTPROCESSINGSTRATEGYAOMONLY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/RequestProcessingStrategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/PortableServer.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - /** - * @class RequestProcessingStrategyAOMOnly - * - * Request Processing Strategy which only uses the Active Object Map (AOM) - */ - class RequestProcessingStrategyAOMOnly - : public RequestProcessingStrategy - { - public: - RequestProcessingStrategyAOMOnly (void); - -#if (TAO_HAS_MINIMUM_POA == 0) - - PortableServer::ServantManager_ptr - get_servant_manager (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void - set_servant_manager (PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void - set_servant (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - PortableServer::Servant - get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual - TAO_SERVANT_LOCATION - locate_servant (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - virtual - PortableServer::Servant - locate_servant (const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - virtual void cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL); - - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); - - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual void post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_REQUESTPROCESSINGSTRATEGYAOMONLY_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp deleted file mode 100644 index 820605a1d42..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - RequestProcessingStrategyAOMOnlyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyAOMOnlyFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue /*srvalue*/) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyAOMOnly, 0); - break; - } - default : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyAOMOnlyFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyAOMOnlyFactoryImpl::destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyAOMOnlyFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyAOMOnlyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyAOMOnlyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyAOMOnlyFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyAOMOnlyFactoryImpl) diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h deleted file mode 100644 index 44a9df665af..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h +++ /dev/null @@ -1,55 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyAOMOnlyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyAOMOnlyFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyAOMOnlyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyAOMOnlyFactoryImpl) - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp deleted file mode 100644 index 63e873629e9..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp +++ /dev/null @@ -1,288 +0,0 @@ -// -*- C++ -*- - -#include "tao/ORB_Constants.h" -#include "tao/TSS_Resources.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/ServantManagerC.h" -#include "tao/PortableServer/Servant_Base.h" -#include "tao/PortableServer/POA_Current_Impl.h" - -ACE_RCSID (PortableServer, - Request_Processing, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategyDefaultServant::RequestProcessingStrategyDefaultServant (void) - : default_servant_ (0) - { - } - - void - RequestProcessingStrategyDefaultServant::strategy_cleanup( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - this->default_servant_ = 0; - } - - PortableServer::ServantManager_ptr - RequestProcessingStrategyDefaultServant::get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - PortableServer::ServantManager::_nil ()); - } - - void - RequestProcessingStrategyDefaultServant::set_servant_manager ( - PortableServer::ServantManager_ptr /*imgr*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW (PortableServer::POA::WrongPolicy ()); - } - - PortableServer::Servant - RequestProcessingStrategyDefaultServant::get_servant ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // This operation returns the default servant associated with the - // POA. - return this->default_servant_.in (); - } - - void - RequestProcessingStrategyDefaultServant::set_servant ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // This operation registers the specified servant with the POA as - // the default servant. This servant will be used for all requests - // for which no servant is found in the Active Object Map. - this->default_servant_ = servant; - - // The implementation of set_servant will invoke _add_ref at least - // once on the Servant argument before returning. When the POA no - // longer needs the Servant, it will invoke _remove_ref on it the - // same number of times. - if (servant != 0) - { - // A recursive thread lock without using a recursive thread - // lock. Non_Servant_Upcall has a magic constructor and - // destructor. We unlock the Object_Adapter lock for the - // duration of the servant activator upcalls; reacquiring once - // the upcalls complete. Even though we are releasing the lock, - // other threads will not be able to make progress since - // <Object_Adapter::non_servant_upcall_in_progress_> has been - // set. - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - } - - TAO_SERVANT_LOCATION - RequestProcessingStrategyDefaultServant::locate_servant ( - const PortableServer::ObjectId & system_id, - PortableServer::Servant & servant - ACE_ENV_ARG_DECL) - { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; - - location = this->poa_->servant_present (system_id, - servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND); - - if (location == TAO_SERVANT_NOT_FOUND) - { - if (this->default_servant_.in () != 0) - { - location = TAO_DEFAULT_SERVANT; - } - } - - return location; - } - - PortableServer::Servant - RequestProcessingStrategyDefaultServant::locate_servant ( - const char * /*operation*/, - const PortableServer::ObjectId & system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int & /*wait_occurred_restart_call*/ - ACE_ENV_ARG_DECL) - { - PortableServer::Servant servant = 0; - - servant = this->poa_->find_servant (system_id, - servant_upcall, - poa_current_impl - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant == 0) - { - // If the POA has the USE_DEFAULT_SERVANT policy, a default servant - // has been associated with the POA so the POA will invoke the - // appropriate method on that servant. If no servant has been - // associated with the POA, the POA raises the OBJ_ADAPTER system - // exception. - PortableServer::Servant default_servant = this->default_servant_.in (); - if (default_servant == 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 3, - CORBA::COMPLETED_NO), - 0); - } - else - { - // Success - servant = default_servant; - } - } - - return servant; - } - - PortableServer::Servant - RequestProcessingStrategyDefaultServant::system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - { - PortableServer::Servant servant = this->default_servant_.in (); - - if (servant == 0) - { - servant = this->poa_->find_servant (system_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - return servant; - } - - PortableServer::Servant - RequestProcessingStrategyDefaultServant::id_to_servant ( - const PortableServer::ObjectId & /*id*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - PortableServer::Servant servant = this->default_servant_.in (); - - if (servant == 0) - { - /* - * If using default servant request processing strategy but - * no default servant is available, we will raise the - * ObjectNotActive system exception. - */ - ACE_THROW_RETURN (PortableServer::POA::ObjectNotActive (), - 0); - } - - return servant; - } - - void - RequestProcessingStrategyDefaultServant::cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL) - { - if (servant) - { - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - servant->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - // This operation causes the association of the Object Id specified - // by the oid parameter and its servant to be removed from the - // Active Object Map. - int result = this->poa_->unbind_using_user_id (user_id); - - if (result != 0) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - } - - void - RequestProcessingStrategyDefaultServant::etherealize_objects ( - CORBA::Boolean /*etherealize_objects*/) - { - } - - PortableServer::ObjectId * - RequestProcessingStrategyDefaultServant::servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - PortableServer::Servant default_servant = this->default_servant_.in (); - - if (default_servant != 0 && - default_servant == servant) - { - // If they are the same servant, then check if we are in an - // upcall. - TAO::Portable_Server::POA_Current_Impl *poa_current_impl = - static_cast <TAO::Portable_Server::POA_Current_Impl *> - (TAO_TSS_Resources::instance ()->poa_current_impl_); - // If we are in an upcall on the default servant, return the - // ObjectId associated with the current invocation. - if (poa_current_impl != 0 && - servant == poa_current_impl->servant ()) - { - return poa_current_impl->get_object_id (); - } - } - - return this->poa_->servant_to_user_id (servant ACE_ENV_ARG_PARAMETER); - } - - void - RequestProcessingStrategyDefaultServant::post_invoke_servant_cleanup( - const PortableServer::ObjectId &/*system_id*/, - const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) - { - } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyDefaultServant::type() const - { - return ::PortableServer::USE_DEFAULT_SERVANT; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h deleted file mode 100644 index 6752b0dfe36..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyDefaultServant.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANT_H -#define TAO_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANT_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/RequestProcessingStrategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Base.h" - -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/PortableServer.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategyDefaultServant - : public RequestProcessingStrategy - { - public: - RequestProcessingStrategyDefaultServant (void); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - PortableServer::ServantManager_ptr - get_servant_manager (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void set_servant_manager ( - PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void set_servant ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual TAO_SERVANT_LOCATION locate_servant ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant locate_servant ( - const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - virtual void cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL); - - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); - - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual void post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; - - private: - PortableServer::ServantBase_var default_servant_; - }; - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANT_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp deleted file mode 100644 index 9ad0493cb75..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - RequestProcessingStrategyDefaultServantFI, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyDefaultServantFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue /*srvalue*/) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_DEFAULT_SERVANT : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyDefaultServant, 0); - break; - } - default : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyDefaultServantFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyDefaultServantFactoryImpl::destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyDefaultServantFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyDefaultServantFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyDefaultServantFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyDefaultServantFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyDefaultServantFactoryImpl) - - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h deleted file mode 100644 index 220c4ffdfc1..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyDefaultServantFI.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANTFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANTFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyDefaultServantFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyDefaultServantFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyDefaultServantFactoryImpl) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYDEFAULTSERVANTFACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h b/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h deleted file mode 100644 index 9ee872f1a90..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/RequestProcessingPolicyC.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategy; - - class TAO_PortableServer_Export RequestProcessingStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) = 0; - - virtual void destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp deleted file mode 100644 index 138fee4eb92..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/RequestProcessingStrategyFactoryImpl.h" -#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" -#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - RequestProcessingStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) - { - RequestProcessingStrategy* strategy = 0; - RequestProcessingStrategyFactory *strategy_factory = 0; - - switch (value) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyAOMOnlyFactory"); - - break; - } - case ::PortableServer::USE_DEFAULT_SERVANT : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyDefaultServantFactory"); - - break; - } - case ::PortableServer::USE_SERVANT_MANAGER : - { -#if (TAO_HAS_MINIMUM_POA == 0) - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyServantActivatorFactory"); - - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyServantLocatorFactory"); - - break; - } - } -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - break; - } - } - - if (strategy_factory != 0) - strategy = strategy_factory->create (value, srvalue); - else - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("RequestProcessingStrategyFactory"))); - - return strategy; - } - - void - RequestProcessingStrategyFactoryImpl::destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL) - { - RequestProcessingStrategyFactory *strategy_factory = 0; - - switch (strategy->type ()) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyAOMOnlyFactory"); - - break; - } - case ::PortableServer::USE_DEFAULT_SERVANT : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyDefaultServantFactory"); - - break; - } - case ::PortableServer::USE_SERVANT_MANAGER : - { -#if (TAO_HAS_MINIMUM_POA == 0) - switch (strategy->sr_type ()) - { - case ::PortableServer::RETAIN : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyServantActivatorFactory"); - - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory = - ACE_Dynamic_Service<RequestProcessingStrategyFactory>::instance ("RequestProcessingStrategyServantLocatorFactory"); - break; - } - } -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - break; - } - } - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyFactoryImpl) diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h b/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h deleted file mode 100644 index fa07f1c30a3..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyFactoryImpl) - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp deleted file mode 100644 index 2010b5e9076..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp +++ /dev/null @@ -1,355 +0,0 @@ -// $Id$ -#include "tao/ORB_Constants.h" -#include "tao/PortableServer/ServantActivatorC.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" -#include "tao/PortableServer/Servant_Base.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/POA_Current_Impl.h" -#include "tao/PortableServer/Servant_Upcall.h" - -ACE_RCSID (PortableServer, - Request_Processing, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategyServantActivator::RequestProcessingStrategyServantActivator (void) : - etherealize_objects_ (1) - { - } - - void - RequestProcessingStrategyServantActivator::strategy_cleanup ( - ACE_ENV_SINGLE_ARG_DECL) - { - { - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - this->servant_activator_ = - PortableServer::ServantActivator::_nil (); - } - - RequestProcessingStrategy::strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - PortableServer::ServantManager_ptr - RequestProcessingStrategyServantActivator::get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - return PortableServer::ServantManager::_duplicate (this->servant_activator_.in ()); - } - - void - RequestProcessingStrategyServantActivator::set_servant_manager ( - PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // This operation sets the default servant manager associated with the - // POA. This operation may only be invoked once after a POA has been - // created. Attempting to set the servant manager after one has already - // been set will result in the BAD_INV_ORDER system exception with - // standard minor code 6 being raised (see 11.3.9.12 of the corba spec) - if (!CORBA::is_nil (this->servant_activator_.in ())) - { - ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 6, - CORBA::COMPLETED_NO)); - } - - this->servant_activator_ = - PortableServer::ServantActivator::_narrow (imgr - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->validate_servant_manager (this->servant_activator_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - TAO_SERVANT_LOCATION - RequestProcessingStrategyServantActivator::locate_servant ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) - { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; - - location = this->poa_->servant_present (system_id, - servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND); - - if (location == TAO_SERVANT_NOT_FOUND) - { - if (!CORBA::is_nil (this->servant_activator_.in ())) - { - location = TAO_SERVANT_MANAGER; - } - } - - return location; - } - - PortableServer::Servant - RequestProcessingStrategyServantActivator::locate_servant ( - const char * /*operation*/, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - { - PortableServer::Servant servant = 0; - - servant = this->poa_->find_servant (system_id, - servant_upcall, - poa_current_impl - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant != 0) - { - return servant; - } - - // If the POA has the USE_SERVANT_MANAGER policy, a servant manager - // has been associated with the POA so the POA will invoke incarnate - // or preinvoke on it to find a servant that may handle the - // request. (The choice of method depends on the NON_RETAIN or - // RETAIN policy of the POA.) If no servant manager has been - // associated with the POA, the POA raises the OBJ_ADAPTER system - // exception. - // - // If a servant manager is located and invoked, but the servant - // manager is not directly capable of incarnating the object, it - // (the servant manager) may deal with the circumstance in a variety - // of ways, all of which are the application's responsibility. Any - // system exception raised by the servant manager will be returned - // to the client in the reply. In addition to standard CORBA - // exceptions, a servant manager is capable of raising a - // ForwardRequest exception. This exception includes an object - // reference. - // - - this->validate_servant_manager (this->servant_activator_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - servant = - this->incarnate_servant (poa_current_impl.object_id () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // If the incarnate operation returns a servant that is - // already active for a different Object Id and if the POA - // also has the UNIQUE_ID policy, the incarnate has violated - // the POA policy and is considered to be in error. The POA - // will raise an OBJ_ADAPTER system exception for the - // request. - bool may_activate = - this->poa_->is_servant_activation_allowed (servant, - wait_occurred_restart_call); - - if (!may_activate) - { - // If we are not allowed to activate the servant, throw an exception - // etherealize is not called because the servant is never added to - // the active object map - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - // The POA enters the returned Servant value into the Active - // Object Map so that subsequent requests with the same - // ObjectId value will be delivered directly to that servant - // without invoking the servant manager. Only run if there - // are no errors or if a restart is not required. - if (!wait_occurred_restart_call) - { - int result = - this->poa_-> - rebind_using_user_id_and_system_id (servant, - poa_current_impl.object_id (), - system_id, - servant_upcall); - if (result != 0) - { - // Throw an exception, etherealize is not called because servant - // is not added to the active object map - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - // Increment the reference count on the servant upcall. - servant_upcall.increment_servant_refcount (); - } - else - { - CORBA::Boolean cleanup_in_progress = 0; - this->etherealize_servant (poa_current_impl.object_id (), - servant, - cleanup_in_progress - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // We ended up waiting on a condition variable, the - // POA state may have changed while we are waiting. - // Therefore, we need to restart this call. - return 0; - } - - // Success - return servant; - } - - void - RequestProcessingStrategyServantActivator::etherealize_servant ( - const PortableServer::ObjectId& object_id, - PortableServer::Servant servant, - CORBA::Boolean cleanup_in_progress - ACE_ENV_ARG_DECL) - { - CORBA::Boolean remaining_activations = - this->poa_->servant_has_remaining_activations (servant); - - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - // @todo This is not according to the spec. According to 11.3.6.2 at the - // end when etherealize returns a system exception the POA ignores the - // exception - this->servant_activator_->etherealize (object_id, - this->poa_, - servant, - cleanup_in_progress, - remaining_activations - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - PortableServer::Servant - RequestProcessingStrategyServantActivator::incarnate_servant ( - const PortableServer::ObjectId& object_id - ACE_ENV_ARG_DECL) - { - PortableServer::Servant servant = 0; - - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - // @@ - // Invocations of incarnate on the servant manager are serialized. - // Invocations of etherealize on the servant manager are serialized. - // Invocations of incarnate and etherealize on the servant manager are mutually exclusive. - servant = this->servant_activator_->incarnate (object_id, - this->poa_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant == 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 7, - CORBA::COMPLETED_NO), - 0); - } - else - { - return servant; - } - } - - void - RequestProcessingStrategyServantActivator::cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL) - { - // If a servant manager is associated with the POA, - // ServantLocator::etherealize will be invoked with the oid and the - // servant. (The deactivate_object operation does not wait for the - // etherealize operation to complete before deactivate_object - // returns.) - // - // Note: If the servant associated with the oid is serving multiple - // Object Ids, ServantLocator::etherealize may be invoked multiple - // times with the same servant when the other objects are - // deactivated. It is the responsibility of the object - // implementation to refrain from destroying the servant while it is - // active with any Id. - - // If the POA has no ServantActivator associated with it, the POA - // implementation calls _remove_ref when all operation invocations - // have completed. If there is a ServantActivator, the Servant is - // consumed by the call to ServantActivator::etherealize instead. - - // @bala, is this order correct, see 11.3.9.17 of the spec, it - // says first remove from the map, then etherealize. not the - // other way around - // @@ Johnny, you are right! This will not show up until a - // thread is trying to activate the object in another thread - // using activate_object_with_id (). A test case is a must for - // atleast this issue. - if (servant) - { - if (this->etherealize_objects_ && - !CORBA::is_nil (this->servant_activator_.in ())) - { - this->etherealize_servant (user_id, - servant, - this->poa_->cleanup_in_progress () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - servant->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - } - - // This operation causes the association of the Object Id specified - // by the oid parameter and its servant to be removed from the - // Active Object Map. - int result = this->poa_->unbind_using_user_id (user_id); - - if (result != 0) - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - - void - RequestProcessingStrategyServantActivator::etherealize_objects ( - CORBA::Boolean etherealize_objects) - { - this->etherealize_objects_ = etherealize_objects; - } - - void - RequestProcessingStrategyServantActivator::post_invoke_servant_cleanup( - const PortableServer::ObjectId &/*system_id*/, - const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h deleted file mode 100644 index 19e1337576b..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h +++ /dev/null @@ -1,98 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantActivator.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATOR_H -#define TAO_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATOR_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/RequestProcessingStrategyServantManager.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/ServantActivatorC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategyServantActivator - : public RequestProcessingStrategyServantManager - { - public: - RequestProcessingStrategyServantActivator (void); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - PortableServer::ServantManager_ptr get_servant_manager (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void set_servant_manager (PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual TAO_SERVANT_LOCATION locate_servant ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant locate_servant ( - const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL); - - virtual void cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL); - - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); - - virtual void post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - private: - PortableServer::Servant incarnate_servant ( - const PortableServer::ObjectId& object_id - ACE_ENV_ARG_DECL); - - void etherealize_servant (const PortableServer::ObjectId& object_id, - PortableServer::Servant servant, - CORBA::Boolean cleanup_in_progress - ACE_ENV_ARG_DECL); - - private: - PortableServer::ServantActivator_var servant_activator_; - CORBA::Boolean etherealize_objects_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATOR_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp deleted file mode 100644 index 69ae2437301..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - RequestProcessingStrategyServantActivatorFactoryImpl, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyServantActivatorFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_SERVANT_MANAGER : - { - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantActivator, 0); - break; - } - case ::PortableServer::NON_RETAIN : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantActivatorFactoryImpl")); - break; - } - } - break; - } - default : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantActivatorFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyServantActivatorFactoryImpl::destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyServantActivatorFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyServantActivatorFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyServantActivatorFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyServantActivatorFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyServantActivatorFactoryImpl) - - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h deleted file mode 100644 index b9aae2ca3d6..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantActivatorFI.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATORFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATORFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyServantActivatorFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyServantActivatorFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyServantActivatorFactoryImpl) - - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTACTIVATORFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp deleted file mode 100644 index 481521ad6fb..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp +++ /dev/null @@ -1,259 +0,0 @@ -#include "tao/ORB_Constants.h" -#include "tao/PortableServer/ServantLocatorC.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/POA_Current_Impl.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Servant_Base.h" - -ACE_RCSID (PortableServer, - Request_Processing, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategyServantLocator::RequestProcessingStrategyServantLocator (void) - { - } - - void - RequestProcessingStrategyServantLocator::strategy_cleanup( - ACE_ENV_SINGLE_ARG_DECL) - { - { - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - this->servant_locator_ = PortableServer::ServantLocator::_nil (); - } - - RequestProcessingStrategy::strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - PortableServer::ServantManager_ptr - RequestProcessingStrategyServantLocator::get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - return PortableServer::ServantManager::_duplicate (this->servant_locator_.in ()); - } - - void - RequestProcessingStrategyServantLocator::set_servant_manager ( - PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // This operation sets the default servant manager associated with the - // POA. This operation may only be invoked once after a POA has been - // created. Attempting to set the servant manager after one has already - // been set will result in the BAD_INV_ORDER system exception with - // standard minor code 6 being raised (see 11.3.9.12 of the corba spec) - if (!CORBA::is_nil (this->servant_locator_.in ())) - { - ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 6, - CORBA::COMPLETED_NO)); - } - - this->servant_locator_ = PortableServer::ServantLocator::_narrow (imgr - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->validate_servant_manager (this->servant_locator_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - TAO_SERVANT_LOCATION - RequestProcessingStrategyServantLocator::locate_servant ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) - { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; - - location = this->poa_->servant_present (system_id, - servant - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND); - - if (location == TAO_SERVANT_NOT_FOUND) - { - if (!CORBA::is_nil (this->servant_locator_.in ())) - { - location = TAO_SERVANT_MANAGER; - } - } - - return location; - } - - PortableServer::Servant - RequestProcessingStrategyServantLocator::locate_servant ( - const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &/*wait_occurred_restart_call*/ - ACE_ENV_ARG_DECL) - { - PortableServer::Servant servant = 0; - - servant = this->poa_->find_servant (system_id, - servant_upcall, - poa_current_impl - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant != 0) - { - return servant; - } - - // If the POA has the USE_SERVANT_MANAGER policy, a servant manager - // has been associated with the POA so the POA will invoke incarnate - // or preinvoke on it to find a servant that may handle the - // request. (The choice of method depends on the NON_RETAIN or - // RETAIN policy of the POA.) If no servant manager has been - // associated with the POA, the POA raises the OBJ_ADAPTER system - // exception. - // - // If a servant manager is located and invoked, but the servant - // manager is not directly capable of incarnating the object, it - // (the servant manager) may deal with the circumstance in a variety - // of ways, all of which are the application's responsibility. Any - // system exception raised by the servant manager will be returned - // to the client in the reply. In addition to standard CORBA - // exceptions, a servant manager is capable of raising a - // ForwardRequest exception. This exception includes an object - // reference. - // - - this->validate_servant_manager (this->servant_locator_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // No serialization of invocations of preinvoke or - // postinvoke may be assumed; there may be multiple - // concurrent invocations of preinvoke for the same - // ObjectId. - // - // The same thread will be used to preinvoke the object, - // process the request, and postinvoke the object. - - // @@ Note that it is possible for some other thread to - // reset the servant locator once the lock is released. - // However, this possiblility also exists for postinvoke() - // which is also called outside the lock. - - // Release the object adapter lock. - this->poa_->object_adapter().lock ().release (); - - // We have released the object adapter lock. Record this - // for later use. - servant_upcall.state (TAO::Portable_Server::Servant_Upcall::OBJECT_ADAPTER_LOCK_RELEASED); - - PortableServer::ServantLocator::Cookie cookie = 0; - servant = - this->servant_locator_->preinvoke (poa_current_impl.object_id (), - this->poa_, - operation, - cookie - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant == 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 7, - CORBA::COMPLETED_NO), - 0); - } - - // Remember the cookie - servant_upcall.locator_cookie (cookie); - - // Remember operation name. - servant_upcall.operation (operation); - - // Success - return servant; - } - - void - RequestProcessingStrategyServantLocator::cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL) - { - if (servant) - { - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - servant->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } - - // This operation causes the association of the Object Id specified - // by the oid parameter and its servant to be removed from the - // Active Object Map. - int result = this->poa_->unbind_using_user_id (user_id); - - if (result != 0) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - } - - void - RequestProcessingStrategyServantLocator::etherealize_objects ( - CORBA::Boolean /*etherealize_objects*/) - { - } - - void - RequestProcessingStrategyServantLocator::post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall) - { - // @todo This method seems to misbehave according to the corba spec, see - // section 11.3.7.2. It says that when postinvoke raises an system - // exception the methods normal return is overrriden, the request completes - // with the exception - - if (!CORBA::is_nil (this->servant_locator_.in ())) - { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - servant_locator_->postinvoke (system_id, - this->poa_, - servant_upcall.operation (), - servant_upcall.locator_cookie (), - servant_upcall.servant () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // Ignore errors from servant locator .... - } - ACE_ENDTRY; - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h deleted file mode 100644 index 79cac166c68..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h +++ /dev/null @@ -1,89 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantLocator.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_REQUESTPROCESSINGSTRATEGYSERVANTLOCATOR_H -#define TAO_REQUESTPROCESSINGSTRATEGYSERVANTLOCATOR_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/RequestProcessingStrategyServantManager.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/PortableServer.h" -#include "tao/PortableServer/ServantLocatorC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategyServantLocator - : public RequestProcessingStrategyServantManager - { - public: - RequestProcessingStrategyServantLocator (void); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - PortableServer::ServantManager_ptr get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void set_servant_manager ( - PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual TAO_SERVANT_LOCATION locate_servant ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - virtual void post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual PortableServer::Servant locate_servant ( - const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL); - - virtual void cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL); - - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); - - private: - PortableServer::ServantLocator_var servant_locator_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_REQUESTPROCESSINGSTRATEGYSERVANTLOCATOR_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp deleted file mode 100644 index fe3d489977d..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h" -#include "tao/PortableServer/RequestProcessingStrategy.h" -#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - RequestProcessingStrategyServantLocatorFactoryImpl, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategy* - RequestProcessingStrategyServantLocatorFactoryImpl::create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue) - { - RequestProcessingStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::USE_SERVANT_MANAGER : - { - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl")); - break; - } - case ::PortableServer::NON_RETAIN : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantLocator, 0); - break; - } - } - break; - } - default : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyServantLocatorFactoryImpl::destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - RequestProcessingStrategyServantLocatorFactoryImpl, - ACE_TEXT ("RequestProcessingStrategyServantLocatorFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (RequestProcessingStrategyServantLocatorFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - RequestProcessingStrategyServantLocatorFactoryImpl, - TAO::Portable_Server::RequestProcessingStrategyServantLocatorFactoryImpl) - - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h deleted file mode 100644 index adce55b71f2..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantLocatorFI.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTLOCATORFACTORYIMPL_H -#define TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTLOCATORFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/RequestProcessingStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export RequestProcessingStrategyServantLocatorFactoryImpl - : public RequestProcessingStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual RequestProcessingStrategy* create ( - ::PortableServer::RequestProcessingPolicyValue value, - ::PortableServer::ServantRetentionPolicyValue srvalue); - - virtual void destroy ( - RequestProcessingStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyServantLocatorFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyServantLocatorFactoryImpl) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYSERVANTLOCATORFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp deleted file mode 100644 index 60cd7eb033f..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// -*- C++ -*- - -#include "tao/PortableServer/RequestProcessingStrategyServantManager.h" -#include "tao/PortableServer/ServantManagerC.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/ORB_Constants.h" - -ACE_RCSID (PortableServer, - Request_Processing, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - RequestProcessingStrategyServantManager::RequestProcessingStrategyServantManager (void) - { - } - - PortableServer::Servant - RequestProcessingStrategyServantManager::get_servant ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - void - RequestProcessingStrategyServantManager::set_servant ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - ACE_UNUSED_ARG (servant); - - ACE_THROW (PortableServer::POA::WrongPolicy ()); - } - - void - RequestProcessingStrategyServantManager::validate_servant_manager ( - PortableServer::ServantManager_ptr servant_manager - ACE_ENV_ARG_DECL) - { - // When no servant manager is set, give an exception with minor code 4, - // see 11.3.8.6 of the corba spec - if (CORBA::is_nil (servant_manager)) - { - ACE_THROW (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 4, - CORBA::COMPLETED_NO)); - } - } - - PortableServer::Servant - RequestProcessingStrategyServantManager::system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - { - return this->poa_->find_servant (system_id - ACE_ENV_ARG_PARAMETER); - } - - PortableServer::ObjectId * - RequestProcessingStrategyServantManager::servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - return this->poa_->servant_to_user_id (servant ACE_ENV_ARG_PARAMETER); - } - - PortableServer::Servant - RequestProcessingStrategyServantManager::id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - return this->poa_->user_id_to_servant_i (id ACE_ENV_ARG_PARAMETER); - } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyServantManager::type() const - { - return ::PortableServer::USE_SERVANT_MANAGER; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h deleted file mode 100644 index ee152e2585e..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h +++ /dev/null @@ -1,80 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantManager.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_REQUESTPROCESSINGSTRATEGYSERVANTMANAGER_H -#define TAO_REQUESTPROCESSINGSTRATEGYSERVANTMANAGER_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/RequestProcessingStrategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/PortableServer.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class RequestProcessingStrategyServantManager - : public RequestProcessingStrategy - { - public: - RequestProcessingStrategyServantManager (void); - - PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void set_servant (PortableServer::Servant servant ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void validate_servant_manager ( - PortableServer::ServantManager_ptr servant_manager - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_REQUESTPROCESSINGSTRATEGYSERVANTMANAGER_H */ diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp deleted file mode 100644 index a1fa33136ac..00000000000 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ /dev/null @@ -1,2985 +0,0 @@ -// $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/POAManagerFactory.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 "tao/PortableServer/Acceptor_Filter_Factory.h" - -#include "tao/StringSeqC.h" -#include "tao/PortableInterceptorC.h" -#include "tao/PolicyC.h" -#include "tao/ORB_Core.h" -#include "tao/ORB.h" -#include "tao/Server_Strategy_Factory.h" -#include "tao/Acceptor_Registry.h" -#include "tao/Thread_Lane_Resources.h" -#include "tao/Environment.h" -#include "tao/Exception.h" -#include "tao/Stub.h" -#include "tao/Profile.h" -#include "tao/TSS_Resources.h" -#include "tao/IORInterceptor_Adapter.h" -#include "tao/debug.h" - -// auto_ptr class -#include "ace/Auto_Ptr.h" -#include "ace/Dynamic_Service.h" -#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" -#endif /* ! __ACE_INLINE__ */ - -ACE_RCSID (PortableServer, - Root_POA, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// 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. -CORBA::Octet const -TAO_Root_POA::objectkey_prefix [TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE] = { - 024, // octal for ^t - 001, // octal for ^a - 017, // octal for ^o - 000 -}; - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -PortableServer::ThreadPolicy_ptr -TAO_Root_POA::create_thread_policy (PortableServer::ThreadPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::ThreadPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::ThreadPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::ThreadPolicy::_nil ()); - - return policy; -} - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - -#if !defined (CORBA_E_MICRO) - -PortableServer::LifespanPolicy_ptr -TAO_Root_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::LifespanPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::LifespanPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::LifespanPolicy::_nil ()); - - return policy; -} - -#endif - -#if !defined (CORBA_E_MICRO) -PortableServer::IdUniquenessPolicy_ptr -TAO_Root_POA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::IdUniquenessPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::IdUniquenessPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::IdUniquenessPolicy::_nil ()); - - return policy; -} -#endif - -#if !defined (CORBA_E_MICRO) -PortableServer::IdAssignmentPolicy_ptr -TAO_Root_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::IdAssignmentPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::IdAssignmentPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::IdAssignmentPolicy::_nil ()); - - return policy; -} -#endif - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -PortableServer::ImplicitActivationPolicy_ptr -TAO_Root_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::ImplicitActivationPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::ImplicitActivationPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::ImplicitActivationPolicy::_nil ()); - - return policy; -} - -PortableServer::ServantRetentionPolicy_ptr -TAO_Root_POA::create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::ServantRetentionPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::ServantRetentionPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::ServantRetentionPolicy::_nil ()); - - return policy; -} - -PortableServer::RequestProcessingPolicy_ptr -TAO_Root_POA::create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::Portable_Server::RequestProcessingPolicy *policy = 0; - ACE_NEW_THROW_EX (policy, - TAO::Portable_Server::RequestProcessingPolicy (value), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (PortableServer::RequestProcessingPolicy::_nil ()); - - return policy; -} - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -void -TAO_Root_POA::set_obj_ref_factory ( - PortableInterceptor::ObjectReferenceFactory *current_factory - ACE_ENV_ARG_DECL) -{ - TAO::ORT_Adapter *adapter = this->ORT_adapter (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - if (adapter) - { - // Activate a different factory - this->ort_adapter_->set_obj_ref_factory (current_factory - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -} - -TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL) - : name_ (name), - poa_manager_ (* (dynamic_cast <TAO_POA_Manager*> (poa_manager))), - poa_manager_factory_ (* (object_adapter->poa_manager_factory_)), - tagged_component_ (), - tagged_component_id_ (), - profile_id_array_ (0), - policies_ (policies), - ort_adapter_ (0), - adapter_state_ (PortableInterceptor::HOLDING), - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - - adapter_activator_ (), - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - children_ (), - lock_ (lock), - orb_core_ (orb_core), - object_adapter_ (object_adapter), - cleanup_in_progress_ (0), - outstanding_requests_ (0), - outstanding_requests_condition_ (thread_lock), - wait_for_completion_pending_ (0), - waiting_destruction_ (0), - servant_deactivation_condition_ (thread_lock), - filter_factory_ (0), - caller_key_to_object_ (0), - servant_for_key_to_object_ (0) -{ - // Parse the policies that are used in the critical path in - // a cache. - this->cached_policies_.update (this->policies_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - -#if (TAO_HAS_MINIMUM_POA == 1) - // If this is the RootPOA, set the value of the ImplicitActivationPolicy - // to IMPLICIT_ACTIVATION since it is impossible to pass the policy - // as it is not compiled into the library. - // - // If the ImplicitActivationPolicy policy is ever compiled in the - // minimum POA builds, remove this code and remove the guards - // in Object_Adapter.cpp when changing the default policy for the - // RootPOA. - if (ACE_OS::strcmp (this->name_.c_str (), - TAO_DEFAULT_ROOTPOA_NAME) == 0) - { - this->cached_policies_.implicit_activation - (PortableServer::IMPLICIT_ACTIVATION); - } -#endif /* TAO_HAS_MINIMUM_POA == 1 */ - - // Set the active strategies to be used by this POA - this->active_policy_strategies_.update (this->cached_policies_, - this - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // Set the folded name of this POA. - this->set_folded_name (parent); - - // Register self with manager. - int result = this->poa_manager_.register_poa (this); - if (result != 0) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - - // Add self to Object Adapter class. - result = - this->object_adapter ().bind_poa (this->folded_name_, - this, - this->system_name_.out ()); - if (result != 0) - { - // Remove from POA Manager in case of errors. No checks of - // further errors... - this->poa_manager_.remove_poa (this); - - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - - // Set the id for this POA. - this->set_id (parent); - - // Notify the Lifespan strategy of our startup - ACE_TRY - { - this->active_policy_strategies_.lifespan_strategy()->notify_startup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - this->poa_manager_.remove_poa (this); - this->object_adapter ().unbind_poa (this, - this->folded_name_, - this->system_name_.in ()); - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK; -} - -TAO_Root_POA::~TAO_Root_POA (void) -{ -} - -void -TAO_Root_POA::complete_destruction_i (ACE_ENV_SINGLE_ARG_DECL) -{ - // No longer awaiting destruction. - this->waiting_destruction_ = 0; - - // Remove POA from the POAManager. - int result = this->poa_manager_.remove_poa (this); - - if (result != 0) - ACE_THROW (CORBA::OBJ_ADAPTER ()); - - // Remove POA from the Object Adapter. - result = this->object_adapter ().unbind_poa (this, - this->folded_name_, - this->system_name_.in ()); - if (result != 0) - ACE_THROW (CORBA::OBJ_ADAPTER ()); - - // Cleanup all strategies - this->active_policy_strategies_.cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - // Forced cleanup. The new memory management scheme is evil and can - // lead to reference deadlock, i.e., POA holds object A, but POA - // cannot die because object A hold POA. - { - // - // If new things are added to this cleanup code, make sure to move - // the minimum CORBA #define after the declaration of - // <non_servant_upcall>. - // - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - - // ATTENTION: Trick locking here, see class header for details - TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); - ACE_UNUSED_ARG (non_servant_upcall); - - this->adapter_activator_ = PortableServer::AdapterActivator::_nil (); - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - } - - ::CORBA::release (this); -} - -#if ! defined (CORBA_E_MICRO) -PortableServer::POA_ptr -TAO_Root_POA::create_POA_i (const char *adapter_name, - PortableServer::POAManager_ptr poa_manager, - const CORBA::PolicyList &policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterAlreadyExists, - PortableServer::POA::InvalidPolicy)) -{ - // Initialize a TAO_POA_Policy_Set instance so that it contains the - // default POA policies. - TAO_POA_Policy_Set tao_policies (this->object_adapter ().default_poa_policies ()); - - // Merge policies from the ORB level. - this->object_adapter ().validator ().merge_policies (tao_policies.policies () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - // Merge in any policies that the user may have specified. - tao_policies.merge_policies (policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - // If any of the policy objects specified are not valid for the ORB - // implementation, if conflicting policy objects are specified, or - // if any of the specified policy objects require prior - // administrative action that has not been performed, an - // InvalidPolicy exception is raised containing the index in the - // policies parameter value of the first offending policy object. - tao_policies.validate_policies (this->object_adapter ().validator (), - this->orb_core_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - // If the poa_manager parameter is null, a new POAManager object is - // created and associated with the new POA. Otherwise, the specified - // POAManager object is associated with the new POA. The POAManager - // object can be obtained using the attribute name the_POAManager. - - PortableServer::POAManager_var the_poa_manager; - - if (CORBA::is_nil (poa_manager)) - { - PortableServer::POA_var poa = PortableServer::POA::_duplicate (this); - PortableServer::POA_var root_poa; - - // Find the RootPOA by traversing the POA hierarchy until the - // RootPOA is reached. The RootPOA has no parent. - while (!CORBA::is_nil (poa.in ())) - { - root_poa = poa; - poa = poa->the_parent (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - } - - // Get the POAManagerFactory instance owned by RootPOA. - PortableServer::POAManagerFactory_var tao_poa_manager_factory - = root_poa->the_POAManagerFactory (); - - CORBA::PolicyList empty_policies; - - // The POAManager name will be generated when the POAManager instance - // is created. - the_poa_manager - = tao_poa_manager_factory->create_POAManager (0, - empty_policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - } - else - { - the_poa_manager = PortableServer::POAManager::_duplicate (poa_manager); - } - - PortableServer::POA_var poa = this->create_POA_i (adapter_name, - the_poa_manager.in (), - tao_policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - return poa._retn (); -} -#endif - -TAO_Root_POA * -TAO_Root_POA::new_POA (const String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL) -{ - TAO_Regular_POA *poa = 0; - - ACE_NEW_THROW_EX (poa, - TAO_Regular_POA (name, - poa_manager, - policies, - parent, - lock, - thread_lock, - orb_core, - object_adapter - ACE_ENV_ARG_PARAMETER), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - return poa; -} - -#if ! defined (CORBA_E_MICRO) -PortableServer::POA_ptr -TAO_Root_POA::create_POA_i (const TAO_Root_POA::String &adapter_name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterAlreadyExists, - PortableServer::POA::InvalidPolicy)) -{ - // This operaton creates a new POA as a child of the target POA. The - // specified name identifies the new POA with respect to other POAs - // with the same parent POA. If the target POA already has a child - // POA with the specified name, the AdapterAlreadyExists exception - // is raised. - int result = this->children_.find (adapter_name); - - // Child was found - if (result != -1) - { - ACE_THROW_RETURN (PortableServer::POA::AdapterAlreadyExists (), - PortableServer::POA::_nil ()); - } - - // - // Child was not found. Create one. - // - - // The specified policy objects are associated with the POA and used - // to control its behavior. The policy objects are effectively - // copied before this operation returns, so the application is free - // to destroy them while the POA is in use. Policies are not - // inherited from the parent POA. - TAO_Root_POA * poa = this->new_POA (adapter_name, - poa_manager, - policies, - this, - this->object_adapter ().lock (), - this->object_adapter ().thread_lock (), - this->orb_core_, - this->object_adapter_ - ACE_ENV_ARG_PARAMETER); - - // Give ownership of the new map to the POA_var. Note, that it - // is important for the POA_var to take ownership before - // checking for exception since we may need to delete the new map. - PortableServer::POA_var new_poa = poa; - - // Check for exception in construction of the POA. - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - // Add to children map - result = this->children_.bind (adapter_name, - poa); - if (result != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - PortableServer::POA::_nil ()); - } - - // Increment the reference count on the child POA since the children - // map must retain ownership. Do so immediately before any other - // operations to prevent memory cleanup problems induced from - // errors below. - poa->_add_ref (); - - // Iterate over the registered IOR interceptors so that they may be - // given the opportunity to add tagged components to the profiles - // for this servant. - poa->establish_components (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - // Note: Creating a POA using a POA manager that is in the active - // state can lead to race conditions if the POA supports preexisting - // objects, because the new POA may receive a request before its - // adapter activator, servant manager, or default servant have been - // initialized. These problems do not occur if the POA is created by - // an adapter activator registered with a parent of the new POA, - // because requests are queued until the adapter activator - // returns. To avoid these problems when a POA must be explicitly - // initialized, the application can initialize the POA by invoking - // find_POA with a TRUE activate parameter. - - // Everything is fine. Don't let the POA_var release the - // implementation. - return new_poa._retn (); -} -#endif - -#if ! defined (CORBA_E_MICRO) -PortableServer::POA_ptr -TAO_Root_POA::find_POA (const char *adapter_name, - CORBA::Boolean activate_it - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterNonExistent)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - TAO_Root_POA *poa = this->find_POA_i (adapter_name, - activate_it - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - return PortableServer::POA::_duplicate (poa); -} -#endif - -#if ! defined (CORBA_E_MICRO) -TAO_Root_POA * -TAO_Root_POA::find_POA_i (const ACE_CString &child_name, - CORBA::Boolean activate_it - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterNonExistent)) -{ - TAO_Root_POA *child = 0; - int result = this->children_.find (child_name, - child); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) - - if (result != 0) - { - if (activate_it) - { - if (!CORBA::is_nil (this->adapter_activator_.in ())) - { - // Check our state - this->check_state (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Boolean success = false; - ACE_TRY_EX (UnknownAdapter) - { - // ATTENTION: Trick locking here, see class header for details - TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall ( - *this); - ACE_UNUSED_ARG (non_servant_upcall); - - // When unknown_adapter gives a system exception, the POA - // should raise OBJ_ADAPTER with standard minor code 1. - // See 11.3.9.2 of the Corba spec - success = - this->adapter_activator_->unknown_adapter ( - this, - child_name.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (UnknownAdapter); - } - ACE_CATCH (CORBA::SystemException, ex) - { - ACE_TRY_THROW_EX (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 1, - CORBA::COMPLETED_NO), - UnknownAdapter); - } - ACE_ENDTRY; - ACE_CHECK_RETURN (0); - - if (success) - { - result = this->children_.find (child_name, - child); - } - else - { - result = -1; - } - } - else - { - result = -1; - } - } - else - { - result = -1; - } - } -#else - ACE_UNUSED_ARG (activate_it); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - if (result == 0) - { - return child; - } - else - { - // Otherwise, the AdapterNonExistent exception is raised. - ACE_THROW_RETURN (PortableServer::POA::AdapterNonExistent (), - 0); - } -} -#endif - -TAO_POA_Manager & -TAO_Root_POA::tao_poa_manager () -{ - return poa_manager_; -} - -#if ! defined (CORBA_E_MICRO) -PortableServer::POA_ptr -TAO_Root_POA::create_POA (const char *adapter_name, - PortableServer::POAManager_ptr poa_manager, - const CORBA::PolicyList &policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterAlreadyExists, - PortableServer::POA::InvalidPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->create_POA_i (adapter_name, - poa_manager, - policies - ACE_ENV_ARG_PARAMETER); -} -#endif - -PortableServer::ObjectId * -TAO_Root_POA::servant_to_id (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) -{ - // If we had upgradeable locks, this would initially be a read lock - // - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->servant_to_id_i (servant - ACE_ENV_ARG_PARAMETER); -} - -PortableServer::ObjectId * -TAO_Root_POA::servant_to_user_id (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - servant_to_user_id (servant ACE_ENV_ARG_PARAMETER); -} - -PortableServer::Servant -TAO_Root_POA::reference_to_servant (CORBA::Object_ptr reference - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->reference_to_servant_i (reference - ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_Root_POA::servant_to_reference (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) -{ - TAO_POA_GUARD_RETURN (CORBA::Object::_nil ()); - - return this->servant_to_reference_i (servant - ACE_ENV_ARG_PARAMETER); -} - -PortableServer::POAList * -TAO_Root_POA::the_children (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->the_children_i (ACE_ENV_SINGLE_ARG_PARAMETER); -} - - -PortableServer::Servant -TAO_Root_POA::id_to_servant (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->id_to_servant_i (oid - ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_Root_POA::id_to_reference (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->id_to_reference_i (oid, true ACE_ENV_ARG_PARAMETER); -} - - -CORBA::Object_ptr -TAO_Root_POA::create_reference_with_id (const PortableServer::ObjectId &id, - const char *intf - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (CORBA::Object::_nil ()); - - return this->create_reference_with_id_i (id, - intf, - this->server_priority () - ACE_ENV_ARG_PARAMETER); -} - - -void -TAO_Root_POA::destroy (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Lock access for the duration of this transaction. - TAO::Portable_Server::POA_Guard poa_guard (*this ACE_ENV_ARG_PARAMETER, 0); - ACE_CHECK; - ACE_UNUSED_ARG (poa_guard); - - this->destroy_i (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_Root_POA::remove_from_parent_i (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - // The root poa has no parent, so this is a noop -} - -void -TAO_Root_POA::destroy_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (this->cleanup_in_progress_) - return; - - // Is the <wait_for_completion> semantics for this thread correct? - TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (), - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - 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 - // POAManager::deactivate operation that does not allow a - // re-creation of its associated POA in the same process.) - - // Remove POA from the parent - this->remove_from_parent_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - TAO::ORT_Array array_obj_ref_template (1); - - CORBA::ULong i = 0; - - // Gather all ObjectReferenceTemplates and change all adapter states - // to INACTIVE. - for (CHILDREN::iterator iterator = this->children_.begin (); - iterator != this->children_.end (); - ++iterator) - { - TAO_Root_POA * const child_poa = (*iterator).int_id_; - - TAO::ORT_Adapter * const adapter = child_poa->ORT_adapter_i (); - - // In case no ORT library is linked we get zero. - if (adapter != 0) - { - // Get the ObjectReferenceTemplate for the child POA. - PortableInterceptor::ObjectReferenceTemplate * const ort = - adapter->get_adapter_template (); - - // Add it to the sequence of object reference templates that - // will be destroyed. - array_obj_ref_template.size (1); - - array_obj_ref_template[0] = ort; - } - - child_poa->adapter_state_ = - PortableInterceptor::INACTIVE; - - // Notify the state changes to the IORInterceptors - this->adapter_state_changed (array_obj_ref_template, - PortableInterceptor::INACTIVE - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (adapter != 0) - adapter->release (array_obj_ref_template[0]); - - ++i; - } - - // Destroy all child POA's now. - for (CHILDREN::iterator destroy_iterator = this->children_.begin (); - destroy_iterator != this->children_.end (); - ++destroy_iterator) - { - TAO_Root_POA *destroy_child_poa = (*destroy_iterator).int_id_; - - destroy_child_poa->destroy_i (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - // Notify the lifespan strategy of our shutdown - this->active_policy_strategies_.lifespan_strategy()->notify_shutdown ( - ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - -// @todo, is the exception handling above correct, should we just fail when -// the notify above fails - - // When a POA is destroyed, any requests that have started execution - // continue to completion. Any requests that have not started - // execution are processed as if they were newly arrived, that is, - // the POA will attempt to cause recreation of the POA by invoking - // one or more adapter activators as described in Section 3.3.3. - // If the wait_for_completion parameter is TRUE, the destroy - // operation will return only after all requests in process have - // completed and all invocations of etherealize have - // completed. Otherwise, the destroy operation returns after - // destroying the POAs. - - this->deactivate_all_objects_i (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // If there are no outstanding requests and that we are not in a - // non-servant upcall or if we are in a non-servant upcall, make - // sure we are the POA related to the non-servant upcall. - TAO::Portable_Server::Non_Servant_Upcall *non_servant_upcall_in_progress = - this->object_adapter ().non_servant_upcall_in_progress (); - if (this->outstanding_requests_ == 0 && - (non_servant_upcall_in_progress == 0 || - &non_servant_upcall_in_progress->poa () != this)) - { - TAO::ORT_Array my_array_obj_ref_template; - - TAO::ORT_Adapter * const ort_adapter = - this->ORT_adapter_i (); - - // In case no ORT library is linked we get zero. - if (ort_adapter != 0) - { - // Get the ObjectReferenceTemplate. - PortableInterceptor::ObjectReferenceTemplate * const ort = - ort_adapter->get_adapter_template (); - - // Add it to the sequence of object reference templates, we - // just notify for ourselves that we are now non_existent, - // our childs will do it for themselves. - my_array_obj_ref_template.size (1); - my_array_obj_ref_template[0] = ort; - } - - // According to the ORT spec, after a POA is destroyed, its state - // has to be changed to NON_EXISTENT and all the registered - // interceptors are to be informed. Since, the POA is destroyed - // and is released in the complete_destruction_i method, we are - // trying to keep the poa still around by doing a duplicate of - // it. (a hack). - PortableServer::POA_var poa = PortableServer::POA::_duplicate (this); - - this->complete_destruction_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->adapter_state_ = PortableInterceptor::NON_EXISTENT; - - this->adapter_state_changed (my_array_obj_ref_template, - this->adapter_state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - if (ort_adapter != 0) - { - ort_adapter->release (my_array_obj_ref_template[0]); - - TAO::ORT_Adapter_Factory *ort_factory = - this->ORT_adapter_factory (); - - ort_factory->destroy (ort_adapter); - - this->ort_adapter_ = 0; - } - } - else - { - // Mark that we are ready for destruction. - this->waiting_destruction_ = 1; - } -} - -int -TAO_Root_POA::delete_child (const TAO_Root_POA::String &child) -{ - int result = 0; - - // If we are not closing down, we must remove this child from our - // collection. - if (!this->cleanup_in_progress_) - result = this->children_.unbind (child); - - // Otherwise, if we are closing down, we are currently iterating - // over our children and there is not need to remove this child from - // our collection. - - return result; -} - -PortableServer::POAList * -TAO_Root_POA::the_children_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableServer::POAList_var children; - CORBA::ULong child_current = static_cast <CORBA::ULong> - (this->children_.current_size ()); - ACE_NEW_THROW_EX (children, - PortableServer::POAList (child_current), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - children->length (child_current); - - CORBA::ULong index = 0; - for (CHILDREN::iterator iterator = this->children_.begin (); - iterator != this->children_.end (); - ++iterator, ++index) - { - TAO_Root_POA *child_poa = (*iterator).int_id_; - children[index] = PortableServer::POA::_duplicate (child_poa); - } - - return children._retn (); -} - -PortableInterceptor::AdapterName * -TAO_Root_POA::adapter_name_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // The adapter name is the sequence of names starting from the - // RootPOA to the one whose name is requested. The name of the - // RootPOA is "RootPOA". - - PortableServer::POA_var poa = PortableServer::POA::_duplicate (this); - - CORBA::ULong len = 0; - - // Find the length of the adapter name sequence by traversing the - // POA hierarchy until the RootPOA is reached. The RootPOA has no - // parent. - while (!CORBA::is_nil (poa.in ())) - { - poa = poa->the_parent (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ++len; - } - - // Empty adapter name sequence. - PortableInterceptor::AdapterName *names = 0; - ACE_NEW_THROW_EX (names, - PortableInterceptor::AdapterName (len), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (0); - - PortableInterceptor::AdapterName_var safe_names (names); - - names->length (len); - - poa = PortableServer::POA::_duplicate (this); - - (*names)[0] = CORBA::string_dup ("RootPOA"); - - // Fill in the AdapterName sequence as the POA hierarchy is - // traversed. - CORBA::ULong ilen = len; - for (CORBA::ULong i = 1; i < len; ++i) - { - (*names)[--ilen] = poa->the_name (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - poa = poa->the_parent (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // If this condition asserts, the POA hierarchy was modified - // (i.e. reduced in size) by another thread! - ACE_ASSERT ((ilen > 0 ? !CORBA::is_nil (poa.in ()) : 1)); - } - - return safe_names._retn (); -} - -void -TAO_Root_POA::add_ior_component (TAO_MProfile & mprofile, - const IOP::TaggedComponent &component - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Add the given tagged component to all profiles. - const CORBA::ULong profile_count = mprofile.profile_count (); - - for (CORBA::ULong i = 0; i < profile_count; ++i) - { - TAO_Profile *profile = mprofile.get_profile (i); - - profile->add_tagged_component (component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -} - -void -TAO_Root_POA::add_ior_component_to_profile ( - TAO_MProfile & mprofile, - const IOP::TaggedComponent &component, - IOP::ProfileId profile_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Add the given tagged component to all profiles matching the given - // ProfileId. - bool found_profile = false; - - CORBA::ULong const profile_count = mprofile.profile_count (); - - for (CORBA::ULong i = 0; i < profile_count; ++i) - { - TAO_Profile *profile = mprofile.get_profile (i); - - if (profile->tag () == profile_id) - { - profile->add_tagged_component (component - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - found_profile = true; - } - } - - // 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) - ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 29, - CORBA::COMPLETED_NO)); -} - -void -TAO_Root_POA::adapter_state_changed ( - const TAO::ORT_Array &array_obj_ref_template, - PortableInterceptor::AdapterState state - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO_IORInterceptor_Adapter *ior_adapter = - this->orb_core_.ior_interceptor_adapter (); - - if (ior_adapter) - { - ior_adapter->adapter_state_changed (array_obj_ref_template, - state - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -} - -PortableServer::ObjectId * -TAO_Root_POA::activate_object_i (PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - activate_object (servant, - priority, - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); -} - -PortableServer::ObjectId * -TAO_Root_POA::activate_object (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)) -{ - while (1) - { - int wait_occurred_restart_call = 0; - - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - PortableServer::ObjectId *result = - this->activate_object_i (servant, - this->server_priority (), - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // If we ended up waiting on a condition variable, the POA state - // may have changed while we are waiting. Therefore, we need to - // restart this call. - if (wait_occurred_restart_call) - continue; - else - return result; - } -} - -#if !defined (CORBA_E_MICRO) -void -TAO_Root_POA::activate_object_with_id (const PortableServer::ObjectId &id, - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)) -{ - while (1) - { - int wait_occurred_restart_call = 0; - - // Lock access for the duration of this transaction. - TAO_POA_GUARD; - - this->activate_object_with_id_i (id, - servant, - this->server_priority (), - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // If we ended up waiting on a condition variable, the POA state - // may have changed while we are waiting. Therefore, we need to - // restart this call. - if (wait_occurred_restart_call) - continue; - else - return; - } -} -#endif - -#if !defined (CORBA_E_MICRO) -void -TAO_Root_POA::activate_object_with_id_i (const PortableServer::ObjectId &id, - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)) -{ - this->active_policy_strategies_.servant_retention_strategy()-> - activate_object_with_id (id, - servant, - priority, - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} -#endif - -void -TAO_Root_POA::deactivate_all_objects_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - this->deactivate_all_objects_i (etherealize_objects - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - this->wait_for_completions (wait_for_completion - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_Root_POA::wait_for_completions (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) -{ - while (this->object_adapter ().enable_locking_ && - wait_for_completion && - this->outstanding_requests_ > 0) - { - this->wait_for_completion_pending_ = 1; - - int result = this->outstanding_requests_condition_.wait (); - if (result == -1) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - } -} - -/* static */ -void -TAO_Root_POA::check_for_valid_wait_for_completions (const TAO_ORB_Core &orb_core, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) -{ - if (wait_for_completion) - { - TAO::Portable_Server::POA_Current_Impl *poa_current_impl = - static_cast <TAO::Portable_Server::POA_Current_Impl *> - (TAO_TSS_Resources::instance ()->poa_current_impl_); - - while (1) - { - // If wait_for_completion is TRUE and the current thread is - // in an invocation context dispatched from some POA - // belonging to the same ORB as this POA, the BAD_INV_ORDER - // system exception with standard minor code 3 is raised and - // POA destruction does not occur. - if (poa_current_impl != 0) - { - if (&orb_core == &poa_current_impl->orb_core ()) - { - // CORBA 2.3 specifies which minor code corresponds - // to this particular problem. - ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 3, - CORBA::COMPLETED_NO)); - } - } - else - break; - - poa_current_impl = - poa_current_impl->previous_current_impl_; - } - } -} - -void -TAO_Root_POA::deactivate_all_objects_i (CORBA::Boolean etherealize_objects - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - this->active_policy_strategies_.request_processing_strategy ()-> - etherealize_objects (etherealize_objects); - - this->active_policy_strategies_.servant_retention_strategy ()-> - deactivate_all_objects (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -void -TAO_Root_POA::deactivate_object (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD; - - this->deactivate_object_i (oid - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - - -void -TAO_Root_POA::deactivate_object_i (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) -{ - this->active_policy_strategies_.servant_retention_strategy()-> - deactivate_object (id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -CORBA::Boolean -TAO_Root_POA::is_persistent (void) const -{ - return active_policy_strategies_.lifespan_strategy()->is_persistent (); -} - -CORBA::Object_ptr -TAO_Root_POA::create_reference (const char *intf - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (CORBA::Object::_nil ()); - - return this->create_reference_i (intf, - this->server_priority () - ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_Root_POA::create_reference_i (const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - if (!this->has_system_id ()) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - CORBA::Object::_nil ()); - } - - return this->active_policy_strategies_.servant_retention_strategy()-> - create_reference (intf, priority ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_Root_POA::invoke_key_to_object_helper_i (const char * repository_id, - const PortableServer::ObjectId & id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - const PortableInterceptor::ObjectId &user_oid = - reinterpret_cast <const PortableInterceptor::ObjectId &>(id); - - // Ask the ORT to create the object. - if (this->ORT_adapter_i ()) - { - // Ask the ORT to create the object. - return this->ort_adapter_->make_object (repository_id, - user_oid - ACE_ENV_ARG_PARAMETER); - } - else - { - return this->invoke_key_to_object (ACE_ENV_SINGLE_ARG_PARAMETER); - } -} - -CORBA::Object_ptr -TAO_Root_POA::create_reference_with_id_i (const PortableServer::ObjectId &user_id, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // If the POA has the SYSTEM_ID policy and it detects that the - // Object Id value was not generated by the system or for this POA, - // the create_reference_with_id operation may raise the BAD_PARAM - // system exception. An ORB is not required to detect all such - // invalid Object Id values, but a portable application must not - // invoke this operation on a POA that has the SYSTEM_ID policy with - // an Object Id value that was not previously generated by the - // system for that POA, or, if the POA also has the PERSISTENT - // policy, for a previous instantiation of the same POA. - if (this->has_system_id () && - !this->is_poa_generated_id (user_id)) - { - ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 14, - CORBA::COMPLETED_NO), - CORBA::Object::_nil ()); - } - - return this->active_policy_strategies_.servant_retention_strategy()-> - create_reference_with_id (user_id, intf, priority ACE_ENV_ARG_PARAMETER); -} - -PortableServer::ObjectId * -TAO_Root_POA::servant_to_id_i (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) -{ - return this->active_policy_strategies_.request_processing_strategy()-> - servant_to_id (servant ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_Root_POA::servant_to_reference_i (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - servant_to_reference (servant ACE_ENV_ARG_PARAMETER); -} - -PortableServer::Servant -TAO_Root_POA::reference_to_servant_i (CORBA::Object_ptr reference - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)) -{ - // Make sure that the reference is valid. - if (CORBA::is_nil (reference)) - { - ACE_THROW_RETURN (CORBA::BAD_PARAM (), - 0); - } - - PortableServer::ObjectId system_id; - bool const is_generated = - this->is_poa_generated (reference, system_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (!is_generated) - { - // In case this object reference is not generated by this POA throw - // an exception - ACE_THROW_RETURN (PortableServer::POA::WrongAdapter (), - 0); - } - - PortableServer::Servant servant = - this->active_policy_strategies_.request_processing_strategy()-> - system_id_to_servant (system_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant != 0) - { - // ATTENTION: Trick locking here, see class header for details - TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); - ACE_UNUSED_ARG (non_servant_upcall); - - // The POA invokes _add_ref once on the Servant before returning - // it. If the application uses reference counting, the caller of - // id_to_servant is responsible for invoking _remove_ref once on - // the returned Servant when it is finished with it. A - // conforming caller need not invoke _remove_ref on the returned - // Servant if the type of the Servant uses the default reference - // counting inherited from ServantBase. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - return servant; -} - -bool -TAO_Root_POA::is_poa_generated (CORBA::Object_ptr reference, - PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) -{ - TAO::ObjectKey_var key = reference->_key (ACE_ENV_SINGLE_ARG_PARAMETER); - 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; - 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); - if (result != 0 || - !this->root () && - poa_system_name != this->system_name () || - is_root != this->root () || - is_system_id != this->system_id () || - !this->validate_lifespan (is_persistent, poa_creation_time)) - { - // The passed reference is NOT generated by this POA - return false; - } - else - { - // The passed reference is generated by this POA - return true; - } -} - -PortableServer::ObjectId * -TAO_Root_POA::reference_to_id (CORBA::Object_ptr reference - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)) -{ - // Make sure that the reference is valid. - if (CORBA::is_nil (reference)) - { - ACE_THROW_RETURN (CORBA::BAD_PARAM (), - 0); - } - - // The WrongPolicy exception is declared to allow future extensions. - - // This operation is valid only if the reference was created by the - // POA on which the operation is being performed. If the object - // 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); - ACE_CHECK_RETURN (0); - - if (!is_generated) - { - ACE_THROW_RETURN (PortableServer::POA::WrongAdapter (), - 0); - } - - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - return this->active_policy_strategies_.servant_retention_strategy()-> - system_id_to_object_id (system_id ACE_ENV_ARG_PARAMETER); -} - -PortableServer::Servant -TAO_Root_POA::find_servant (const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - find_servant (system_id ACE_ENV_ARG_PARAMETER); -} - -int -TAO_Root_POA::unbind_using_user_id (const PortableServer::ObjectId &user_id) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - unbind_using_user_id (user_id); -} - -void -TAO_Root_POA::cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL) -{ - this->active_policy_strategies_.request_processing_strategy()-> - cleanup_servant (servant, user_id ACE_ENV_ARG_PARAMETER); -} - -PortableServer::Servant -TAO_Root_POA::id_to_servant_i (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) -{ - - PortableServer::Servant servant = - this->active_policy_strategies_.request_processing_strategy()-> - id_to_servant (id ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant != 0) - { - // ATTENTION: Trick locking here, see class header for details - TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); - ACE_UNUSED_ARG (non_servant_upcall); - - // The POA invokes _add_ref once on the Servant before returning - // it. If the application uses reference counting, the caller of - // id_to_servant is responsible for invoking _remove_ref once on - // the returned Servant when it is finished with it. A - // conforming caller need not invoke _remove_ref on the returned - // Servant if the type of the Servant uses the default reference - // counting inherited from ServantBase. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - return servant; -} - -PortableServer::Servant -TAO_Root_POA::user_id_to_servant_i (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - user_id_to_servant (id ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -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, indirect ACE_ENV_ARG_PARAMETER); -} - -CORBA::OctetSeq * -TAO_Root_POA::id (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - CORBA::OctetSeq *id = 0; - ACE_NEW_THROW_EX (id, - CORBA::OctetSeq (this->id_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - return id; -} - -PortableServer::Servant -TAO_Root_POA::locate_servant_i (const char *operation, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) -{ - return this->active_policy_strategies_.request_processing_strategy()-> - locate_servant (operation, - system_id, - servant_upcall, - poa_current_impl, - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); -} - -/* static */ -int -TAO_Root_POA::parse_key (const TAO::ObjectKey &key, - TAO_Object_Adapter::poa_name &poa_system_name, - PortableServer::ObjectId &system_id, - CORBA::Boolean &is_root, - CORBA::Boolean &is_persistent, - CORBA::Boolean &is_system_id, - TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time) -{ - // Get the object key octets. - const CORBA::Octet *key_data = key.get_buffer (); - - // Skip the object key prefix since we have already checked for this. - CORBA::ULong starting_at = TAO_OBJECTKEY_PREFIX_SIZE; - - // Check the root indicator. - char root_key_type = key_data[starting_at]; - if (root_key_type == TAO_Root_POA::root_key_char ()) - { - is_root = true; - } - else if (root_key_type == TAO_Root_POA::non_root_key_char ()) - { - is_root = false; - } - else - { - // Incorrect key - return -1; - } - - // Skip past the system id indicator - starting_at += TAO_Root_POA::root_key_type_length (); - - // Check the system id indicator. - 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; - } - else if (system_id_key_type == TAO_Root_POA::user_id_key_char ()) - { - is_system_id = false; - } - else - { - // Incorrect key - return -1; - } - - // Skip past the system id indicator - starting_at += TAO_Root_POA::system_id_key_type_length (); - - // Check the persistence indicator - char persistent_key_type = key_data[starting_at]; - if (persistent_key_type == TAO_Root_POA::persistent_key_char ()) - { - is_persistent = true; - } - else if (persistent_key_type == TAO_Root_POA::transient_key_char ()) - { - is_persistent = false; - } - else - { - // Incorrect key - return -1; - } - - // Skip past the persistent indicator - starting_at += TAO_Root_POA::persistent_key_type_length (); - -#if (POA_NO_TIMESTAMP == 0) - // Grab the timestamp for transient POAs. - if (!is_persistent) - { - // Take the creation time for the timestamp - poa_creation_time.creation_time (key_data + starting_at); - - // Skip past the timestamp - starting_at += TAO::Portable_Server::Creation_Time::creation_time_length (); - } -#else - ACE_UNUSED_ARG (poa_creation_time); -#endif /* POA_NO_TIMESTAMP */ - - // Calculate the size of the POA name. - CORBA::ULong poa_name_size = 0; - if (!is_persistent) - { - // Transient POAs have fixed size. - poa_name_size = TAO_Object_Adapter::transient_poa_name_size (); - } - else if (is_system_id) - { - // System ids have fixed size. - poa_name_size = static_cast <CORBA::ULong> - (key.length () - starting_at - - TAO_Active_Object_Map::system_id_size ()); - } - else - { - // Get the size from the object key. - ACE_OS::memcpy (&poa_name_size, - key_data + starting_at, - sizeof (poa_name_size)); - poa_name_size = ACE_NTOHL (poa_name_size); - - starting_at += sizeof (poa_name_size); - } - - // Grep the name if there is a name - if (!is_root) - { - poa_system_name.replace (poa_name_size, - poa_name_size, - (CORBA::Octet *) key_data + starting_at, - 0); - - starting_at += poa_name_size; - } - - // The rest is the system id. - CORBA::ULong system_id_size = key.length () - starting_at; - - // Reset <system_id>. - system_id.length (system_id_size); - CORBA::Octet * buf = system_id.get_buffer (); - ACE_OS::memcpy (buf, key_data + starting_at, system_id_size); - - // Success - return 0; -} - -TAO::ObjectKey * -TAO_Root_POA::create_object_key (const PortableServer::ObjectId &id) -{ - // Calculate the space required for the key. - CORBA::ULong buffer_size = - this->id_.length () + - id.length (); - - // Create the buffer for the key. - CORBA::Octet *buffer = TAO::ObjectKey::allocbuf (buffer_size); - - // First copy the POA id into the key. - ACE_OS::memcpy (&buffer[0], - this->id_.get_buffer (), - this->id_.length ()); - - // Then copy the object id into the key. - ACE_OS::memcpy (&buffer[this->id_.length ()], - id.get_buffer (), - id.length ()); - - // Create the key, giving the ownership of the buffer to the - // sequence. - TAO::ObjectKey *key = 0; - ACE_NEW_RETURN (key, - TAO::ObjectKey (buffer_size, - buffer_size, - buffer, - 1), - 0); - - return key; -} - -void -TAO_Root_POA::set_id (TAO_Root_POA *parent) -{ - // Calculate the prefix size. - CORBA::ULong prefix_size = 0; - prefix_size += TAO_OBJECTKEY_PREFIX_SIZE; - - // If we are dealing with a persistent POA and user ids are being - // 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 = - this->is_persistent () && - !this->system_id (); - - // Size required by the POA name. - CORBA::ULong poa_name = 0; - - // Calculate the space required for the POA name. - CORBA::ULong poa_name_length = this->system_name_->length (); - if (parent != 0) - { - poa_name += poa_name_length; - } - - // Check if we need to added the length of the POA name. - if (add_poa_name_length) - { - poa_name += sizeof (poa_name_length); - } - - // Get the space needed for the lifespan length - // byte. - CORBA::ULong const lifespan_key_length = - this->active_policy_strategies_.lifespan_strategy()->key_length (); - - CORBA::ULong const 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 = - prefix_size + - this->root_key_type_length () + - id_assignment_key_length + - lifespan_key_length + - poa_name; - - // Create the buffer for the POA id. - this->id_.length (buffer_size); - CORBA::Octet *buffer = &this->id_[0]; - - // Keeps track of where the next infomation goes; start at 0 byte. - CORBA::ULong starting_at = 0; - - // Add the object key prefix. - ACE_OS::memcpy (&buffer[starting_at], - &objectkey_prefix[0], - TAO_OBJECTKEY_PREFIX_SIZE); - - starting_at += TAO_OBJECTKEY_PREFIX_SIZE; - - // Copy the root byte. - if (parent != 0) - { - buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::non_root_key_char (); - } - else - { - buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::root_key_char (); - } - starting_at += this->root_key_type_length (); - - // Add the id_assignment part - this->active_policy_strategies_.id_assignment_strategy()->create_key (buffer, starting_at); - - // Add the lifespan part - this->active_policy_strategies_.lifespan_strategy()->create_key (buffer, starting_at); - - // Check if we need to added the length of the POA name. - if (add_poa_name_length) - { - poa_name_length = ACE_HTONL (poa_name_length); - ACE_OS::memcpy (&buffer[starting_at], - &poa_name_length, - sizeof (poa_name_length)); - starting_at += sizeof (poa_name_length); - } - - // Put the POA name into the key (for non-root POAs). - if (parent != 0) - { - ACE_OS::memcpy (&buffer[starting_at], - this->system_name_->get_buffer (), - this->system_name_->length ()); - starting_at += this->system_name_->length (); - } -} - -int -TAO_Root_POA::is_poa_generated_id (const PortableServer::ObjectId &id) -{ -#if defined (POA_NAME_IN_POA_GENERATED_ID) - - // Grab the buffer - const char *id_buffer = (const char *) id.get_buffer (); - - // Check to see if the POA name is the first part of the id - return - this->name_.length () < id.length () && - ACE_OS::strncmp (id_buffer, - this->name_.c_str (), - this->name_.length ()) == 0; -#else /* POA_NAME_IN_POA_GENERATED_ID */ - - ACE_UNUSED_ARG (id); - return 1; - -#endif /* POA_NAME_IN_POA_GENERATED_ID */ -} - -void -TAO_Root_POA::set_folded_name (TAO_Root_POA *parent) -{ - size_t length = 0; - size_t parent_length = 0; - - if (parent != 0) - { - parent_length = parent->folded_name ().length (); - length += parent_length; - } - - length += this->name_.length (); - length += TAO_Root_POA::name_separator_length (); - - this->folded_name_.length (static_cast <CORBA::ULong> (length)); - CORBA::Octet *folded_name_buffer = this->folded_name_.get_buffer (); - - if (parent != 0) - { - ACE_OS::memcpy (folded_name_buffer, - parent->folded_name ().get_buffer (), - parent_length); - } - - ACE_OS::memcpy (&folded_name_buffer[parent_length], - this->name_.c_str (), - this->name_.length ()); - - folded_name_buffer[length - TAO_Root_POA::name_separator_length ()] = TAO_Root_POA::name_separator (); -} - -int -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; - TAO::Portable_Server::Temporary_Creation_Time poa_creation_time; - - return TAO_Root_POA::parse_key (object_key, - poa_system_name, - user_id, - is_root, - is_persistent, - is_system_id, - poa_creation_time); -} - -TAO_Object_Adapter & -TAO_Root_POA::object_adapter (void) -{ - return *this->object_adapter_; -} - -CORBA::Object_ptr -TAO_Root_POA::invoke_key_to_object (ACE_ENV_SINGLE_ARG_DECL) -{ - PortableServer::ObjectId_var &system_id = - *this->key_to_object_params_.system_id_; - - // Create object key. - TAO::ObjectKey_var key = - this->create_object_key (system_id.in ()); - - return this->key_to_object (key.in (), - 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_.indirect_ - ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_Root_POA::key_to_object (const TAO::ObjectKey &key, - const char *type_id, - TAO_ServantBase *servant, - CORBA::Boolean collocated, - CORBA::Short priority, - bool indirect - ACE_ENV_ARG_DECL) -{ - // Check if the ORB is still running, otherwise throw an exception. - // @@ What if the ORB was destroyed? In that case we shouldn't even - // get here! - this->orb_core_.check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // - // ImplRepo related. - // -#if (TAO_HAS_MINIMUM_CORBA == 0) - - CORBA::Object_ptr obj = CORBA::Object::_nil (); - - if (indirect && this->active_policy_strategies_.lifespan_strategy()->use_imr () - && this->orb_core ().imr_endpoints_in_ior ()) - { - // Check to see if we alter the IOR. - CORBA::Object_var imr = - this->orb_core ().implrepo_service (); - - if (CORBA::is_nil (imr.in ()) - || !imr->_stubobj () - || !imr->_stubobj ()->profile_in_use ()) - { - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - "Missing ImR IOR, will not use the ImR\n")); - } - goto orbkey; - } - - CORBA::String_var imr_str = - imr->_stubobj ()->profile_in_use ()->to_string (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (obj); - - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "IMR IOR = \n%s\n", - ACE_TEXT_CHAR_TO_TCHAR (imr_str.in ()))); - - // Search for "corbaloc:" alone, without the protocol. This code - // should be protocol neutral. - const char corbaloc[] = "corbaloc:"; - char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc); - pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':'); - - pos = ACE_OS::strchr (pos + 1, - imr->_stubobj ()->profile_in_use ()->object_key_delimiter ()); - - if (pos) - pos[1] = 0; // Crop the string. - else - { - if (TAO_debug_level > 0) - ACE_ERROR ((LM_ERROR, - "Could not parse ImR IOR, skipping ImRification\n")); - goto orbkey; - } - - ACE_CString ior (imr_str.in ()); - - // Add the key. - - CORBA::String_var key_str; - TAO::ObjectKey::encode_sequence_to_string (key_str.inout (), key); - - ior += key_str.in (); - - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "ImR-ified IOR = \n%s\n", - ACE_TEXT_CHAR_TO_TCHAR (ior.c_str ()))); - - obj = - this->orb_core_.orb ()->string_to_object (ior.c_str () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (obj); - - return obj; - } - -orbkey: - -#else - ACE_UNUSED_ARG (indirect); -#endif /* TAO_HAS_MINIMUM_CORBA */ - - TAO_Stub *data = - this->key_to_stub_i (key, type_id, priority ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - TAO_Stub_Auto_Ptr safe_data (data); - - CORBA::Object_ptr tmp; - - if (this->orb_core_.optimize_collocation_objects ()) - { - ACE_NEW_THROW_EX (tmp, CORBA::Object (data, - collocated, - servant), - CORBA::INTERNAL ()); - - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - } - else - { - ACE_NEW_THROW_EX (tmp, - CORBA::Object (data, - collocated), - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - } - - data->servant_orb (this->orb_core_.orb ()); - - // Transfer ownership to the Object. - (void) safe_data.release (); - - return tmp; -} - -TAO_Stub * -TAO_Root_POA::key_to_stub (const TAO::ObjectKey &key, - const char *type_id, - CORBA::Short priority - ACE_ENV_ARG_DECL) -{ - // Check if the ORB is still running, otherwise throw an exception. - // @@ What if the ORB was destroyed? In that case we shouldn't even - // get here! - this->orb_core_.check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return this->key_to_stub_i (key, type_id, priority ACE_ENV_ARG_PARAMETER); -} - -TAO_Stub * -TAO_Root_POA::key_to_stub_i (const TAO::ObjectKey &key, - const char *type_id, - CORBA::Short priority - ACE_ENV_ARG_DECL) -{ - CORBA::PolicyList_var client_exposed_policies = - this->client_exposed_policies (priority - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (this->filter_factory_ == 0) - this->filter_factory_ - = ACE_Dynamic_Service<TAO_Acceptor_Filter_Factory>::instance ("TAO_Acceptor_Filter_Factory"); - - TAO_Acceptor_Filter* filter = - this->filter_factory_->create_object (this->poa_manager_); - - // Give ownership to the auto pointer. - auto_ptr<TAO_Acceptor_Filter> new_filter (filter); - - TAO_Stub *data = - this->create_stub_object ( - key, - type_id, - client_exposed_policies._retn (), - filter, - this->orb_core_.lane_resources ().acceptor_registry () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return data; -} - -void -TAO_Root_POA::establish_components (ACE_ENV_SINGLE_ARG_DECL) -{ - TAO_IORInterceptor_Adapter *ior_adapter = - this->orb_core_.ior_interceptor_adapter (); - - if (ior_adapter) - { - ior_adapter->establish_components (this ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -} - -void -TAO_Root_POA::components_established (PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL) -{ - TAO_IORInterceptor_Adapter *ior_adapter = - this->orb_core_.ior_interceptor_adapter (); - - if (ior_adapter) - { - ior_adapter->components_established (info ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } -} - -void -TAO_Root_POA::save_ior_component (const IOP::TaggedComponent &component - ACE_ENV_ARG_DECL_NOT_USED) -{ - const CORBA::ULong old_len = this->tagged_component_.length (); - - this->tagged_component_.length (old_len + 1); - this->tagged_component_[old_len] = component; -} - -void -TAO_Root_POA:: -save_ior_component_and_profile_id (const IOP::TaggedComponent &component, - IOP::ProfileId profile_id - ACE_ENV_ARG_DECL_NOT_USED) -{ - // The length of this->tagged_component_id_ is the same as the - // length of the profile_id_array_ since we are trying to make a - // one-to-one link between these two arrays. So, whenever - // 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 (); - - CORBA::ULong const new_len = old_len + 1; - - this->tagged_component_id_.length (new_len); - this->tagged_component_id_[old_len] = component; - - this->profile_id_array_.size (new_len); - this->profile_id_array_[old_len] = profile_id; -} - -TAO_Stub * -TAO_Root_POA::create_stub_object (const TAO::ObjectKey &object_key, - const char *type_id, - CORBA::PolicyList *policy_list, - TAO_Acceptor_Filter *filter, - TAO_Acceptor_Registry &acceptor_registry - ACE_ENV_ARG_DECL) -{ - int error = 0; - - // Count the number of endpoints. - size_t const profile_count = - acceptor_registry.endpoint_count (); - - // Create a profile container and have acceptor registries populate - // it with profiles as appropriate. - TAO_MProfile mprofile (0); - - // Allocate space for storing the profiles. There can never be more - // profiles than there are endpoints. In some cases, there can be - // less profiles than endpoints. - int result = - mprofile.set (static_cast <CORBA::ULong> (profile_count)); - if (result == -1) - error = 1; - - if (!error) - { - result = - filter->fill_profile (object_key, - mprofile, - acceptor_registry.begin (), - acceptor_registry.end ()); - if (result == -1) - error = 1; - } - - if (!error) - result = filter->encode_endpoints (mprofile); - if (result == -1) - error = 1; - - if (error) - ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO_MPROFILE_CREATION_ERROR, - 0), - CORBA::COMPLETED_NO), - 0); - - // Make sure we have at least one profile. <mp> may end up being - // empty if none of the acceptor endpoints have the right priority - // for this object, for example. - if (mprofile.profile_count () == 0) - ACE_THROW_RETURN (CORBA::BAD_PARAM ( - CORBA::SystemException::_tao_minor_code ( - TAO_MPROFILE_CREATION_ERROR, - 0), - CORBA::COMPLETED_NO), - 0); - - TAO_Stub *stub = - this->orb_core_.create_stub_object (mprofile, - type_id, - policy_list - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // Add the saved tagged components methods to the profiles. - CORBA::ULong len = this->tagged_component_.length (); - for (CORBA::ULong i = 0; i != len; ++i) - { - this->add_ior_component (mprofile, - this->tagged_component_[i] - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - len = this->tagged_component_id_.length (); - - for (CORBA::ULong k = 0; k != len; ++k) - { - this->add_ior_component_to_profile (mprofile, - this->tagged_component_id_[k], - this->profile_id_array_[k] - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - return stub; -} - -CORBA::PolicyList * -TAO_Root_POA::client_exposed_policies (CORBA::Short /* object_priority */ - ACE_ENV_ARG_DECL) -{ - CORBA::PolicyList *client_exposed_policies = 0; - ACE_NEW_THROW_EX (client_exposed_policies, - CORBA::PolicyList (), - CORBA::NO_MEMORY (TAO::VMCID, - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (0); - - CORBA::PolicyList_var policies = client_exposed_policies; - - // Add in all of the client exposed policies. - this->policies_.add_client_exposed_fixed_policies (client_exposed_policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return policies._retn (); -} - -TAO_SERVANT_LOCATION -TAO_Root_POA::locate_servant_i (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) -{ - return this->active_policy_strategies_.request_processing_strategy()-> - locate_servant (system_id, servant ACE_ENV_ARG_PARAMETER); -} - -TAO_SERVANT_LOCATION -TAO_Root_POA::servant_present (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - servant_present (system_id, servant ACE_ENV_ARG_PARAMETER); -} - -PortableServer::Servant -TAO_Root_POA::find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL) -{ - return this->active_policy_strategies_.servant_retention_strategy()-> - find_servant (system_id, - servant_upcall, - poa_current_impl - 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) -{ - return ACE_Dynamic_Service<TAO::ORT_Adapter_Factory>::instance - (orb_core_.configuration (), - TAO_Root_POA::ort_adapter_factory_name ()); -} - -TAO::ORT_Adapter * -TAO_Root_POA::ORT_adapter_i (void) -{ - if (this->ort_adapter_ != 0) - return this->ort_adapter_; - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - TAO::ORT_Adapter_Factory * ort_ap_factory = - this->ORT_adapter_factory (); - - if (!ort_ap_factory) - return 0; - - // Get the full adapter name of this POA, do this before we - // create the adapter so that in case this fails, we just - // return 0 and not a not activated adapter - PortableInterceptor::AdapterName *adapter_name = - this->adapter_name_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->ort_adapter_ = - ort_ap_factory->create (); - - if (!this->ort_adapter_) - return 0; - - // @todo We have to look at this, we activate it but hold the POA lock, - // in case we are called by ORT_adapter, we shouldn't keep the lock - // here, but then the ort_adapter should be guarded against multiple - // activations. - this->ort_adapter_->activate (this->orb_core_.server_id (), - this->orb_core_.orbid (), - adapter_name, - this - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "(%P|%t) Cannot initialize the " - "object_reference_template_adapter\n"); - } - ACE_ENDTRY; - ACE_CHECK_RETURN (0); - - return this->ort_adapter_; -} - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -PortableServer::AdapterActivator_ptr -TAO_Root_POA::the_activator (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (PortableServer::AdapterActivator::_nil ()); - - return PortableServer::AdapterActivator::_duplicate (this->adapter_activator_.in ()); -} - -void -TAO_Root_POA::the_activator (PortableServer::AdapterActivator_ptr adapter_activator - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD; - - this->adapter_activator_ = PortableServer::AdapterActivator::_duplicate (adapter_activator); -} - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)*/ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -PortableServer::ServantManager_ptr -TAO_Root_POA::get_servant_manager (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (PortableServer::ServantManager::_nil ()); - - return this->active_policy_strategies_.request_processing_strategy()-> - get_servant_manager (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -void -TAO_Root_POA::set_servant_manager (PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD; - - this->active_policy_strategies_.request_processing_strategy()-> - set_servant_manager (imgr ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -PortableServer::Servant -TAO_Root_POA::get_servant_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - return this->active_policy_strategies_.request_processing_strategy()-> - get_servant (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -PortableServer::Servant -TAO_Root_POA::get_servant (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::NoServant, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - PortableServer::Servant servant = - this->get_servant_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (servant != 0) - { - // ATTENTION: Trick locking here, see class header for details - TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this); - ACE_UNUSED_ARG (non_servant_upcall); - - // The POA invokes _add_ref once on the Servant before returning - // it. If the application uses reference counting, the caller of - // get_servant is responsible for invoking _remove_ref once on - // the returned Servant when it is finished with it. A - // conforming caller need not invoke _remove_ref on the returned - // Servant if the type of the Servant uses the default reference - // counting inherited from ServantBase. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return servant; - } - else - { - // If no servant has been associated with the POA, the NoServant - // exception is raised. - ACE_THROW_RETURN (PortableServer::POA::NoServant (), - 0); - } -} - -void -TAO_Root_POA::set_servant (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) -{ - // Lock access for the duration of this transaction. - TAO_POA_GUARD; - - this->active_policy_strategies_.request_processing_strategy()-> - set_servant (servant ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - -bool -TAO_Root_POA::is_servant_activation_allowed (PortableServer::Servant servant, - int &wait_occurred_restart_call) -{ - return this->active_policy_strategies_.id_uniqueness_strategy ()-> - is_servant_activation_allowed (servant, wait_occurred_restart_call); -} - -bool -TAO_Root_POA::has_system_id (void) const -{ - return this->active_policy_strategies_.id_assignment_strategy ()-> - has_system_id (); -} - -int -TAO_Root_POA::rebind_using_user_id_and_system_id ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall) -{ - return this->active_policy_strategies_.servant_retention_strategy ()-> - rebind_using_user_id_and_system_id (servant, - user_id, - system_id, - servant_upcall); -} - -CORBA::Boolean -TAO_Root_POA::servant_has_remaining_activations (PortableServer::Servant servant) -{ - return this->active_policy_strategies_.servant_retention_strategy ()-> - servant_has_remaining_activations (servant); -} - -bool -TAO_Root_POA::allow_implicit_activation (void) const -{ - return this->active_policy_strategies_.implicit_activation_strategy ()-> - allow_implicit_activation (); -} - -bool -TAO_Root_POA::allow_multiple_activations (void) const -{ - return this->active_policy_strategies_.id_uniqueness_strategy ()-> - allow_multiple_activations (); -} - -void -TAO_Root_POA::post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall) -{ - this->active_policy_strategies_.request_processing_strategy ()-> - post_invoke_servant_cleanup (system_id, servant_upcall); -} - -CORBA::Short -TAO_Root_POA::server_priority (void) const -{ - return this->cached_policies_.server_priority (); -} - -int -TAO_Root_POA::is_servant_active ( - PortableServer::Servant servant, - int &wait_occurred_restart_call) -{ - return this->active_policy_strategies_.servant_retention_strategy ()-> - is_servant_in_map (servant, wait_occurred_restart_call); -} - -TAO::Portable_Server::Cached_Policies::PriorityModel -TAO_Root_POA::priority_model (void) const -{ - return cached_policies_.priority_model (); -} - -#if (TAO_HAS_MINIMUM_POA == 0) -int -TAO_Root_POA::enter () -{ - return this->active_policy_strategies_.thread_strategy ()->enter(); -} -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#if (TAO_HAS_MINIMUM_POA == 0) -int -TAO_Root_POA::exit () -{ - return this->active_policy_strategies_.thread_strategy ()->exit(); -} -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -bool -TAO_Root_POA::validate_lifespan ( - CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const -{ - return this->active_policy_strategies_.lifespan_strategy()-> - validate (is_persistent, creation_time); -} - -CORBA::Boolean -TAO_Root_POA::root (void) const -{ - return true; -} - -TAO::ORT_Adapter * -TAO_Root_POA::ORT_adapter (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - if (this->ort_adapter_ != 0) - return this->ort_adapter_; - - // Lock access for the duration of this transaction. - TAO_POA_GUARD_RETURN (0); - - // DCL .. - if (this->ort_adapter_ != 0) - return this->ort_adapter_; - - return this->ORT_adapter_i (); -} - -CORBA::Policy * -TAO_Root_POA::server_protocol (void) -{ - return 0; -} - -void -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, - 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 -TAO_Root_POA::waiting_servant_deactivation (void) const -{ - return this->active_policy_strategies_.servant_retention_strategy ()-> - waiting_servant_deactivation (); -} - -void -TAO_Root_POA::ort_adapter_factory_name (const char *name) -{ - TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_ = - name; -} - -CORBA::Policy_ptr -TAO_Root_POA::get_policy (CORBA::PolicyType policy - ACE_ENV_ARG_DECL) -{ - return this->policies_.get_policy (policy ACE_ENV_ARG_PARAMETER); -} - -void -TAO_Root_POA::check_state (ACE_ENV_SINGLE_ARG_DECL) -{ - this->active_policy_strategies_.lifespan_strategy ()-> - check_state (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -const char * -TAO_Root_POA::ort_adapter_factory_name (void) -{ - return TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_.c_str(); -} - -void -TAO_Root_POA::imr_client_adapter_name (const char *name) -{ - TAO_POA_Static_Resources::instance ()->imr_client_adapter_name_ = name; -} - -const char * -TAO_Root_POA::imr_client_adapter_name (void) -{ - return TAO_POA_Static_Resources::instance ()->imr_client_adapter_name_.c_str(); -} - -PortableServer::POAManager_ptr -TAO_Root_POA::the_POAManager (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return PortableServer::POAManager::_duplicate (&this->poa_manager_); -} - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) -PortableServer::POAManagerFactory_ptr -TAO_Root_POA::the_POAManagerFactory (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return PortableServer::POAManagerFactory::_duplicate (&this->poa_manager_factory_); -} -#endif - -CORBA::ORB_ptr -TAO_Root_POA::_get_orb (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return CORBA::ORB::_duplicate (this->orb_core_.orb ()); -} - -// Initialize instance_ to 0, since this is what we test for in the call -// to instance (). Note that this does not require a constructor call, so -// it is always initialized by the time that instance () can be called. -TAO_POA_Static_Resources* TAO_POA_Static_Resources::instance_ = 0; - -// Force an instance to be created at module initialization time, -// since we do not want to worry about double checked locking and -// the race condition to initialize the lock. -TAO_POA_Static_Resources* TAO_POA_Static_Resources::initialization_reference_ = - TAO_POA_Static_Resources::instance (); - -TAO_POA_Static_Resources* -TAO_POA_Static_Resources::instance (void) -{ - if (TAO_POA_Static_Resources::instance_ == 0) - { - // This new is never freed on purpose. The data specified by - // it needs to be around for the last shared library that references - // this class. This could occur in a destructor in a shared library - // that is unloaded after this one. One solution to avoid this - // harmless memory leak would be to use reference counting. - ACE_NEW_RETURN (TAO_POA_Static_Resources::instance_, - TAO_POA_Static_Resources (), - 0); - } - - return TAO_POA_Static_Resources::instance_; -} - -TAO_POA_Static_Resources::TAO_POA_Static_Resources (void) - : ort_adapter_factory_name_ ("ORT_Adapter_Factory"), - imr_client_adapter_name_ ("ImR_Client_Adapter") -{ -} - -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 diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h deleted file mode 100644 index c6f97421b05..00000000000 --- a/TAO/tao/PortableServer/Root_POA.h +++ /dev/null @@ -1,1053 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Root_POA.h - * - * $Id$ - * - * Header file for CORBA's ORB type. - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_ROOT_POA_H -#define TAO_ROOT_POA_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -// Object Adapter -#include "tao/PortableServer/Object_Adapter.h" - -// POA Policy Set -#include "tao/PortableServer/POA_Policy_Set.h" - -// Cached POA Policies -#include "tao/PortableServer/POA_Cached_Policies.h" -#include "tao/PortableServer/Active_Policy_Strategies.h" - -#include "tao/PortableServer/ORT_Adapter.h" - -#include "tao/PortableServer/PortableServer.h" - -// Object_Key -#include "tao/Object_KeyC.h" - -// Local Object -#include "tao/LocalObject.h" - -// Portable Interceptor -#include "tao/PI_ForwardC.h" - -// OctetSeq -#include "tao/OctetSeqC.h" - -#include "ace/SString.h" -#include "ace/Hash_Map_Manager_T.h" -#include "ace/Array_Base.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Null_Mutex.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward Declaration -class TAO_Acceptor_Filter; -class TAO_Acceptor_Filter_Factory; -class TAO_Acceptor_Registry; -class TAO_IORInfo; -class TAO_Regular_POA; -class TAO_POAManager_Factory; - -namespace PortableInterceptor -{ - class IORInfo; - typedef IORInfo *IORInfo_ptr; -} - -namespace TAO -{ - class ORT_Adapter; - class ORT_Adapter_Factory; - - namespace Portable_Server - { - class Servant_Upcall; - class POA_Current_Impl; - class Temporary_Creation_Time; - } -} - -namespace PortableServer -{ - class POAManager; - typedef POAManager *POAManager_ptr; -} - -/** - * @class TAO_Root_POA - * - * @brief Implementation of the PortableServer::POA interface. - * - * Implementation of the PortableServer::POA interface. - */ -class TAO_PortableServer_Export TAO_Root_POA - : public virtual PortableServer::POA, - public virtual TAO_Local_RefCounted_Object -{ -public: - - friend class TAO_Object_Adapter; - friend class TAO::Portable_Server::Servant_Upcall; - friend class TAO::Portable_Server::Non_Servant_Upcall; - friend class TAO_POA_Manager; - friend class TAO_RT_Collocation_Resolver; - friend class TAO_IORInfo; - - typedef ACE_CString String; - -#if !defined (CORBA_E_MICRO) - PortableServer::POA_ptr create_POA ( - const char *adapter_name, - PortableServer::POAManager_ptr poa_manager, - const CORBA::PolicyList &policies - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterAlreadyExists, - PortableServer::POA::InvalidPolicy)); - - PortableServer::POA_ptr find_POA (const char *adapter_name, - CORBA::Boolean activate_it - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterNonExistent)); -#endif - - void destroy (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::ThreadPolicy_ptr create_thread_policy ( - PortableServer::ThreadPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#if !defined (CORBA_E_MICRO) - PortableServer::LifespanPolicy_ptr create_lifespan_policy ( - PortableServer::LifespanPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); -#endif - -#if !defined (CORBA_E_MICRO) - PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy ( - PortableServer::IdUniquenessPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); -#endif - -#if !defined (CORBA_E_MICRO) - PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy ( - PortableServer::IdAssignmentPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); -#endif - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - - PortableServer::ImplicitActivationPolicy_ptr - create_implicit_activation_policy ( - PortableServer::ImplicitActivationPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::ServantRetentionPolicy_ptr - create_servant_retention_policy ( - PortableServer::ServantRetentionPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::RequestProcessingPolicy_ptr - create_request_processing_policy ( - PortableServer::RequestProcessingPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - - char * the_name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::POA_ptr the_parent (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::POAList *the_children ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::POAManager_ptr the_POAManager ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::POAManagerFactory_ptr the_POAManagerFactory ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -#endif - - /// This method returns the adapter_name as a sequence of strings of - /// length one or more or just a fixed name depending on the Object - /// Adapter. Added wrt to ORT Spec. - PortableInterceptor::AdapterName *adapter_name (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Store the given TaggedComponent for eventual insertion into all - /// object reference profiles. - void save_ior_component (const IOP::TaggedComponent &component - ACE_ENV_ARG_DECL); - - /// Store the given TaggedComponent for eventual insertion into all - /// object reference profiles with the given ProfileId. - void save_ior_component_and_profile_id ( - const IOP::TaggedComponent &component, - IOP::ProfileId profile_id - ACE_ENV_ARG_DECL); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::AdapterActivator_ptr the_activator ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void the_activator (PortableServer::AdapterActivator_ptr adapter_activator - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::ServantManager_ptr get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void set_servant_manager (PortableServer::ServantManager_ptr imgr - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - PortableServer::Servant get_servant (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::NoServant, - PortableServer::POA::WrongPolicy)); - - void set_servant (PortableServer::Servant servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); -#endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - - PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)); - -#if !defined (CORBA_E_MICRO) - void activate_object_with_id (const PortableServer::ObjectId &id, - PortableServer::Servant p_servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)); -#endif - - void deactivate_object (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - CORBA::Object_ptr create_reference (const char *intf - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - CORBA::Object_ptr create_reference_with_id ( - const PortableServer::ObjectId &oid, - const char *intf - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - PortableServer::ObjectId *servant_to_user_id (PortableServer::Servant p_servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - PortableServer::Servant reference_to_servant ( - CORBA::Object_ptr reference - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)); - - PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)); - - PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - CORBA::OctetSeq *id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Accessor for POA policies. - TAO_POA_Policy_Set &policies (void); - - /// Get the set policy of the given type. - CORBA::Policy_ptr get_policy (CORBA::PolicyType policy ACE_ENV_ARG_DECL); - - /// This method gives the policies that are exposed to the client. - /// These policies are shipped within the IOR. - virtual CORBA::PolicyList *client_exposed_policies ( - CORBA::Short object_priority - ACE_ENV_ARG_DECL - ); - - TAO_Root_POA (const String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL); - - virtual ~TAO_Root_POA (void); - - static char name_separator (void); - - static CORBA::ULong name_separator_length (void); - - enum - { - TAO_OBJECTKEY_PREFIX_SIZE = 4 - }; - - static CORBA::Octet const objectkey_prefix[TAO_OBJECTKEY_PREFIX_SIZE]; - - const TAO_Object_Adapter::poa_name &folded_name (void) const; - - const TAO_Object_Adapter::poa_name &system_name (void) const; - - static void check_for_valid_wait_for_completions ( - const TAO_ORB_Core &orb_core, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL - ); - - /// ORB Core for POA. - TAO_ORB_Core &orb_core (void) const; - - TAO::Portable_Server::Cached_Policies::PriorityModel priority_model (void) const; - - CORBA::Boolean cleanup_in_progress (void); - - /// Calls protected static method used when POACurrent is not appropriate. - static int parse_ir_object_key (const TAO::ObjectKey &object_key, - PortableServer::ObjectId &user_id); - - TAO_Object_Adapter &object_adapter (void); - - ACE_Lock &lock (void); - - /// Create the correct stub, properly initialized with the - /// attributes and policies attached to the current POA. - TAO_Stub* key_to_stub (const TAO::ObjectKey &key, - const char *type_id, - CORBA::Short priority - ACE_ENV_ARG_DECL); - - /// Accessor methods to POA state. - /** - * The POA can be in one of HOLDING, ACTIVE, DISCARDING, INACTIVE - * and NON_EXISTENT states. - */ - PortableInterceptor::AdapterState get_adapter_state ( - ACE_ENV_SINGLE_ARG_DECL); - - virtual void *thread_pool (void) const; - - virtual CORBA::Policy *server_protocol (void); - - CORBA::ULong outstanding_requests (void) const; - - const ACE_CString &name (void) const; - - CORBA::Boolean waiting_destruction (void) const; - - static void ort_adapter_factory_name (const char *name); - - static const char *ort_adapter_factory_name (void); - - /// Sets the value of TAO_POA_Static_Resources::imr_client_adapter_name_. - static void imr_client_adapter_name (const char *name); - - /// Gets the value of TAO_POA_Static_Resources::imr_client_adapter_name_. - static const char *imr_client_adapter_name (void); - - CORBA::Object_ptr invoke_key_to_object (ACE_ENV_SINGLE_ARG_DECL); - - CORBA::Boolean system_id (void); - - CORBA::ULong waiting_servant_deactivation (void) const; - - /// Return the POA Manager related to this POA - TAO_POA_Manager &tao_poa_manager (); - - bool is_poa_generated (CORBA::Object_ptr reference, - PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - /* - * Validate if the servant may be activated - * @retval true This servant may be activated - * @retval false This servant may not be activated - */ - bool is_servant_activation_allowed ( - PortableServer::Servant servant, - int &wait_occurred_restart_call); - - int rebind_using_user_id_and_system_id ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall); - - CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); - - bool allow_implicit_activation (void) const; - - bool allow_multiple_activations (void) const; - - int is_servant_active ( - PortableServer::Servant servant, - int &wait_occurred_restart_call); - - void deactivate_object_i (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - CORBA::Boolean is_persistent (void) const; - - CORBA::Short server_priority (void) const; - - bool has_system_id (void) const; - - PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - TAO_SERVANT_LOCATION servant_present ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL); - - /** - * Find the the servant with ObjectId <system_id>, and retrieve - * its priority.Usually used in RT CORBA with SERVER_DECLARED - * priority model. - * - * @return -1 if servant does not exist, else 0 indicating the - * servant exists and priority successfully retrieved. - */ - int find_servant_priority ( - const PortableServer::ObjectId &system_id, - CORBA::Short &priority - ACE_ENV_ARG_DECL); - - int unbind_using_user_id (const PortableServer::ObjectId &user_id); - - void cleanup_servant ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id - ACE_ENV_ARG_DECL); - - void post_invoke_servant_cleanup( - const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - bool validate_lifespan ( - CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; - - PortableServer::ObjectId *activate_object_i ( - PortableServer::Servant p_servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)); - - 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, - PortableServer::POA::WrongPolicy)); - - PortableServer::ObjectId *servant_to_id_i (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - TAO_SYNCH_CONDITION &servant_deactivation_condition (void); - - int is_poa_generated_id (const PortableServer::ObjectId &id); - - /// Check the state of this POA - void check_state (ACE_ENV_SINGLE_ARG_DECL); - - int delete_child (const String &child); - - PortableServer::Servant user_id_to_servant_i (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - virtual CORBA::ORB_ptr _get_orb ( - ACE_ENV_SINGLE_ARG_DECL - ); - - /// These hooks are needed by the CSD strategy to override - /// and no-ops by default. - - /// Hook - The POA has been (or is being) activated. - virtual void poa_activated_hook (); - - /// Hook - The POA has been deactivated. - virtual void poa_deactivated_hook (); - - /// Hook - A servant has been activated. - virtual void servant_activated_hook (PortableServer::Servant servant, - const PortableServer::ObjectId& oid - ACE_ENV_ARG_DECL); - - /// Hook - A servant has been deactivated. - virtual void servant_deactivated_hook (PortableServer::Servant servant, - const PortableServer::ObjectId& oid - ACE_ENV_ARG_DECL); - -protected: - -#if (TAO_HAS_MINIMUM_POA == 0) - int enter (void); - - int exit (void); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - /// Template method for creating new POA's of this type. - virtual TAO_Root_POA *new_POA (const String &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - TAO_Root_POA *parent, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL); - -#if ! defined (CORBA_E_MICRO) - PortableServer::POA_ptr create_POA_i ( - const char *adapter_name, - PortableServer::POAManager_ptr poa_manager, - const CORBA::PolicyList &policies - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterAlreadyExists, - PortableServer::POA::InvalidPolicy)); - - PortableServer::POA_ptr create_POA_i (const String &adapter_name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterAlreadyExists, - PortableServer::POA::InvalidPolicy)); - - TAO_Root_POA *find_POA_i (const ACE_CString &child_name, - CORBA::Boolean activate_it - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::AdapterNonExistent)); -#endif - - void destroy_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void complete_destruction_i (ACE_ENV_SINGLE_ARG_DECL); - - PortableServer::POAList *the_children_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// This method returns the adapter_name as a sequence of strings of - /// length one or more or just a fixed name depending on the Object - /// Adapter. Added wrt to ORT Spec. - PortableInterceptor::AdapterName *adapter_name_i (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Method to notify the IOR Interceptors when there is a state - /// changed not related to POAManager. - void adapter_state_changed ( - const TAO::ORT_Array &array_obj_ref_template, - PortableInterceptor::AdapterState state - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Add the given tagged component to all profiles. - void add_ior_component (TAO_MProfile & mprofile, - const IOP::TaggedComponent & component - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Add the given tagged component to all profiles matching the given - /// ProfileId. - void add_ior_component_to_profile (TAO_MProfile & mprofile, - const IOP::TaggedComponent & component, - IOP::ProfileId profile_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Wrapper for the ORB's key_to_object that will alter the object pointer - /// if the ImplRepo is used. - CORBA::Object_ptr key_to_object (const TAO::ObjectKey &key, - const char *type_id, - TAO_ServantBase *servant, - CORBA::Boolean collocated, - CORBA::Short priority, - bool indirect - ACE_ENV_ARG_DECL); - - /// Like key_to_stub() but assume that the ORB is not shutting down. - virtual TAO_Stub* key_to_stub_i (const TAO::ObjectKey &key, - const char *type_id, - CORBA::Short priority - ACE_ENV_ARG_DECL); - - TAO_Stub *create_stub_object (const TAO::ObjectKey &object_key, - const char *type_id, - CORBA::PolicyList *policy_list, - TAO_Acceptor_Filter *filter, - TAO_Acceptor_Registry &acceptor_registry - ACE_ENV_ARG_DECL); - - PortableServer::Servant get_servant_i (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - -protected: -#if !defined (CORBA_E_MICRO) - void activate_object_with_id_i (const PortableServer::ObjectId &id, - PortableServer::Servant p_servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)); -#endif - - virtual void remove_from_parent_i (ACE_ENV_SINGLE_ARG_DECL); - - void deactivate_all_objects_i (CORBA::Boolean etherealize_objects - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void deactivate_all_objects_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - void wait_for_completions (CORBA::Boolean wait_for_completion - ACE_ENV_ARG_DECL); - - CORBA::Object_ptr create_reference_i (const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - CORBA::Object_ptr create_reference_with_id_i ( - const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - PortableServer::Servant reference_to_servant_i ( - CORBA::Object_ptr reference - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)); - - CORBA::Object_ptr servant_to_reference_i (PortableServer::Servant p_servant - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - PortableServer::Servant id_to_servant_i (const PortableServer::ObjectId &oid - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - /// Call the IORInterceptor::establish_components() method on all - /// registered IORInterceptors. - /** - * This method calls IORInterceptor::establish_components() method - * on all registered IORInterceptors, and - * IORInterceptor::components_established() once the former is - * completed. - */ - void establish_components (ACE_ENV_SINGLE_ARG_DECL); - - /// Call the IORInterceptor::components_established() method on all - /// registered IORInterceptors. - void components_established (PortableInterceptor::IORInfo_ptr info - ACE_ENV_ARG_DECL); - - void set_folded_name (TAO_Root_POA *parent); - - void set_id (TAO_Root_POA *parent); - - TAO::ObjectKey *create_object_key (const PortableServer::ObjectId &id); - - static int parse_key (const TAO::ObjectKey &key, - TAO_Object_Adapter::poa_name &poa_system_name, - PortableServer::ObjectId &system_id, - CORBA::Boolean &is_root, - CORBA::Boolean &is_persistent, - CORBA::Boolean &is_system_id, - TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time); - -protected: - /// Accessor methods to ObjectReferenceTemplate - PortableInterceptor::ObjectReferenceTemplate * - get_adapter_template (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Accessor methods to ObjectReferenceTemplate, non locked version - PortableInterceptor::ObjectReferenceTemplate *get_adapter_template_i (void); - - /// Accessor methods to PortableInterceptor::ObjectReferenceFactory - PortableInterceptor::ObjectReferenceFactory * - get_obj_ref_factory (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Set the object reference factory - void set_obj_ref_factory ( - PortableInterceptor::ObjectReferenceFactory *current_factory - ACE_ENV_ARG_DECL); - - - TAO_SERVANT_LOCATION locate_servant_i (const PortableServer::ObjectId &id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - PortableServer::Servant locate_servant_i ( - const char *operation, - const PortableServer::ObjectId &id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL - ); - -public: - // @todo Temporarily for servant retention - CORBA::Object_ptr - invoke_key_to_object_helper_i (const char * repository_id, - const PortableServer::ObjectId & id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); -protected: - - /// Get the ORT adapter, in case there is no adapter yet, this method will - /// try to create one and hold the POA lock - TAO::ORT_Adapter *ORT_adapter (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Get the ORT adapter, in case there is no adapter yet, this method will - /// try to create one but assumes the POA lock is already hold - TAO::ORT_Adapter *ORT_adapter_i (void); - - TAO::ORT_Adapter_Factory *ORT_adapter_factory (void); - - CORBA::Boolean persistent (void); - - static char persistent_key_char (void); - - static char transient_key_char (void); - - static CORBA::ULong persistent_key_type_length (void); - - static char system_id_key_char (void); - - static char user_id_key_char (void); - - static CORBA::ULong system_id_key_type_length (void); - - virtual CORBA::Boolean root (void) const; - - virtual char root_key_type (void); - - static char root_key_char (void); - - static char non_root_key_char (void); - - static CORBA::ULong root_key_type_length (void); - - void outstanding_requests (CORBA::ULong new_outstanding_requests); - - CORBA::ULong increment_outstanding_requests (void); - - CORBA::ULong decrement_outstanding_requests (void); - - String name_; - - /// Reference to the POAManager that this poa assicuates with. - TAO_POA_Manager &poa_manager_; - /// Reference to the POAManagerFactory that generate the POAManager. - TAO_POAManager_Factory& poa_manager_factory_; - - IOP::TaggedComponentList tagged_component_; - - IOP::TaggedComponentList tagged_component_id_; - - ACE_Array_Base <IOP::ProfileId> profile_id_array_; - - TAO_POA_Policy_Set policies_; - - TAO_Object_Adapter::poa_name folded_name_; - - TAO_Object_Adapter::poa_name_var system_name_; - - CORBA::OctetSeq id_; - - /// Pointer to the object reference template adapter. - TAO::ORT_Adapter *ort_adapter_; - - /// Adapter can be accepting, rejecting etc. - PortableInterceptor::AdapterState adapter_state_; - - TAO::Portable_Server::Cached_Policies cached_policies_; - - TAO::Portable_Server::Active_Policy_Strategies active_policy_strategies_; - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::AdapterActivator_var adapter_activator_; -#endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - - typedef - ACE_Hash_Map_Manager_Ex< - ACE_CString, TAO_Root_POA *, - ACE_Hash<ACE_CString>, - ACE_Equal_To<ACE_CString>, - ACE_Null_Mutex - > - CHILDREN; - - CHILDREN children_; - - ACE_Lock &lock_; - - TAO_ORB_Core &orb_core_; - - /// The object adapter we belong to - TAO_Object_Adapter *object_adapter_; - - CORBA::Boolean cleanup_in_progress_; - - CORBA::ULong outstanding_requests_; - - TAO_SYNCH_CONDITION outstanding_requests_condition_; - - CORBA::Boolean wait_for_completion_pending_; - - CORBA::Boolean waiting_destruction_; - - TAO_SYNCH_CONDITION servant_deactivation_condition_; - - TAO_Acceptor_Filter_Factory * filter_factory_; - -public: - // @todo Temporarily for servant retention - CORBA::ULong caller_key_to_object_; - - PortableServer::Servant servant_for_key_to_object_; - - struct Key_To_Object_Params - { - PortableServer::ObjectId_var *system_id_; - const char *type_id_; - 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_, - bool indirect); - }; - - Key_To_Object_Params key_to_object_params_; -}; - -/** - * @class TAO_POA_Static_Resources - * - * @brief The static (global) resoures of all POA's. - * - * This class is used by the POA to store the resources global to - * all POA's. All instance variables that would have been - * declared "static" in TAO_Regular_POA, should be declared in this class - * to avoid the "static initialization order fiasco" as described in - * http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11. - * Briefly, this is the problem that occurs if any static initializers - * in any other code call into set static members of TAO_Regular_POA. - * Since the order in which these initializers execute is unspecified, - * uninitialized members can be accessed. - */ -class TAO_PortableServer_Export TAO_POA_Static_Resources -{ -public: - - /// Return the singleton instance. - static TAO_POA_Static_Resources* instance (void); - -public: - - /** - * Name of the factory object used to adapt function calls on the - * PortableInterceptor interfaces ORT. The default value is - * "ObjectReferenceTemplate_Adapter_Factory". If the ORT library is linked, - * the corresponding accessor function - * objectreferencefactory_adapter_factory_name() will be called to set - * the value to "Concrete_ObjectReferenceTemplate_Adapter_Factory". - */ - ACE_CString ort_adapter_factory_name_; - - /** - * Name of the service object for functions that make calls on - * the Implementation Repository. The default value is "ImR_Client_Adapter". - * If TAO_IMR_CLient is linked, imr_client_adapter_name() will be - * called to set the value to "Concrete_ImR_Client_Adapter". - */ - ACE_CString imr_client_adapter_name_; -private: - /// Constructor. - TAO_POA_Static_Resources (void); - -private: - /// The singleton instance. - static TAO_POA_Static_Resources* instance_; - - /// Mostly unused variable whose sole purpose is to enforce - /// the instantiation of a TAO_POA_Static_Resources instance - /// at initialization time. - static TAO_POA_Static_Resources* initialization_reference_; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -// **************************************************************** - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Root_POA.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_ROOT_POA_H */ diff --git a/TAO/tao/PortableServer/Root_POA.inl b/TAO/tao/PortableServer/Root_POA.inl deleted file mode 100644 index 116d1d99c4f..00000000000 --- a/TAO/tao/PortableServer/Root_POA.inl +++ /dev/null @@ -1,246 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// Exception macros -#include "tao/Environment.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE CORBA::Boolean -TAO_Root_POA::cleanup_in_progress (void) -{ - return this->cleanup_in_progress_; -} - -ACE_INLINE ACE_Lock & -TAO_Root_POA::lock (void) -{ - return this->lock_; -} - -ACE_INLINE TAO_POA_Policy_Set & -TAO_Root_POA::policies (void) -{ - return this->policies_; -} - -ACE_INLINE PortableServer::POA_ptr -TAO_Root_POA::the_parent (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return PortableServer::POA::_nil (); -} - -ACE_INLINE PortableInterceptor::AdapterName * -TAO_Root_POA::adapter_name (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->adapter_name_i (ACE_ENV_SINGLE_ARG_PARAMETER); -} - -ACE_INLINE PortableInterceptor::ObjectReferenceTemplate * -TAO_Root_POA::get_adapter_template (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::ORT_Adapter *adapter = this->ORT_adapter (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (adapter) - { - return this->ort_adapter_->get_adapter_template(); - } - - return 0; -} - -ACE_INLINE PortableInterceptor::ObjectReferenceTemplate * -TAO_Root_POA::get_adapter_template_i () -{ - if (this->ORT_adapter_i ()) - { - return this->ort_adapter_->get_adapter_template (); - } - - return 0; -} - -ACE_INLINE PortableInterceptor::ObjectReferenceFactory * -TAO_Root_POA::get_obj_ref_factory (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - TAO::ORT_Adapter *adapter = this->ORT_adapter (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (adapter) - { - return this->ort_adapter_->get_obj_ref_factory(); - } - - return 0; -} - -ACE_INLINE CORBA::Boolean -TAO_Root_POA::system_id (void) -{ - return (this->cached_policies_.id_assignment () == PortableServer::SYSTEM_ID); -} - -ACE_INLINE CORBA::Boolean -TAO_Root_POA::persistent (void) -{ - return (this->cached_policies_.lifespan () == PortableServer::PERSISTENT); -} - -ACE_INLINE const ACE_CString & -TAO_Root_POA::name (void) const -{ - return this->name_; -} - -ACE_INLINE char * -TAO_Root_POA::the_name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->name_.c_str ()); -} - -ACE_INLINE const TAO_Object_Adapter::poa_name & -TAO_Root_POA::folded_name (void) const -{ - return this->folded_name_; -} - -ACE_INLINE const TAO_Object_Adapter::poa_name & -TAO_Root_POA::system_name (void) const -{ - return this->system_name_.in (); -} - -ACE_INLINE char -TAO_Root_POA::name_separator (void) -{ - return '\0'; -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::name_separator_length (void) -{ - return sizeof (char); -} - -ACE_INLINE char -TAO_Root_POA::persistent_key_char (void) -{ - return 'P'; -} - -ACE_INLINE char -TAO_Root_POA::transient_key_char (void) -{ - return 'T'; -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::persistent_key_type_length (void) -{ - return sizeof (char); -} - -ACE_INLINE char -TAO_Root_POA::system_id_key_char (void) -{ - return 'S'; -} - -ACE_INLINE char -TAO_Root_POA::user_id_key_char (void) -{ - return 'U'; -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::system_id_key_type_length (void) -{ - return sizeof (char); -} - -ACE_INLINE char -TAO_Root_POA::root_key_char (void) -{ - return 'R'; -} - -ACE_INLINE char -TAO_Root_POA::non_root_key_char (void) -{ - return 'N'; -} - -ACE_INLINE char -TAO_Root_POA::root_key_type (void) -{ - return TAO_Root_POA::root_key_char (); -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::root_key_type_length (void) -{ - return sizeof (char); -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::outstanding_requests (void) const -{ - return this->outstanding_requests_; -} - -ACE_INLINE void -TAO_Root_POA::outstanding_requests (CORBA::ULong new_outstanding_requests) -{ - this->outstanding_requests_ = new_outstanding_requests; -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::increment_outstanding_requests (void) -{ - return ++this->outstanding_requests_; -} - -ACE_INLINE CORBA::ULong -TAO_Root_POA::decrement_outstanding_requests (void) -{ - return --this->outstanding_requests_; -} - -ACE_INLINE CORBA::Boolean -TAO_Root_POA::waiting_destruction (void) const -{ - return this->waiting_destruction_; -} - -ACE_INLINE TAO_ORB_Core & -TAO_Root_POA::orb_core (void) const -{ - return this->orb_core_; -} - -ACE_INLINE PortableInterceptor::AdapterState -TAO_Root_POA::get_adapter_state (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return this->adapter_state_; -} - -ACE_INLINE void * -TAO_Root_POA::thread_pool (void) const -{ - return 0; -} - -ACE_INLINE TAO_SYNCH_CONDITION & -TAO_Root_POA::servant_deactivation_condition (void) -{ - return servant_deactivation_condition_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/SArg_Traits_T.h b/TAO/tao/PortableServer/SArg_Traits_T.h deleted file mode 100644 index 09f01b6bef4..00000000000 --- a/TAO/tao/PortableServer/SArg_Traits_T.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file SArg_Traits_T.h - * - * $Id$ - * - * @author Jeff Parsons - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef TAO_SARG_TRAITS_T_H -#define TAO_SARG_TRAITS_T_H - -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * - * @brief Base class for all skeleton arg traits specializations. - * - */ - template<typename T> - class SArg_Traits - { - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_SARG_TRAITS_T_H */ diff --git a/TAO/tao/PortableServer/ServantActivator.pidl b/TAO/tao/PortableServer/ServantActivator.pidl deleted file mode 100644 index daadaa4a612..00000000000 --- a/TAO/tao/PortableServer/ServantActivator.pidl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file ServantActivator.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * This file was used to generate the code in - * ServantActivatorC.{h,inl,cpp}, using the following command: - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * ServantActivator.pidl - */ - -#ifndef _PORTABLESERVER_SERVANT_ACTIVATOR_IDL_ -#define _PORTABLESERVER_SERVANT_ACTIVATOR_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/PortableServer/PS_Forward.pidl" -#include "tao/PortableServer/ServantManager.pidl" -#include "tao/PortableServer/ForwardRequest.pidl" - -#pragma prefix "omg.org" - -#if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - -module PortableServer -{ -# pragma version PortableServer 2.3 - - local interface ServantActivator : ServantManager - { -# pragma version ServantActivator 2.3 - - Servant incarnate (in ObjectId oid, - in POA adapter) - raises (ForwardRequest); - - void etherealize (in ObjectId oid, - in POA adapter, - in Servant serv, - in boolean cleanup_in_progress, - in boolean remaining_activations); - }; -}; - -#endif - -#endif // _PORTABLESERVER_SERVANT_ACTIVATOR_IDL_ diff --git a/TAO/tao/PortableServer/ServantLocator.pidl b/TAO/tao/PortableServer/ServantLocator.pidl deleted file mode 100644 index 19221cde6f8..00000000000 --- a/TAO/tao/PortableServer/ServantLocator.pidl +++ /dev/null @@ -1,63 +0,0 @@ -/** - * @file ServantLocator.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * This file was used to generate the code in - * ServantLocatorC.{h,inl,cpp}, using the following command: - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * ServantLocator.pidl - * - * Apply patches using the following command: - * - * patch < diffs/PS_Forward.diff - */ - -#ifndef _PORTABLESERVER_SERVANTLOCATOR_IDL_ -#define _PORTABLESERVER_SERVANTLOCATOR_IDL_ - -///FUZZ: disable check_for_include/ -#include "tao/orb_types.pidl" -#include "tao/PortableServer/PS_Forward.pidl" -#include "tao/PortableServer/ServantManager.pidl" -#include "tao/PortableServer/ForwardRequest.pidl" - -#pragma prefix "omg.org" - -#if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - -module PortableServer -{ -# pragma version PortableServer 2.3 - - local interface ServantLocator : ServantManager - { -# pragma version ServantLocator 2.3 - - native Cookie; - - Servant preinvoke (in ObjectId oid, - in POA adapter, - in CORBA::Identifier operation, - out Cookie the_cookie) - raises (ForwardRequest); - - void postinvoke (in ObjectId oid, - in POA adapter, - in CORBA::Identifier operation, - in Cookie the_cookie, - in Servant the_servant); - }; -}; - -#endif - -#endif // _PORTABLESERVER_SERVANTLOCATOR_IDL_ diff --git a/TAO/tao/PortableServer/ServantManager.pidl b/TAO/tao/PortableServer/ServantManager.pidl deleted file mode 100644 index 52c3707f543..00000000000 --- a/TAO/tao/PortableServer/ServantManager.pidl +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @file ServantManager.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * This file was used to generate the code in - * ServantManagerC.{h,inl,cpp}, using the following command: - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * ServantManager.pidl - */ - -#ifndef _PORTABLESERVER_SERVANT_MANAGER_IDL_ -#define _PORTABLESERVER_SERVANT_MANAGER_IDL_ - -#pragma prefix "omg.org" - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - -module PortableServer -{ -# pragma version PortableServer 2.3 - - // ServantManager interface. - local interface ServantManager {}; -}; - -#endif - -#endif // _PORTABLESERVER_SERVANT_MANAGER_IDL_ diff --git a/TAO/tao/PortableServer/ServantRetentionPolicy.cpp b/TAO/tao/PortableServer/ServantRetentionPolicy.cpp deleted file mode 100644 index b4301aef697..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionPolicy.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "tao/PortableServer/ServantRetentionPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - ServantRetentionPolicy, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionPolicy::ServantRetentionPolicy ( - ::PortableServer::ServantRetentionPolicyValue value) : - value_ (value) - { - } - - CORBA::Policy_ptr - ServantRetentionPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ServantRetentionPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - ServantRetentionPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - ServantRetentionPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::ServantRetentionPolicyValue - ServantRetentionPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return this->value_; - } - - CORBA::PolicyType - ServantRetentionPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::SERVANT_RETENTION_POLICY_ID; - } - - TAO_Cached_Policy_Type - ServantRetentionPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_SERVANT_RETENTION; - } - - TAO_Policy_Scope - ServantRetentionPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ServantRetentionPolicy.h b/TAO/tao/PortableServer/ServantRetentionPolicy.h deleted file mode 100644 index 948d7ee33dc..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONPOLICY_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ServantRetentionPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionPolicy : - public virtual ::PortableServer::ServantRetentionPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - ServantRetentionPolicy (::PortableServer::ServantRetentionPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::ServantRetentionPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::ServantRetentionPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONPOLICY_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionPolicy.pidl b/TAO/tao/PortableServer/ServantRetentionPolicy.pidl deleted file mode 100644 index 79f6b54bd46..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionPolicy.pidl +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file ServantRetentionPolicy.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * ServantRetentionPolicy.pidl - */ - -#ifndef _PORTABLESERVER_SERVANTRETENTIONPOLICY_IDL_ -#define _PORTABLESERVER_SERVANTRETENTIONPOLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum ServantRetentionPolicyValue - { - RETAIN, - NON_RETAIN - }; - -#if !defined (TAO_HAS_MINIMUM_POA) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - - local interface ServantRetentionPolicy : CORBA::Policy - { - readonly attribute ServantRetentionPolicyValue value; - }; - -#endif - -}; - -#endif // _PORTABLESERVER_SERVANTRETENTIONPOLICY_IDL_ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategy.h b/TAO/tao/PortableServer/ServantRetentionStrategy.h deleted file mode 100644 index 053fcb8961e..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategy.h +++ /dev/null @@ -1,166 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_SERVANTRETENTIONSTRATEGY_H -#define TAO_SERVANTRETENTIONSTRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Policy_Strategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Location.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" -#include "tao/PortableServer/PortableServer.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; -class TAO_Active_Object_Map; -struct TAO_Active_Object_Map_Entry; - -namespace TAO -{ - namespace Portable_Server - { - class ServantRetentionStrategy - : public Policy_Strategy - { - public: - virtual CORBA::ULong waiting_servant_deactivation (void) const = 0; - - virtual int is_servant_in_map (PortableServer::Servant servant, - int &wait_occurred_restart_call) = 0; - - virtual TAO_SERVANT_LOCATION servant_present ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL) = 0; - - virtual int find_servant_priority ( - const PortableServer::ObjectId &system_id, - CORBA::Short &priority - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::ObjectId *activate_object ( - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)) = 0; - -#if !defined (CORBA_E_MICRO) - virtual void activate_object_with_id ( - const PortableServer::ObjectId &id, - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)) = 0; -#endif - - virtual void deactivate_object (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) = 0; - - virtual PortableServer::ObjectId *system_id_to_object_id ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)) = 0; - - virtual PortableServer::Servant user_id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) = 0; - - virtual 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)) = 0; - - virtual void deactivate_all_objects (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) = 0; - - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) = 0; - - virtual CORBA::Object_ptr servant_to_reference ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) = 0; - - virtual CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) = 0; - - virtual CORBA::Object_ptr create_reference_with_id ( - const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) = 0; - - virtual int rebind_using_user_id_and_system_id ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall) = 0; - - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id) = 0; - - virtual CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant) = 0; - - virtual ::PortableServer::ServantRetentionPolicyValue type() const = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_SERVANTRETENTIONSTRATEGY_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h b/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h deleted file mode 100644 index 84d581d0c18..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/StrategyFactory.h" -#include "tao/PortableServer/ServantRetentionPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ServantRetentionStrategy; - - class TAO_PortableServer_Export ServantRetentionStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create ( - ::PortableServer::ServantRetentionPolicyValue value) = 0; - - virtual void destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp deleted file mode 100644 index c1a5c11f000..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ServantRetentionStrategyFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ServantRetentionStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategy* - ServantRetentionStrategyFactoryImpl::create ( - ::PortableServer::ServantRetentionPolicyValue value) - { - ServantRetentionStrategyFactory *strategy_factory = 0; - const char *strategy_factory_name = 0; - - switch (value) - { - case ::PortableServer::RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyRetainFactory"; - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyNonRetainFactory"; - break; - } - } - - strategy_factory = - ACE_Dynamic_Service<ServantRetentionStrategyFactory>::instance (strategy_factory_name); - - if (strategy_factory == 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %s\n"), - strategy_factory_name)); - - return strategy_factory->create (value); - } - - void - ServantRetentionStrategyFactoryImpl::destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL) - { - const char *strategy_factory_name = 0; - - switch (strategy->type ()) - { - case ::PortableServer::RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyRetainFactory"; - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory_name = "ServantRetentionStrategyNonRetainFactory"; - break; - } - } - - ServantRetentionStrategyFactory *servantretention_strategy_factory = - ACE_Dynamic_Service<ServantRetentionStrategyFactory>::instance (strategy_factory_name); - - if (servantretention_strategy_factory != 0) - { - servantretention_strategy_factory->destroy (strategy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - ServantRetentionStrategyFactoryImpl, - ACE_TEXT ("ServantRetentionStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ServantRetentionStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ServantRetentionStrategyFactoryImpl, - TAO::Portable_Server::ServantRetentionStrategyFactoryImpl) diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h deleted file mode 100644 index b6864c9984e..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionStrategyFactoryImpl - : public ServantRetentionStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create ( - ::PortableServer::ServantRetentionPolicyValue value); - - virtual void destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyFactoryImpl) - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp deleted file mode 100644 index a0a365fd003..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp +++ /dev/null @@ -1,347 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyNonRetain.cpp - * - * $Id$ - * - */ -//============================================================================= - -#include "tao/PortableServer/ServantRetentionStrategyNonRetain.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/POA_Current_Impl.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/Servant_Base.h" -#include "tao/debug.h" - -ACE_RCSID (PortableServer, - Servant_Retention_Strategy, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategyNonRetain::ServantRetentionStrategyNonRetain (void) : - poa_ (0) - { - } - - void - ServantRetentionStrategyNonRetain::strategy_init ( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL_NOT_USED) - { - poa_ = poa; - } - - void - ServantRetentionStrategyNonRetain::strategy_cleanup ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - poa_ = 0; - } - - void - ServantRetentionStrategyNonRetain::deactivate_object ( - const PortableServer::ObjectId &/*id*/ - ACE_ENV_ARG_DECL) - { - // When using Non_Retain we don't have an active object map and we just - // can't deactivate any object - ACE_THROW (PortableServer::POA::WrongPolicy ()); - } - - PortableServer::Servant - ServantRetentionStrategyNonRetain::find_servant ( - const PortableServer::ObjectId &/*system_id*/ - ACE_ENV_ARG_DECL) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - PortableServer::ObjectId * - ServantRetentionStrategyNonRetain::system_id_to_object_id ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)) - { - // The system id is the id (and no conversion/transformation is - // needed). - PortableServer::ObjectId *id = 0; - ACE_NEW_THROW_EX (id, - PortableServer::ObjectId (system_id), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (0); - - return id; - } - - PortableServer::Servant - ServantRetentionStrategyNonRetain::user_id_to_servant ( - const PortableServer::ObjectId &/*id*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - CORBA::Object_ptr - ServantRetentionStrategyNonRetain::id_to_reference ( - const PortableServer::ObjectId &/*id*/, - bool /*indirect*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - CORBA::Object::_nil ()); - } - - TAO_SERVANT_LOCATION - ServantRetentionStrategyNonRetain::servant_present ( - const PortableServer::ObjectId &/*system_id*/, - PortableServer::Servant &/*servant*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - return TAO_SERVANT_NOT_FOUND; - } - - PortableServer::Servant - ServantRetentionStrategyNonRetain::find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL_NOT_USED) - { - // We have the NON_RETAIN policy, user id is the system id. - - // Smartly copy all the data; <poa_current_impl.object_id_> does - // not own the data. - poa_current_impl.replace_object_id (system_id); - - servant_upcall.user_id (&system_id); - - return 0; - } - - int - ServantRetentionStrategyNonRetain::find_servant_priority ( - const PortableServer::ObjectId &/*system_id*/, - CORBA::Short &/*priority*/ - ACE_ENV_ARG_DECL) - { - return -1; - } - - int - ServantRetentionStrategyNonRetain::is_servant_in_map ( - PortableServer::Servant /*servant*/, - int &/*wait_occurred_restart_call*/) - { - return 0; - } - - CORBA::ULong - ServantRetentionStrategyNonRetain::waiting_servant_deactivation (void) const - { - return 0; - } - - void - ServantRetentionStrategyNonRetain::deactivate_all_objects ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - } - - PortableServer::ObjectId * - ServantRetentionStrategyNonRetain::servant_to_user_id ( - PortableServer::Servant /*servant*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - CORBA::Object_ptr - ServantRetentionStrategyNonRetain::servant_to_reference ( - PortableServer::Servant /*servant*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - CORBA::Object::_nil ()); - } - - PortableServer::ObjectId * - ServantRetentionStrategyNonRetain::activate_object ( - PortableServer::Servant /*servant*/, - CORBA::Short /*priority*/, - int &/*wait_occurred_restart_call*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - -#if !defined (CORBA_E_MICRO) - void - ServantRetentionStrategyNonRetain::activate_object_with_id ( - const PortableServer::ObjectId &/*id*/, - PortableServer::Servant /*servant*/, - CORBA::Short /*priority*/, - int &/*wait_occurred_restart_call*/ - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)) - { - ACE_THROW (PortableServer::POA::WrongPolicy ()); - } -#endif - - CORBA::Object_ptr - ServantRetentionStrategyNonRetain::create_reference ( - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // This operation creates an object reference that encapsulates a - // POA-generated Object Id value and the specified interface - // repository id. This operation does not cause an activation to - // take place. The resulting reference may be passed to clients, so - // that subsequent requests on those references will cause the - // appropriate servant manager to be invoked, if one is - // available. The generated Object Id value may be obtained by - // invoking POA::reference_to_id with the created reference. - - PortableServer::ObjectId_var system_id; - PortableServer::ObjectId user_id; - - // Otherwise, it is the NON_RETAIN policy. Therefore, any ol' - // object id will do (even an empty one). - PortableServer::ObjectId *sys_id = 0; - ACE_NEW_THROW_EX (sys_id, - PortableServer::ObjectId, - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - system_id = sys_id; - - // User id is the same as system id. - user_id = system_id.in (); - - // Remember params for potentially invoking <key_to_object> later. - this->poa_->key_to_object_params_.set (system_id, - intf, - 0, - 1, - priority, - true); - - return this->poa_->invoke_key_to_object_helper_i (intf, - user_id - ACE_ENV_ARG_PARAMETER); - } - - CORBA::Object_ptr - ServantRetentionStrategyNonRetain::create_reference_with_id ( - const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - // This operation creates an object reference that encapsulates the - // specified Object Id and interface repository Id values. This - // operation does not cause an activation to take place. The - // resulting reference may be passed to clients, so that subsequent - // requests on those references will cause the object to be - // activated if necessary, or the default servant used, depending on - // the applicable policies. - - PortableServer::Servant servant = 0; - PortableServer::ObjectId_var system_id; - - // Otherwise, it is the NON_RETAIN policy. Therefore, user id - // is the same as system id. - PortableServer::ObjectId *sys_id; - ACE_NEW_THROW_EX (sys_id, - PortableServer::ObjectId (oid), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - system_id = sys_id; - - // Remember params for potentially invoking <key_to_object> later. - this->poa_->key_to_object_params_.set (system_id, - intf, - servant, - 1, - priority, - true); - - return this->poa_->invoke_key_to_object_helper_i (intf, - oid - ACE_ENV_ARG_PARAMETER); - } - - int - ServantRetentionStrategyNonRetain::rebind_using_user_id_and_system_id ( - PortableServer::Servant /*servant*/, - const PortableServer::ObjectId &/*user_id*/, - const PortableServer::ObjectId &/*system_id*/, - TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) - { - return -1; - } - - CORBA::Boolean - ServantRetentionStrategyNonRetain::servant_has_remaining_activations ( - PortableServer::Servant /*servant*/) - { - return false; - } - - int - ServantRetentionStrategyNonRetain::unbind_using_user_id ( - const PortableServer::ObjectId &/*user_id*/) - { - return 0; - } - - ::PortableServer::ServantRetentionPolicyValue - ServantRetentionStrategyNonRetain::type() const - { - return ::PortableServer::NON_RETAIN; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h deleted file mode 100644 index 1b26e36fe54..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h +++ /dev/null @@ -1,173 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyNonRetain.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_SERVANT_RETENTION_STRATEGY_NON_RETAIN_H -#define TAO_SERVANT_RETENTION_STRATEGY_NON_RETAIN_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/ServantRetentionStrategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Location.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class ServantRetentionStrategyNonRetain - : public ServantRetentionStrategy - { - public: - ServantRetentionStrategyNonRetain (void); - - virtual void strategy_init (TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - CORBA::ULong waiting_servant_deactivation (void) const; - - virtual - PortableServer::ObjectId * - activate_object (PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)); - -#if !defined (CORBA_E_MICRO) - virtual - void - activate_object_with_id (const PortableServer::ObjectId &id, - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)); -#endif - - virtual void deactivate_object (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - virtual int is_servant_in_map (PortableServer::Servant servant, - int &wait_occurred_restart_call); - - virtual PortableServer::ObjectId *system_id_to_object_id ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)); - - virtual - PortableServer::Servant - user_id_to_servant (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - 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)); - - virtual TAO_SERVANT_LOCATION servant_present ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL); - - virtual int find_servant_priority ( - const PortableServer::ObjectId &system_id, - CORBA::Short &priority - ACE_ENV_ARG_DECL); - - virtual void deactivate_all_objects (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual CORBA::Object_ptr servant_to_reference ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual CORBA::Object_ptr create_reference_with_id ( - const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual int rebind_using_user_id_and_system_id ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); - - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id); - - virtual ::PortableServer::ServantRetentionPolicyValue type() const; - - protected: - TAO_Root_POA *poa_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_SERVANT_RETENTION_STRATEGY_NON_RETAIN_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp deleted file mode 100644 index bc3a3510554..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategyNonRetain.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ServantRetentionStrategyNonRetainFactoryImpl, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategy* - ServantRetentionStrategyNonRetainFactoryImpl::create ( - ::PortableServer::ServantRetentionPolicyValue value) - { - ServantRetentionStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::NON_RETAIN : - { - ACE_NEW_RETURN (strategy, ServantRetentionStrategyNonRetain, 0); - break; - } - case ::PortableServer::RETAIN : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ServantRetentionStrategyNonRetainFactoryImpl::destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - ServantRetentionStrategyNonRetainFactoryImpl, - ACE_TEXT ("ServantRetentionStrategyNonRetainFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ServantRetentionStrategyNonRetainFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ServantRetentionStrategyNonRetainFactoryImpl, - TAO::Portable_Server::ServantRetentionStrategyNonRetainFactoryImpl) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h deleted file mode 100644 index 688e49cbeec..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyNonRetainFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYNONRETAIN_FACTORYIMPL_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYNONRETAIN_FACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionStrategyNonRetainFactoryImpl - : public ServantRetentionStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create ( - ::PortableServer::ServantRetentionPolicyValue value); - - virtual void destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyNonRetainFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyNonRetainFactoryImpl) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYNONRETAIN_FACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp deleted file mode 100644 index 3543a783c74..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp +++ /dev/null @@ -1,1096 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyRetain.cpp - * - * $Id$ - * - */ -//============================================================================= - -#include "tao/ORB_Core.h" -#include "tao/debug.h" -#include "tao/PortableServer/ServantRetentionStrategyRetain.h" -#include "tao/PortableServer/Non_Servant_Upcall.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/POA_Current_Impl.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/Active_Object_Map.h" -#include "tao/PortableServer/Active_Object_Map_Entry.h" -#include "ace/Auto_Ptr.h" - -ACE_RCSID (PortableServer, - Servant_Retention_Strategy, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategyRetain::ServantRetentionStrategyRetain (void) : - ServantRetentionStrategyNonRetain (), - active_object_map_ (0), - waiting_servant_deactivation_ (0) - { - } - - void - ServantRetentionStrategyRetain::strategy_init ( - TAO_Root_POA *poa - ACE_ENV_ARG_DECL) - { - poa_ = poa; - - // Create the active object map to be used - TAO_Active_Object_Map *active_object_map = 0; - ACE_NEW_THROW_EX (active_object_map, - TAO_Active_Object_Map (!poa->system_id (), - !poa->allow_multiple_activations (), - poa->is_persistent (), - poa->orb_core().server_factory ()->active_object_map_creation_parameters () - ACE_ENV_ARG_PARAMETER), CORBA::NO_MEMORY ()); - ACE_CHECK; - - // Give ownership of the new map to the auto pointer. Note, that it - // is important for the auto pointer to take ownership before - // checking for exception since we may need to delete the new map. - auto_ptr<TAO_Active_Object_Map> new_active_object_map (active_object_map); - - // Check for exception in construction of the active object map. - ACE_CHECK; - - // Finally everything is fine. Make sure to take ownership away - // from the auto pointer. - this->active_object_map_ = new_active_object_map.release (); - } - - void - ServantRetentionStrategyRetain::strategy_cleanup( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - // Delete the active object map. - delete this->active_object_map_; - active_object_map_ = 0; - } - - void - ServantRetentionStrategyRetain::deactivate_object ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - { - - TAO_Active_Object_Map_Entry *active_object_map_entry = 0; - int result = this->active_object_map_-> - find_entry_using_user_id (id, - active_object_map_entry); - - // If there is no active object associated with the specified Object - // Id, the operation raises an ObjectNotActive exception. - if (result != 0) - { - ACE_THROW (PortableServer::POA::ObjectNotActive ()); - } - - this->deactivate_map_entry (active_object_map_entry - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - ServantRetentionStrategyRetain::deactivate_map_entry ( - TAO_Active_Object_Map_Entry *active_object_map_entry - ACE_ENV_ARG_DECL) - { - // Decrement the reference count. - CORBA::UShort new_count = --active_object_map_entry->reference_count_; - - // Inform the custom servant dispatching (CSD) strategy that the - // servant is deactivated. This would be called just once when the - // servant is deactivated the first time. - if (active_object_map_entry->deactivated_ == 0) - { - this->poa_->servant_deactivated_hook ( - active_object_map_entry->servant_, - active_object_map_entry->user_id_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - if (new_count == 0) - { - this->poa_->cleanup_servant (active_object_map_entry->servant_, - active_object_map_entry->user_id_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - // It should be noted that there may be a period of time between - // an object's deactivation and the etherealization (during - // which outstanding requests are being processed) in which - // arriving requests on that object should not be passed to its - // servant. During this period, requests targeted for such an - // object act as if the POA were in holding state until - // etherealize completes. If etherealize is called as a - // consequence of a deactivate call with a etherealize_objects - // parameter of TRUE, incoming requests are rejected. - - // Else mark entry as closed... - active_object_map_entry->deactivated_ = 1; - } - } - - int - ServantRetentionStrategyRetain::unbind_using_user_id ( - const PortableServer::ObjectId &user_id) - { - return this->active_object_map_-> - unbind_using_user_id (user_id); - } - - PortableServer::Servant - ServantRetentionStrategyRetain::find_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - { - // Find user id from system id. - PortableServer::ObjectId_var user_id; - if (active_object_map_-> - find_user_id_using_system_id (system_id, - user_id.out()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - // This operation returns the active servant associated with the - // specified system Object Id value. If the Object Id value is - // not active in the POA, an ObjectNotActive exception is - // raised. - TAO_Active_Object_Map_Entry *entry = 0; - PortableServer::Servant servant = 0; - - int result = - active_object_map_-> - find_servant_using_system_id_and_user_id (system_id, - user_id.in(), - servant, - entry); - - if (result == -1) - { - ACE_THROW_RETURN (PortableServer::POA::ObjectNotActive (), - 0); - } - - return servant; - } - - PortableServer::ObjectId * - ServantRetentionStrategyRetain::system_id_to_object_id ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)) - { - // The object denoted by the reference does not have to be - // active for this operation to succeed. - PortableServer::ObjectId_var user_id; - if (this->active_object_map_-> - find_user_id_using_system_id (system_id, - user_id.out ()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - return user_id._retn (); - } - - PortableServer::Servant - ServantRetentionStrategyRetain::user_id_to_servant ( - const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - // If the POA has the RETAIN policy and the specified ObjectId is in - // the Active Object Map, this operation returns the servant - // associated with that object in the Active Object Map. - PortableServer::Servant servant = 0; - - int result = - this->active_object_map_->find_servant_using_user_id (id, - servant); - - if (result == -1) - { - ACE_THROW_RETURN (PortableServer::POA::ObjectNotActive (), - 0); - } - - return servant; - } - - CORBA::Object_ptr - ServantRetentionStrategyRetain::id_to_reference ( - const PortableServer::ObjectId &id, - bool indirect - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)) - { - // If an object with the specified Object Id value is currently - // active, a reference encapsulating the information used to - // activate the object is returned. - PortableServer::ObjectId_var system_id; - PortableServer::Servant servant; - CORBA::Short priority; - - if (this->active_object_map_-> - find_servant_and_system_id_using_user_id (id, - servant, - system_id.out (), - priority) == 0) - { - // Remember params for potentially invoking <key_to_object> later. - this->poa_->key_to_object_params_.set (system_id, - servant->_interface_repository_id (), - servant, - 1, - priority, - indirect); - - return this->poa_->invoke_key_to_object_helper_i (servant->_interface_repository_id (), - id - ACE_ENV_ARG_PARAMETER); - } - else - { - // If the Object Id value is not active in the POA, an - // ObjectNotActive exception is raised. - ACE_THROW_RETURN (PortableServer::POA::ObjectNotActive (), - CORBA::Object::_nil ()); - } - } - - TAO_SERVANT_LOCATION - ServantRetentionStrategyRetain::servant_present ( - const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL) - { - // Find user id from system id. - PortableServer::ObjectId_var user_id; - if (this->active_object_map_-> - find_user_id_using_system_id (system_id, - user_id.out()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - TAO_SERVANT_NOT_FOUND); - } - - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_-> - find_servant_using_system_id_and_user_id (system_id, - user_id.in(), - servant, - entry); - if (result == 0) - { - // Success - return TAO_SERVANT_FOUND; - } - else - { - return TAO_SERVANT_NOT_FOUND; - } - } - - PortableServer::Servant - ServantRetentionStrategyRetain::find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL) - { - PortableServer::ObjectId user_id; - // If we have the RETAIN policy, convert/transform from system id to - // user id. - if (this->active_object_map_-> - find_user_id_using_system_id (system_id, - user_id) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - poa_current_impl.object_id(user_id); - servant_upcall.user_id (&poa_current_impl.object_id()); - - // If the POA has the RETAIN policy, the POA looks in the Active - // Object Map to find if there is a servant associated with the - // Object Id value from the request. If such a servant exists, the - // POA invokes the appropriate method on the servant. - PortableServer::Servant servant = 0; - TAO_Active_Object_Map_Entry *active_object_map_entry = 0; - int result = this->active_object_map_-> - find_servant_using_system_id_and_user_id (system_id, - user_id, - servant, - active_object_map_entry); - - - if (result == 0) - { - servant_upcall.active_object_map_entry (active_object_map_entry); - - // Increment the reference count. - servant_upcall.increment_servant_refcount (); - } - - return servant; - } - - int - ServantRetentionStrategyRetain::find_servant_priority ( - const PortableServer::ObjectId &system_id, - CORBA::Short &priority - ACE_ENV_ARG_DECL) - { - PortableServer::ObjectId user_id; - // If we have the RETAIN policy, convert/transform from system id to - // user id. - if (this->active_object_map_-> - find_user_id_using_system_id (system_id, - user_id) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - -1); - } - - // If the POA has the RETAIN policy, the POA looks in the Active - // Object Map to find if there is a servant associated with the - // Object Id value from the request. If such a servant exists, the - // POA invokes the appropriate method on the servant. - PortableServer::Servant servant = 0; - TAO_Active_Object_Map_Entry *active_object_map_entry = 0; - int result = this->active_object_map_-> - find_servant_using_system_id_and_user_id (system_id, - user_id, - servant, - active_object_map_entry); - - if (result == 0) - { - priority = active_object_map_entry->priority_; - return 0; - } - - return -1; - } - - int - ServantRetentionStrategyRetain::is_servant_in_map ( - PortableServer::Servant servant, - int &wait_occurred_restart_call) - { - int deactivated = 0; - int servant_in_map = - this->active_object_map_->is_servant_in_map (servant, - deactivated); - - if (!servant_in_map) - { - return 0; - } - else - { - if (deactivated) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) TAO_Root_POA::is_servant_in_map: waiting for servant to deactivate\n"))); - - // We are going to wait on this condition variable; the POA - // state may change by the time we get the lock again. - // Therefore, indicate to the caller that all conditions - // need to be checked again. - wait_occurred_restart_call = 1; - - ++this->waiting_servant_deactivation_; - - if (this->poa_->object_adapter ().enable_locking ()) - this->poa_->servant_deactivation_condition ().wait (); - - --this->waiting_servant_deactivation_; - - return 0; - } - else - { - return 1; - } - } - } - - int - ServantRetentionStrategyRetain::is_user_id_in_map ( - const PortableServer::ObjectId &id, - CORBA::Short priority, - int &priorities_match, - int &wait_occurred_restart_call) - { - int deactivated = 0; - int user_id_in_map = - this->active_object_map_->is_user_id_in_map (id, - priority, - priorities_match, - deactivated); - - if (!user_id_in_map) - { - return 0; - } - else - { - if (deactivated) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) TAO_Root_POA::is_user_id_in_map: waiting for servant to deactivate\n"))); - - // We are going to wait on this condition variable; the POA - // state may change by the time we get the lock again. - // Therefore, indicate to the caller that all conditions - // need to be checked again. - wait_occurred_restart_call = 1; - - ++this->waiting_servant_deactivation_; - - if (this->poa_->object_adapter ().enable_locking ()) - this->poa_->servant_deactivation_condition ().wait (); - - --this->waiting_servant_deactivation_; - - return 0; - } - else - { - return 1; - } - } - } - - CORBA::ULong - ServantRetentionStrategyRetain::waiting_servant_deactivation (void) const - { - return waiting_servant_deactivation_; - } - - void - ServantRetentionStrategyRetain::deactivate_all_objects ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // If the etherealize_objects parameter is TRUE, the POA has the - // RETAIN policy, and a servant manager is registered with the POA, - // the etherealize operation on the servant manager will be called - // for each active object in the Active Object Map. The apparent - // destruction of the POA occurs before any calls to etherealize are - // made. Thus, for example, an etherealize method that attempts to - // invoke operations on the POA will receive the OBJECT_NOT_EXIST - // exception. - - // We must copy the map entries into a separate place since we - // cannot remove entries while iterating through the map. - ACE_Array_Base<TAO_Active_Object_Map_Entry *> map_entries - (this->active_object_map_->current_size ()); - - size_t counter = 0; - TAO_Active_Object_Map::user_id_map::iterator end - = this->active_object_map_->user_id_map_->end (); - - for (TAO_Active_Object_Map::user_id_map::iterator iter - = this->active_object_map_->user_id_map_->begin (); - iter != end; - ++iter) - { - TAO_Active_Object_Map::user_id_map::value_type map_pair = *iter; - TAO_Active_Object_Map_Entry *active_object_map_entry = map_pair.second (); - - if (!active_object_map_entry->deactivated_) - { - map_entries[counter] = active_object_map_entry; - ++counter; - } - } - - for (size_t i = 0; - i < counter; - ++i) - { - this->deactivate_map_entry (map_entries[i] - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - PortableServer::ObjectId * - ServantRetentionStrategyRetain::servant_to_user_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - // This operation requires the RETAIN and either the UNIQUE_ID or - // IMPLICIT_ACTIVATION policies; if not present, the WrongPolicy - // exception is raised. - if (!((!this->poa_->allow_multiple_activations () - || this->poa_->allow_implicit_activation ()))) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - /** - * If the POA has both the RETAIN and the UNIQUE_ID policy and the - * specified servant is active, the Object Id associated with that - * servant is returned. - * - * If the POA has both the RETAIN and the IMPLICIT_ACTIVATION policy and - * either the POA has the MULTIPLE_ID policy or the specified servant is - * not active, the servant is activated using a POA-generated Object Id - * and the Interface Id associated with the servant, and that Object Id - * is returned. - * - */ - - // If the POA has the UNIQUE_ID policy and the specified servant is - // active, the Object Id associated with that servant is returned. - PortableServer::ObjectId_var user_id; - if (!this->poa_->allow_multiple_activations () && - this->active_object_map_-> - find_user_id_using_servant (servant, - user_id.out ()) != -1) - { - return user_id._retn (); - } - - // If the POA has the IMPLICIT_ACTIVATION policy and either the POA - // has the MULTIPLE_ID policy or the specified servant is not - // active, the servant is activated using a POA-generated Object Id - // and the Interface Id associated with the servant, and that Object - // Id is returned. - if (this->poa_->allow_implicit_activation ()) - { - // If we reach here, then we either have the MULTIPLE_ID policy - // or we have the UNIQUE_ID policy and we are not in the active - // object map. - PortableServer::ObjectId_var user_id; - if (this->active_object_map_-> - bind_using_system_id_returning_user_id (servant, - this->poa_->server_priority (), - user_id.out ()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - // - // Everything is finally ok - // - - // Inform the custom servant dispatching (CSD) strategy that the - // sevant is activated. - this->poa_->servant_activated_hook (servant, - user_id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - // If this operation causes the object to be activated, _add_ref - // is invoked at least once on the Servant argument before - // returning. Otherwise, the POA does not increment or decrement - // the reference count of the Servant passed to this function. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return user_id._retn (); - } - - /* - * Otherwise, the ServantNotActive exception is raised. - */ - ACE_THROW_RETURN (PortableServer::POA::ServantNotActive (), - 0); - } - - PortableServer::ObjectId * - ServantRetentionStrategyRetain::servant_to_system_id_i ( - PortableServer::Servant servant, - CORBA::Short &priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - // This operation requires the RETAIN and either the UNIQUE_ID or - // IMPLICIT_ACTIVATION policies; if not present, the WrongPolicy - // exception is raised. - if (!((!this->poa_->allow_multiple_activations () - || this->poa_->allow_implicit_activation ()))) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - // This operation has three possible behaviors. - - // If the POA has the UNIQUE_ID policy and the specified servant is - // active, the Object Id associated with that servant is returned. - PortableServer::ObjectId_var system_id; - if (!this->poa_->allow_multiple_activations () && - this->active_object_map_-> - find_system_id_using_servant (servant, - system_id.out (), - priority) != -1) - { - return system_id._retn (); - } - - // If the POA has the IMPLICIT_ACTIVATION policy and either the POA - // has the MULTIPLE_ID policy or the specified servant is not - // active, the servant is activated using a POA-generated Object Id - // and the Interface Id associated with the servant, and that Object - // Id is returned. - if (this->poa_->allow_implicit_activation ()) - { - // If we reach here, then we either have the MULTIPLE_ID policy - // or we have the UNIQUE_ID policy and we are not in the active - // object map. - PortableServer::ObjectId_var system_id; - if (this->active_object_map_-> - bind_using_system_id_returning_system_id (servant, - priority, - system_id.out ()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - // - // Everything is finally ok - // - - // Inform the custom servant dispatching (CSD) strategy that the - // sevant is activated. - this->poa_->servant_activated_hook (servant, - system_id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - // If this operation causes the object to be activated, _add_ref - // is invoked at least once on the Servant argument before - // returning. Otherwise, the POA does not increment or decrement - // the reference count of the Servant passed to this function. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return system_id._retn (); - } - - // Otherwise, the ServantNotActive exception is raised. - ACE_THROW_RETURN (PortableServer::POA::ServantNotActive (), - 0); - } - - CORBA::Object_ptr - ServantRetentionStrategyRetain::servant_to_reference ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)) - { - // Note: The allocation of an Object Id value and installation in - // the Active Object Map caused by implicit activation may actually - // be deferred until an attempt is made to externalize the - // reference. The real requirement here is that a reference is - // produced that will behave appropriately (that is, yield a - // consistent Object Id value when asked politely). - CORBA::Short priority = - this->poa_->server_priority (); - - PortableServer::ObjectId_var system_id = - this->servant_to_system_id_i (servant, - priority - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - PortableServer::ObjectId user_id; - - // This operation requires the RETAIN, therefore don't worry about - // the NON_RETAIN case. - if (this->active_object_map_-> - find_user_id_using_system_id (system_id.in (), - user_id) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - CORBA::Object::_nil ()); - } - - // Remember params for potentially invoking <key_to_object> later. - this->poa_->key_to_object_params_.set ( - system_id, - servant->_interface_repository_id (), - servant, - 1, - priority, - true); - - // Ask the ORT to create the object. - // @@NOTE:There is a possible deadlock lurking here. We held the - // lock, and we are possibly trying to make a call into the - // application code. Think what would happen if the app calls us - // back. We need to get to this at some point. - return this->poa_->invoke_key_to_object_helper_i ( - servant->_interface_repository_id (), - user_id - ACE_ENV_ARG_PARAMETER); - } - - PortableServer::ObjectId * - ServantRetentionStrategyRetain::activate_object ( - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)) - { - if (!this->poa_->has_system_id ()) - { - ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), - 0); - } - - bool may_activate = - this->poa_->is_servant_activation_allowed (servant, wait_occurred_restart_call); - - if (!may_activate) - { - if (wait_occurred_restart_call) - { - return 0; - } - else - { - ACE_THROW_RETURN (PortableServer::POA::ServantAlreadyActive (), - 0); - } - } - - // Otherwise, the activate_object operation generates an Object Id - // and enters the Object Id and the specified servant in the Active - // Object Map. The Object Id is returned. - PortableServer::ObjectId_var user_id; - if (this->active_object_map_-> - bind_using_system_id_returning_user_id (servant, - priority, - user_id.out ()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - } - - // - // Everything is finally ok - // - - // Inform the custom servant dispatching (CSD) strategy that the - // sevant is activated. - this->poa_->servant_activated_hook (servant, - user_id.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - // The implementation of activate_object will invoke _add_ref at - // least once on the Servant argument before returning. When the POA - // no longer needs the Servant, it will invoke _remove_ref on it the - // same number of times. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return user_id._retn (); - } - -#if !defined (CORBA_E_MICRO) - void - ServantRetentionStrategyRetain::activate_object_with_id ( - const PortableServer::ObjectId &id, - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)) - { - // If the POA has the SYSTEM_ID policy and it detects that the - // Object Id value was not generated by the system or for this POA, - // the activate_object_with_id operation may raise the BAD_PARAM - // system exception. An ORB is not required to detect all such - // invalid Object Id values, but a portable application must not - // invoke activate_object_with_id on a POA that has the SYSTEM_ID - // policy with an Object Id value that was not previously generated - // by the system for that POA, or, if the POA also has the - // PERSISTENT policy, for a previous instantiation of the same POA. - if (this->poa_->has_system_id () && - !this->poa_->is_poa_generated_id (id)) - { - ACE_THROW (CORBA::BAD_PARAM ()); - } - - // If the CORBA object denoted by the Object Id value is already - // active in this POA (there is a servant bound to it in the Active - // Object Map), the ObjectAlreadyActive exception is raised. - int priorities_match = 1; - int result = - this->is_user_id_in_map (id, - priority, - priorities_match, - wait_occurred_restart_call); - - // @johnny the implementation is not complete, this does the spec also say - // If the POA has the UNIQUE_ID policy and the servant is already - // in the Active Object Map, the ServantAlreadyActive exception is raised. - if (result) - { - ACE_THROW (PortableServer::POA::ObjectAlreadyActive ()); - } - else if (wait_occurred_restart_call) - { - // We ended up waiting on a condition variable, the POA state - // may have changed while we are waiting. Therefore, we need to - // restart this call. - return; - } - - // If the activate_object_with_id_and_priority operation is invoked - // with a different priority to an earlier invocation of one of the - // create reference with priority operations, for the same object, - // then the ORB shall raise a BAD_INV_ORDER system exception (with a - // Standard Minor Exception Code of 1). If the priority value is the - // same then the ORB shall return SUCCESS. - if (!priorities_match) - { - ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 1, - CORBA::COMPLETED_NO)); - } - - bool may_activate = - this->poa_->is_servant_activation_allowed (servant, wait_occurred_restart_call); - - if (!may_activate) - { - if (wait_occurred_restart_call) - { - return; - } - else - { - ACE_THROW (PortableServer::POA::ServantAlreadyActive ()); - } - } - - // Otherwise, the activate_object_with_id operation enters an - // association between the specified Object Id and the specified - // servant in the Active Object Map. - if (this->active_object_map_->bind_using_user_id (servant, - id, - priority) != 0) - { - ACE_THROW (CORBA::OBJ_ADAPTER ()); - } - - // - // Everything is finally ok - // - - // Inform the custom servant dispatching (CSD) strategy that the - // sevant is activated. - this->poa_->servant_activated_hook (servant, - id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // ATTENTION: Trick locking here, see class header for details - Non_Servant_Upcall non_servant_upcall (*this->poa_); - ACE_UNUSED_ARG (non_servant_upcall); - - // The implementation of activate_object_with_id will invoke - // _add_ref at least once on the Servant argument before - // returning. When the POA no longer needs the Servant, it will - // invoke _remove_ref on it the same number of times. - servant->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - } -#endif - - CORBA::Object_ptr - ServantRetentionStrategyRetain::create_reference ( - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)) - { - // This operation creates an object reference that encapsulates a - // POA-generated Object Id value and the specified interface - // repository id. This operation does not cause an activation to - // take place. The resulting reference may be passed to clients, so - // that subsequent requests on those references will cause the - // appropriate servant manager to be invoked, if one is - // available. The generated Object Id value may be obtained by - // invoking POA::reference_to_id with the created reference. - - PortableServer::ObjectId_var system_id; - PortableServer::ObjectId user_id; - - if (this->active_object_map_-> - bind_using_system_id_returning_system_id (0, - priority, - system_id.out ()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - CORBA::Object::_nil ()); - } - - // Find user id from system id. - if (this->active_object_map_-> - find_user_id_using_system_id (system_id.in (), - user_id) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - CORBA::Object::_nil ()); - } - - // Remember params for potentially invoking <key_to_object> later. - this->poa_->key_to_object_params_.set (system_id, - intf, - 0, - 1, - priority, - true); - - return this->poa_->invoke_key_to_object_helper_i (intf, - user_id - ACE_ENV_ARG_PARAMETER); - - } - - CORBA::Object_ptr - ServantRetentionStrategyRetain::create_reference_with_id ( - const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - // This operation creates an object reference that encapsulates the - // specified Object Id and interface repository Id values. This - // operation does not cause an activation to take place. The - // resulting reference may be passed to clients, so that subsequent - // requests on those references will cause the object to be - // activated if necessary, or the default servant used, depending on - // the applicable policies. - - PortableServer::Servant servant = 0; - PortableServer::ObjectId_var system_id; - - // @@ We need something that can find the system id using - // appropriate strategy, at the same time, return the servant if - // one is available. Before we have that function, - // <create_reference_with_id_i> basically generates broken - // collocated object when DIRECT collocation strategy is used. - - if (this->active_object_map_-> - find_system_id_using_user_id (oid, - priority, - system_id.out ()) != 0) - { - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - CORBA::Object::_nil ()); - } - - // Remember params for potentially invoking <key_to_object> later. - this->poa_->key_to_object_params_.set (system_id, - intf, - servant, - 1, - priority, - true); - - return this->poa_->invoke_key_to_object_helper_i (intf, - oid - ACE_ENV_ARG_PARAMETER); - } - - int - ServantRetentionStrategyRetain::rebind_using_user_id_and_system_id ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall) - { - TAO_Active_Object_Map_Entry *entry = 0; - int result = this->active_object_map_-> - rebind_using_user_id_and_system_id (servant, - user_id, - system_id, - entry); - servant_upcall.active_object_map_entry(entry); - - return result; - } - - CORBA::Boolean - ServantRetentionStrategyRetain::servant_has_remaining_activations ( - PortableServer::Servant servant) - { - return this->active_object_map_->remaining_activations (servant); - } - - - ::PortableServer::ServantRetentionPolicyValue - ServantRetentionStrategyRetain::type() const - { - return ::PortableServer::RETAIN; - } - - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h deleted file mode 100644 index a82ba0aa20a..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ /dev/null @@ -1,196 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyRetain.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H -#define TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/ServantRetentionStrategyNonRetain.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Root_POA; - -namespace TAO -{ - namespace Portable_Server - { - class ServantRetentionStrategyRetain - : public ServantRetentionStrategyNonRetain - { - public: - ServantRetentionStrategyRetain (void); - - CORBA::ULong waiting_servant_deactivation (void) const; - - virtual void strategy_init (TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - virtual int is_servant_in_map (PortableServer::Servant servant, - int &wait_occurred_restart_call); - - virtual - PortableServer::ObjectId * - activate_object (PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::WrongPolicy)); - -#if !defined (CORBA_E_MICRO) - virtual - void - activate_object_with_id (const PortableServer::ObjectId &id, - PortableServer::Servant servant, - CORBA::Short priority, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantAlreadyActive, - PortableServer::POA::ObjectAlreadyActive, - PortableServer::POA::WrongPolicy)); -#endif - - void deactivate_object (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL); - - virtual PortableServer::ObjectId * system_id_to_object_id ( - const PortableServer::ObjectId &system_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongAdapter, - PortableServer::POA::WrongPolicy)); - - virtual - PortableServer::Servant - user_id_to_servant (const PortableServer::ObjectId &id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ObjectNotActive, - PortableServer::POA::WrongPolicy)); - - 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)); - - virtual - TAO_SERVANT_LOCATION - servant_present (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant - ACE_ENV_ARG_DECL); - - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall, - TAO::Portable_Server::POA_Current_Impl &poa_current_impl - ACE_ENV_ARG_DECL); - - virtual int find_servant_priority ( - const PortableServer::ObjectId &system_id, - CORBA::Short &priority - ACE_ENV_ARG_DECL); - - virtual void deactivate_all_objects (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual - CORBA::Object_ptr - servant_to_reference (PortableServer::Servant servant - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual - CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::WrongPolicy)); - - virtual - CORBA::Object_ptr create_reference_with_id ( - const PortableServer::ObjectId &oid, - const char *intf, - CORBA::Short priority - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual ::PortableServer::ServantRetentionPolicyValue type() const; - - protected: - int - is_user_id_in_map (const PortableServer::ObjectId &id, - CORBA::Short priority, - int &priorities_match, - int &wait_occurred_restart_call); - - void - deactivate_map_entry (TAO_Active_Object_Map_Entry *active_object_map_entry - ACE_ENV_ARG_DECL); - - PortableServer::ObjectId *servant_to_system_id_i ( - PortableServer::Servant p_servant, - CORBA::Short &priority - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableServer::POA::ServantNotActive, - PortableServer::POA::WrongPolicy)); - - virtual - int rebind_using_user_id_and_system_id ( - PortableServer::Servant servant, - const PortableServer::ObjectId &user_id, - const PortableServer::ObjectId &system_id, - TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual - CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); - - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id); - - private: - TAO_Active_Object_Map *active_object_map_; - CORBA::ULong waiting_servant_deactivation_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_SERVANT_RETENTION_STRATEGY_RETAIN_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp deleted file mode 100644 index f801a3b5e25..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/PortableServer/ServantRetentionStrategyRetain.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ServantRetentionStrategyRetainFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ServantRetentionStrategy* - ServantRetentionStrategyRetainFactoryImpl::create ( - ::PortableServer::ServantRetentionPolicyValue value) - { - ServantRetentionStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::RETAIN : - { - ACE_NEW_RETURN (strategy, ServantRetentionStrategyRetain, 0); - break; - } - case ::PortableServer::NON_RETAIN : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ServantRetentionStrategyRetainFactoryImpl::destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - ServantRetentionStrategyRetainFactoryImpl, - ACE_TEXT ("ServantRetentionStrategyRetainFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ServantRetentionStrategyRetainFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ServantRetentionStrategyRetainFactoryImpl, - TAO::Portable_Server::ServantRetentionStrategyRetainFactoryImpl) diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h deleted file mode 100644 index 1dbddfbb378..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyRetainFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H -#define TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ServantRetentionStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ServantRetentionStrategyRetainFactoryImpl - : public ServantRetentionStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ServantRetentionStrategy* create ( - ::PortableServer::ServantRetentionPolicyValue value); - - virtual void destroy ( - ServantRetentionStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyRetainFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyRetainFactoryImpl) - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp deleted file mode 100644 index 0d66b79c7e5..00000000000 --- a/TAO/tao/PortableServer/Servant_Base.cpp +++ /dev/null @@ -1,361 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Servant_Base.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/Operation_Table.h" -#include "tao/PortableServer/POA_Current_Impl.h" - -#include "tao/Timeprobe.h" -#include "tao/ORB_Core.h" -#include "tao/TSS_Resources.h" -#include "tao/Stub.h" -#include "tao/Environment.h" -#include "tao/TAO_Server_Request.h" -#include "tao/IFR_Client_Adapter.h" - -#include "ace/Dynamic_Service.h" -#include "ace/OS_NS_string.h" - -//@@ TAO_SERVANT_BASE_INCLUDE_ADD_HOOK - -ACE_RCSID (PortableServer, - Servant_Base, - "$Id$") - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Servant_Base.i" -#endif /* ! __ACE_INLINE__ */ - -#if defined (ACE_ENABLE_TIMEPROBES) - -static const char *TAO_Servant_Base_Timeprobe_Description[] = -{ - "Servant_Base::_find - start", - "Servant_Base::_find - end" -}; - -enum - { - TAO_SERVANT_BASE_FIND_START = 700, - TAO_SERVANT_BASE_FIND_END - }; - -// Setup Timeprobes -ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Servant_Base_Timeprobe_Description, - TAO_SERVANT_BASE_FIND_START); - -#endif /* ACE_ENABLE_TIMEPROBES */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_ServantBase::TAO_ServantBase (void) - : TAO_Abstract_ServantBase () - , ref_count_ (1) - , optable_ (0) -{ -} - -TAO_ServantBase::TAO_ServantBase (const TAO_ServantBase &rhs) - : TAO_Abstract_ServantBase () - , ref_count_ (1) - , optable_ (rhs.optable_) -{ -} - -TAO_ServantBase & -TAO_ServantBase::operator= (const TAO_ServantBase &rhs) -{ - this->optable_ = rhs.optable_; - return *this; -} - -TAO_ServantBase::~TAO_ServantBase (void) -{ -} - -PortableServer::POA_ptr -TAO_ServantBase::_default_POA (ACE_ENV_SINGLE_ARG_DECL) -{ - CORBA::Object_var object = - TAO_ORB_Core_instance ()->root_poa (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableServer::POA::_nil ()); - - return PortableServer::POA::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); -} - -CORBA::Boolean -TAO_ServantBase::_is_a (const char *logical_type_id - ACE_ENV_ARG_DECL_NOT_USED) -{ - static char const id[] = "IDL:omg.org/CORBA/Object:1.0"; - return ACE_OS::strcmp (logical_type_id, id) == 0; -} - -CORBA::Boolean -TAO_ServantBase::_non_existent (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return false; -} - -CORBA::InterfaceDef_ptr -TAO_ServantBase::_get_interface (ACE_ENV_SINGLE_ARG_DECL) -{ - TAO_IFR_Client_Adapter *adapter = - ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance ( - TAO_ORB_Core::ifr_client_adapter_name () - ); - - if (adapter == 0) - { - ACE_THROW_RETURN (CORBA::INTF_REPOS (), - 0); - } - - // This doesn't take multiple ORBs into account, but it's being - // used only to resolve the IFR, so we should be ok. - return adapter->get_interface (TAO_ORB_Core_instance ()->orb (), - this->_interface_repository_id () - ACE_ENV_ARG_PARAMETER); -} - -CORBA::Object_ptr -TAO_ServantBase::_get_component (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return CORBA::Object::_nil (); -} - -char * -TAO_ServantBase::_repository_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return CORBA::string_dup (this->_interface_repository_id ()); -} - -int -TAO_ServantBase::_find (const char *opname, - TAO_Skeleton& skelfunc, - const size_t length) -{ - ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START); - return this->optable_->find (opname, skelfunc, length); -} - -int -TAO_ServantBase::_find (const char *opname, - TAO_Collocated_Skeleton& skelfunc, - TAO::Collocation_Strategy st, - const size_t length) -{ - ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_BASE_FIND_START); - return this->optable_->find (opname, skelfunc, st, length); -} - -TAO_Stub * -TAO_ServantBase::_create_stub (ACE_ENV_SINGLE_ARG_DECL) -{ - TAO_Stub *stub = 0; - - TAO::Portable_Server::POA_Current_Impl *poa_current_impl = - static_cast<TAO::Portable_Server::POA_Current_Impl *> - (TAO_TSS_Resources::instance ()->poa_current_impl_); - - CORBA::ORB_ptr servant_orb = 0; - - if (poa_current_impl != 0 - && this == poa_current_impl->servant ()) - { - servant_orb = poa_current_impl->orb_core ().orb () ; - - stub = - poa_current_impl->poa ()->key_to_stub ( - poa_current_impl->object_key (), - this->_interface_repository_id (), - poa_current_impl->priority () - ACE_ENV_ARG_PARAMETER - ); - ACE_CHECK_RETURN (0); - } - else - { - PortableServer::POA_var poa = - this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Object_var object = - poa->servant_to_reference (this ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // Get the stub object - stub = object->_stubobj (); - - // Increment the reference count since <object> will zap its - // stub object on deletion. - stub->_incr_refcnt (); - - servant_orb = stub->orb_core ()->orb (); - } - - stub->servant_orb (servant_orb); - return stub; -} - -void TAO_ServantBase::synchronous_upcall_dispatch (TAO_ServerRequest & req, - void * servant_upcall, - void * derived_this - ACE_ENV_ARG_DECL) -{ - TAO_Skeleton skel; - char const * const opname = req.operation (); - - // It seems that I might have missed s/g here. What if - // it is a one way that is SYNC_WITH_SERVER. - // Add the following line to handle this reply send as well. - - // Handle the one ways that are SYNC_WITH_SERVER and not collocated - if (req.sync_with_server () && !req.collocated ()) - { - req.send_no_exception_reply (); - } - - // Fetch the skeleton for this operation - if (this->_find (opname, - skel, - static_cast <unsigned int> (req.operation_length())) == -1) - { - ACE_THROW (CORBA::BAD_OPERATION ()); - } - - CORBA::Boolean const send_reply = - !req.sync_with_server () - && req.response_expected () - && !req.deferred_reply (); - - ACE_TRY - { - // Invoke the skeleton, it will demarshal the arguments, invoke - // the right operation on the skeleton class, and marshal any - // results. De/marshaling will only occur in the uncollocated - // case. - skel (req, - servant_upcall, - derived_this - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - /* - * Dispatch resolution specialization add hook. - * Over-ridden with code to handle optimized dispatch. - */ - //@@ TAO_DISPATCH_RESOLUTION_OPT_ADD_HOOK - - // It is our job to send the already marshaled reply, but only - // send if it is expected and it has not already been sent - - // We send the reply only if it is NOT a SYNC_WITH_SERVER, a - // response is expected and if the reply is not deferred. - if (send_reply) - { - req.tao_send_reply (); - } - } - ACE_CATCHANY - { - // If an exception was raised we should marshal it and send - // the appropriate reply to the client - if (send_reply) - { - if (req.collocated ()) - { - // Report the exception to the collocated client. - ACE_RE_THROW; - } - else - req.tao_send_reply_exception (ACE_ANY_EXCEPTION); - } - } - ACE_ENDTRY; - ACE_CHECK; - - return; -} - -void TAO_ServantBase::asynchronous_upcall_dispatch (TAO_ServerRequest & req, - void * servant_upcall, - void * derived_this - ACE_ENV_ARG_DECL) -{ - TAO_Skeleton skel; - const char *opname = req.operation (); - - // It seems that I might have missed s/g here. What if - // it is a one way that is SYNC_WITH_SERVER. - // Add the following line to handle this reply send as well. - - // Handle the one ways that are SYNC_WITH_SERVER - if (req.sync_with_server ()) - { - req.send_no_exception_reply (); - } - - // Fetch the skeleton for this operation - if (this->_find (opname, - skel, - static_cast <unsigned int> (req.operation_length())) == -1) - { - ACE_THROW (CORBA::BAD_OPERATION ()); - } - - ACE_TRY - { - // Invoke the skeleton, it will demarshal the arguments, invoke - // the right operation on the skeleton class, and marshal any - // results. De/marshaling will only occur in the uncollocated - // case. - skel (req, - servant_upcall, - derived_this - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // It is our job to send the already marshaled reply, but only - // send if it is expected and it has not already been sent - - // Return immediately. Do not send a reply; this is an - // asynchronous upcall. (unless, of course there is a system - // exception. - - } - ACE_CATCHANY - { - // If an exception was raised we should marshal it and send - // the appropriate reply to the client - req.tao_send_reply_exception (ACE_ANY_EXCEPTION); - } - ACE_ENDTRY; - ACE_CHECK; - - return; -} - -void -TAO_ServantBase::_add_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - ++this->ref_count_; -} - -void -TAO_ServantBase::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - long const new_count = --this->ref_count_; - - if (new_count == 0) - delete this; -} - -CORBA::ULong -TAO_ServantBase::_refcount_value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const -{ - return static_cast<CORBA::ULong> (this->ref_count_.value ()); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Servant_Base.h b/TAO/tao/PortableServer/Servant_Base.h deleted file mode 100644 index 63757c06ecf..00000000000 --- a/TAO/tao/PortableServer/Servant_Base.h +++ /dev/null @@ -1,197 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Base.h - * - * $Id$ - * - * @author Irfan Pyarali <irfan@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_SERVANT_BASE_H -#define TAO_SERVANT_BASE_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/PS_ForwardC.h" -#include "tao/PortableServer/Servant_var.h" -#include "tao/Abstract_Servant_Base.h" -#include "ace/Atomic_Op.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_Operation_Table; - -/** - * @class TAO_ServantBase - * - * @brief Base class for skeletons and servants. - * - * The POA spec requires that all servants inherit from this class' - * base class. - * - * An instance of a servant class derived from - * ServantBase initially has a reference count of - * one. Invoking _add_ref on the servant instance increases its - * reference count by one. Invoking _remove_ref on the servant - * instance decreases its reference count by one; if the - * resulting reference count equals zero, _remove_ref invokes - * delete on its this pointer in order to destroy the - * servant. For ORBs that operate in multi-threaded - * environments, the implementations of _add_ref and _remove_ref - * that the ServantBase class provides shall be - * thread-safe. - * - * Like ServantBase supports copy - * construction and the default assignment operation. Copy - * construction always sets the reference count of the new - * servant instance to one. The default assignment - * implementation merely returns *this and does not affect the - * reference count. - * - */ -class TAO_PortableServer_Export TAO_ServantBase - : public virtual TAO_Abstract_ServantBase -{ -public: - - /// Destructor. - virtual ~TAO_ServantBase (void); - - /// Returns the default POA for this servant. - virtual PortableServer::POA_ptr _default_POA ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - /// Local implementation of the CORBA::Object::_is_a method. - virtual CORBA::Boolean _is_a (const char *logical_type_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - /// Default _non_existent: always returns false. - virtual CORBA::Boolean _non_existent ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - /// Query the Interface Repository for the interface definition. - virtual CORBA::InterfaceDef_ptr _get_interface ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - /// Default _get_component: always returns CORBA::Object::_nil(). - virtual CORBA::Object_ptr _get_component ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - /// Get the repository id. - virtual char * _repository_id ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ); - - /// This is an auxiliary method for _this() and _narrow(). - virtual TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL); - - /** - * Dispatches a request to the object: find the operation, cast the - * type to the most derived type, demarshall all the parameters from - * the request and finally invokes the operation, storing the - * results and out parameters (if any) or the exceptions thrown into - * @a request. - */ - virtual void _dispatch (TAO_ServerRequest &request, - void *servant_upcall - ACE_ENV_ARG_DECL) = 0; - - /// Please see documentation in tao/Abstract_Servant_Base.h for - /// details. - virtual int _find (const char *opname, - TAO_Skeleton &skelfunc, - const size_t length = 0); - - virtual int _find (const char *opname, - TAO_Collocated_Skeleton &skelfunc, - TAO::Collocation_Strategy st, - const size_t length = 0); - - /// Get this interface's repository id (TAO specific). - virtual const char *_interface_repository_id (void) const = 0; - - //@{ - /** - * @name Reference Counting Operations - */ - /// Increase reference count by one. - virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL); - - /** - * Decreases reference count by one; if the resulting reference - * count equals zero, _remove_ref invokes delete on its this pointer - * in order to destroy the servant. - */ - virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL); - - /** - * Returns the current reference count value. - */ - virtual CORBA::ULong _refcount_value (ACE_ENV_SINGLE_ARG_DECL) const; - //@} - -protected: - - /// Default constructor, only derived classes can be created. - TAO_ServantBase (void); - - /// Copy constructor, protected so no instances can be created. - TAO_ServantBase (const TAO_ServantBase &); - - /// Assignment operator. - TAO_ServantBase &operator= (const TAO_ServantBase &); - - virtual void synchronous_upcall_dispatch (TAO_ServerRequest & req, - void * servant_upcall, - void * derived_this - ACE_ENV_ARG_DECL); - - virtual void asynchronous_upcall_dispatch (TAO_ServerRequest & req, - void * servant_upcall, - void * derived_this - ACE_ENV_ARG_DECL); - -protected: - /// Reference counter. - ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> ref_count_; - - /// The operation table for this servant. It is initialized by the - /// most derived class. - TAO_Operation_Table * optable_; -}; - -class TAO_PortableServer_Export TAO_Servant_Hash -{ -public: - /// Returns hash value. - u_long operator () (PortableServer::Servant servant) const; -}; - - -namespace PortableServer -{ - typedef Servant_var<TAO_ServantBase> ServantBase_var; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Servant_Base.i" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_SERVANT_BASE_H */ diff --git a/TAO/tao/PortableServer/Servant_Base.i b/TAO/tao/PortableServer/Servant_Base.i deleted file mode 100644 index afa16b3fb71..00000000000 --- a/TAO/tao/PortableServer/Servant_Base.i +++ /dev/null @@ -1,13 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -ACE_INLINE u_long -TAO_Servant_Hash::operator () (PortableServer::Servant servant) const -{ - return static_cast<u_long> (reinterpret_cast<ptrdiff_t> (servant)); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Servant_Dispatcher.cpp b/TAO/tao/PortableServer/Servant_Dispatcher.cpp deleted file mode 100644 index 05f34b15345..00000000000 --- a/TAO/tao/PortableServer/Servant_Dispatcher.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Servant_Dispatcher.h" - -ACE_RCSID(PortableServer, - Servant_Dispatcher, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_Servant_Dispatcher::~TAO_Servant_Dispatcher (void) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Servant_Dispatcher.h b/TAO/tao/PortableServer/Servant_Dispatcher.h deleted file mode 100644 index 10c062e52d1..00000000000 --- a/TAO/tao/PortableServer/Servant_Dispatcher.h +++ /dev/null @@ -1,91 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Dispatcher.h - * - * $Id$ - * - * @author Frank Hunleth <fhunleth@cs.wustl.edu> - */ -//============================================================================= - -#ifndef TAO_SERVANT_DISPATCHER_H -#define TAO_SERVANT_DISPATCHER_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Servant_Upcall.h" -#include "ace/SStringfwd.h" - -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -class ACE_Lock; -ACE_END_VERSIONED_NAMESPACE_DECL - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward references. -class TAO_POA_Manager; -class TAO_POA_Policy_Set; -class TAO_Root_POA; -class TAO_ORB_Core; -class TAO_ServerRequest; - -namespace PortableServer -{ - class POAManager; - typedef POAManager *POAManager_ptr; -} - -/** - * @class TAO_Servant_Dispatcher - * - * @brief Interface for POA servant dispatching strategies. - */ -class TAO_PortableServer_Export TAO_Servant_Dispatcher -{ -public: - virtual ~TAO_Servant_Dispatcher (void); - - /// Pre_invoke remote request. - virtual void pre_invoke_remote_request ( - TAO_Root_POA &poa, - CORBA::Short servant_priority, - TAO_ServerRequest &req, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state - ACE_ENV_ARG_DECL - ) = 0; - - /// Pre_invoke collocated request. - virtual void pre_invoke_collocated_request ( - TAO_Root_POA &poa, - CORBA::Short servant_priority, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state - ACE_ENV_ARG_DECL) = 0; - - /// Post_invoke request. - virtual void post_invoke ( - TAO_Root_POA &poa, - TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &pre_invoke_state) = 0; - - /// Factory method for creating new POA's. - virtual TAO_Root_POA *create_Root_POA ( - const ACE_CString &name, - PortableServer::POAManager_ptr poa_manager, - const TAO_POA_Policy_Set &policies, - ACE_Lock &lock, - TAO_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - TAO_Object_Adapter *object_adapter - ACE_ENV_ARG_DECL) = 0; -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_SERVANT_DISPATCHER_H */ diff --git a/TAO/tao/PortableServer/Servant_Location.h b/TAO/tao/PortableServer/Servant_Location.h deleted file mode 100644 index 7ab08442408..00000000000 --- a/TAO/tao/PortableServer/Servant_Location.h +++ /dev/null @@ -1,38 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Location.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_SERVANT_LOCATION_H -#define TAO_SERVANT_LOCATION_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -enum TAO_SERVANT_LOCATION -{ - TAO_SERVANT_FOUND, - TAO_DEFAULT_SERVANT, - TAO_SERVANT_MANAGER, - TAO_SERVANT_NOT_FOUND -}; - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_SERVANT_LOCATION_H */ diff --git a/TAO/tao/PortableServer/Servant_Upcall.cpp b/TAO/tao/PortableServer/Servant_Upcall.cpp deleted file mode 100644 index 9e5ef598e2b..00000000000 --- a/TAO/tao/PortableServer/Servant_Upcall.cpp +++ /dev/null @@ -1,473 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Object_Adapter.h" -#include "tao/PortableServer/Servant_Upcall.h" -#include "tao/PortableServer/Root_POA.h" -#include "tao/PortableServer/Default_Servant_Dispatcher.h" -#include "tao/PortableServer/Collocated_Object_Proxy_Broker.h" -#include "tao/PortableServer/Active_Object_Map_Entry.h" -#include "tao/PortableServer/ForwardRequestC.h" - -// -- TAO Include -- -#include "tao/ORB.h" -#include "tao/ORB_Core.h" -#include "tao/debug.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Servant_Upcall.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/OS_NS_string.h" - -ACE_RCSID (PortableServer, - Servant_Upcall, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - Servant_Upcall::Servant_Upcall (TAO_ORB_Core *oc) - : object_adapter_ (0), - poa_ (0), - servant_ (0), - state_ (INITIAL_STAGE), - system_id_ (TAO_POA_OBJECT_ID_BUF_SIZE, 0, system_id_buf_), - user_id_ (0), - current_context_ (), -#if (TAO_HAS_MINIMUM_POA == 0) - cookie_ (0), - operation_ (0), -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - active_object_map_entry_ (0) - { - TAO_Object_Adapter *object_adapter = - dynamic_cast<TAO_Object_Adapter *>(oc->poa_adapter ()); - this->object_adapter_ = object_adapter; - } - - int - Servant_Upcall::prepare_for_upcall ( - const TAO::ObjectKey &key, - const char *operation, - CORBA::Object_out forward_to - ACE_ENV_ARG_DECL) - { - while (1) - { - int wait_occurred_restart_call = 0; - - int result = - this->prepare_for_upcall_i (key, - operation, - forward_to, - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_Adapter::DS_FAILED); - - if (result == TAO_Adapter::DS_FAILED && - wait_occurred_restart_call) - { - // We ended up waiting on a condition variable. The POA - // state may have changed while we are waiting. Therefore, - // we need to call prepare_for_upcall_i() again. We also - // need to cleanup the state of the upcall object before - // continuing. - this->upcall_cleanup (); - continue; - } - else - { - return result; - } - } - } - - int - Servant_Upcall::prepare_for_upcall_i ( - const TAO::ObjectKey &key, - const char *operation, - CORBA::Object_out forward_to, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL) - { - // Acquire the object adapter lock first. - int result = this->object_adapter_->lock ().acquire (); - if (result == -1) - // Locking error. - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - TAO_Adapter::DS_FAILED); - - // We have acquired the object adapter lock. Record this for later - // use. - this->state_ = OBJECT_ADAPTER_LOCK_ACQUIRED; - - // Check if a non-servant upcall is in progress. If a non-servant - // upcall is in progress, wait for it to complete. Unless of - // course, the thread making the non-servant upcall is this thread. - this->object_adapter_->wait_for_non_servant_upcalls_to_complete ( - ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_Adapter::DS_FAILED); - - // Locate the POA. - this->object_adapter_->locate_poa (key, - this->system_id_, - this->poa_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_Adapter::DS_FAILED); - - // Check the state of the POA. - this->poa_->check_state (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_Adapter::DS_FAILED); - - // Setup current for this request. - this->current_context_.setup (this->poa_, - key); - - // Increase <poa->outstanding_requests_> for the duration of finding - // the POA, finding the servant, and making the upcall. - this->poa_->increment_outstanding_requests (); - - // We have setup the POA Current. Record this for later use. - this->state_ = POA_CURRENT_SETUP; - - ACE_TRY - { - // Lookup the servant. - this->servant_ = - this->poa_->locate_servant_i (operation, - this->system_id_, - *this, - this->current_context_, - wait_occurred_restart_call - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (wait_occurred_restart_call) - return TAO_Adapter::DS_FAILED; - } -#if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - ACE_CATCH (PortableServer::ForwardRequest, forward_request) - { - forward_to = - CORBA::Object::_duplicate (forward_request.forward_reference.in ()); - return TAO_Adapter::DS_FORWARD; - } -#else - ACE_CATCHANY - { - ACE_UNUSED_ARG (forward_to); - ACE_RE_THROW; - } -#endif /* TAO_HAS_MINIMUM_CORBA */ - ACE_ENDTRY; - - // Now that we know the servant. - this->current_context_.servant (this->servant_); - - // For servants from Servant Locators, there is no active object map - // entry. - if (this->active_object_map_entry ()) - this->current_context_.priority (this->active_object_map_entry ()->priority_); - - if (this->state_ != OBJECT_ADAPTER_LOCK_RELEASED) - { - // Release the object adapter lock. - this->object_adapter_->lock ().release (); - - // We have release the object adapter lock. Record this for - // later use. - this->state_ = OBJECT_ADAPTER_LOCK_RELEASED; - } - - // Serialize servants (if appropriate). - this->single_threaded_poa_setup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_Adapter::DS_FAILED); - - // We have acquired the servant lock. Record this for later use. - this->state_ = SERVANT_LOCK_ACQUIRED; - - // After this point, <this->servant_> is ready for dispatching. - return TAO_Adapter::DS_OK; - } - - void - Servant_Upcall::pre_invoke_remote_request ( - TAO_ServerRequest &req - ACE_ENV_ARG_DECL) - { - this->object_adapter_->servant_dispatcher_->pre_invoke_remote_request ( - this->poa (), - this->priority (), - req, - this->pre_invoke_state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Servant_Upcall::pre_invoke_collocated_request ( - ACE_ENV_SINGLE_ARG_DECL) - { - this->object_adapter_->servant_dispatcher_->pre_invoke_collocated_request ( - this->poa (), - this->priority (), - this->pre_invoke_state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - - void - Servant_Upcall::post_invoke (void) - { - this->object_adapter_->servant_dispatcher_->post_invoke ( - this->poa (), - this->pre_invoke_state_); - } - - Servant_Upcall::Pre_Invoke_State::Pre_Invoke_State (void) - : state_ (NO_ACTION_REQUIRED), - original_native_priority_ (0), - original_CORBA_priority_ (0) - { - } - - ::TAO_Root_POA * - Servant_Upcall::lookup_POA (const TAO::ObjectKey &key - ACE_ENV_ARG_DECL) - { - // Acquire the object adapter lock first. - int result = this->object_adapter_->lock ().acquire (); - if (result == -1) - // Locking error. - ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (), - 0); - - // We have acquired the object adapter lock. Record this for later - // use. - this->state_ = OBJECT_ADAPTER_LOCK_ACQUIRED; - - // Check if a non-servant upcall is in progress. If a non-servant - // upcall is in progress, wait for it to complete. Unless of - // course, the thread making the non-servant upcall is this thread. - this->object_adapter_->wait_for_non_servant_upcalls_to_complete ( - ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - // Locate the POA. - this->object_adapter_->locate_poa (key, - this->system_id_, - this->poa_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return this->poa_; - } - - Servant_Upcall::~Servant_Upcall (void) - { - this->upcall_cleanup (); - } - - void - Servant_Upcall::upcall_cleanup (void) - { - this->post_invoke (); - - switch (this->state_) - { - case SERVANT_LOCK_ACQUIRED: - // Unlock servant (if appropriate). - this->single_threaded_poa_cleanup (); - - /* FALLTHRU */ - - case OBJECT_ADAPTER_LOCK_RELEASED: - // Cleanup servant locator related state. Note that because - // this operation does not change any Object Adapter related - // state, it is ok to call it outside the lock. - this->post_invoke_servant_cleanup (); - - // Since the object adapter lock was released, we must acquire - // it. - // - // Note that errors are ignored here since we cannot do much - // with it. - this->object_adapter_->lock ().acquire (); - - // Check if a non-servant upcall is in progress. If a - // non-servant upcall is in progress, wait for it to complete. - // Unless of course, the thread making the non-servant upcall is - // this thread. - this->object_adapter_->wait_for_non_servant_upcalls_to_complete_no_throw (); - - // Cleanup servant related state. - this->servant_cleanup (); - - /* FALLTHRU */ - - case POA_CURRENT_SETUP: - // Cleanup POA related state. - this->poa_cleanup (); - - // Teardown current for this request. - this->current_context_.teardown (); - - /* FALLTHRU */ - - case OBJECT_ADAPTER_LOCK_ACQUIRED: - // Finally, since the object adapter lock was acquired, we must - // release it. - this->object_adapter_->lock ().release (); - - /* FALLTHRU */ - - case INITIAL_STAGE: - default: - // @@ Keep compiler happy, the states above are the only - // possible ones. - break; - } - } - - void - Servant_Upcall::post_invoke_servant_cleanup (void) - { - this->poa_->post_invoke_servant_cleanup (this->current_context_.object_id (), - *this); - } - - void - Servant_Upcall::single_threaded_poa_setup (ACE_ENV_SINGLE_ARG_DECL) - { -#if (TAO_HAS_MINIMUM_POA == 0) - // Serialize servants (if necessary). - // - // Note that this lock must be acquired *after* the object adapter - // lock has been released. This is necessary since we cannot block - // waiting for the servant lock while holding the object adapter - // lock. Otherwise, the thread that wants to release this lock will - // not be able to do so since it can't acquire the object adapterx - // lock. - int result = this->poa_->enter(); - - if (result == -1) - // Locking error. - ACE_THROW (CORBA::OBJ_ADAPTER ()); -#else - ACE_ENV_ARG_NOT_USED; // FUZZ: ignore check_for_ace_check -#endif /* !TAO_HAS_MINIMUM_POA == 0 */ - } - - void - Servant_Upcall::single_threaded_poa_cleanup (void) - { -#if (TAO_HAS_MINIMUM_POA == 0) - int result = 0; - - // Since the servant lock was acquired, we must release it. - result = this->poa_->exit (); - - ACE_UNUSED_ARG (result); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - } - - void - Servant_Upcall::increment_servant_refcount (void) - { - // Cleanup servant related stuff. - if (this->active_object_map_entry_ != 0) - ++this->active_object_map_entry_->reference_count_; - } - - void - Servant_Upcall::servant_cleanup (void) - { - // Cleanup servant related stuff. - if (this->active_object_map_entry_ != 0) - { - // Decrement the reference count. - CORBA::UShort new_count = - --this->active_object_map_entry_->reference_count_; - - if (new_count == 0) - { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - this->poa_->cleanup_servant ( - this->active_object_map_entry_->servant_, - this->active_object_map_entry_->user_id_ - ACE_ENV_ARG_PARAMETER); - - ACE_TRY_CHECK; - } - ACE_CATCHALL - { - // Ignore errors from servant cleanup .... - } - ACE_ENDTRY; - - if (this->poa_->waiting_servant_deactivation() > 0 && - this->object_adapter_->enable_locking_) - { - // Wakeup all waiting threads. - this->poa_->servant_deactivation_condition_.broadcast (); - } - } - } - } - - void - Servant_Upcall::poa_cleanup (void) - { - // Decrease <poa->outstanding_requests_> now that the upcall - // is complete. - // - // Note that the object adapter lock is acquired before - // <POA::outstanding_requests_> is decreased. - CORBA::ULong outstanding_requests = - this->poa_->decrement_outstanding_requests (); - - // Check if all pending requests are over. - if (outstanding_requests == 0) - { - // If locking is enabled and some thread is waiting in POA::destroy. - if (this->object_adapter_->enable_locking_ && - this->poa_->wait_for_completion_pending_) - { - // Wakeup all waiting threads. - this->poa_->outstanding_requests_condition_.broadcast (); - } - - // Note that there is no need to check for - // <non_servant_upcall_in_progress> since it is not possible for - // non-servant upcalls to be in progress at this point. - if (this->poa_->waiting_destruction_) - { - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - this->poa_->complete_destruction_i (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // Ignore exceptions - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "TAO_POA::~complete_destruction_i"); - } - ACE_ENDTRY; - ACE_CHECK; - - this->poa_ = 0; - } - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Servant_Upcall.h b/TAO/tao/PortableServer/Servant_Upcall.h deleted file mode 100644 index 427934e4faa..00000000000 --- a/TAO/tao/PortableServer/Servant_Upcall.h +++ /dev/null @@ -1,251 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_Upcall.h - * - * $Id$ - * - * @author Irfan Pyarali - */ -//============================================================================= - -#ifndef TAO_SERVANT_UPCALL_H -#define TAO_SERVANT_UPCALL_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/POA_Current_Impl.h" - -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Forward declaration -class TAO_Root_POA; -class TAO_ServerRequest; -class TAO_Object_Adapter; -class TAO_RT_Collocation_Resolver; -struct TAO_Active_Object_Map_Entry; - -namespace CORBA -{ - class Object; - typedef Object *Object_ptr; - typedef TAO_Pseudo_Var_T<Object> Object_var; - typedef TAO_Pseudo_Out_T<Object> Object_out; -} - -namespace TAO -{ - namespace Portable_Server - { - /** - * @class Servant_Upcall - * - * @brief This class finds out the POA and the servant to perform an - * upcall. It can only be instantiated without the object - * adapter's lock held. For each upcall a new instance of this - * class is created. - */ - class TAO_PortableServer_Export Servant_Upcall - { - public: - friend class ::TAO_RT_Collocation_Resolver; - - /** - * @class Pre_Invoke_State - * - * @brief This struct keeps track of state related to pre- and - * post-invoke operations. - */ - class Pre_Invoke_State - { - public: - /// Constructor. - Pre_Invoke_State (void); - - enum State - { - NO_ACTION_REQUIRED, - PRIORITY_RESET_REQUIRED - }; - - /// Indicates whether the priority of the thread needs to be - /// reset back to its original value. - State state_; - - /// Original native priority of the thread. - CORBA::Short original_native_priority_; - - /// Original CORBA priority of the thread. - CORBA::Short original_CORBA_priority_; - }; - - /// Constructor. - explicit Servant_Upcall (TAO_ORB_Core *orb_core); - - /// Destructor. - ~Servant_Upcall (void); - - /// Locate POA and servant. - int prepare_for_upcall (const TAO::ObjectKey &key, - const char *operation, - CORBA::Object_out forward_to - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - /// Helper. - int prepare_for_upcall_i (const TAO::ObjectKey &key, - const char *operation, - CORBA::Object_out forward_to, - int &wait_occurred_restart_call - ACE_ENV_ARG_DECL_WITH_DEFAULTS); - - /// Run pre_invoke for a remote request. - void pre_invoke_remote_request (TAO_ServerRequest &req - ACE_ENV_ARG_DECL); - - /// Run pre_invoke for a collocated request. - void pre_invoke_collocated_request (ACE_ENV_SINGLE_ARG_DECL); - - /// Run post_invoke for a request. - void post_invoke (void); - - /// Locate POA. - ::TAO_Root_POA *lookup_POA (const TAO::ObjectKey &key - ACE_ENV_ARG_DECL); - - /// POA accessor. - ::TAO_Root_POA &poa (void) const; - - /// Object Adapter accessor. - TAO_Object_Adapter &object_adapter (void) const; - - /// System ID accessor. - const PortableServer::ObjectId &id (void) const; - - /// User ID accessors. This is the same value returned by - /// PortableServer::Current::get_object_id(). - void user_id (const PortableServer::ObjectId *); - const PortableServer::ObjectId &user_id (void) const; - - /// Servant accessor. - PortableServer::Servant servant (void) const; - - #if (TAO_HAS_MINIMUM_POA == 0) - - /// Get the Servant Locator's cookie - void* locator_cookie (void) const; - - /// Set the Servant Locator's cookie - void locator_cookie (void* cookie); - - /// Get the operation name. - const char *operation (void) const; - - /// Set the operation name. - void operation (const char *); - - #endif /* TAO_HAS_MINIMUM_POA == 0 */ - - /// Set the active_object_map_entry. - void active_object_map_entry (TAO_Active_Object_Map_Entry *entry); - - /// Get the active_object_map_entry. - TAO_Active_Object_Map_Entry *active_object_map_entry (void) const; - - /// Get the priority for the current upcall. - CORBA::Short priority (void) const; - - enum State - { - INITIAL_STAGE, - OBJECT_ADAPTER_LOCK_ACQUIRED, - POA_CURRENT_SETUP, - OBJECT_ADAPTER_LOCK_RELEASED, - SERVANT_LOCK_ACQUIRED - }; - - /// Get the state. - State state (void) const; - - /// Set the state. - void state (State); - - /// Increment the refcount - void increment_servant_refcount (void); - - protected: - - void post_invoke_servant_cleanup (void); - void single_threaded_poa_setup (ACE_ENV_SINGLE_ARG_DECL); - void single_threaded_poa_cleanup (void); - void servant_cleanup (void); - void poa_cleanup (void); - - /// Clean-up / reset state of this Servant_Upcall object. - void upcall_cleanup (void); - - protected: - - TAO_Object_Adapter *object_adapter_; - - ::TAO_Root_POA *poa_; - - PortableServer::Servant servant_; - - State state_; - - CORBA::Octet system_id_buf_[TAO_POA_OBJECT_ID_BUF_SIZE]; - PortableServer::ObjectId system_id_; - - const PortableServer::ObjectId *user_id_; - - POA_Current_Impl current_context_; - - #if (TAO_HAS_MINIMUM_POA == 0) - - /// Servant Locator's cookie - void* cookie_; - - /// Operation name for this current. - const char *operation_; - - #endif /* TAO_HAS_MINIMUM_POA == 0 */ - - /// Pointer to the entry in the TAO_Active_Object_Map corresponding - /// to the servant for this request. - TAO_Active_Object_Map_Entry *active_object_map_entry_; - - /// Preinvoke data for the upcall. - Pre_Invoke_State pre_invoke_state_; - - private: - Servant_Upcall (const Servant_Upcall &); - void operator= (const Servant_Upcall &); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Servant_Upcall.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_SERVANT_UPCALL_H */ diff --git a/TAO/tao/PortableServer/Servant_Upcall.inl b/TAO/tao/PortableServer/Servant_Upcall.inl deleted file mode 100644 index 5f016db3fe6..00000000000 --- a/TAO/tao/PortableServer/Servant_Upcall.inl +++ /dev/null @@ -1,108 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ACE_INLINE ::TAO_Root_POA & - Servant_Upcall::poa (void) const - { - return *this->poa_; - } - - ACE_INLINE PortableServer::Servant - Servant_Upcall::servant (void) const - { - return this->servant_; - } - - ACE_INLINE TAO_Object_Adapter & - Servant_Upcall::object_adapter (void) const - { - return *this->object_adapter_; - } - - ACE_INLINE const PortableServer::ObjectId & - Servant_Upcall::id (void) const - { - return this->system_id_; - } - - ACE_INLINE void - Servant_Upcall::user_id ( - const PortableServer::ObjectId *id) - { - this->user_id_ = id; - } - - ACE_INLINE const PortableServer::ObjectId & - Servant_Upcall::user_id (void) const - { - return *(this->user_id_); - } - - #if (TAO_HAS_MINIMUM_POA == 0) - - ACE_INLINE void* - Servant_Upcall::locator_cookie (void) const - { - return this->cookie_; - } - - ACE_INLINE void - Servant_Upcall::locator_cookie (void* cookie) - { - this->cookie_ = cookie; - } - - ACE_INLINE const char * - Servant_Upcall::operation (void) const - { - return this->operation_; - } - - ACE_INLINE void - Servant_Upcall::operation (const char *name) - { - this->operation_ = name; - } - - #endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_INLINE void - Servant_Upcall::active_object_map_entry (TAO_Active_Object_Map_Entry *entry) - { - this->active_object_map_entry_ = entry; - } - - ACE_INLINE TAO_Active_Object_Map_Entry * - Servant_Upcall::active_object_map_entry (void) const - { - return this->active_object_map_entry_; - } - - ACE_INLINE CORBA::Short - Servant_Upcall::priority (void) const - { - return this->current_context_.priority (); - } - - ACE_INLINE Servant_Upcall::State - Servant_Upcall::state (void) const - { - return this->state_; - } - - ACE_INLINE void - Servant_Upcall::state (Servant_Upcall::State state) - { - this->state_ = state; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Servant_var.cpp b/TAO/tao/PortableServer/Servant_var.cpp deleted file mode 100755 index e5fca921aaa..00000000000 --- a/TAO/tao/PortableServer/Servant_var.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// $Id$ - -#ifndef TAO_PORTABLESERVER_SERVANT_VAR_CPP -#define TAO_PORTABLESERVER_SERVANT_VAR_CPP - -#include "tao/PortableServer/Servant_var.h" - -#if !defined (__ACE_INLINE__) -# include "tao/PortableServer/Servant_var.inl" -#endif /* __ACE_INLINE__ */ - -#include "tao/Exception.h" -#include "tao/Environment.h" -#include "ace/CORBA_macros.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template <class T> -T * -PortableServer::Servant_var<T>::_duplicate (T * p) -{ - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - if (p != 0) - { - p->_add_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHALL - { - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (0); - - return p; -} - -template <class T> -PortableServer::Servant_var<T>::~Servant_var (void) /* throw () */ -{ - // Unfortunately, there is no throw spec on _remove_ref, so we - // can't assume that it will not throw. If it does, then we are in - // trouble. In any event, we can't let the exception escape our - // destructor. - ACE_TRY_NEW_ENV - { - if (this->ptr_ != 0) - { - this->ptr_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHALL - { - // Forget the exception.. - } - ACE_ENDTRY; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_PORTABLESERVER_SERVANT_VAR_CPP */ diff --git a/TAO/tao/PortableServer/Servant_var.h b/TAO/tao/PortableServer/Servant_var.h deleted file mode 100755 index 94a7ada7655..00000000000 --- a/TAO/tao/PortableServer/Servant_var.h +++ /dev/null @@ -1,170 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Servant_var.h - * - * $Id$ - * - * @author Jody Hagins <jody@atdesk.com> - * @author Carlos O'Ryan <coryan@atdesk.com> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_SERVANT_VAR_H -#define TAO_PORTABLESERVER_SERVANT_VAR_H -#include /**/ "ace/pre.h" -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/orbconf.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace PortableServer -{ - /** - * @class Servant_var - * - * @brief Provides a type safe counted reference to servants. - * - * @author Jody Hagins - * - * @todo Life would be much easier if _add_ref() and _remove_ref() had - * throw specs of "throw ()", that can be hidden in static - * methods though. - */ - template<class T> - class Servant_var - { - public: - typedef T servant_type; - - /// Constructor. Assumes ownership of @c p. - explicit Servant_var (T * p = 0); - - /// Copy constructor. Adds reference to @c rhs. - Servant_var (Servant_var<T> const & rhs); - - /// Assignment operator. Adds reference to @c rhs. - Servant_var<T> & operator= (Servant_var<T> const & rhs); - - /// Destructor. Removes a reference from the underlying object, - /// possibly destroying it. - /** - * This destructor doesn't throw exceptions. - */ - ~Servant_var (void) /* throw () */; - - /// Assignment operator. Assumes ownership of @c p. - Servant_var<T> & operator= (T * p); - -# if !defined(ACE_LACKS_MEMBER_TEMPLATES) - /// Template member constructor from a pointer that will implicitly - /// cast to type T. Assumes ownership of @c p. - /// This constructor allows constructs such as: - /// Servant_Base<Base> p(new Derived); - template <class Y> - Servant_var (Y * p); - - /// Template member copy constructor from a Servant_var<Y>, where - /// Y can be implicitly cast to type T. - template <class Y> - Servant_var (Servant_var<Y> const & rhs); - - /// Template member assignment operator from a Servant_var<Y>, where - /// Y can be implicitly cast to type T. - template <class Y> - Servant_var<T> & operator= (Servant_var<Y> const & rhs); - - /// Template member assignment operator from a pointer to Y, where Y - /// can be implicitly cast to type T. - template <class Y> - Servant_var<T> & operator= (Y * p); -# endif /* ACE_LACKS_MEMBER_TEMPLATES */ - - /// Smart pointer operator-> provides access to the underlying object. - T const * operator->() const; - - /// Smart pointer operator-> provides access to the underlying object. - T * operator->(); - - /// Dereference the underlying object. - T const & operator*() const; - - /// Dereference the underlying object. - T & operator*(); - - /// Return a void pointer to the underlying object. This allows - /// it to be used in conditional code and tested against 0. - operator void const * () const; - - /// As an IN parameter. - T * in() const; - - /// As an INOUT parameter. - T *& inout(); - - /// As an OUT parameter. - T *& out(); - - /// Return a pointer to the underlying object, and this counted - /// reference will no longer own the object. - T * _retn(); - - /// Increment the reference count and return the servant. - /** - * It is safe to pass in a null pointer, the pointer is simply - * returned in that case. - * - * @todo We might want to add a throw spec and catch all (potential) - * exceptions in _add_ref() - * - * @todo It might be useful to add a _release() method that handles - * any potential exceptions... - */ - static T * _duplicate (T *); - - /// Swap the contents of a Servant_var<T> with another - /// Servant_var<T> - /** - * Non-throwing swap operation. - * Often used to implement strong exception safety. - */ - void swap (Servant_var<T> & rhs) /* throw () */; - - private: - T * ptr_; - }; - - /// Compare two Servant_vars for equivalence. - template <class X, class Y> - bool operator==(Servant_var<X> const & x, - Servant_var<Y> const & y); - - /// Compare two Servant_vars for non-equivalence. - template <class X, class Y> - bool operator!=(Servant_var<X> const & x, - Servant_var<Y> const & y); - -} // namespace PortableServer - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -# include "tao/PortableServer/Servant_var.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Servant_var.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("tao/PortableServer/Servant_var.cpp") -#endif - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANT_VAR_H */ diff --git a/TAO/tao/PortableServer/Servant_var.inl b/TAO/tao/PortableServer/Servant_var.inl deleted file mode 100755 index 01434bf16ba..00000000000 --- a/TAO/tao/PortableServer/Servant_var.inl +++ /dev/null @@ -1,182 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include <algorithm> - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template <class T> -ACE_INLINE void -PortableServer::Servant_var<T>::swap (Servant_var<T> & rhs) /* throw () */ -{ - std::swap (this->ptr_, rhs.ptr_); -} - -template <class T> -ACE_INLINE -PortableServer::Servant_var<T>::Servant_var (T * p) - : ptr_ (p) -{ -} - -// If _add_ref throws, this object will not be completely constructed -// so the destructor will not be called. -template <class T> -ACE_INLINE -PortableServer::Servant_var<T>::Servant_var (Servant_var<T> const & rhs) - : ptr_ (Servant_var<T>::_duplicate(rhs.ptr_)) -{ -} - -template <class T> -ACE_INLINE PortableServer::Servant_var<T> & -PortableServer::Servant_var<T>::operator= (Servant_var<T> const & rhs) -{ - PortableServer::Servant_var<T> tmp (rhs); - this->swap (tmp); - return *this; -} - -template <class T> -ACE_INLINE typename PortableServer::Servant_var<T> & -PortableServer::Servant_var<T>::operator= (T * p) -{ - if (this->ptr_ != p) - { - // This constructor doesn't increase the reference count, nor is - // it a copy constructor, so we must check for self-assignment. - // Otherwise the reference count would be prematurely - // decremented upon exiting this scope. - PortableServer::Servant_var<T> tmp (p); - this->swap (tmp); - } - - return *this; -} - -#if !defined(ACE_LACKS_MEMBER_TEMPLATES) -template <class T> template <class Y> -ACE_INLINE -PortableServer::Servant_var<T>::Servant_var (Y * p) - : ptr_ (p) -{ -} - -template <class T> template <class Y> -ACE_INLINE -PortableServer::Servant_var<T>::Servant_var (Servant_var<Y> const & rhs) - : ptr_ (Servant_var<T>::_duplicate (rhs.in ())) -{ -} - -template <class T> template <class Y> -ACE_INLINE typename PortableServer::Servant_var<T> & -PortableServer::Servant_var<T>::operator=(Servant_var<Y> const & rhs) -{ - PortableServer::Servant_var<T> tmp (rhs); - this->swap (tmp); - return *this; -} - -template <class T> template <class Y> -ACE_INLINE typename PortableServer::Servant_var<T> & -PortableServer::Servant_var<T>::operator= (Y * p) -{ - if (this->ptr_ != p) - { - // This constructor doesn't increase the reference count, nor is - // it a copy constructor, so we must check for self-assignment. - // Otherwise the reference count would be prematurely - // decremented upon exiting this scope. - PortableServer::Servant_var<T> tmp (p); - this->swap (tmp); - } - - return *this; -} -#endif /* ACE_LACKS_MEMBER_TEMPLATES */ - -template <class T> -ACE_INLINE T const * -PortableServer::Servant_var<T>::operator->() const -{ - return this->ptr_; -} - -template <class T> -ACE_INLINE T * -PortableServer::Servant_var<T>::operator->() -{ - return this->ptr_; -} - -template <class T> -ACE_INLINE T const & -PortableServer::Servant_var<T>::operator*() const -{ - return *this->ptr_; -} - -template <class T> -ACE_INLINE T & -PortableServer::Servant_var<T>::operator*() -{ - return *this->ptr_; -} - -template <class T> -ACE_INLINE PortableServer::Servant_var<T>::operator void const * () const -{ - return this->ptr_; -} - -template <class T> -ACE_INLINE T * -PortableServer::Servant_var<T>::in (void) const -{ - return this->ptr_; -} - -template <class T> -ACE_INLINE T *& -PortableServer::Servant_var<T>::inout (void) -{ - return this->ptr_; -} - -template <class T> -ACE_INLINE T *& -PortableServer::Servant_var<T>::out (void) -{ - PortableServer::Servant_var<T> tmp; - this->swap (tmp); - return this->ptr_; -} - -template <class T> -ACE_INLINE T * -PortableServer::Servant_var<T>::_retn (void) -{ - T * const rval = ptr_; - this->ptr_ = 0; - return rval; -} - -template <class X, class Y> -ACE_INLINE bool -operator== (typename PortableServer::Servant_var<X> const & x, - typename PortableServer::Servant_var<Y> const & y) -{ - return x.in () == y.in (); -} - -template <class X, class Y> -ACE_INLINE bool -operator!= (typename PortableServer::Servant_var<X> const & x, - typename PortableServer::Servant_var<Y> const & y) -{ - return x.in () != y.in (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Special_Basic_SArgument_T.cpp b/TAO/tao/PortableServer/Special_Basic_SArgument_T.cpp deleted file mode 100644 index 52e00cb5110..00000000000 --- a/TAO/tao/PortableServer/Special_Basic_SArgument_T.cpp +++ /dev/null @@ -1,145 +0,0 @@ -// $Id$ - -#ifndef TAO_SPECIAL_BASIC_SARGUMENT_T_CPP -#define TAO_SPECIAL_BASIC_SARGUMENT_T_CPP - -#include "tao/PortableServer/Special_Basic_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Special_Basic_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - - -// ============================================================ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -CORBA::Boolean -TAO::In_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::demarshal ( - TAO_InputCDR & cdr - ) -{ - return cdr >> to_S (this->x_); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -void -TAO::In_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, from_S (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - return cdr << from_S (this->x_); -} - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::demarshal ( - TAO_InputCDR & cdr - ) -{ - return cdr >> to_S (this->x_); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -void -TAO::Inout_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, from_S (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - return cdr << from_S (this->x_); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -void -TAO::Out_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, from_S (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - return cdr << from_S (this->x_); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -void -TAO::Ret_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -interceptor_value (CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, from_S (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_SPECIAL_BASIC_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Special_Basic_SArgument_T.h b/TAO/tao/PortableServer/Special_Basic_SArgument_T.h deleted file mode 100644 index 505fcd74c27..00000000000 --- a/TAO/tao/PortableServer/Special_Basic_SArgument_T.h +++ /dev/null @@ -1,177 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Special_Basic_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - - -#ifndef TAO_SPECIAL_BASIC_SARGUMENT_T_H -#define TAO_SPECIAL_BASIC_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_Special_Basic_SArgument_T - * - * @brief Template class for IN skeleton argument of (w)char/boolean/octet. - * - */ - template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> - class In_Special_Basic_SArgument_T : public InArgument - { - public: - In_Special_Basic_SArgument_T (void); - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S const & arg (void) const; - - private: - S x_; - }; - - /** - * @class Inout_Special_Basic_SArgument_T - * - * @brief Template class for INOUT (w)char/boolean/octet skeleton argument. - * - */ - template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> - class Inout_Special_Basic_SArgument_T : public InoutArgument - { - public: - Inout_Special_Basic_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @class Out_Special_Basic_SArgument_T - * - * @brief Template class for OUT skeleton argument of (w)char/boolean/octet. - * - */ - template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> - class Out_Special_Basic_SArgument_T : public OutArgument - { - public: - Out_Special_Basic_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @class Ret_Basic_SArgument_T - * - * @brief Template class for return skeleton value of (w)char/boolean/octet. - * - */ - template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> - class Ret_Special_Basic_SArgument_T : public RetArgument - { - public: - Ret_Special_Basic_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @struct Special_Basic_SArg_Traits_T - * - * @brief Template class for skeleton argument traits - * of (w)char/boolean/octet. - * - */ - template<typename T, typename to_T, typename from_T, class Insert_Policy> - struct Special_Basic_SArg_Traits_T - { - typedef T ret_type; - typedef T in_type; - typedef T & inout_type; - typedef T & out_type; - - typedef In_Special_Basic_SArgument_T<T,to_T,from_T,Insert_Policy> in_arg_val; - typedef Inout_Special_Basic_SArgument_T<T,to_T,from_T,Insert_Policy> inout_arg_val; - typedef Out_Special_Basic_SArgument_T<T,to_T,from_T,Insert_Policy> out_arg_val; - typedef Ret_Special_Basic_SArgument_T<T,to_T,from_T,Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef T const & in_arg_type; - typedef inout_type inout_arg_type; - typedef out_type out_arg_type; - typedef out_type ret_arg_type; - - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Special_Basic_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Special_Basic_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Special_Basic_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_SPECIAL_BASIC_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Special_Basic_SArgument_T.inl b/TAO/tao/PortableServer/Special_Basic_SArgument_T.inl deleted file mode 100644 index a6f4dd1a499..00000000000 --- a/TAO/tao/PortableServer/Special_Basic_SArgument_T.inl +++ /dev/null @@ -1,96 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -TAO::In_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -In_Special_Basic_SArgument_T (void) -{ -} - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -S const & -TAO::In_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::arg (void) const -{ - return this->x_; -} - -// =========================================================================== - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -Inout_Special_Basic_SArgument_T (void) -{ -} - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Inout_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// =========================================================================== - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -TAO::Out_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -Out_Special_Basic_SArgument_T (void) -{ -} - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -S & -TAO::Out_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// =========================================================================== - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>:: -Ret_Special_Basic_SArgument_T (void) -{ -} - -template<typename S, - typename to_S, - typename from_S, - class Insert_Policy> -ACE_INLINE -S & -TAO::Ret_Special_Basic_SArgument_T<S,to_S,from_S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Special_Basic_SArguments.h b/TAO/tao/PortableServer/Special_Basic_SArguments.h deleted file mode 100644 index f306336fe83..00000000000 --- a/TAO/tao/PortableServer/Special_Basic_SArguments.h +++ /dev/null @@ -1,83 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Special_Basic_SArguments.h - * - * $Id$ - * - * @author Jeff Parsons - * @author Carlos O'Ryan - */ -//============================================================================= - - -#ifndef TAO_SPECIAL_BASIC_SARGUMENTS_H -#define TAO_SPECIAL_BASIC_SARGUMENTS_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Special_Basic_SArgument_T.h" -#include "tao/PortableServer/SArg_Traits_T.h" - -#include "ace/CDR_Stream.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * - * @brief Specializations for (w)char, octet and boolean. - * - */ - - template<> - class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_char> - : public Special_Basic_SArg_Traits_T<CORBA::Char, - ACE_InputCDR::to_char, - ACE_OutputCDR::from_char, - TAO::Any_Insert_Policy_Stream <ACE_OutputCDR::from_char> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_wchar> - : public Special_Basic_SArg_Traits_T<CORBA::WChar, - ACE_InputCDR::to_wchar, - ACE_OutputCDR::from_wchar, - TAO::Any_Insert_Policy_Stream <ACE_OutputCDR::from_wchar> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_octet> - : public Special_Basic_SArg_Traits_T<CORBA::Octet, - ACE_InputCDR::to_octet, - ACE_OutputCDR::from_octet, - TAO::Any_Insert_Policy_Stream <ACE_OutputCDR::from_octet> > - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<ACE_InputCDR::to_boolean> - : public Special_Basic_SArg_Traits_T<CORBA::Boolean, - ACE_InputCDR::to_boolean, - ACE_OutputCDR::from_boolean, - TAO::Any_Insert_Policy_Stream <ACE_OutputCDR::from_boolean> > - - { - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_SPECIAL_BASIC_SARGUMENTS_H */ diff --git a/TAO/tao/PortableServer/StrategyFactory.cpp b/TAO/tao/PortableServer/StrategyFactory.cpp deleted file mode 100644 index 58a4bc04c11..00000000000 --- a/TAO/tao/PortableServer/StrategyFactory.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/StrategyFactory.h" -#include "ace/Dynamic_Service.h" - -ACE_RCSID (PortableServer, - StrategyFactory, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - StrategyFactory::~StrategyFactory (void) - { - } - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/StrategyFactory.h b/TAO/tao/PortableServer/StrategyFactory.h deleted file mode 100644 index b441256d214..00000000000 --- a/TAO/tao/PortableServer/StrategyFactory.h +++ /dev/null @@ -1,45 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file StrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_STRATEGYFACTORY_H -#define TAO_PORTABLESERVER_STRATEGYFACTORY_H - -#include /**/ "ace/pre.h" - -#include "ace/Service_Object.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/orbconf.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class StrategyFactory - : public ACE_Service_Object - { - public: - virtual ~StrategyFactory (void); - }; - } /* namespace Portable_Server */ -} /* namespace TAO */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_STRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/TAO_PortableServer.pc.in b/TAO/tao/PortableServer/TAO_PortableServer.pc.in deleted file mode 100644 index 47b7b8b4e46..00000000000 --- a/TAO/tao/PortableServer/TAO_PortableServer.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: TAO_PortableServer -Description: TAO PortableServer Library -Requires: TAO_AnyTypeCode, TAO -Version: @VERSION@ -Libs: -L${libdir} -lTAO_PortableServer -Cflags: -I${includedir} diff --git a/TAO/tao/PortableServer/TAO_PortableServer.rc b/TAO/tao/PortableServer/TAO_PortableServer.rc deleted file mode 100644 index f16419968f5..00000000000 --- a/TAO/tao/PortableServer/TAO_PortableServer.rc +++ /dev/null @@ -1,30 +0,0 @@ -#include "..\Version.h" - -1 VERSIONINFO - FILEVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0 - PRODUCTVERSION TAO_MAJOR_VERSION,TAO_MINOR_VERSION,TAO_BETA_VERSION,0 - FILEFLAGSMASK 0x3fL - FILEFLAGS 0x0L - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "FileDescription", "PortableServer\0" - VALUE "FileVersion", TAO_VERSION "\0" - VALUE "InternalName", "TAO_PortableServerDLL\0" - VALUE "LegalCopyright", "\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "TAO_PortableServer.DLL\0" - VALUE "ProductName", "TAO\0" - VALUE "ProductVersion", TAO_VERSION "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END diff --git a/TAO/tao/PortableServer/ThreadPolicy.cpp b/TAO/tao/PortableServer/ThreadPolicy.cpp deleted file mode 100644 index 747e4b42ef3..00000000000 --- a/TAO/tao/PortableServer/ThreadPolicy.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "tao/PortableServer/ThreadPolicy.h" -#include "tao/PortableServer/PortableServer.h" - -ACE_RCSID (PortableServer, - ThreadPolicy, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ThreadPolicy::ThreadPolicy (::PortableServer::ThreadPolicyValue value) - : value_ (value) - { - } - - CORBA::Policy_ptr - ThreadPolicy::copy (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - ThreadPolicy *copy = 0; - ACE_NEW_THROW_EX (copy, - ThreadPolicy (this->value_), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (CORBA::Policy::_nil ()); - - return copy; - } - - void - ThreadPolicy::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - } - - ::PortableServer::ThreadPolicyValue - ThreadPolicy::value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return value_; - } - - CORBA::PolicyType - ThreadPolicy::policy_type (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) - { - return ::PortableServer::THREAD_POLICY_ID; - } - - TAO_Cached_Policy_Type - ThreadPolicy::_tao_cached_type (void) const - { - return TAO_CACHED_POLICY_THREAD; - } - - TAO_Policy_Scope - ThreadPolicy::_tao_scope (void) const - { - return TAO_POLICY_POA_SCOPE; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadPolicy.h b/TAO/tao/PortableServer/ThreadPolicy.h deleted file mode 100644 index 5159fc646be..00000000000 --- a/TAO/tao/PortableServer/ThreadPolicy.h +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadPolicy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICY_H -#define TAO_PORTABLESERVER_THREADPOLICY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadPolicyC.h" -#include "tao/LocalObject.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined(_MSC_VER) -#pragma warning(push) -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ThreadPolicy - : public virtual ::PortableServer::ThreadPolicy, - public virtual TAO_Local_RefCounted_Object - { - public: - ThreadPolicy (::PortableServer::ThreadPolicyValue value); - - CORBA::Policy_ptr copy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - ::PortableServer::ThreadPolicyValue value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::PolicyType policy_type (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the cached policy type for this policy. - TAO_Cached_Policy_Type _tao_cached_type (void) const; - - /// Returns the scope at which this policy can be applied. See orbconf.h. - TAO_Policy_Scope _tao_scope (void) const; - - private: - ::PortableServer::ThreadPolicyValue value_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#if defined(_MSC_VER) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICY_H */ diff --git a/TAO/tao/PortableServer/ThreadPolicy.pidl b/TAO/tao/PortableServer/ThreadPolicy.pidl deleted file mode 100644 index 253a7b8dcbb..00000000000 --- a/TAO/tao/PortableServer/ThreadPolicy.pidl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file ThreadPolicy.pidl - * - * $Id$ - * - * @brief Pre-compiled IDL source for the PortableServer module. - * - * tao_idl.exe \ - * -o orig -Gp -Gd -Ge 1 -Sci -GA -I$(TAO_ROOT) - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ - * -Wb,pre_include="ace/pre.h" \ - * -Wb,post_include="ace/post.h" \ - * ThreadPolicy.pidl - */ - -#ifndef _PORTABLESERVER_THREAD_POLICY_IDL_ -#define _PORTABLESERVER_THREAD_POLICY_IDL_ - -#include "tao/Policy.pidl" - -#pragma prefix "omg.org" - -module PortableServer -{ -# pragma version PortableServer 2.3 - - enum ThreadPolicyValue - { - ORB_CTRL_MODEL, - SINGLE_THREAD_MODEL -/* ,MAIN_THREAD_MODEL*/ - }; - -#if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) && !defined (TAO_HAS_MINIMUM_POA) - local interface ThreadPolicy : CORBA::Policy - { - readonly attribute ThreadPolicyValue value; - }; -#endif - -}; - -#endif // _PORTABLESERVER_THREAD_POLICY_IDL_ diff --git a/TAO/tao/PortableServer/ThreadStrategy.cpp b/TAO/tao/PortableServer/ThreadStrategy.cpp deleted file mode 100644 index c3d6a446a4a..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategy.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ThreadStrategy.h" - -ACE_RCSID (PortableServer, - ThreadStrategy, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - ThreadStrategy::strategy_init (TAO_Root_POA * /*poa*/ - ACE_ENV_ARG_DECL_NOT_USED) - { - } - - void - ThreadStrategy::strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategy.h b/TAO/tao/PortableServer/ThreadStrategy.h deleted file mode 100644 index 622ad7d3748..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategy.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategy.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_THREAD_STRATEGY_H -#define TAO_THREAD_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/Policy_Strategy.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadPolicyC.h" -#include "tao/orbconf.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategy - : public Policy_Strategy - { - public: - virtual int enter () = 0; - - virtual int exit () = 0; - - virtual void strategy_init (TAO_Root_POA *poa ACE_ENV_ARG_DECL); - - virtual void strategy_cleanup(ACE_ENV_SINGLE_ARG_DECL); - - virtual ::PortableServer::ThreadPolicyValue type() const = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_THREAD_STRATEGY_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategyFactory.h b/TAO/tao/PortableServer/ThreadStrategyFactory.h deleted file mode 100644 index a22078ed773..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactory.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyFactory.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORY_H -#define TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORY_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/StrategyFactory.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadPolicyC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategy; - - class ThreadStrategyFactory - : public StrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ThreadStrategy *create ( - ::PortableServer::ThreadPolicyValue value) = 0; - - /// Cleanup the given strategy instance - virtual void destroy ( - ThreadStrategy *strategy - ACE_ENV_ARG_DECL) = 0; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORY_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp b/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp deleted file mode 100644 index b21116e42b1..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp +++ /dev/null @@ -1,102 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ThreadStrategyFactoryImpl.h" -#include "tao/PortableServer/ThreadStrategy.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ThreadStrategyFactoryImpl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ThreadStrategy* - ThreadStrategyFactoryImpl::create ( - ::PortableServer::ThreadPolicyValue value) - { - ThreadStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ThreadStrategyFactory *strategy_factory = - ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategySingleFactory"); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("ThreadStrategySingleFactory"))); - - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - strategy = - ACE_Dynamic_Service<ThreadStrategy>::instance ("ThreadStrategyORBControl"); - - if (strategy == 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) %p\n"), - ACE_TEXT ("ERROR, Unable to get ") - ACE_TEXT ("ThreadStrategyORBControl"))); - - break; - } - } - - return strategy; - } - - void - ThreadStrategyFactoryImpl::destroy ( - ThreadStrategy *strategy - ACE_ENV_ARG_DECL) - { - switch (strategy->type ()) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ThreadStrategyFactory *strategy_factory = - ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategySingleFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - // Noop - break; - } - } - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategyFactoryImpl, - ACE_TEXT ("ThreadStrategyFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategyFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategyFactoryImpl, - TAO::Portable_Server::ThreadStrategyFactoryImpl) - diff --git a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h b/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h deleted file mode 100644 index cfe8b44147c..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ThreadStrategyFactory.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ThreadStrategyFactoryImpl - : public ThreadStrategyFactory - { - public: - /// Create a new servant retention strategy - virtual ThreadStrategy* create ( - ::PortableServer::ThreadPolicyValue value); - - virtual void destroy ( - ThreadStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategyFactoryImpl) - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp b/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp deleted file mode 100644 index 44edaa4b6a9..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ThreadStrategyORBControl.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ThreadStrategyORBControl, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - int - ThreadStrategyORBControl::enter () - { - return 0; - } - - int - ThreadStrategyORBControl::exit () - { - return 0; - } - - ::PortableServer::ThreadPolicyValue - ThreadStrategyORBControl::type() const - { - return ::PortableServer::ORB_CTRL_MODEL; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategyORBControl, - TAO::Portable_Server::ThreadStrategyORBControl) - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategyORBControl, - ACE_TEXT ("ThreadStrategyORBControl"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategyORBControl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) diff --git a/TAO/tao/PortableServer/ThreadStrategyORBControl.h b/TAO/tao/PortableServer/ThreadStrategyORBControl.h deleted file mode 100644 index d88997c2214..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyORBControl.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyORBControl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_THREADSTRATEGYORBCONTROL_H -#define TAO_THREADSTRATEGYORBCONTROL_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadStrategy.h" -#include "tao/orbconf.h" -#include "ace/Service_Config.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategyORBControl - : public ThreadStrategy - { - public: - virtual int enter (); - - virtual int exit (); - - virtual ::PortableServer::ThreadPolicyValue type() const; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategyORBControl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategyORBControl) - -#include /**/ "ace/post.h" - -#endif /* TAO_THREADSTRATEGYORBCONTROL_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingle.cpp b/TAO/tao/PortableServer/ThreadStrategySingle.cpp deleted file mode 100644 index 2a903d2876b..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingle.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ThreadStrategySingle.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ThreadStrategySingle, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - int - ThreadStrategySingle::enter () - { - return lock_.acquire(); - } - - int - ThreadStrategySingle::exit () - { - return lock_.release(); - } - - ::PortableServer::ThreadPolicyValue - ThreadStrategySingle::type() const - { - return ::PortableServer::SINGLE_THREAD_MODEL; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategySingle, - TAO::Portable_Server::ThreadStrategySingle) - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategySingle, - ACE_TEXT ("ThreadStrategySingle"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategySingle), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingle.h b/TAO/tao/PortableServer/ThreadStrategySingle.h deleted file mode 100644 index 0836472a09e..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingle.h +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategySingle.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_THREADSTRATEGYSINGLE_H -#define TAO_THREADSTRATEGYSINGLE_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/ThreadStrategy.h" - -#include "tao/orbconf.h" - -#include "ace/Service_Config.h" - -// Locking -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" -#include "ace/Recursive_Thread_Mutex.h" -#include "ace/Null_Mutex.h" - - -#if (TAO_HAS_MINIMUM_POA == 0) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class TAO_PortableServer_Export ThreadStrategySingle : - public ThreadStrategy - { - public: - virtual int enter (); - - virtual int exit (); - - virtual ::PortableServer::ThreadPolicyValue type() const; - private: - TAO_SYNCH_RECURSIVE_MUTEX lock_; - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategySingle) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategySingle) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_THREADSTRATEGYSINGLE_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp b/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp deleted file mode 100644 index b718ea02ef2..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/ThreadStrategySingleFactoryImpl.h" -#include "tao/PortableServer/ThreadStrategy.h" -#include "tao/PortableServer/ThreadStrategySingle.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - ThreadStrategyFactoryImpl, - "$Id$") - -#if (TAO_HAS_MINIMUM_POA == 0) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - ThreadStrategy* - ThreadStrategySingleFactoryImpl::create ( - ::PortableServer::ThreadPolicyValue value) - { - ThreadStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ACE_NEW_RETURN (strategy, ThreadStrategySingle, 0); - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - ACE_ERROR ((LM_ERROR, "Incorrect type in ThreadStrategySingleFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ThreadStrategySingleFactoryImpl::destroy ( - ThreadStrategy *strategy - ACE_ENV_ARG_DECL) - { - strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - delete strategy; - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DEFINE ( - ThreadStrategySingleFactoryImpl, - ACE_TEXT ("ThreadStrategySingleFactory"), - ACE_SVC_OBJ_T, - &ACE_SVC_NAME (ThreadStrategySingleFactoryImpl), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, - 0) - -ACE_FACTORY_NAMESPACE_DEFINE ( - ACE_Local_Service, - ThreadStrategySingleFactoryImpl, - TAO::Portable_Server::ThreadStrategySingleFactoryImpl) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h b/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h deleted file mode 100644 index e04f0995a42..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategySingleFactoryImpl.h - * - * $Id$ - * - * @author Johnny Willemsen <jwillemsen@remedy.nl> - */ -//============================================================================= - -#ifndef TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H -#define TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Config.h" -#include "tao/PortableServer/ThreadStrategyFactory.h" - -#if (TAO_HAS_MINIMUM_POA == 0) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategySingleFactoryImpl - : public ThreadStrategyFactory - { - public: - /// Create a new thread strategy - virtual ThreadStrategy* create ( - ::PortableServer::ThreadPolicyValue value); - - virtual void destroy ( - ThreadStrategy *strategy - ACE_ENV_ARG_DECL); - }; - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategySingleFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategySingleFactoryImpl) - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/TypeCode_SArg_Traits.h b/TAO/tao/PortableServer/TypeCode_SArg_Traits.h deleted file mode 100644 index 5bfc9b5a7dd..00000000000 --- a/TAO/tao/PortableServer/TypeCode_SArg_Traits.h +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file TypeCode_SArg_Traits.h - * - * $Id$ - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef TAO_TYPECODE_SARG_TRAITS_H -#define TAO_TYPECODE_SARG_TRAITS_H - -#include /**/ "ace/pre.h" - -#include "tao/CORBA_methods.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/Object_SArgument_T.h" -#include "tao/Pseudo_VarOut_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace CORBA -{ - class TypeCode; - typedef TypeCode *TypeCode_ptr; - - typedef TAO_Pseudo_Var_T<TypeCode> TypeCode_var; - typedef TAO_Pseudo_Out_T<TypeCode> TypeCode_out; -} - -// -------------------------------------------------------------- - -namespace TAO -{ - template <typename T> class SArg_Traits; - - /// Used in generated code if CORBA::TypeCode is an argument or - /// return type. - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::TypeCode> - : public Object_SArg_Traits_T<CORBA::TypeCode_ptr, - CORBA::TypeCode_var, - CORBA::TypeCode_out, - TAO::Any_Insert_Policy_Stream <CORBA::TypeCode_ptr> - > - { - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_TYPECODE_SARG_TRAITS_H */ diff --git a/TAO/tao/PortableServer/UB_String_SArgument_T.cpp b/TAO/tao/PortableServer/UB_String_SArgument_T.cpp deleted file mode 100644 index 7f8db0408f5..00000000000 --- a/TAO/tao/PortableServer/UB_String_SArgument_T.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// $Id$ - -#ifndef TAO_UB_STRING_SARGUMENT_T_CPP -#define TAO_UB_STRING_SARGUMENT_T_CPP - -#include "tao/PortableServer/UB_String_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/UB_String_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, typename S_var> -CORBA::Boolean -TAO::In_UB_String_SArgument_T<S,S_var>::demarshal (TAO_InputCDR &cdr) -{ - return cdr >> this->x_.out (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_var> -void -TAO::In_UB_String_SArgument_T<S,S_var>::interceptor_value ( - CORBA::Any *any) const -{ - (*any) <<= this->x_.in (); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S, typename S_var> -CORBA::Boolean -TAO::Inout_UB_String_SArgument_T<S,S_var>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -template<typename S, typename S_var> -CORBA::Boolean -TAO::Inout_UB_String_SArgument_T<S,S_var>::demarshal (TAO_InputCDR & cdr) -{ - return cdr >> this->x_.out (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_var> -void -TAO::Inout_UB_String_SArgument_T<S,S_var>::interceptor_value ( - CORBA::Any *any) const -{ - (*any) <<= this->x_.in (); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, typename S_var> -CORBA::Boolean -TAO::Out_UB_String_SArgument_T<S,S_var>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_var> -void -TAO::Out_UB_String_SArgument_T<S,S_var>::interceptor_value ( - CORBA::Any *any) const -{ - (*any) <<= this->x_.in (); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S, typename S_var> -CORBA::Boolean -TAO::Ret_UB_String_SArgument_T<S,S_var>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, typename S_var> -void -TAO::Ret_UB_String_SArgument_T<S,S_var>::interceptor_value ( - CORBA::Any *any) const -{ - (*any) <<= this->x_.in (); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_UB_STRING_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/UB_String_SArgument_T.h b/TAO/tao/PortableServer/UB_String_SArgument_T.h deleted file mode 100644 index ac1202a2d4f..00000000000 --- a/TAO/tao/PortableServer/UB_String_SArgument_T.h +++ /dev/null @@ -1,162 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UB_String_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - -#ifndef TAO_UB_STRING_SARGUMENT_T_H -#define TAO_UB_STRING_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_UB_String_SArgument_T - * - * @brief Template class for IN skeleton UB (w)string argument. - * - */ - template<typename S, typename S_var> - class In_UB_String_SArgument_T : public InArgument - { - public: - In_UB_String_SArgument_T (void); - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S const * arg (void) const; - - private: - S_var x_; - }; - - /** - * @class Inout_UB_String_SArgument_T - * - * @brief Template class for INOUT skeleton UB (w)string argument. - * - */ - template<typename S, typename S_var> - class Inout_UB_String_SArgument_T : public InoutArgument - { - public: - Inout_UB_String_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S *& arg (void); - - private: - S_var x_; - }; - - /** - * @class Out_UB_String_SArgument_T - * - * @brief Template class for INOUT skeleton UB (w)string argument. - * - */ - template<typename S, typename S_var> - class Out_UB_String_SArgument_T : public OutArgument - { - public: - Out_UB_String_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S *& arg (void); - - private: - S_var x_; - }; - - /** - * @class Ret_UB_String_SArgument_T - * - * @brief Template class for return skeleton value of UB (w)string. - * - */ - template<typename S, typename S_var> - class Ret_UB_String_SArgument_T : public RetArgument - { - public: - Ret_UB_String_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S *& arg (void); - - private: - S_var x_; - }; - - /** - * @struct UB_String_SArg_Traits_T - * - * @brief Template class for argument traits of unbounded (w)strings. - * - */ - template<typename T, typename T_var, typename T_out> - struct UB_String_SArg_Traits_T - { - typedef T * ret_type; - typedef const T * in_type; - typedef T *& inout_type; - typedef T_out out_type; - - typedef In_UB_String_SArgument_T<T,T_var> in_arg_val; - typedef Inout_UB_String_SArgument_T<T,T_var> inout_arg_val; - typedef Out_UB_String_SArgument_T<T,T_var> out_arg_val; - typedef Ret_UB_String_SArgument_T<T,T_var> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef in_type in_arg_type; - typedef inout_type inout_arg_type; - typedef inout_type out_arg_type; - typedef inout_type ret_arg_type; - - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/UB_String_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/UB_String_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("UB_String_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_UB_STRING_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/UB_String_SArgument_T.inl b/TAO/tao/PortableServer/UB_String_SArgument_T.inl deleted file mode 100644 index b60809e056d..00000000000 --- a/TAO/tao/PortableServer/UB_String_SArgument_T.inl +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, typename S_var> -ACE_INLINE -TAO::In_UB_String_SArgument_T<S,S_var>::In_UB_String_SArgument_T (void) -{} - -template<typename S, typename S_var> -const S * -TAO::In_UB_String_SArgument_T<S,S_var>::arg (void) const -{ - return this->x_.in (); -} - -// ========================================================================== - -template<typename S, typename S_var> -ACE_INLINE -TAO::Inout_UB_String_SArgument_T<S,S_var>::Inout_UB_String_SArgument_T (void) -{} - -template<typename S, typename S_var> -ACE_INLINE -S *& -TAO::Inout_UB_String_SArgument_T<S,S_var>::arg (void) -{ - return this->x_.inout (); -} - -// ========================================================================== - -template<typename S, typename S_var> -ACE_INLINE -TAO::Out_UB_String_SArgument_T<S,S_var>::Out_UB_String_SArgument_T ( - void - ) -{} - -template<typename S, typename S_var> -ACE_INLINE -S *& -TAO::Out_UB_String_SArgument_T<S,S_var>::arg (void) -{ - return this->x_.out (); -} - -// ========================================================================== - -template<typename S, typename S_var> -ACE_INLINE -TAO::Ret_UB_String_SArgument_T<S,S_var>::Ret_UB_String_SArgument_T (void) -{} - -template<typename S, typename S_var> -S *& -TAO::Ret_UB_String_SArgument_T<S,S_var>::arg (void) -{ - return this->x_.out (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/UB_String_SArguments.h b/TAO/tao/PortableServer/UB_String_SArguments.h deleted file mode 100644 index e86e7c0ae24..00000000000 --- a/TAO/tao/PortableServer/UB_String_SArguments.h +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file UB_String_SArguments.h - * - * $Id$ - * - * @author Jeff Parsons - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef TAO_UB_STRING_SARGUMENTS_H -#define TAO_UB_STRING_SARGUMENTS_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/PortableServer/UB_String_SArgument_T.h" -#include "tao/PortableServer/SArg_Traits_T.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * - * @brief Specializatons for unbounded (w)strings. - * - */ - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::Char *> - : public UB_String_SArg_Traits_T<CORBA::Char, - CORBA::String_var, - CORBA::String_out> - { - }; - - template<> - class TAO_PortableServer_Export SArg_Traits<CORBA::WChar *> - : public UB_String_SArg_Traits_T<CORBA::WChar, - CORBA::WString_var, - CORBA::WString_out> - { - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_UB_STRING_SARGUMENTS_H */ diff --git a/TAO/tao/PortableServer/Upcall_Command.cpp b/TAO/tao/PortableServer/Upcall_Command.cpp deleted file mode 100644 index dd6b7d8e85f..00000000000 --- a/TAO/tao/PortableServer/Upcall_Command.cpp +++ /dev/null @@ -1,17 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Upcall_Command.h" - - -ACE_RCSID (PortableServer, - Upcall_Command, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO::Upcall_Command::~Upcall_Command (void) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Upcall_Command.h b/TAO/tao/PortableServer/Upcall_Command.h deleted file mode 100644 index 40c216457f7..00000000000 --- a/TAO/tao/PortableServer/Upcall_Command.h +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Upcall_Command.h - * - * $Id$ - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef TAO_UPCALL_COMMAND_H -#define TAO_UPCALL_COMMAND_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#ifndef ACE_LACKS_PRAGMA_ONCE -# pragma once -#endif /* !ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Versioned_Namespace.h" -#include "ace/CORBA_macros.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace CORBA -{ - class Environment; -} - -namespace TAO -{ - - /** - * @class Upcall_Command - * - * @brief "ABC" that all operation-specific command objects must - * subclass. - * - * The actual upcall into a servant is executed through a concrete - * @c Upcall_Command object. This is necessary to simplify upcall - * interactions in the presence of interceptors, such as when the - * @c send_exception() interception point must be invoked when the - * servant operation throws an exception. - */ - class TAO_PortableServer_Export Upcall_Command - { - public: - - /// Destructor. - virtual ~Upcall_Command (void); - - /// Execute the upcall. - virtual void execute (ACE_ENV_SINGLE_ARG_DECL) = 0; - - }; - -} // End namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_UPCALL_COMMAND_H */ diff --git a/TAO/tao/PortableServer/Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Upcall_Wrapper.cpp deleted file mode 100644 index 2e9b1f1564d..00000000000 --- a/TAO/tao/PortableServer/Upcall_Wrapper.cpp +++ /dev/null @@ -1,302 +0,0 @@ -// $Id$ - -#include "tao/PortableServer/Upcall_Wrapper.h" -#include "tao/PortableServer/Upcall_Command.h" - -#if TAO_HAS_INTERCEPTORS == 1 -# include "tao/ServerRequestInterceptor_Adapter.h" -# include "tao/PortableInterceptorC.h" -# include "tao/ORB_Core.h" -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - -#include "tao/PortableInterceptor.h" - -#include "tao/TAO_Server_Request.h" -#include "tao/CDR.h" -#include "tao/Argument.h" -#include "tao/operation_details.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (PortableServer, - Upcall_Wrapper, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -void -TAO::Upcall_Wrapper::upcall (TAO_ServerRequest & server_request, - TAO::Argument * const args[], - size_t nargs, - TAO::Upcall_Command & command - -#if TAO_HAS_INTERCEPTORS == 1 - , void * servant_upcall - , CORBA::TypeCode_ptr const * exceptions - , CORBA::ULong nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - ACE_ENV_ARG_DECL - ) -{ - if (server_request.incoming ()) - { - this->pre_upcall (*server_request.incoming (), - args, - nargs - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - -#if TAO_HAS_INTERCEPTORS == 1 - - // Make sure that, for the collocated case, we use the client-side - // arguments. For the non-collocated case, we will use the server-side - // arguments since they got set up in our pre_upcall() method. Note that - // our pre_upcall() method doesn't get invoked in the collocated case, - // and is the reason why we need to provide the client-side args instead - // of the (never set or initialized) server-side args. - // - // Before the following logic was added, the - // $TAO_ROOT/tests/Portable_Interceptors/Collocated/run_test.pl - // showed that the server-side request interceptor was getting bogus - // values when it took a look at the request arguments. Some - // additional testing revealed that this only occurred in the - // collocated request case. - - // By default, we assume that we will use the server-side args. - TAO::Argument * const * the_args = args; - size_t the_nargs = nargs; - - if (server_request.collocated()) - { - // It is a collocated request so we need to use the client-side - // args instead. - the_args = server_request.operation_details()->args(); - the_nargs = server_request.operation_details()->args_num(); - } - - TAO::ServerRequestInterceptor_Adapter *interceptor_adapter = - server_request.orb_core ()->serverrequestinterceptor_adapter (); - - ACE_TRY - { - { - if (interceptor_adapter != 0) - { - // Invoke intermediate server side interception points. - interceptor_adapter->receive_request (server_request, - the_args, - the_nargs, - servant_upcall, - exceptions, - nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - // Don't bother performing the upcall if an interceptor caused a - // location forward. - CORBA::Object_var forward_to = server_request.forward_location (); - if (CORBA::is_nil (forward_to.in ())) - { - if (interceptor_adapter != 0) - { - interceptor_adapter->execute_command (server_request, - command - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - else -#endif /* TAO_HAS_INTERCEPTORS */ - { - // The actual upcall. - command.execute (ACE_ENV_SINGLE_ARG_PARAMETER); - TAO_INTERCEPTOR_CHECK; - } - -#if TAO_HAS_INTERCEPTORS == 1 - } - } - - if (interceptor_adapter == 0) - { - server_request.reply_status (PortableInterceptor::SUCCESSFUL); - } - else - { - // Do not execute the send_reply() interception point if an - // interceptor caused a location forward. The send_other() - // interception point should already have been executed by the - // ServerRequestInterceptor_Adapter object. - // - // It should actually be safe to call this interception point, - // regardless, since the interceptor flow stack should have been - // emptied by the send_other() interception point. Note that - // we'd still need to avoid resetting the reply status to - // SUCCESSFUL, however. - CORBA::Object_var forward_to_after = server_request.forward_location (); - if (CORBA::is_nil (forward_to_after.in ())) - { - // No location forward by interceptors and successful upcall. - server_request.reply_status (PortableInterceptor::SUCCESSFUL); - interceptor_adapter->send_reply (server_request, - the_args, - the_nargs, - servant_upcall, - exceptions, - nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - } - ACE_CATCHANY - { - // Just assume the current exception is a system exception, the - // status can only change when the interceptor changes this - // and this is only done when the sri_adapter is available. If we - // don't have an sri_adapter we just rethrow the exception - PortableInterceptor::ReplyStatus status = - PortableInterceptor::SYSTEM_EXCEPTION; - - server_request.caught_exception (&ACE_ANY_EXCEPTION); - - if (interceptor_adapter != 0) - { - interceptor_adapter->send_exception (server_request, - the_args, - the_nargs, - servant_upcall, - exceptions, - nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - status = - server_request.reply_status (); - } - - if (status == PortableInterceptor::SYSTEM_EXCEPTION - || status == PortableInterceptor::USER_EXCEPTION) - { - ACE_RE_THROW; - } - } -# if defined (ACE_HAS_EXCEPTIONS) \ - && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) - ACE_CATCHALL - { - // Just assume the current exception is a system exception, the - // status can only change when the interceptor changes this - // and this is only done when the sri_adapter is available. If we - // don't have an sri_adapter we just rethrow the exception - PortableInterceptor::ReplyStatus status = - PortableInterceptor::SYSTEM_EXCEPTION; - - CORBA::UNKNOWN ex; - - server_request.caught_exception (&ex); - - if (interceptor_adapter != 0) - { - interceptor_adapter->send_exception (server_request, - the_args, - the_nargs, - servant_upcall, - exceptions, - nexceptions - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - status = - server_request.reply_status (); - } - - if (status == PortableInterceptor::SYSTEM_EXCEPTION) - ACE_TRY_THROW (ex); - } -# endif /* ACE_HAS_EXCEPTIONS && ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS */ - ACE_ENDTRY; - ACE_CHECK; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - if (server_request.response_expected () - && !server_request.sync_with_server ()) - { - server_request.init_reply (); - } - -#if TAO_HAS_INTERCEPTORS == 1 - // Don't bother marshaling inout/out/return values if an interceptor - // caused a location forward. - CORBA::Object_var forward_to_end = server_request.forward_location (); - if (CORBA::is_nil (forward_to_end.in ())) -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - { - if (server_request.outgoing ()) - { - this->post_upcall (*server_request.outgoing (), - args, - nargs - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } -} - -void -TAO::Upcall_Wrapper::pre_upcall (TAO_InputCDR & cdr, - TAO::Argument * const * args, - size_t nargs - ACE_ENV_ARG_DECL) -{ - // Demarshal the operation "in" and "inout" arguments, if any. - - // NOTE: The TAO::Argument corresponding to the return value is - // always the first element in the array, regardless of - // whether or not the return type is void. - - ACE_ASSERT (nargs != 0); - - TAO::Argument * const * const begin = args + 1; // Skip the return value. - TAO::Argument * const * const end = args + nargs; - - for (TAO::Argument * const * i = begin; i != end; ++i) - { - if (!(*i)->demarshal (cdr)) - { - TAO_InputCDR::throw_skel_exception (errno - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } -} - -void -TAO::Upcall_Wrapper::post_upcall (TAO_OutputCDR & cdr, - TAO::Argument * const * args, - size_t nargs - ACE_ENV_ARG_DECL) -{ - // Marshal the operation "inout" and "out" arguments and return - // value, if any. - - TAO::Argument * const * const begin = args; - TAO::Argument * const * const end = args + nargs; - - for (TAO::Argument * const * i = begin; i != end; ++i) - { - if (!(*i)->marshal (cdr)) - { - TAO_OutputCDR::throw_skel_exception (errno - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - } - - // Reply body marshaling completed. No other fragments to send. - cdr.more_fragments (false); -} - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/Upcall_Wrapper.h b/TAO/tao/PortableServer/Upcall_Wrapper.h deleted file mode 100644 index f0ba3f1c7e0..00000000000 --- a/TAO/tao/PortableServer/Upcall_Wrapper.h +++ /dev/null @@ -1,131 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Upcall_Wrapper.h - * - * $Id$ - * - * @author Ossama Othman - * @author Jeff Parsons - * @author Carlos O'Ryan - */ -//============================================================================= - -#ifndef TAO_UPCALL_WRAPPER_H -#define TAO_UPCALL_WRAPPER_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#ifndef ACE_LACKS_PRAGMA_ONCE -# pragma once -#endif /* !ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Basic_Types.h" -#include "tao/orbconf.h" -#include "ace/CORBA_macros.h" - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -class TAO_ServantBase; -class TAO_ServerRequest; -class TAO_InputCDR; -class TAO_OutputCDR; - -namespace PortableServer -{ - typedef ::TAO_ServantBase ServantBase; -} - -namespace CORBA -{ - class Environment; -} - -namespace TAO -{ - class Argument; - class Upcall_Command; - - /** - * @class Upcall_Wrapper - * - * @brief Wraps the activities of the _skel operations. - * - */ - class TAO_PortableServer_Export Upcall_Wrapper - { - public: - - /** - * @note The TAO::Argument corresponding to the return value is - * always the first element in the array, regardless of - * whether or not the return type is void. - */ - - /// Perform the upcall. - /** - * @param server_request Object containing server side messaging - * operations (e.g. CDR reply construction, etc). - * @param args Operation argument list. - * @param nargs Number of arguments in the operation - * argument list. - * @param command @c Command object that performs the - * actual upcall into the servant. - * - * @param servant_upcall Object containing information for POA - * that dispatched the servant. - * @param servant The servant handling the upcall. - * @param exceptions Array of user exceptions the operation - * may raise. - * @param nexceptions The number of exceptions in the operation - * user exception array. - */ - void upcall (TAO_ServerRequest & server_request, - TAO::Argument * const args[], - size_t nargs, - TAO::Upcall_Command & command - -#if TAO_HAS_INTERCEPTORS == 1 - , void * servant_upcall - , CORBA::TypeCode_ptr const * exceptions - , CORBA::ULong nexceptions -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - - ACE_ENV_ARG_DECL); - - private: - - - /// Perform pre-upcall operations. - /** - * Perform pre-upcall operations, including operation @c IN and - * @c INOUT argument demarshaling. - */ - void pre_upcall (TAO_InputCDR & cdr, - TAO::Argument * const * args, - size_t nargs - ACE_ENV_ARG_DECL); - - /// Perform post-upcall operations. - /** - * Perform post-upcall operations, including operation @c INOUT - * and @c OUT argument marshaling. - */ - void post_upcall (TAO_OutputCDR & cdr, - TAO::Argument * const * args, - size_t nargs - ACE_ENV_ARG_DECL); - - }; - -} // End namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_UPCALL_WRAPPER_H */ diff --git a/TAO/tao/PortableServer/Var_Array_SArgument_T.cpp b/TAO/tao/PortableServer/Var_Array_SArgument_T.cpp deleted file mode 100644 index 489af67b782..00000000000 --- a/TAO/tao/PortableServer/Var_Array_SArgument_T.cpp +++ /dev/null @@ -1,142 +0,0 @@ -// $Id$ - -#ifndef TAO_VAR_ARRAY_SARGUMENT_T_CPP -#define TAO_VAR_ARRAY_SARGUMENT_T_CPP - -#include "tao/PortableServer/Var_Array_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Var_Array_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::In_Var_Array_SArgument_T<S_forany, - Insert_Policy>::demarshal (TAO_InputCDR & cdr) -{ - S_forany tmp (this->x_); - return cdr >> tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_forany, - class Insert_Policy> -void -TAO::In_Var_Array_SArgument_T<S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_)); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Var_Array_SArgument_T<S_forany, - Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << S_forany (this->x_); -} - -template<typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Var_Array_SArgument_T<S_forany, - Insert_Policy>::demarshal (TAO_InputCDR & cdr) -{ - S_forany tmp (this->x_); - return cdr >> tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_forany, - class Insert_Policy> -void -TAO::Inout_Var_Array_SArgument_T<S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - typedef typename S_forany::_slice_type slice_type; - Insert_Policy::any_insert ( - any, - S_forany (const_cast <slice_type *>(this->x_)) - ); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S_var, - typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - S_forany tmp (this->x_.ptr ()); - return cdr << tmp; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - typename S_forany, - class Insert_Policy> -void -TAO::Out_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_.ptr ())); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S_var, - typename S_forany, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::marshal ( - TAO_OutputCDR & cdr - ) -{ - return cdr << S_forany (this->x_.ptr ()); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S_var, - typename S_forany, - class Insert_Policy> -void -TAO::Ret_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, S_forany (this->x_.ptr ())); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_VAR_ARRAY_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Var_Array_SArgument_T.h b/TAO/tao/PortableServer/Var_Array_SArgument_T.h deleted file mode 100644 index 22a1ee23caa..00000000000 --- a/TAO/tao/PortableServer/Var_Array_SArgument_T.h +++ /dev/null @@ -1,176 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Var_Array_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - -#ifndef TAO_VAR_ARRAY_SARGUMENT_T_H -#define TAO_VAR_ARRAY_SARGUMENT_T_H - -#include /**/ "ace/pre.h" - -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_Var_Array_SArgument_T - * - * @brief IN skeleton argument of variable size element array. - * - */ - template<typename S_forany, - class Insert_Policy> - class In_Var_Array_SArgument_T : public InArgument - { - public: - - In_Var_Array_SArgument_T (void); - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type const * arg (void) const; - - private: - mutable typename S_forany::_array_type x_; - }; - - /** - * @class Inout_Var_Array_SArgument_T - * - * @brief INOUT skeleton argument of variable size element array. - * - */ - template<typename S_forany, - class Insert_Policy> - class Inout_Var_Array_SArgument_T : public InoutArgument - { - public: - Inout_Var_Array_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type * arg (void); - - private: - typename S_forany::_array_type x_; - }; - - /** - * @class Out_Var_Array_SArgument_T - * - * @brief OUT skeleton argument of variable size element array. - * - */ - template<typename S_var, - typename S_forany, - class Insert_Policy> - class Out_Var_Array_SArgument_T : public OutArgument - { - public: - Out_Var_Array_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type *& arg (void); - - private: - S_var x_; - }; - - /** - * @class Ret_Var_Array_SArgument_T - * - * @brief Skeleton value of variable size element array. - * - */ - template<typename S_var, - typename S_forany, - class Insert_Policy> - class Ret_Var_Array_SArgument_T : public RetArgument - { - public: - Ret_Var_Array_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - typename S_forany::_slice_type *& arg (void); - - private: - S_var x_; - }; - - /** - * @struct Var_Array_SArg_Traits_T - * - * @brief Argument traits of variable size element array. - * - */ - template<typename T_out, - typename T_forany, - class Insert_Policy> - struct Var_Array_SArg_Traits_T - { - typedef typename T_forany::_slice_type * ret_type; - typedef const typename T_forany::_array_type in_type; - typedef typename T_forany::_array_type inout_type; - typedef T_out out_type; - - typedef In_Var_Array_SArgument_T<T_forany, - Insert_Policy> in_arg_val; - typedef Inout_Var_Array_SArgument_T<T_forany, - Insert_Policy> inout_arg_val; - typedef Out_Var_Array_SArgument_T<typename T_out::_var_type, - T_forany, - Insert_Policy> out_arg_val; - typedef Ret_Var_Array_SArgument_T<typename T_out::_var_type, - T_forany, - Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef typename T_forany::_slice_type const * in_arg_type; - typedef ret_type inout_arg_type; - typedef ret_type & out_arg_type; - typedef ret_type & ret_arg_type; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Var_Array_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Var_Array_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Var_Array_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_VAR_ARRAY_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Var_Array_SArgument_T.inl b/TAO/tao/PortableServer/Var_Array_SArgument_T.inl deleted file mode 100644 index 0d0e74abafd..00000000000 --- a/TAO/tao/PortableServer/Var_Array_SArgument_T.inl +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::In_Var_Array_SArgument_T<S_forany, - Insert_Policy>::In_Var_Array_SArgument_T (void) -{} - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -typename S_forany::_slice_type const * -TAO::In_Var_Array_SArgument_T<S_forany, - Insert_Policy>::arg (void) const -{ - S_forany tmp (this->x_); - return tmp.in (); -} - -// ========================================================================== - -template<typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Var_Array_SArgument_T<S_forany, - Insert_Policy>:: -Inout_Var_Array_SArgument_T (void) -{ -} - -template<typename S_forany, - class Insert_Policy> -typename S_forany::_slice_type * -TAO::Inout_Var_Array_SArgument_T<S_forany, - Insert_Policy>::arg (void) -{ - S_forany tmp (this->x_); - return tmp.inout (); -} - -// ========================================================================== - -template<typename S_var, - typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::Out_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>:: -Out_Var_Array_SArgument_T (void) -{ -} - -template<typename S_var, - typename S_forany, - class Insert_Policy> -typename S_forany::_slice_type *& -TAO::Out_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::arg (void) -{ - return this->x_.out (); -} - -// ========================================================================== - -template<typename S_var, - typename S_forany, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>:: -Ret_Var_Array_SArgument_T (void) -{ -} - -template<typename S_var, - typename S_forany, - class Insert_Policy> -ACE_INLINE -typename S_forany::_slice_type *& -TAO::Ret_Var_Array_SArgument_T<S_var, - S_forany, - Insert_Policy>::arg (void) -{ - return this->x_.out (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Var_Size_SArgument_T.cpp b/TAO/tao/PortableServer/Var_Size_SArgument_T.cpp deleted file mode 100644 index cb8864f7859..00000000000 --- a/TAO/tao/PortableServer/Var_Size_SArgument_T.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// $Id$ - -#ifndef TAO_VAR_SIZE_SARGUMENT_T_CPP -#define TAO_VAR_SIZE_SARGUMENT_T_CPP - -#include "tao/PortableServer/Var_Size_SArgument_T.h" - -#if !defined (__ACE_INLINE__) -#include "tao/PortableServer/Var_Size_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::In_Var_Size_SArgument_T<S,Insert_Policy>::demarshal (TAO_InputCDR &cdr) -{ - return cdr >> this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::In_Var_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any - ) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// =========================================================== - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Var_Size_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_; -} - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Inout_Var_Size_SArgument_T<S,Insert_Policy>::demarshal (TAO_InputCDR & cdr) -{ - return cdr >> this->x_; -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Inout_Var_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any - ) const -{ - Insert_Policy::any_insert (any, this->x_); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================== - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Out_Var_Size_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Out_Var_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -// ============================================================ - -template<typename S, - class Insert_Policy> -CORBA::Boolean -TAO::Ret_Var_Size_SArgument_T<S,Insert_Policy>::marshal (TAO_OutputCDR &cdr) -{ - return cdr << this->x_.in (); -} - -#if TAO_HAS_INTERCEPTORS == 1 - -template<typename S, - class Insert_Policy> -void -TAO::Ret_Var_Size_SArgument_T<S,Insert_Policy>::interceptor_value ( - CORBA::Any *any) const -{ - Insert_Policy::any_insert (any, this->x_.in ()); -} - -#endif /* TAO_HAS_INTERCEPTORS */ - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_VAR_SIZE_SARGUMENT_T_CPP */ diff --git a/TAO/tao/PortableServer/Var_Size_SArgument_T.h b/TAO/tao/PortableServer/Var_Size_SArgument_T.h deleted file mode 100644 index 1632a639a54..00000000000 --- a/TAO/tao/PortableServer/Var_Size_SArgument_T.h +++ /dev/null @@ -1,165 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Var_Size_SArgument_T.h - * - * $Id$ - * - * @authors Jeff Parsons, Carlos O'Ryan and Ossama Othman - */ -//============================================================================= - -#ifndef TAO_VAR_SIZE_SARGUMENT_T_H -#define TAO_VAR_SIZE_SARGUMENT_T_H - -#include /**/ "ace/pre.h" -#include "tao/Argument.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class In_Var_Size_SArgument_T - * - * @brief Template class for IN skeleton argument of fixed size IDL types. - * - */ - template<typename S, - class Insert_Policy> - class In_Var_Size_SArgument_T : public InArgument - { - public: - - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S const & arg (void) const; - - private: - S x_; - }; - - /** - * @class Inout_Var_Size_SArgument_T - * - * @brief Template class for INOUT skeleton arg of fixed size IDL types. - * - */ - template<typename S, - class Insert_Policy> - class Inout_Var_Size_SArgument_T : public InoutArgument - { - public: - Inout_Var_Size_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - virtual CORBA::Boolean demarshal (TAO_InputCDR &); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S & arg (void); - - private: - S x_; - }; - - /** - * @class Out_Var_Size_SArgument_T - * - * @brief Template class for OUT skeleton argument of fixed size IDL types. - * - */ - template<typename S, - class Insert_Policy> - class Out_Var_Size_SArgument_T : public OutArgument - { - public: - Out_Var_Size_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S *& arg (void); - - private: - typename S::_var_type x_; - }; - - /** - * @class Ret_Var_Size_SArgument_T - * - * @brief Template class for return skeleton value of fixed size IDL types. - * - */ - template<typename S, - class Insert_Policy> - class Ret_Var_Size_SArgument_T : public RetArgument - { - public: - Ret_Var_Size_SArgument_T (void); - - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); -#if TAO_HAS_INTERCEPTORS == 1 - virtual void interceptor_value (CORBA::Any *any) const; -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - S *& arg (void); - - private: - typename S::_var_type x_; - }; - - /** - * @struct Var_Size_SArg_Traits_T - * - * @brief Template class for skeleton argument traits of - * variable size IDL types. - * - */ - template<typename T, - class Insert_Policy> - struct Var_Size_SArg_Traits_T - { - typedef T * ret_type; - typedef const T & in_type; - typedef T & inout_type; - typedef typename T::_out_type out_type; - - typedef In_Var_Size_SArgument_T<T,Insert_Policy> in_arg_val; - typedef Inout_Var_Size_SArgument_T<T,Insert_Policy> inout_arg_val; - typedef Out_Var_Size_SArgument_T<T,Insert_Policy> out_arg_val; - typedef Ret_Var_Size_SArgument_T<T,Insert_Policy> ret_val; - - // Typedefs corresponding to return value of arg() method in both - // the client and server side argument class templates. - typedef in_type in_arg_type; - typedef inout_type inout_arg_type; - typedef ret_type & out_arg_type; - typedef ret_type & ret_arg_type; - }; -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#if defined (__ACE_INLINE__) -#include "tao/PortableServer/Var_Size_SArgument_T.inl" -#endif /* __ACE_INLINE__ */ - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "tao/PortableServer/Var_Size_SArgument_T.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ - -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Var_Size_SArgument_T.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#include /**/ "ace/post.h" - -#endif /* TAO_VAR_SIZE_SARGUMENT_T_H */ diff --git a/TAO/tao/PortableServer/Var_Size_SArgument_T.inl b/TAO/tao/PortableServer/Var_Size_SArgument_T.inl deleted file mode 100644 index 80d2c3fd9bf..00000000000 --- a/TAO/tao/PortableServer/Var_Size_SArgument_T.inl +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -template<typename S, - class Insert_Policy> -S const & -TAO::In_Var_Size_SArgument_T<S,Insert_Policy>::arg (void) const -{ - return this->x_; -} - -// ========================================================================== - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Inout_Var_Size_SArgument_T<S,Insert_Policy>::Inout_Var_Size_SArgument_T (void) -{ -} - -template<typename S, - class Insert_Policy> -S & -TAO::Inout_Var_Size_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_; -} - -// ========================================================================== - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Out_Var_Size_SArgument_T<S,Insert_Policy>::Out_Var_Size_SArgument_T (void) -{ -} - -template<typename S, - class Insert_Policy> -S *& -TAO::Out_Var_Size_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_.out (); -} - -// ========================================================================== - -template<typename S, - class Insert_Policy> -ACE_INLINE -TAO::Ret_Var_Size_SArgument_T<S,Insert_Policy>::Ret_Var_Size_SArgument_T (void) -{ -} - -template<typename S, - class Insert_Policy> -ACE_INLINE -S *& -TAO::Ret_Var_Size_SArgument_T<S,Insert_Policy>::arg (void) -{ - return this->x_.out (); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/diffs/PS_Forward.diff b/TAO/tao/PortableServer/diffs/PS_Forward.diff deleted file mode 100644 index db64ebb520b..00000000000 --- a/TAO/tao/PortableServer/diffs/PS_Forward.diff +++ /dev/null @@ -1,63 +0,0 @@ ---- orig/PS_ForwardC.h 2005-04-29 12:01:04.396555200 +0200 -+++ PS_ForwardC.h 2005-05-25 15:19:21.321457600 +0200 -@@ -1,6 +1,6 @@ - // -*- C++ -*- - // --// $Id$ -+// $Id$ - - // **** Code generated by the The ACE ORB (TAO) IDL Compiler **** - // TAO and the TAO IDL Compiler have been developed by: -@@ -61,11 +61,24 @@ - #pragma option push -w-rvl -w-rch -w-ccc -w-inl - #endif /* __BORLANDC__ */ - -+class TAO_ServantBase; -+class TAO_ServantBase_var; -+class TAO_Local_ServantBase; -+class TAO_Root_POA; -+class TAO_DynamicImplementation; -+ - // TAO_IDL - Generated from - // be\be_visitor_module/module_ch.cpp:48 - - namespace PortableServer - { -+ typedef TAO_ServantBase ServantBase; -+ struct RefCountServantBase {}; -+ typedef TAO_ServantBase_var ServantBase_var; -+ typedef ServantBase *Servant; -+ -+ typedef TAO_Local_ServantBase LocalServantBase; -+ typedef TAO_DynamicImplementation DynamicImplementation; - - // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:472 -@@ -113,27 +126,6 @@ - // Traits specializations. - namespace TAO - { -- --#if !defined (_PORTABLESERVER_POA__TRAITS_CH_) --#define _PORTABLESERVER_POA__TRAITS_CH_ -- -- template<> -- struct TAO_PortableServer_Export Objref_Traits< ::PortableServer::POA> -- { -- static ::PortableServer::POA_ptr duplicate ( -- ::PortableServer::POA_ptr -- ); -- static void release ( -- ::PortableServer::POA_ptr -- ); -- static ::PortableServer::POA_ptr nil (void); -- static CORBA::Boolean marshal ( -- ::PortableServer::POA_ptr p, -- TAO_OutputCDR & cdr -- ); -- }; -- --#endif /* end #if !defined */ - } - - // TAO_IDL - Generated from diff --git a/TAO/tao/PortableServer/diffs/PortableServer.diff b/TAO/tao/PortableServer/diffs/PortableServer.diff deleted file mode 100644 index f79f1875c64..00000000000 --- a/TAO/tao/PortableServer/diffs/PortableServer.diff +++ /dev/null @@ -1,247 +0,0 @@ ---- orig/PortableServerC.h 2005-04-11 16:44:01.152521600 +0200 -+++ PortableServerC.h 2005-04-11 16:44:04.287028800 +0200 -@@ -36,6 +36,10 @@ - - #include "ace/config-all.h" - -+#ifndef TAO_PORTABLESERVER_SAFE_INCLUDE -+#error "You should not include PortableServerC.h directly, use PortableServer.h" -+#endif /* !TAO_PORTABLESERVER_SAFE_INCLUDE */ -+ - #if !defined (ACE_LACKS_PRAGMA_ONCE) - # pragma once - #endif /* ACE_LACKS_PRAGMA_ONCE */ -@@ -465,6 +469,8 @@ - // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ch.cpp:51 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - #if !defined (_PORTABLESERVER_POA_NOSERVANT_CH_) - #define _PORTABLESERVER_POA_NOSERVANT_CH_ - -@@ -512,6 +518,8 @@ - - #endif /* end #if !defined */ - -+#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -+ - // TAO_IDL - Generated from - // be\be_visitor_exception/exception_ch.cpp:51 - -@@ -855,6 +863,7 @@ - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) - virtual ::PortableServer::ThreadPolicy_ptr create_thread_policy ( - ::PortableServer::ThreadPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS -@@ -862,6 +871,7 @@ - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; -+#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 -@@ -899,6 +909,7 @@ - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) - virtual ::PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy ( - ::PortableServer::ImplicitActivationPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS -@@ -906,10 +917,12 @@ - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; -+#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) - virtual ::PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy ( - ::PortableServer::ServantRetentionPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS -@@ -917,10 +930,12 @@ - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; -+#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) - virtual ::PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy ( - ::PortableServer::RequestProcessingPolicyValue value - ACE_ENV_ARG_DECL_WITH_DEFAULTS -@@ -928,6 +943,7 @@ - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; -+#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 -@@ -972,6 +988,8 @@ - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - virtual ::PortableServer::AdapterActivator_ptr the_activator ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) -@@ -989,10 +1007,12 @@ - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; -+#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) - virtual ::PortableServer::ServantManager_ptr get_servant_manager ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) -@@ -1012,10 +1032,13 @@ - CORBA::SystemException, - ::PortableServer::POA::WrongPolicy - )) = 0; -+#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - virtual ::PortableServer::Servant get_servant ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) -@@ -1037,6 +1060,8 @@ - ::PortableServer::POA::WrongPolicy - )) = 0; - -+#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -+ - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - -@@ -1298,11 +1323,15 @@ - // TAO_IDL - Generated from - // be\be_visitor_exception/any_op_ch.cpp:52 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - TAO_PortableServer_Export void operator<<= (CORBA::Any &, const PortableServer::POA::NoServant &); // copying version - TAO_PortableServer_Export void operator<<= (CORBA::Any &, PortableServer::POA::NoServant*); // noncopying version - TAO_PortableServer_Export CORBA::Boolean operator>>= (const CORBA::Any &, PortableServer::POA::NoServant *&); // deprecated - TAO_PortableServer_Export CORBA::Boolean operator>>= (const CORBA::Any &, const PortableServer::POA::NoServant *&); - -+#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -+ - // TAO_IDL - Generated from - // be\be_visitor_exception/any_op_ch.cpp:52 - -@@ -1366,4 +1395,3 @@ - - #endif /* ifndef */ - -- ---- orig/PortableServerC.cpp 2005-04-11 16:44:01.152521600 +0200 -+++ PortableServerC.cpp 2005-04-11 16:44:04.317072000 +0200 -@@ -29,7 +29,7 @@ - // be\be_codegen.cpp:291 - - --#include "PortableServerC.h" -+#include "PortableServer.h" - #include "tao/CDR.h" - #include "tao/ORB_Core.h" - #include "tao/Object_Argument_T.h" -@@ -45,7 +45,6 @@ - // Arg traits specializations. - namespace TAO - { -- - #if !defined (_PORTABLESERVER_ADAPTERACTIVATOR__ARG_TRAITS_CS_) - #define _PORTABLESERVER_ADAPTERACTIVATOR__ARG_TRAITS_CS_ - -@@ -64,7 +63,6 @@ - #endif /* end #if !defined */ - } - -- - // TAO_IDL - Generated from - // be\be_visitor_sequence/sequence_cs.cpp:65 - -@@ -463,6 +461,8 @@ - // TAO_IDL - Generated from - // be\be_visitor_exception/exception_cs.cpp:63 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - PortableServer::POA::NoServant::NoServant (void) - : CORBA::UserException ( - "IDL:omg.org/PortableServer/POA/NoServant:2.3", -@@ -555,6 +555,8 @@ - return ::PortableServer::POA::_tc_NoServant; - } - -+#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -+ - // TAO_IDL - Generated from - // be\be_visitor_exception/exception_cs.cpp:63 - ---- orig/PortableServerA.cpp 2005-04-11 16:44:01.152521600 +0200 -+++ PortableServerA.cpp 2005-04-11 16:44:04.337100800 +0200 -@@ -25,7 +25,7 @@ - // Information about TAO is available at: - // http://www.cs.wustl.edu/~schmidt/TAO.html - --#include "PortableServerC.h" -+#include "PortableServer.h" - #include "tao/Null_RefCount_Policy.h" - #include "tao/TypeCode_Constants.h" - #include "tao/Alias_TypeCode.h" -@@ -154,6 +154,8 @@ - // TAO_IDL - Generated from - // be\be_visitor_typecode/struct_typecode.cpp:70 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - static TAO::TypeCode::Struct_Field<char const *, CORBA::TypeCode_ptr const *> const * const _tao_fields_PortableServer_POA_NoServant = 0; - static TAO::TypeCode::Struct<char const *, - CORBA::TypeCode_ptr const *, -@@ -170,6 +172,8 @@ - ::CORBA::TypeCode_ptr const PortableServer::POA::_tc_NoServant = - &_tao_tc_PortableServer_POA_NoServant; - -+#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -+ - // TAO_IDL - Generated from - // be\be_visitor_typecode/struct_typecode.cpp:70 - -@@ -662,6 +666,8 @@ - // TAO_IDL - Generated from - // be\be_visitor_exception/any_op_cs.cpp:50 - -+#if (TAO_HAS_MINIMUM_POA == 0) -+ - template<> - CORBA::Boolean - TAO::Any_Dual_Impl_T<PortableServer::POA::NoServant>::marshal_value (TAO_OutputCDR &) -@@ -731,6 +737,8 @@ - ); - } - -+#endif /* TAO_HAS_MINIMUM_CORBA == 0 */ -+ - // TAO_IDL - Generated from - // be\be_visitor_exception/any_op_cs.cpp:50 - diff --git a/TAO/tao/PortableServer/diffs/PortableServer_include.diff b/TAO/tao/PortableServer/diffs/PortableServer_include.diff deleted file mode 100644 index d6638858330..00000000000 --- a/TAO/tao/PortableServer/diffs/PortableServer_include.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- orig/PortableServer_includeC.h 2005-04-11 16:44:03.175430400 +0200 -+++ PortableServer_includeC.h 2005-04-11 16:44:05.098195200 +0200 -@@ -45,7 +45,7 @@ - #include "tao/SystemException.h" - #include "tao/Environment.h" - --#include "tao/PortableServer/PortableServerC.h" -+#include "tao/PortableServer/PortableServer.h" - - #if defined (TAO_EXPORT_MACRO) - #undef TAO_EXPORT_MACRO diff --git a/TAO/tao/PortableServer/get_arg.h b/TAO/tao/PortableServer/get_arg.h deleted file mode 100644 index 1d0d05827b5..00000000000 --- a/TAO/tao/PortableServer/get_arg.h +++ /dev/null @@ -1,105 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file get_arg.h - * - * $Id$ - * - * Thru-POA/skeleton argument selection function templates. - * @par - * These function templates are used to choose between arguments - * supplied in thru-POA collocated invocations and arguments in - * uncollocated invocations. - * - * @note A function template approach is used to avoid complicated - * argument conversions between stub supplied arguments and - * skeleton supplied ones. For example, it is possible to make - * argument selection more transparent by taking advantage of - * run-time polymorphism. However, that approach would incur - * additional footprint overhead on the client side due to the - * introduction of virtual tables, etc. - * - * @author Ossama Othman - */ -//============================================================================= - -#ifndef TAO_GET_ARG_H -#define TAO_GET_ARG_H - -#include /**/ "ace/pre.h" - -#include "tao/operation_details.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - /// Get return value/argument. - template<typename T> - typename TAO::SArg_Traits<T>::ret_arg_type - get_ret_arg (TAO_Operation_Details const * details, - TAO::Argument * const * skel_args) - { - return - (details != 0 && details->args () != 0) - ? static_cast<typename TAO::Arg_Traits<T>::ret_val *> ( - details->args ()[0])->arg () - : static_cast<typename TAO::SArg_Traits<T>::ret_val *> ( - skel_args[0])->arg (); - } - - /// Get "in" argument. - template<typename T> - typename TAO::SArg_Traits<T>::in_arg_type - get_in_arg (TAO_Operation_Details const * details, - TAO::Argument * const * skel_args, - size_t i) - { - return - (details != 0 && details->args () != 0) - ? static_cast<typename TAO::Arg_Traits<T>::in_arg_val *> ( - details->args ()[i])->arg () - : static_cast<typename TAO::SArg_Traits<T>::in_arg_val *> ( - skel_args[i])->arg (); - } - - /// Get "inout" argument. - template<typename T> - typename TAO::SArg_Traits<T>::inout_arg_type - get_inout_arg (TAO_Operation_Details const * details, - TAO::Argument * const * skel_args, - size_t i) - { - return - (details != 0 && details->args () != 0) - ? static_cast<typename TAO::Arg_Traits<T>::inout_arg_val *> ( - details->args ()[i])->arg () - : static_cast<typename TAO::SArg_Traits<T>::inout_arg_val *> ( - skel_args[i])->arg (); - } - - /// Get "out" argument. - template<typename T> - typename TAO::SArg_Traits<T>::out_arg_type - get_out_arg (TAO_Operation_Details const * details, - TAO::Argument * const * skel_args, - size_t i) - { - return - (details != 0 && details->args () != 0) - ? static_cast<typename TAO::Arg_Traits<T>::out_arg_val *> ( - details->args ()[i])->arg () - : static_cast<typename TAO::SArg_Traits<T>::out_arg_val *> ( - skel_args[i])->arg (); - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_GET_ARG_H*/ diff --git a/TAO/tao/PortableServer/poa_macros.h b/TAO/tao/PortableServer/poa_macros.h deleted file mode 100644 index 4ef9552bfd4..00000000000 --- a/TAO/tao/PortableServer/poa_macros.h +++ /dev/null @@ -1,43 +0,0 @@ -// -*- C++ -*- - -// $Id$ - -#ifndef TAO_POA_MACROS_H -#define TAO_POA_MACROS_H - -#include /**/ "ace/pre.h" - -#include "tao/orbconf.h" -#include "ace/CORBA_macros.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#define TAO_OBJECT_ADAPTER_GUARD \ - ACE_GUARD_THROW_EX (ACE_Lock, \ - monitor, \ - this->lock (), \ - CORBA::OBJ_ADAPTER ()); \ - ACE_CHECK - -#define TAO_OBJECT_ADAPTER_GUARD_RETURN(RETURN) \ - ACE_GUARD_THROW_EX (ACE_Lock, \ - monitor, \ - this->lock (), \ - CORBA::OBJ_ADAPTER ()); \ - ACE_CHECK_RETURN (RETURN) - -#define TAO_POA_GUARD \ - TAO::Portable_Server::POA_Guard poa_guard (*this ACE_ENV_ARG_PARAMETER); \ - ACE_UNUSED_ARG (poa_guard); \ - ACE_CHECK - -#define TAO_POA_GUARD_RETURN(RETURN) \ - TAO::Portable_Server::POA_Guard poa_guard (*this ACE_ENV_ARG_PARAMETER); \ - ACE_UNUSED_ARG (poa_guard); \ - ACE_CHECK_RETURN (RETURN) - -#include /**/ "ace/post.h" - -#endif /* TAO_POA_MACROS_H */ diff --git a/TAO/tao/PortableServer/portableserver_export.h b/TAO/tao/PortableServer/portableserver_export.h deleted file mode 100644 index 81c9200c157..00000000000 --- a/TAO/tao/PortableServer/portableserver_export.h +++ /dev/null @@ -1,40 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl -// ------------------------------ -#ifndef TAO_PORTABLESERVER_EXPORT_H -#define TAO_PORTABLESERVER_EXPORT_H - -#include "ace/config-all.h" - -#if defined (TAO_AS_STATIC_LIBS) -# if !defined (TAO_PORTABLESERVER_HAS_DLL) -# define TAO_PORTABLESERVER_HAS_DLL 0 -# endif /* ! TAO_PORTABLESERVER_HAS_DLL */ -#else -# if !defined (TAO_PORTABLESERVER_HAS_DLL) -# define TAO_PORTABLESERVER_HAS_DLL 1 -# endif /* ! TAO_PORTABLESERVER_HAS_DLL */ -#endif - -#if defined (TAO_PORTABLESERVER_HAS_DLL) && (TAO_PORTABLESERVER_HAS_DLL == 1) -# if defined (TAO_PORTABLESERVER_BUILD_DLL) -# define TAO_PortableServer_Export ACE_Proper_Export_Flag -# define TAO_PORTABLESERVER_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define TAO_PORTABLESERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* TAO_PORTABLESERVER_BUILD_DLL */ -# define TAO_PortableServer_Export ACE_Proper_Import_Flag -# define TAO_PORTABLESERVER_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define TAO_PORTABLESERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* TAO_PORTABLESERVER_BUILD_DLL */ -#else /* TAO_PORTABLESERVER_HAS_DLL == 1 */ -# define TAO_PortableServer_Export -# define TAO_PORTABLESERVER_SINGLETON_DECLARATION(T) -# define TAO_PORTABLESERVER_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* TAO_PORTABLESERVER_HAS_DLL == 1 */ - -#endif /* TAO_PORTABLESERVER_EXPORT_H */ - -// End of auto generated file. |