From 322d0a3e30d2e608108e0d7caf6bdcddbd728081 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 13 Feb 2023 11:42:23 +0100 Subject: Major cleanup in PortableServer library --- .../PortableServer/Active_Policy_Strategies.cpp | 320 +++++++++++---------- TAO/tao/PortableServer/Active_Policy_Strategies.h | 54 ++-- .../PortableServer/Active_Policy_Strategies.inl | 16 +- .../PortableServer/Default_Servant_Dispatcher.h | 6 +- TAO/tao/PortableServer/IdAssignmentPolicy.h | 4 +- TAO/tao/PortableServer/IdAssignmentStrategy.cpp | 10 - TAO/tao/PortableServer/IdAssignmentStrategy.h | 10 +- .../PortableServer/IdAssignmentStrategyFactory.h | 47 --- .../IdAssignmentStrategyFactoryImpl.cpp | 64 ----- .../IdAssignmentStrategyFactoryImpl.h | 49 ---- .../PortableServer/IdAssignmentStrategySystem.cpp | 13 - .../PortableServer/IdAssignmentStrategySystem.h | 15 +- .../PortableServer/IdAssignmentStrategyUser.cpp | 13 - TAO/tao/PortableServer/IdAssignmentStrategyUser.h | 15 +- TAO/tao/PortableServer/IdUniquenessPolicy.cpp | 2 +- TAO/tao/PortableServer/IdUniquenessPolicy.h | 4 +- TAO/tao/PortableServer/IdUniquenessStrategy.cpp | 23 ++ TAO/tao/PortableServer/IdUniquenessStrategy.h | 20 +- .../PortableServer/IdUniquenessStrategyFactory.h | 48 ---- .../IdUniquenessStrategyFactoryImpl.cpp | 93 ------ .../IdUniquenessStrategyFactoryImpl.h | 48 ---- .../IdUniquenessStrategyMultiple.cpp | 20 -- .../PortableServer/IdUniquenessStrategyMultiple.h | 23 +- .../PortableServer/IdUniquenessStrategyUnique.cpp | 27 +- .../PortableServer/IdUniquenessStrategyUnique.h | 27 +- .../IdUniquenessStrategyUniqueFactoryImpl.cpp | 59 ---- .../IdUniquenessStrategyUniqueFactoryImpl.h | 48 ---- .../PortableServer/ImplicitActivationStrategy.cpp | 23 -- .../PortableServer/ImplicitActivationStrategy.h | 8 +- .../ImplicitActivationStrategyExplicit.cpp | 13 - .../ImplicitActivationStrategyExplicit.h | 14 +- .../ImplicitActivationStrategyFactory.h | 47 --- .../ImplicitActivationStrategyFactoryImpl.cpp | 67 ----- .../ImplicitActivationStrategyFactoryImpl.h | 49 ---- .../ImplicitActivationStrategyImplicit.cpp | 13 - .../ImplicitActivationStrategyImplicit.h | 13 +- TAO/tao/PortableServer/LifespanStrategy.cpp | 7 +- TAO/tao/PortableServer/LifespanStrategy.h | 13 +- TAO/tao/PortableServer/LifespanStrategyFactory.h | 48 ---- .../PortableServer/LifespanStrategyFactoryImpl.cpp | 90 ------ .../PortableServer/LifespanStrategyFactoryImpl.h | 50 ---- .../PortableServer/LifespanStrategyPersistent.cpp | 6 - .../PortableServer/LifespanStrategyPersistent.h | 23 +- .../LifespanStrategyPersistentFactoryImpl.cpp | 58 ---- .../LifespanStrategyPersistentFactoryImpl.h | 50 ---- .../PortableServer/LifespanStrategyTransient.cpp | 6 - TAO/tao/PortableServer/LifespanStrategyTransient.h | 25 +- .../LifespanStrategyTransientFactoryImpl.cpp | 59 ---- .../LifespanStrategyTransientFactoryImpl.h | 51 ---- TAO/tao/PortableServer/Object_Adapter.cpp | 19 +- TAO/tao/PortableServer/Object_Adapter.h | 4 +- TAO/tao/PortableServer/Object_Adapter.inl | 4 +- TAO/tao/PortableServer/Policy_Strategy.h | 47 --- TAO/tao/PortableServer/PortableServer.cpp | 141 +-------- TAO/tao/PortableServer/Regular_POA.cpp | 4 - TAO/tao/PortableServer/Regular_POA.h | 10 +- .../PortableServer/RequestProcessingStrategy.cpp | 22 +- TAO/tao/PortableServer/RequestProcessingStrategy.h | 22 +- .../RequestProcessingStrategyAOMOnly.cpp | 15 +- .../RequestProcessingStrategyAOMOnly.h | 47 ++- ...RequestProcessingStrategyAOMOnlyFactoryImpl.cpp | 61 ---- .../RequestProcessingStrategyAOMOnlyFactoryImpl.h | 51 ---- .../RequestProcessingStrategyDefaultServant.cpp | 35 +-- .../RequestProcessingStrategyDefaultServant.h | 46 ++- .../RequestProcessingStrategyDefaultServantFI.cpp | 68 ----- .../RequestProcessingStrategyDefaultServantFI.h | 54 ---- .../RequestProcessingStrategyFactory.h | 50 ---- .../RequestProcessingStrategyFactoryImpl.cpp | 141 --------- .../RequestProcessingStrategyFactoryImpl.h | 50 ---- .../RequestProcessingStrategyServantActivator.cpp | 13 +- .../RequestProcessingStrategyServantActivator.h | 28 +- ...RequestProcessingStrategyServantActivatorFI.cpp | 80 ------ .../RequestProcessingStrategyServantActivatorFI.h | 54 ---- .../RequestProcessingStrategyServantLocator.cpp | 13 +- .../RequestProcessingStrategyServantLocator.h | 26 +- .../RequestProcessingStrategyServantLocatorFI.cpp | 81 ------ .../RequestProcessingStrategyServantLocatorFI.h | 54 ---- .../RequestProcessingStrategyServantManager.cpp | 10 - .../RequestProcessingStrategyServantManager.h | 19 +- TAO/tao/PortableServer/Root_POA.cpp | 12 +- TAO/tao/PortableServer/Root_POA.h | 4 +- .../PortableServer/ServantRetentionStrategy.cpp | 23 ++ TAO/tao/PortableServer/ServantRetentionStrategy.h | 13 +- .../ServantRetentionStrategyFactory.h | 47 --- .../ServantRetentionStrategyFactoryImpl.cpp | 95 ------ .../ServantRetentionStrategyFactoryImpl.h | 48 ---- .../ServantRetentionStrategyNonRetain.cpp | 12 +- .../ServantRetentionStrategyNonRetain.h | 75 +++-- ...ervantRetentionStrategyNonRetainFactoryImpl.cpp | 65 ----- .../ServantRetentionStrategyNonRetainFactoryImpl.h | 52 ---- .../ServantRetentionStrategyRetain.cpp | 20 +- .../ServantRetentionStrategyRetain.h | 78 ++--- .../ServantRetentionStrategyRetainFactoryImpl.cpp | 60 ---- .../ServantRetentionStrategyRetainFactoryImpl.h | 49 ---- TAO/tao/PortableServer/Servant_Location.h | 16 +- TAO/tao/PortableServer/Servant_Upcall.cpp | 2 +- TAO/tao/PortableServer/ThreadStrategy.cpp | 21 -- TAO/tao/PortableServer/ThreadStrategy.h | 13 +- TAO/tao/PortableServer/ThreadStrategyFactory.h | 49 ---- .../PortableServer/ThreadStrategyFactoryImpl.cpp | 95 ------ TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h | 48 ---- .../PortableServer/ThreadStrategyORBControl.cpp | 18 -- TAO/tao/PortableServer/ThreadStrategyORBControl.h | 12 +- TAO/tao/PortableServer/ThreadStrategySingle.cpp | 19 -- TAO/tao/PortableServer/ThreadStrategySingle.h | 8 +- .../ThreadStrategySingleFactoryImpl.cpp | 64 ----- .../ThreadStrategySingleFactoryImpl.h | 52 ---- 107 files changed, 561 insertions(+), 3589 deletions(-) delete mode 100644 TAO/tao/PortableServer/IdAssignmentStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h create mode 100644 TAO/tao/PortableServer/IdUniquenessStrategy.cpp delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategy.cpp delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/Policy_Strategy.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp delete mode 100644 TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h create mode 100644 TAO/tao/PortableServer/ServantRetentionStrategy.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ThreadStrategy.cpp delete mode 100644 TAO/tao/PortableServer/ThreadStrategyFactory.h delete mode 100644 TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h delete mode 100644 TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp delete mode 100644 TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp index cbb9434cf71..b457efcdc4f 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.cpp +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.cpp @@ -2,31 +2,22 @@ #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" +#include "tao/PortableServer/ThreadStrategySingle.h" +#include "tao/PortableServer/ThreadStrategyORBControl.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/LifespanStrategyPersistent.h" +#include "tao/PortableServer/LifespanStrategyTransient.h" +#include "tao/PortableServer/RequestProcessingStrategyAOMOnly.h" +#include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h" +#include "tao/PortableServer/RequestProcessingStrategyServantLocator.h" +#include "tao/PortableServer/RequestProcessingStrategyServantActivator.h" +#include "tao/PortableServer/ServantRetentionStrategyNonRetain.h" +#include "tao/PortableServer/ServantRetentionStrategyRetain.h" #if !defined (__ACE_INLINE__) # include "tao/PortableServer/Active_Policy_Strategies.inl" @@ -38,91 +29,19 @@ namespace TAO { namespace Portable_Server { - Active_Policy_Strategies::Active_Policy_Strategies () - : 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) { - this->thread_strategy_factory_ = - ACE_Dynamic_Service::instance ("ThreadStrategyFactory"); - - if (this->thread_strategy_factory_ != 0) - this->thread_strategy_ = - this->thread_strategy_factory_->create (policies.thread()); + this->create (policies.thread()); + this->create (policies.id_assignment()); + this->create (policies.id_uniqueness()); + this->create (policies.servant_retention()); + this->create (policies.lifespan()); + this->create (policies.implicit_activation()); + this->create (policies.request_processing(), policies.servant_retention()); /**/ - - this->id_assignment_strategy_factory_ = - ACE_Dynamic_Service::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::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::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::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::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::instance ("ImplicitActivationStrategyFactory"); - - if (this->implicit_activation_strategy_factory_ != 0) - this->implicit_activation_strategy_ = - this->implicit_activation_strategy_factory_->create (policies.implicit_activation()); - - /**/ - if (this->lifespan_strategy_ != 0) { this->lifespan_strategy_->strategy_init (poa); @@ -130,7 +49,7 @@ namespace TAO if (this->request_processing_strategy_ != 0) { - this->request_processing_strategy_->strategy_init (poa, policies.servant_retention()); + this->request_processing_strategy_->strategy_init (poa); } if (this->id_uniqueness_strategy_ != 0) @@ -138,78 +57,189 @@ namespace TAO this->id_uniqueness_strategy_->strategy_init (poa); } - if (this->implicit_activation_strategy_ != 0) + if (this->servant_retention_strategy_ != 0) { - this->implicit_activation_strategy_->strategy_init (poa); + this->servant_retention_strategy_->strategy_init (poa); } + } + + void + Active_Policy_Strategies::cleanup () + { + this->lifespan_strategy_->strategy_cleanup (); + this->lifespan_strategy_.reset (nullptr); + this->request_processing_strategy_->strategy_cleanup (); + this->request_processing_strategy_.reset (nullptr); + this->id_uniqueness_strategy_->strategy_cleanup (); + this->id_uniqueness_strategy_.reset (nullptr); + this->implicit_activation_strategy_.reset (nullptr); + this->thread_strategy_.reset (nullptr); + this->servant_retention_strategy_->strategy_cleanup (); + this->servant_retention_strategy_.reset (nullptr); + this->id_assignment_strategy_.reset (nullptr); + } - if (this->thread_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::ThreadPolicyValue value) + { + switch (value) + { + case ::PortableServer::SINGLE_THREAD_MODEL : { - this->thread_strategy_->strategy_init (poa); +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) + this->thread_strategy_.reset (new ThreadStrategySingle ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; } - - if (this->servant_retention_strategy_ != 0) + case ::PortableServer::ORB_CTRL_MODEL : { - this->servant_retention_strategy_->strategy_init (poa); + this->thread_strategy_.reset (new ThreadStrategyORBControl ()); + break; } + } + } - if (this->id_assignment_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::IdAssignmentPolicyValue value) + { + switch (value) + { + case ::PortableServer::SYSTEM_ID : + { + this->id_assignment_strategy_.reset (new IdAssignmentStrategySystem ()); + break; + } + case ::PortableServer::USER_ID : { - this->id_assignment_strategy_->strategy_init (poa); +#if !defined (CORBA_E_MICRO) + this->id_assignment_strategy_.reset (new IdAssignmentStrategyUser ()); +#endif /* CORBA_E_MICRO */ + break; } + } } void - Active_Policy_Strategies::cleanup () + Active_Policy_Strategies::create (::PortableServer::IdUniquenessPolicyValue value) { - if (this->lifespan_strategy_ != 0) + switch (value) + { + case ::PortableServer::MULTIPLE_ID : { - this->lifespan_strategy_factory_->destroy (lifespan_strategy_); - - this->lifespan_strategy_ = 0; +#if !defined (CORBA_E_MICRO) + this->id_uniqueness_strategy_.reset (new IdUniquenessStrategyMultiple ()); +#endif /* CORBA_E_MICRO */ + break; } - - if (this->request_processing_strategy_ != 0) + case ::PortableServer::UNIQUE_ID : { - this->request_processing_strategy_factory_->destroy (request_processing_strategy_); - - this->request_processing_strategy_ = 0; + this->id_uniqueness_strategy_.reset (new IdUniquenessStrategyUnique ()); + break; } + } + } - if (this->id_uniqueness_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::ServantRetentionPolicyValue value) + { + switch (value) + { + case ::PortableServer::RETAIN : { - this->id_uniqueness_strategy_factory_->destroy (id_uniqueness_strategy_); - - this->id_uniqueness_strategy_ = 0; + this->servant_retention_strategy_.reset (new ServantRetentionStrategyRetain ()); + break; } - - if (this->implicit_activation_strategy_ != 0) + case ::PortableServer::NON_RETAIN : { - this->implicit_activation_strategy_factory_->destroy (implicit_activation_strategy_); - - this->implicit_activation_strategy_ = 0; +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) + this->servant_retention_strategy_.reset (new ServantRetentionStrategyNonRetain ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; } + } + } - if (this->thread_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::LifespanPolicyValue value) + { + switch (value) + { + case ::PortableServer::PERSISTENT : { - this->thread_strategy_factory_->destroy (thread_strategy_); - - this->thread_strategy_ = 0; +#if !defined (CORBA_E_MICRO) + this->lifespan_strategy_.reset (new LifespanStrategyPersistent ()); +#endif /* CORBA_E_MICRO */ + break; } - - if (this->servant_retention_strategy_ != 0) + case ::PortableServer::TRANSIENT : { - this->servant_retention_strategy_factory_->destroy (servant_retention_strategy_); - - this->servant_retention_strategy_ = 0; + this->lifespan_strategy_.reset (new LifespanStrategyTransient ()); + break; } + } + } - if (this->id_assignment_strategy_ != 0) + void + Active_Policy_Strategies::create (::PortableServer::ImplicitActivationPolicyValue value) + { + switch (value) + { + case ::PortableServer::IMPLICIT_ACTIVATION : + { +#if !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) + this->implicit_activation_strategy_.reset (new ImplicitActivationStrategyImplicit ()); +#endif /* CORBA_E_MICRO */ + break; + } + case ::PortableServer::NO_IMPLICIT_ACTIVATION : { - this->id_assignment_strategy_factory_->destroy (id_assignment_strategy_); + this->implicit_activation_strategy_.reset (new ImplicitActivationStrategyExplicit ()); + break; + } + } + } - this->id_assignment_strategy_ = 0; + void + Active_Policy_Strategies::create ( + ::PortableServer::RequestProcessingPolicyValue value, + ::PortableServer::ServantRetentionPolicyValue srvalue) + { + switch (value) + { + case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : + { + this->request_processing_strategy_.reset (new RequestProcessingStrategyAOMOnly ()); + break; + } + case ::PortableServer::USE_DEFAULT_SERVANT : + { +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + this->request_processing_strategy_.reset (new RequestProcessingStrategyDefaultServant ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; + } + case ::PortableServer::USE_SERVANT_MANAGER : + { + switch (srvalue) + { + case ::PortableServer::RETAIN : + { +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + this->request_processing_strategy_.reset (new RequestProcessingStrategyServantActivator ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; + } + case ::PortableServer::NON_RETAIN : + { +#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + this->request_processing_strategy_.reset (new RequestProcessingStrategyServantLocator ()); +#endif /* TAO_HAS_MINIMUM_POA == 0 */ + break; + } + } + break; } + } } } } diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.h b/TAO/tao/PortableServer/Active_Policy_Strategies.h index b683ed244eb..f05fbba535c 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.h +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.h @@ -14,11 +14,20 @@ #include /**/ "ace/pre.h" #include "tao/orbconf.h" +#include #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/PortableServer/ThreadPolicyC.h" +#include "tao/PortableServer/IdAssignmentPolicyC.h" +#include "tao/PortableServer/IdUniquenessPolicyC.h" +#include "tao/PortableServer/ServantRetentionPolicyC.h" +#include "tao/PortableServer/LifespanPolicyC.h" +#include "tao/PortableServer/ImplicitActivationPolicyC.h" +#include "tao/PortableServer/RequestProcessingPolicyC.h" + TAO_BEGIN_VERSIONED_NAMESPACE_DECL class TAO_Root_POA; @@ -36,24 +45,15 @@ namespace TAO 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 (); + Active_Policy_Strategies () = default; - void update (Cached_Policies &policies, - TAO_Root_POA* poa); + void update (Cached_Policies &policies, TAO_Root_POA* poa); void cleanup (); @@ -72,21 +72,22 @@ namespace TAO ServantRetentionStrategy *servant_retention_strategy () 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_; + void create (::PortableServer::ThreadPolicyValue value); + void create (::PortableServer::IdAssignmentPolicyValue value); + void create (::PortableServer::IdUniquenessPolicyValue value); + void create (::PortableServer::ServantRetentionPolicyValue value); + void create (::PortableServer::LifespanPolicyValue value); + void create (::PortableServer::ImplicitActivationPolicyValue value); + void create (::PortableServer::RequestProcessingPolicyValue value, ::PortableServer::ServantRetentionPolicyValue srvalue); + + private: + std::unique_ptr thread_strategy_ {}; + std::unique_ptr id_assignment_strategy_ {}; + std::unique_ptr id_uniqueness_strategy_ {}; + std::unique_ptr servant_retention_strategy_ {}; + std::unique_ptr lifespan_strategy_ {}; + std::unique_ptr implicit_activation_strategy_ {}; + std::unique_ptr request_processing_strategy_ {}; }; /** @@ -96,6 +97,7 @@ namespace TAO class Active_Policy_Strategies_Cleanup_Guard { public: + Active_Policy_Strategies_Cleanup_Guard () = delete; Active_Policy_Strategies_Cleanup_Guard (Active_Policy_Strategies *p); ~Active_Policy_Strategies_Cleanup_Guard (); diff --git a/TAO/tao/PortableServer/Active_Policy_Strategies.inl b/TAO/tao/PortableServer/Active_Policy_Strategies.inl index b28b53ea4a5..0f1e51fb0eb 100644 --- a/TAO/tao/PortableServer/Active_Policy_Strategies.inl +++ b/TAO/tao/PortableServer/Active_Policy_Strategies.inl @@ -9,49 +9,49 @@ namespace TAO ThreadStrategy* Active_Policy_Strategies::thread_strategy () const { - return this->thread_strategy_; + return this->thread_strategy_.get (); } ACE_INLINE RequestProcessingStrategy* Active_Policy_Strategies::request_processing_strategy () const { - return this->request_processing_strategy_; + return this->request_processing_strategy_.get (); } ACE_INLINE IdAssignmentStrategy * Active_Policy_Strategies::id_assignment_strategy () const { - return this->id_assignment_strategy_; + return this->id_assignment_strategy_. get (); } ACE_INLINE IdUniquenessStrategy * Active_Policy_Strategies::id_uniqueness_strategy () const { - return this->id_uniqueness_strategy_; + return this->id_uniqueness_strategy_.get (); } ACE_INLINE LifespanStrategy* Active_Policy_Strategies::lifespan_strategy () const { - return this->lifespan_strategy_; + return this->lifespan_strategy_. get(); } ACE_INLINE ImplicitActivationStrategy* Active_Policy_Strategies::implicit_activation_strategy () const { - return this->implicit_activation_strategy_; + return this->implicit_activation_strategy_.get (); } ACE_INLINE ServantRetentionStrategy* Active_Policy_Strategies::servant_retention_strategy () const { - return this->servant_retention_strategy_; + return this->servant_retention_strategy_.get (); } ACE_INLINE @@ -76,7 +76,7 @@ namespace TAO Active_Policy_Strategies_Cleanup_Guard::_retn () { Active_Policy_Strategies *temp = this->ptr_; - this->ptr_ = 0; + this->ptr_ = nullptr; return temp; } } diff --git a/TAO/tao/PortableServer/Default_Servant_Dispatcher.h b/TAO/tao/PortableServer/Default_Servant_Dispatcher.h index a77043c28d2..d4d6a333a86 100644 --- a/TAO/tao/PortableServer/Default_Servant_Dispatcher.h +++ b/TAO/tao/PortableServer/Default_Servant_Dispatcher.h @@ -8,8 +8,8 @@ */ //============================================================================= -#ifndef TAO_DEFAULT_SERVANT_DISPATCHER_H -#define TAO_DEFAULT_SERVANT_DISPATCHER_H +#ifndef Default_Servant_DISPATCHER_H +#define Default_Servant_DISPATCHER_H #include /**/ "ace/pre.h" #include "tao/PortableServer/portableserver_export.h" @@ -68,4 +68,4 @@ public: TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" -#endif /* TAO_DEFAULT_SERVANT_DISPATCHER_H */ +#endif /* Default_Servant_DISPATCHER_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentPolicy.h b/TAO/tao/PortableServer/IdAssignmentPolicy.h index 82686e026dc..bef8f68e0b5 100644 --- a/TAO/tao/PortableServer/IdAssignmentPolicy.h +++ b/TAO/tao/PortableServer/IdAssignmentPolicy.h @@ -52,10 +52,10 @@ namespace TAO CORBA::PolicyType policy_type (); /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type () const; + TAO_Cached_Policy_Type _tao_cached_type () const override; /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope () const; + TAO_Policy_Scope _tao_scope () const override; private: ::PortableServer::IdAssignmentPolicyValue value_; diff --git a/TAO/tao/PortableServer/IdAssignmentStrategy.cpp b/TAO/tao/PortableServer/IdAssignmentStrategy.cpp index 100a129d208..bd03e9693d6 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategy.cpp +++ b/TAO/tao/PortableServer/IdAssignmentStrategy.cpp @@ -6,16 +6,6 @@ namespace TAO { namespace Portable_Server { - void - IdAssignmentStrategy::strategy_init (TAO_Root_POA * /*poa*/) - { - } - - void - IdAssignmentStrategy::strategy_cleanup() - { - } - char IdAssignmentStrategy::key_type_length () const { diff --git a/TAO/tao/PortableServer/IdAssignmentStrategy.h b/TAO/tao/PortableServer/IdAssignmentStrategy.h index dca18216db1..5f4e1ce6e5f 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategy.h +++ b/TAO/tao/PortableServer/IdAssignmentStrategy.h @@ -12,14 +12,12 @@ #define TAO_ID_ASSIGNMENT_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/Basic_Types.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 @@ -27,12 +25,10 @@ namespace TAO namespace Portable_Server { class IdAssignmentStrategy - : public Policy_Strategy { public: - virtual void strategy_init(TAO_Root_POA *poa); - - virtual void strategy_cleanup(); + IdAssignmentStrategy () = default; + virtual ~IdAssignmentStrategy () = default; /** * Returns the key type the says which specific policy we have diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h b/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h deleted file mode 100644 index ceab91a8dc7..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactory.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 e2d04886b10..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "tao/PortableServer/IdAssignmentStrategyFactoryImpl.h" -#include "tao/PortableServer/IdAssignmentStrategy.h" -#include "ace/Dynamic_Service.h" - -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 ::instance (strategy_name); - - if (strategy == 0) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_name)); - - return strategy; - } - - void - IdAssignmentStrategyFactoryImpl::destroy (IdAssignmentStrategy *) - { - // Noop because both types are singletons - } - - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h b/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h deleted file mode 100644 index d0f64224202..00000000000 --- a/TAO/tao/PortableServer/IdAssignmentStrategyFactoryImpl.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdAssignmentStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_IDASSIGNMENTSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp b/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp index 30d87e69e9f..49c84bd15b3 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp +++ b/TAO/tao/PortableServer/IdAssignmentStrategySystem.cpp @@ -21,18 +21,5 @@ namespace TAO } } -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) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategySystem.h b/TAO/tao/PortableServer/IdAssignmentStrategySystem.h index 7ee2acb36f4..8b05e5b8eca 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategySystem.h +++ b/TAO/tao/PortableServer/IdAssignmentStrategySystem.h @@ -12,35 +12,28 @@ #define TAO_IDASSIGNMENTSTRATEGYSYSTEM_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdAssignmentStrategy.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 + class IdAssignmentStrategySystem : public IdAssignmentStrategy { public: - virtual char id_assignment_key_type () const; + char id_assignment_key_type () const override; - virtual bool has_system_id () const; + bool has_system_id () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategySystem) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategySystem) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp b/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp index 622dbd3f4ef..1b6f8064d42 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp +++ b/TAO/tao/PortableServer/IdAssignmentStrategyUser.cpp @@ -20,17 +20,4 @@ namespace TAO } } -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) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdAssignmentStrategyUser.h b/TAO/tao/PortableServer/IdAssignmentStrategyUser.h index c64be097bce..49898a8b581 100644 --- a/TAO/tao/PortableServer/IdAssignmentStrategyUser.h +++ b/TAO/tao/PortableServer/IdAssignmentStrategyUser.h @@ -12,35 +12,28 @@ #define TAO_IDASSIGNMENTSTRATEGYUSER_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdAssignmentStrategy.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 + class IdAssignmentStrategyUser : public IdAssignmentStrategy { public: - virtual char id_assignment_key_type () const; + char id_assignment_key_type () const override; - virtual bool has_system_id () const; + bool has_system_id () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdAssignmentStrategyUser) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdAssignmentStrategyUser) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.cpp b/TAO/tao/PortableServer/IdUniquenessPolicy.cpp index ce0297809b5..97a312289aa 100644 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.cpp +++ b/TAO/tao/PortableServer/IdUniquenessPolicy.cpp @@ -21,7 +21,7 @@ namespace TAO CORBA::Policy_ptr IdUniquenessPolicy::copy () { - IdUniquenessPolicy *copy = 0; + IdUniquenessPolicy *copy = nullptr; ACE_NEW_THROW_EX (copy, IdUniquenessPolicy (this->value_), CORBA::NO_MEMORY ()); diff --git a/TAO/tao/PortableServer/IdUniquenessPolicy.h b/TAO/tao/PortableServer/IdUniquenessPolicy.h index 3ecbf3b3492..3cf26325ac5 100644 --- a/TAO/tao/PortableServer/IdUniquenessPolicy.h +++ b/TAO/tao/PortableServer/IdUniquenessPolicy.h @@ -52,10 +52,10 @@ namespace TAO CORBA::PolicyType policy_type (); /// Return the cached policy type for this policy. - virtual TAO_Cached_Policy_Type _tao_cached_type () const; + TAO_Cached_Policy_Type _tao_cached_type () const override; /// Returns the scope at which this policy can be applied. See orbconf.h. - virtual TAO_Policy_Scope _tao_scope () const; + TAO_Policy_Scope _tao_scope () const override; private: ::PortableServer::IdUniquenessPolicyValue value_; diff --git a/TAO/tao/PortableServer/IdUniquenessStrategy.cpp b/TAO/tao/PortableServer/IdUniquenessStrategy.cpp new file mode 100644 index 00000000000..caa7602057b --- /dev/null +++ b/TAO/tao/PortableServer/IdUniquenessStrategy.cpp @@ -0,0 +1,23 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file IdUniquenessStrategy.cpp + */ +//============================================================================= + +#include "tao/PortableServer/IdUniquenessStrategy.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ + namespace Portable_Server + { + IdUniquenessStrategy::IdUniquenessStrategy () + { + } + } /* namespace Portable_Server */ +} /* namespace TAO */ + +TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdUniquenessStrategy.h b/TAO/tao/PortableServer/IdUniquenessStrategy.h index b3372d94343..7098f64e59e 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategy.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategy.h @@ -12,14 +12,12 @@ #define TAO_ID_UNIQUENESS_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdUniquenessPolicyC.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 @@ -28,22 +26,24 @@ namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export IdUniquenessStrategy - : public Policy_Strategy + class IdUniquenessStrategy { public: + IdUniquenessStrategy (); + virtual ~IdUniquenessStrategy () = default; + + virtual void strategy_init (TAO_Root_POA *poa); + + virtual void strategy_cleanup (); + /* * 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, - bool &w) = 0; + virtual bool is_servant_activation_allowed (PortableServer::Servant s, bool &w) = 0; virtual bool allow_multiple_activations () const = 0; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const = 0; }; } } diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h b/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h deleted file mode 100644 index c01c47fee41..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 f215d512ae1..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.cpp +++ /dev/null @@ -1,93 +0,0 @@ -#include "tao/PortableServer/IdUniquenessStrategyFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategy.h" -#include "ace/Dynamic_Service.h" - -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::instance ("IdUniquenessStrategyMultiple"); - - if (strategy == 0) - TAOLIB_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::instance ("IdUniquenessStrategyUniqueFactory"); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - TAOLIB_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) - { - switch (strategy->type ()) - { - case ::PortableServer::MULTIPLE_ID : - { - // Noop - break; - } - case ::PortableServer::UNIQUE_ID : - { - IdUniquenessStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("IdUniquenessStrategyUniqueFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - break; - } - } - } - - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h b/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h deleted file mode 100644 index 8c869ab0ab9..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE (IdUniquenessStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp index 170d4a18643..cfcdd9fb672 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp +++ b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.cpp @@ -32,27 +32,7 @@ namespace TAO { return true; } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessStrategyMultiple::type () const - { - return ::PortableServer::MULTIPLE_ID; - } - } } -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) TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h index 15e212c64ab..15831b56c31 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategyMultiple.h @@ -12,43 +12,32 @@ #define TAO_ID_UNIQUENESSSTRATEGY_MULITPLE_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdUniquenessStrategy.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 + class IdUniquenessStrategyMultiple : public IdUniquenessStrategy { public: - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup (); + void strategy_cleanup () override; - virtual bool is_servant_activation_allowed ( - PortableServer::Servant servant, - bool &w); + bool is_servant_activation_allowed (PortableServer::Servant servant, bool &w) override; - virtual bool allow_multiple_activations () const; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const; + bool allow_multiple_activations () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyMultiple) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyMultiple) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp index c805fabf79d..eb890598218 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp +++ b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.cpp @@ -7,11 +7,6 @@ namespace TAO { namespace Portable_Server { - IdUniquenessStrategyUnique::IdUniquenessStrategyUnique () : - poa_ (0) - { - } - void IdUniquenessStrategyUnique::strategy_init ( TAO_Root_POA *poa) @@ -22,7 +17,7 @@ namespace TAO void IdUniquenessStrategyUnique::strategy_cleanup () { - poa_ = 0; + poa_ = nullptr; } bool @@ -44,28 +39,8 @@ namespace TAO { return false; } - - ::PortableServer::IdUniquenessPolicyValue - IdUniquenessStrategyUnique::type() const - { - return ::PortableServer::UNIQUE_ID; - } - } } -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) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h index 26450fc1f6f..37223597713 100644 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h +++ b/TAO/tao/PortableServer/IdUniquenessStrategyUnique.h @@ -12,48 +12,37 @@ #define TAO_ID_UNIQUENESSSTRATEGYUNIQUE_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/IdUniquenessStrategy.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 + class IdUniquenessStrategyUnique : public IdUniquenessStrategy { public: - IdUniquenessStrategyUnique (); + IdUniquenessStrategyUnique () = default; - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup (); + void strategy_cleanup () override; - virtual bool is_servant_activation_allowed ( - PortableServer::Servant servant, - bool &wait_occurred_restart_call); + bool is_servant_activation_allowed (PortableServer::Servant servant, bool &wait_occurred_restart_call) override; - virtual bool allow_multiple_activations () const; - - virtual ::PortableServer::IdUniquenessPolicyValue type() const; + bool allow_multiple_activations () const override; private: - TAO_Root_POA* poa_; + TAO_Root_POA* poa_ {}; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyUnique) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyUnique) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp deleted file mode 100644 index 71383493628..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h" -#include "tao/PortableServer/IdUniquenessStrategyUnique.h" -#include "ace/Dynamic_Service.h" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in IdUniquenessStrategyUniqueFactoryImpl")); - break; - } - } - - return strategy; - } - - void - IdUniquenessStrategyUniqueFactoryImpl::destroy ( - IdUniquenessStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h b/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h deleted file mode 100644 index f5dfc25b016..00000000000 --- a/TAO/tao/PortableServer/IdUniquenessStrategyUniqueFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file IdUniquenessStrategyUniqueFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, IdUniquenessStrategyUniqueFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IDUNIQUENESSSTRATEGYUNIQUEFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp deleted file mode 100644 index 3bc68da0d7e..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategy.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ImplicitActivationStrategy.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - ImplicitActivationStrategy::strategy_init (TAO_Root_POA * /*poa*/) - { - // dependent on type create the correct strategy. - } - - void - ImplicitActivationStrategy::strategy_cleanup () - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategy.h b/TAO/tao/PortableServer/ImplicitActivationStrategy.h index 491df8cf702..f1491cf6664 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategy.h +++ b/TAO/tao/PortableServer/ImplicitActivationStrategy.h @@ -12,7 +12,7 @@ #define TAO_ACTIVATION_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/orbconf.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -25,12 +25,10 @@ namespace TAO namespace Portable_Server { class ImplicitActivationStrategy - : public Policy_Strategy { public: - virtual void strategy_init(TAO_Root_POA *poa); - - virtual void strategy_cleanup(); + ImplicitActivationStrategy () = default; + virtual ~ImplicitActivationStrategy () = default; virtual bool allow_implicit_activation () const = 0; }; diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp index 98c308606d8..97762e51cb7 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.cpp @@ -15,17 +15,4 @@ namespace TAO } } -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) - TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h index 05846df574a..03a2663f6b3 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyExplicit.h @@ -12,35 +12,27 @@ #define TAO_IMPLICITACTIVATIONSTRATEGYEXPLICIT_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/ImplicitActivationStrategy.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 + class ImplicitActivationStrategyExplicit : public ImplicitActivationStrategy { public: - virtual bool allow_implicit_activation () const; + bool allow_implicit_activation () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyExplicit) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyExplicit) - TAO_END_VERSIONED_NAMESPACE_DECL - #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 f2d8514ef57..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactory.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 d9035f5bcae..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/ImplicitActivationStrategyImplicit.h" -#include "tao/PortableServer/ImplicitActivationStrategyExplicit.h" - -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::instance (strategy_name); - - if (strategy == 0) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_name)); - - return strategy; - } - - void - ImplicitActivationStrategyFactoryImpl::destroy ( - ImplicitActivationStrategy * /*strategy*/) - { - // Noop because both types are singletons - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h b/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h deleted file mode 100644 index 3ee40e3d8ba..00000000000 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ImplicitActivationStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_IMPLICITACTIVATIONSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp index 989dd133b88..5ff61d8362b 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.cpp @@ -16,19 +16,6 @@ namespace TAO } } -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) - TAO_END_VERSIONED_NAMESPACE_DECL #endif diff --git a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h index 68d0a997130..daa7ba096a9 100644 --- a/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h +++ b/TAO/tao/PortableServer/ImplicitActivationStrategyImplicit.h @@ -12,15 +12,12 @@ #define TAO_IMPLICITACTIVATIONSTRATEGYIMPLICIT_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/ImplicitActivationStrategy.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/ImplicitActivationStrategy.h" -#include "ace/Service_Config.h" - #if !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -29,18 +26,14 @@ namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export ImplicitActivationStrategyImplicit - : public ImplicitActivationStrategy + class ImplicitActivationStrategyImplicit : public ImplicitActivationStrategy { public: - virtual bool allow_implicit_activation () const; + bool allow_implicit_activation () const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ImplicitActivationStrategyImplicit) -ACE_FACTORY_DECLARE (TAO_PortableServer, ImplicitActivationStrategyImplicit) - TAO_END_VERSIONED_NAMESPACE_DECL #endif diff --git a/TAO/tao/PortableServer/LifespanStrategy.cpp b/TAO/tao/PortableServer/LifespanStrategy.cpp index e331e653adb..6ea71982149 100644 --- a/TAO/tao/PortableServer/LifespanStrategy.cpp +++ b/TAO/tao/PortableServer/LifespanStrategy.cpp @@ -14,11 +14,6 @@ namespace TAO { namespace Portable_Server { - LifespanStrategy::LifespanStrategy () : - poa_ (0) - { - } - void LifespanStrategy::strategy_init (TAO_Root_POA *poa) { @@ -28,7 +23,7 @@ namespace TAO void LifespanStrategy::strategy_cleanup () { - poa_ = 0; + poa_ = nullptr; } CORBA::ULong diff --git a/TAO/tao/PortableServer/LifespanStrategy.h b/TAO/tao/PortableServer/LifespanStrategy.h index 01a9a150dbd..ac034037f9f 100644 --- a/TAO/tao/PortableServer/LifespanStrategy.h +++ b/TAO/tao/PortableServer/LifespanStrategy.h @@ -12,17 +12,18 @@ #define TAO_PORTABLESERVER_LIFESPANPOLICY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/LifespanPolicyC.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 +class TAO_Root_POA; + namespace TAO { namespace Portable_Server @@ -30,10 +31,10 @@ namespace TAO class Temporary_Creation_Time; class LifespanStrategy - : public Policy_Strategy { public: - LifespanStrategy (); + LifespanStrategy () = default; + virtual ~LifespanStrategy () = default; virtual void strategy_init (TAO_Root_POA *poa); @@ -70,8 +71,6 @@ namespace TAO /// Check the state of the POA. virtual void check_state () = 0; - virtual ::PortableServer::LifespanPolicyValue type () const = 0; - virtual bool use_imr () const = 0; virtual CORBA::Object_ptr imr_key_to_object ( @@ -79,7 +78,7 @@ namespace TAO const char *type_id) const = 0; protected: - TAO_Root_POA *poa_; + TAO_Root_POA *poa_ {}; }; } /* namespace Portable_Server */ } /* namespace TAO */ diff --git a/TAO/tao/PortableServer/LifespanStrategyFactory.h b/TAO/tao/PortableServer/LifespanStrategyFactory.h deleted file mode 100644 index e60df4872d1..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactory.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 f66cdebd8b3..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.cpp +++ /dev/null @@ -1,90 +0,0 @@ -#include "tao/PortableServer/LifespanStrategyFactoryImpl.h" -#include "tao/PortableServer/LifespanStrategy.h" -#include "ace/Dynamic_Service.h" - -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::instance (strategy_name); - - if (strategy_factory != 0) - strategy = strategy_factory->create (value); - else - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_name)); - - - return strategy; - } - - void - LifespanStrategyFactoryImpl::destroy (LifespanStrategy *strategy) - { - switch (strategy->type ()) - { - case ::PortableServer::PERSISTENT : - { - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("LifespanStrategyPersistentFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - break; - } - case ::PortableServer::TRANSIENT : - { - LifespanStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("LifespanStrategyTransientFactory"); - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - break; - } - } - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h deleted file mode 100644 index b076007cd7a..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyFactoryImpl.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyFactoryImpl) - - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp index 62f681a6f18..32bb04a343c 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp @@ -127,12 +127,6 @@ namespace TAO this->poa_->tao_poa_manager().check_state (); } - ::PortableServer::LifespanPolicyValue - LifespanStrategyPersistent::type() const - { - return ::PortableServer::PERSISTENT; - } - bool LifespanStrategyPersistent::use_imr () const { diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.h b/TAO/tao/PortableServer/LifespanStrategyPersistent.h index 03d2075f81d..9b964c2b184 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.h +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.h @@ -34,33 +34,30 @@ namespace TAO public: LifespanStrategyPersistent (); - virtual void strategy_init(TAO_Root_POA *poa); + void strategy_init(TAO_Root_POA *poa) override; - virtual void notify_startup (); + void notify_startup () override; - virtual void notify_shutdown (); + void notify_shutdown () override; char key_type () const; - virtual CORBA::Boolean is_persistent () const; + CORBA::Boolean is_persistent () const override; CORBA::ULong key_length () const; - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); + void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) override; - virtual bool + bool validate (CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; + const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const override; /// Check the state of the POA. - virtual void check_state (); + void check_state () override; - virtual ::PortableServer::LifespanPolicyValue type() const; + bool use_imr () const override; - virtual bool use_imr () const; - - virtual CORBA::Object_ptr imr_key_to_object(const TAO::ObjectKey &key, - const char *type_id) const; + CORBA::Object_ptr imr_key_to_object(const TAO::ObjectKey &key, const char *type_id) const override; private: bool use_imr_; diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp deleted file mode 100644 index cd56cf99c58..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/LifespanStrategyPersistent.h" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in LifespanStrategyPersistentFactoryImpl")); - break; - } - } - - return strategy; - } - - void - LifespanStrategyPersistentFactoryImpl::destroy (LifespanStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h deleted file mode 100644 index 77fbcaa3466..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyPersistentFactoryImpl.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyPersistentFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyPersistentFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyPersistentFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYPERSISTENTFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.cpp b/TAO/tao/PortableServer/LifespanStrategyTransient.cpp index 268ea7b3546..eb6ed65faeb 100644 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.cpp +++ b/TAO/tao/PortableServer/LifespanStrategyTransient.cpp @@ -108,12 +108,6 @@ namespace TAO { return CORBA::Object::_nil(); } - - ::PortableServer::LifespanPolicyValue - LifespanStrategyTransient::type () const - { - return ::PortableServer::TRANSIENT; - } } /* namespace Portable_Server */ } /* namespace TAO */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransient.h b/TAO/tao/PortableServer/LifespanStrategyTransient.h index 161994e964a..5a3c7d988d5 100644 --- a/TAO/tao/PortableServer/LifespanStrategyTransient.h +++ b/TAO/tao/PortableServer/LifespanStrategyTransient.h @@ -27,40 +27,35 @@ namespace TAO { namespace Portable_Server { - class LifespanStrategyTransient - : public LifespanStrategy + class LifespanStrategyTransient : public LifespanStrategy { public: LifespanStrategyTransient (); - virtual void notify_startup (); + void notify_startup () override; - virtual void notify_shutdown (); + void notify_shutdown () override; char key_type () const; - virtual CORBA::Boolean is_persistent () const; + CORBA::Boolean is_persistent () const override; CORBA::ULong key_length () const; - virtual void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at); + void create_key (CORBA::Octet *buffer, CORBA::ULong& starting_at) override; - virtual bool validate (CORBA::Boolean is_persistent, - const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const; + const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const override; /// Check the state of the POA. - virtual void check_state (); + void check_state () override; - virtual ::PortableServer::LifespanPolicyValue type() const; + bool use_imr () const override; - virtual bool use_imr () const; - - virtual CORBA::Object_ptr imr_key_to_object (const TAO::ObjectKey &key, - const char *type_id) const; + CORBA::Object_ptr imr_key_to_object (const TAO::ObjectKey &key, const char *type_id) const override; private: - TAO::Portable_Server::Creation_Time creation_time_; + TAO::Portable_Server::Creation_Time const creation_time_; }; } /* namespace Portable_Server */ } /* namespace TAO */ diff --git a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp b/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp deleted file mode 100644 index 05b6c6b1e17..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.cpp +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/LifespanStrategyTransientFactoryImpl.h" -#include "ace/Dynamic_Service.h" -#include "tao/PortableServer/LifespanStrategyTransient.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - LifespanStrategy* - LifespanStrategyTransientFactoryImpl::create ( - ::PortableServer::LifespanPolicyValue value) - { - LifespanStrategy* strategy = 0; - - switch (value) - { - case ::PortableServer::PERSISTENT : - { - TAOLIB_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) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h b/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h deleted file mode 100644 index 1d90c3f23f5..00000000000 --- a/TAO/tao/PortableServer/LifespanStrategyTransientFactoryImpl.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file LifespanStrategyTransientFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, LifespanStrategyTransientFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, LifespanStrategyTransientFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* TAO_PORTABLESERVER_LIFEPSPANSTRATEGYTRANSIENTFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp index bc65cf1fbc3..77a78f08282 100644 --- a/TAO/tao/PortableServer/Object_Adapter.cpp +++ b/TAO/tao/PortableServer/Object_Adapter.cpp @@ -509,30 +509,30 @@ TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key) this->locate_poa (key, id, poa); PortableServer::Servant servant = 0; - TAO_SERVANT_LOCATION const servant_location = + TAO_Servant_Location const servant_location = poa->locate_servant_i (id, servant); switch (servant_location) { - case TAO_SERVANT_FOUND: + case TAO_Servant_Location::Found: // Optimistic attitude - case TAO_DEFAULT_SERVANT: - case TAO_SERVANT_MANAGER: + case TAO_Servant_Location::Default_Servant: + case TAO_Servant_Location::Servant_Manager: return 0; - case TAO_SERVANT_NOT_FOUND: + case TAO_Servant_Location::Not_Found: return -1; } return -1; } -TAO_SERVANT_LOCATION +TAO_Servant_Location TAO_Object_Adapter::find_servant_i (const TAO::ObjectKey &key, PortableServer::Servant &servant) { PortableServer::ObjectId id; - TAO_Root_POA *poa = 0; + TAO_Root_POA *poa = nullptr; this->locate_poa (key, id, poa); @@ -547,7 +547,7 @@ TAO_Object_Adapter::open () // If a POA extension hasn't changed the servant dispatcher, initialize the // default one. - if (this->servant_dispatcher_ == 0) + if (!this->servant_dispatcher_) { ACE_NEW (this->servant_dispatcher_, TAO_Default_Servant_Dispatcher); @@ -560,8 +560,7 @@ TAO_Object_Adapter::open () ::CORBA::PolicyList policy; PortableServer::POAManager_var poa_manager - = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME, - policy); + = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME, policy); #else PortableServer::POAManager_ptr poa_manager_ptr; ::CORBA::PolicyList policy_list; diff --git a/TAO/tao/PortableServer/Object_Adapter.h b/TAO/tao/PortableServer/Object_Adapter.h index c041333d425..4f534d8471b 100644 --- a/TAO/tao/PortableServer/Object_Adapter.h +++ b/TAO/tao/PortableServer/Object_Adapter.h @@ -92,7 +92,7 @@ public: int locate_servant (const TAO::ObjectKey &key); - TAO_SERVANT_LOCATION find_servant (const TAO::ObjectKey &key, + TAO_Servant_Location find_servant (const TAO::ObjectKey &key, PortableServer::Servant &servant); int find_poa (const poa_name &system_name, @@ -165,7 +165,7 @@ public: protected: int locate_servant_i (const TAO::ObjectKey &key); - TAO_SERVANT_LOCATION find_servant_i (const TAO::ObjectKey &key, + TAO_Servant_Location find_servant_i (const TAO::ObjectKey &key, PortableServer::Servant &servant); void dispatch_servant_i (const TAO::ObjectKey &key, diff --git a/TAO/tao/PortableServer/Object_Adapter.inl b/TAO/tao/PortableServer/Object_Adapter.inl index 7acba182498..7092ede9222 100644 --- a/TAO/tao/PortableServer/Object_Adapter.inl +++ b/TAO/tao/PortableServer/Object_Adapter.inl @@ -50,12 +50,12 @@ TAO_Object_Adapter::locate_servant (const TAO::ObjectKey &key) return this->locate_servant_i (key); } -ACE_INLINE TAO_SERVANT_LOCATION +ACE_INLINE TAO_Servant_Location TAO_Object_Adapter::find_servant (const TAO::ObjectKey &key, PortableServer::Servant &servant) { // Lock access for the duration of this transaction. - TAO_OBJECT_ADAPTER_GUARD_RETURN (TAO_SERVANT_NOT_FOUND); + TAO_OBJECT_ADAPTER_GUARD_RETURN (Not_Found); return this->find_servant_i (key, servant); } diff --git a/TAO/tao/PortableServer/Policy_Strategy.h b/TAO/tao/PortableServer/Policy_Strategy.h deleted file mode 100644 index 1acd9e71912..00000000000 --- a/TAO/tao/PortableServer/Policy_Strategy.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file Policy_Strategy.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#ifndef TAO_POLICY_STRATEGY_H -#define TAO_POLICY_STRATEGY_H -#include /**/ "ace/pre.h" - -#include "tao/orbconf.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/Service_Object.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) = 0; - - virtual void strategy_cleanup() = 0; - - virtual ~Policy_Strategy () {}; - }; - } -} - -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 index 42268bcdfec..8d2cd3f885c 100644 --- a/TAO/tao/PortableServer/PortableServer.cpp +++ b/TAO/tao/PortableServer/PortableServer.cpp @@ -1,152 +1,15 @@ #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" - TAO_BEGIN_VERSIONED_NAMESPACE_DECL int TAO_POA_Initializer::init () { - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategySystem); - -#if !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_IdAssignmentStrategyUser); -#endif /* CORBA_E_MICRO */ - -#if !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_IdUniquenessStrategyMultiple); -#endif /* CORBA_E_MICRO */ - - 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); - -#if !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - ACE_Service_Config::process_directive ( - ace_svc_desc_ImplicitActivationStrategyImplicit); -#endif /* CORBA_E_MICRO */ - - // Strategy factories - - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategyFactoryImpl); - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - ACE_Service_Config::process_directive ( - ace_svc_desc_ThreadStrategySingleFactoryImpl); -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyFactoryImpl); - -#if !defined (CORBA_E_MICRO) - ACE_Service_Config::process_directive ( - ace_svc_desc_LifespanStrategyPersistentFactoryImpl); -#endif /* CORBA_E_MICRO */ - - 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) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - 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) && !defined (CORBA_E_MICRO) && !defined (CORBA_E_COMPACT) - 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); + 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); + return ACE_Service_Config::process_directive (ace_svc_desc_TAO_Object_Adapter_Factory); } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/Regular_POA.cpp b/TAO/tao/PortableServer/Regular_POA.cpp index e47ea8010a6..867e819de30 100644 --- a/TAO/tao/PortableServer/Regular_POA.cpp +++ b/TAO/tao/PortableServer/Regular_POA.cpp @@ -28,10 +28,6 @@ TAO_Regular_POA::TAO_Regular_POA (const TAO_Root_POA::String &name, { } -TAO_Regular_POA::~TAO_Regular_POA () -{ -} - void TAO_Regular_POA::remove_from_parent_i () { diff --git a/TAO/tao/PortableServer/Regular_POA.h b/TAO/tao/PortableServer/Regular_POA.h index 9da69970431..e11f4a1d4fe 100644 --- a/TAO/tao/PortableServer/Regular_POA.h +++ b/TAO/tao/PortableServer/Regular_POA.h @@ -47,16 +47,16 @@ public: TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter); - virtual ~TAO_Regular_POA (); + ~TAO_Regular_POA () override = default; - PortableServer::POA_ptr the_parent (); + PortableServer::POA_ptr the_parent () override; protected: - virtual void remove_from_parent_i (); + void remove_from_parent_i () override; - virtual CORBA::Boolean root () const; + CORBA::Boolean root () const override; - virtual char root_key_type (); + char root_key_type () override; /// 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 diff --git a/TAO/tao/PortableServer/RequestProcessingStrategy.cpp b/TAO/tao/PortableServer/RequestProcessingStrategy.cpp index f564757c699..713b6a92e04 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategy.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategy.cpp @@ -14,20 +14,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategy::RequestProcessingStrategy () - : poa_ (0) - { - } - - void - RequestProcessingStrategy::strategy_init( - TAO_Root_POA *poa, - ::PortableServer::ServantRetentionPolicyValue sr_value) - { - poa_ = poa; - sr_value_ = sr_value; - } - void RequestProcessingStrategy::strategy_init(TAO_Root_POA *poa) { @@ -37,13 +23,7 @@ namespace TAO void RequestProcessingStrategy::strategy_cleanup() { - poa_ = 0; - } - - ::PortableServer::ServantRetentionPolicyValue - RequestProcessingStrategy::sr_type() const - { - return sr_value_; + poa_ = nullptr; } } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategy.h b/TAO/tao/PortableServer/RequestProcessingStrategy.h index 5378d1739a4..3a25f9182be 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategy.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategy.h @@ -12,13 +12,12 @@ #define TAO_REQUEST_PROCESSING_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/PortableServer.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 @@ -45,21 +44,16 @@ namespace TAO namespace Portable_Server { class RequestProcessingStrategy - : public Policy_Strategy { public: - RequestProcessingStrategy (); + RequestProcessingStrategy () = default; + virtual ~RequestProcessingStrategy () = default; virtual void strategy_init(TAO_Root_POA *poa); - virtual void strategy_init( - TAO_Root_POA *poa, - ::PortableServer::ServantRetentionPolicyValue); - virtual void strategy_cleanup(); #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - virtual PortableServer::ServantManager_ptr get_servant_manager () = 0; virtual void set_servant_manager ( @@ -68,10 +62,9 @@ namespace TAO virtual void set_servant (PortableServer::Servant servant) = 0; virtual PortableServer::Servant get_servant () = 0; - #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - virtual TAO_SERVANT_LOCATION locate_servant ( + virtual TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) = 0; @@ -101,13 +94,8 @@ namespace TAO 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_Root_POA* poa_ {}; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp index 9a77833ffe3..6d90a05f023 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.cpp @@ -12,12 +12,7 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyAOMOnly::RequestProcessingStrategyAOMOnly() - { - } - #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - PortableServer::ServantManager_ptr RequestProcessingStrategyAOMOnly::get_servant_manager () { @@ -43,10 +38,9 @@ namespace TAO { throw PortableServer::POA::WrongPolicy (); } - #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyAOMOnly::locate_servant ( const PortableServer::ObjectId & system_id, PortableServer::Servant & servant) @@ -141,13 +135,6 @@ namespace TAO const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) { } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyAOMOnly::type() const - { - return ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY; - } - } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h index 28718985f5f..011f360b876 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnly.h @@ -32,58 +32,49 @@ namespace TAO * * Request Processing Strategy which only uses the Active Object Map (AOM) */ - class RequestProcessingStrategyAOMOnly - : public RequestProcessingStrategy + class RequestProcessingStrategyAOMOnly : public RequestProcessingStrategy { public: - RequestProcessingStrategyAOMOnly (); + RequestProcessingStrategyAOMOnly () = default; #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) + PortableServer::ServantManager_ptr get_servant_manager () override; - PortableServer::ServantManager_ptr - get_servant_manager (); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); - - void set_servant (PortableServer::Servant servant); - - PortableServer::Servant get_servant (); + void set_servant (PortableServer::Servant servant) override; + PortableServer::Servant get_servant () override; #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */ - virtual - TAO_SERVANT_LOCATION + TAO_Servant_Location locate_servant (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - 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, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant system_id_to_servant ( + const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id); + PortableServer::Servant id_to_servant ( + const PortableServer::ObjectId &id) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_id (PortableServer::Servant servant) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp deleted file mode 100644 index 2bdb5d8ce17..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.cpp +++ /dev/null @@ -1,61 +0,0 @@ -// -*- C++ -*- -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyAOMOnlyFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyAOMOnlyFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h b/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h deleted file mode 100644 index c3bbc2407fb..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyAOMOnlyFactoryImpl.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyAOMOnlyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyAOMOnlyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyAOMOnlyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYAOMONLYFACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp index cd58b8697d9..97997f1baf6 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.cpp @@ -18,15 +18,10 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyDefaultServant::RequestProcessingStrategyDefaultServant () - : default_servant_ (0) - { - } - void RequestProcessingStrategyDefaultServant::strategy_cleanup() { - this->default_servant_ = 0; + this->default_servant_ = nullptr; } PortableServer::ServantManager_ptr @@ -63,7 +58,7 @@ namespace TAO // 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) + if (servant) { // A recursive thread lock without using a recursive thread // lock. Non_Servant_Upcall has a magic constructor and @@ -80,20 +75,20 @@ namespace TAO } } - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyDefaultServant::locate_servant ( const PortableServer::ObjectId & system_id, PortableServer::Servant & servant) { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; + TAO_Servant_Location location = TAO_Servant_Location::Not_Found; location = this->poa_->servant_present (system_id, servant); - if (location == TAO_SERVANT_NOT_FOUND) + if (location == TAO_Servant_Location::Not_Found) { - if (this->default_servant_.in () != 0) + if (this->default_servant_.in ()) { - location = TAO_DEFAULT_SERVANT; + location = TAO_Servant_Location::Default_Servant; } } @@ -108,13 +103,13 @@ namespace TAO TAO::Portable_Server::POA_Current_Impl &poa_current_impl, bool & /*wait_occurred_restart_call*/) { - PortableServer::Servant servant = 0; + PortableServer::Servant servant = nullptr; servant = this->poa_->find_servant (system_id, servant_upcall, poa_current_impl); - if (servant == 0) + if (!servant) { // If the POA has the USE_DEFAULT_SERVANT policy, a default servant // has been associated with the POA so the POA will invoke the @@ -122,7 +117,7 @@ namespace TAO // associated with the POA, the POA raises the OBJ_ADAPTER system // exception. PortableServer::Servant default_servant = this->default_servant_.in (); - if (default_servant == 0) + if (!default_servant) { throw ::CORBA::OBJ_ADAPTER ( CORBA::OMGVMCID | 3, @@ -144,7 +139,7 @@ namespace TAO { PortableServer::Servant servant = this->default_servant_.in (); - if (servant == 0) + if (!servant) { servant = this->poa_->find_servant (system_id); } @@ -158,7 +153,7 @@ namespace TAO { PortableServer::Servant servant = this->default_servant_.in (); - if (servant == 0) + if (!servant) { /* * If using default servant request processing strategy but @@ -239,12 +234,6 @@ namespace TAO const TAO::Portable_Server::Servant_Upcall &/*servant_upcall*/) { } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyDefaultServant::type() const - { - return ::PortableServer::USE_DEFAULT_SERVANT; - } } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h index e0c9f62f970..5318c0482a7 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServant.h @@ -37,52 +37,50 @@ namespace TAO : public RequestProcessingStrategy { public: - RequestProcessingStrategyDefaultServant (); + RequestProcessingStrategyDefaultServant () = default; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - PortableServer::Servant get_servant (); + PortableServer::Servant get_servant () override; - void set_servant (PortableServer::Servant servant); + void set_servant (PortableServer::Servant servant) override; - virtual TAO_SERVANT_LOCATION locate_servant ( + TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant locate_servant ( + 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, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant system_id_to_servant ( + const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id); + PortableServer::Servant id_to_servant ( + const PortableServer::ObjectId &id) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_id ( + PortableServer::Servant servant) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; private: - PortableServer::ServantBase_var default_servant_; + PortableServer::ServantBase_var default_servant_ {}; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp deleted file mode 100644 index b2a2250c04a..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyDefaultServantFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyDefaultServantFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 3fd7f737609..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyDefaultServantFI.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyDefaultServantFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyDefaultServantFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 24b9a9c8767..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactory.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 bd18a086ce7..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#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" - -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::instance ("RequestProcessingStrategyAOMOnlyFactory"); - - break; - } - case ::PortableServer::USE_DEFAULT_SERVANT : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyDefaultServantFactory"); - - break; - } - case ::PortableServer::USE_SERVANT_MANAGER : - { -#if (TAO_HAS_MINIMUM_POA == 0) - switch (srvalue) - { - case ::PortableServer::RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantActivatorFactory"); - - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantLocatorFactory"); - - break; - } - } -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - break; - } - } - - if (strategy_factory != 0) - strategy = strategy_factory->create (value, srvalue); - else - TAOLIB_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) - { - RequestProcessingStrategyFactory *strategy_factory = 0; - - switch (strategy->type ()) - { - case ::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyAOMOnlyFactory"); - - break; - } - case ::PortableServer::USE_DEFAULT_SERVANT : - { - strategy_factory = - ACE_Dynamic_Service::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::instance ("RequestProcessingStrategyServantActivatorFactory"); - - break; - } - case ::PortableServer::NON_RETAIN : - { - strategy_factory = - ACE_Dynamic_Service::instance ("RequestProcessingStrategyServantLocatorFactory"); - break; - } - } -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - break; - } - } - - if (strategy_factory != 0) - { - strategy_factory->destroy (strategy); - } - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h b/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h deleted file mode 100644 index 96ee26cf106..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyFactoryImpl.h +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_REQUESTPROCESSINGSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp index 2ba133bb309..e07d39daf81 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.cpp @@ -17,11 +17,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyServantActivator::RequestProcessingStrategyServantActivator () : - etherealize_objects_ (true) - { - } - void RequestProcessingStrategyServantActivator::strategy_cleanup () { @@ -61,20 +56,20 @@ namespace TAO this->validate_servant_manager (this->servant_activator_.in ()); } - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyServantActivator::locate_servant ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { - TAO_SERVANT_LOCATION location = TAO_SERVANT_NOT_FOUND; + TAO_Servant_Location location = TAO_Servant_Location::Not_Found; location = this->poa_->servant_present (system_id, servant); - if (location == TAO_SERVANT_NOT_FOUND) + if (location == TAO_Servant_Location::Not_Found) { if (!CORBA::is_nil (this->servant_activator_.in ())) { - location = TAO_SERVANT_MANAGER; + location = TAO_Servant_Location::Servant_Manager; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h index c7675ae80a0..7d41bcf6b6f 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivator.h @@ -34,34 +34,34 @@ namespace TAO : public RequestProcessingStrategyServantManager { public: - RequestProcessingStrategyServantActivator (); + RequestProcessingStrategyServantActivator () = default; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - virtual TAO_SERVANT_LOCATION locate_servant ( + TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant locate_servant ( + 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, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; private: PortableServer::Servant incarnate_servant ( @@ -73,7 +73,7 @@ namespace TAO private: PortableServer::ServantActivator_var servant_activator_; - CORBA::Boolean etherealize_objects_; + CORBA::Boolean etherealize_objects_ { true }; }; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp deleted file mode 100644 index 9d25c652d3a..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantActivatorFactoryImpl")); - break; - } - } - break; - } - default : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantActivatorFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyServantActivatorFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#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 b5bb15a8f98..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantActivatorFI.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantActivatorFI.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyServantActivatorFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyServantActivatorFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 index 01458939b75..40f660c33ee 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.cpp @@ -17,10 +17,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyServantLocator::RequestProcessingStrategyServantLocator () - { - } - void RequestProcessingStrategyServantLocator::strategy_cleanup() { @@ -60,19 +56,18 @@ namespace TAO this->validate_servant_manager (this->servant_locator_.in ()); } - TAO_SERVANT_LOCATION + TAO_Servant_Location RequestProcessingStrategyServantLocator::locate_servant ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { - TAO_SERVANT_LOCATION location = - this->poa_->servant_present (system_id, servant); + TAO_Servant_Location location = this->poa_->servant_present (system_id, servant); - if (location == TAO_SERVANT_NOT_FOUND) + if (location == TAO_Servant_Location::Not_Found) { if (!CORBA::is_nil (this->servant_locator_.in ())) { - location = TAO_SERVANT_MANAGER; + location = TAO_Servant_Location::Servant_Manager; } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h index 9cff43232f2..c6f8c3a4ff6 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocator.h @@ -34,34 +34,34 @@ namespace TAO : public RequestProcessingStrategyServantManager { public: - RequestProcessingStrategyServantLocator (); + RequestProcessingStrategyServantLocator () = default; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - PortableServer::ServantManager_ptr get_servant_manager (); + PortableServer::ServantManager_ptr get_servant_manager () override; - void set_servant_manager (PortableServer::ServantManager_ptr imgr); + void set_servant_manager (PortableServer::ServantManager_ptr imgr) override; - virtual TAO_SERVANT_LOCATION locate_servant ( + TAO_Servant_Location locate_servant ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual void post_invoke_servant_cleanup( + void post_invoke_servant_cleanup( const PortableServer::ObjectId &system_id, - const TAO::Portable_Server::Servant_Upcall &servant_upcall); + const TAO::Portable_Server::Servant_Upcall &servant_upcall) override; - virtual PortableServer::Servant locate_servant ( + 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, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void cleanup_servant ( + void cleanup_servant ( PortableServer::Servant servant, - const PortableServer::ObjectId &user_id); + const PortableServer::ObjectId &user_id) override; - virtual void etherealize_objects (CORBA::Boolean etherealize_objects); + void etherealize_objects (CORBA::Boolean etherealize_objects) override; private: PortableServer::ServantLocator_var servant_locator_; diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp b/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp deleted file mode 100644 index 9da757ce489..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// -*- C++ -*- -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl")); - break; - } - case ::PortableServer::NON_RETAIN : - { - ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantLocator, 0); - break; - } - } - break; - } - default : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl")); - break; - } - } - - return strategy; - } - - void - RequestProcessingStrategyServantLocatorFactoryImpl::destroy ( - RequestProcessingStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 a114844ac8f..00000000000 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file RequestProcessingStrategyServantLocatorFI.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, RequestProcessingStrategyServantLocatorFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, RequestProcessingStrategyServantLocatorFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 index 6454c9ff55b..476258bcf68 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.cpp @@ -14,10 +14,6 @@ namespace TAO { namespace Portable_Server { - RequestProcessingStrategyServantManager::RequestProcessingStrategyServantManager () - { - } - PortableServer::Servant RequestProcessingStrategyServantManager::get_servant () { @@ -63,12 +59,6 @@ namespace TAO { return this->poa_->user_id_to_servant_i (id); } - - ::PortableServer::RequestProcessingPolicyValue - RequestProcessingStrategyServantManager::type() const - { - return ::PortableServer::USE_SERVANT_MANAGER; - } } } diff --git a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h index 420d9441072..65438cb07f7 100644 --- a/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h +++ b/TAO/tao/PortableServer/RequestProcessingStrategyServantManager.h @@ -33,25 +33,20 @@ namespace TAO : public RequestProcessingStrategy { public: - RequestProcessingStrategyServantManager (); + RequestProcessingStrategyServantManager () = default; - PortableServer::Servant get_servant (); + PortableServer::Servant get_servant () override; - void set_servant (PortableServer::Servant servant); + void set_servant (PortableServer::Servant servant) override; - void validate_servant_manager ( + virtual void validate_servant_manager ( PortableServer::ServantManager_ptr servant_manager); - virtual PortableServer::Servant system_id_to_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant system_id_to_servant (const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant id_to_servant ( - const PortableServer::ObjectId &id); + PortableServer::Servant id_to_servant (const PortableServer::ObjectId &id) override; - virtual PortableServer::ObjectId *servant_to_id ( - PortableServer::Servant servant); - - virtual ::PortableServer::RequestProcessingPolicyValue type() const; + PortableServer::ObjectId *servant_to_id (PortableServer::Servant servant) override; }; } } diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index a2ea413e806..049f891a4bf 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -258,11 +258,9 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, // 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) + if (ACE_OS::strcmp (this->name_.c_str (), TAO_DEFAULT_ROOTPOA_NAME) == 0) { - this->cached_policies_.implicit_activation - (PortableServer::IMPLICIT_ACTIVATION); + this->cached_policies_.implicit_activation (PortableServer::IMPLICIT_ACTIVATION); } #endif /* TAO_HAS_MINIMUM_POA == 1 */ @@ -270,7 +268,7 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, this->active_policy_strategies_.update (this->cached_policies_, this); TAO::Portable_Server::Active_Policy_Strategies_Cleanup_Guard aps_cleanup_guard ( - &this->active_policy_strategies_); + std::addressof(this->active_policy_strategies_)); // Set the folded name of this POA. this->set_folded_name (parent); @@ -2189,7 +2187,7 @@ TAO_Root_POA::client_exposed_policies (CORBA::Short /* object_priority */) return policies._retn (); } -TAO_SERVANT_LOCATION +TAO_Servant_Location TAO_Root_POA::locate_servant_i (const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { @@ -2197,7 +2195,7 @@ TAO_Root_POA::locate_servant_i (const PortableServer::ObjectId &system_id, locate_servant (system_id, servant); } -TAO_SERVANT_LOCATION +TAO_Servant_Location TAO_Root_POA::servant_present (const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) { diff --git a/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h index 317e4ce67f5..812a4b7d00e 100644 --- a/TAO/tao/PortableServer/Root_POA.h +++ b/TAO/tao/PortableServer/Root_POA.h @@ -391,7 +391,7 @@ public: PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id); - TAO_SERVANT_LOCATION servant_present ( + TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant); @@ -620,7 +620,7 @@ protected: PortableInterceptor::ObjectReferenceFactory *current_factory); - TAO_SERVANT_LOCATION locate_servant_i (const PortableServer::ObjectId &id, + TAO_Servant_Location locate_servant_i (const PortableServer::ObjectId &id, PortableServer::Servant &servant); PortableServer::Servant locate_servant_i ( diff --git a/TAO/tao/PortableServer/ServantRetentionStrategy.cpp b/TAO/tao/PortableServer/ServantRetentionStrategy.cpp new file mode 100644 index 00000000000..81c33e627da --- /dev/null +++ b/TAO/tao/PortableServer/ServantRetentionStrategy.cpp @@ -0,0 +1,23 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ServantRetentionStrategy.cpp + */ +//============================================================================= + +#include "tao/PortableServer/ServantRetentionStrategy.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ + namespace Portable_Server + { + ServantRetentionStrategy::ServantRetentionStrategy () + { + } + } /* namespace Portable_Server */ +} /* namespace TAO */ + +TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ServantRetentionStrategy.h b/TAO/tao/PortableServer/ServantRetentionStrategy.h index 6873a3b8028..700616953f8 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategy.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategy.h @@ -12,13 +12,12 @@ #define TAO_SERVANTRETENTIONSTRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/Servant_Location.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" @@ -34,15 +33,21 @@ namespace TAO namespace Portable_Server { class ServantRetentionStrategy - : public Policy_Strategy { public: + ServantRetentionStrategy (); + virtual ~ServantRetentionStrategy () = default; + + virtual void strategy_init (TAO_Root_POA *poa); + + virtual void strategy_cleanup(); + virtual CORBA::ULong waiting_servant_deactivation () const = 0; virtual int is_servant_in_map (PortableServer::Servant servant, bool &wait_occurred_restart_call) = 0; - virtual TAO_SERVANT_LOCATION servant_present ( + virtual TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) = 0; diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h b/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h deleted file mode 100644 index dce8425c22b..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactory.h +++ /dev/null @@ -1,47 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 71fa991e79a..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.cpp +++ /dev/null @@ -1,95 +0,0 @@ -// -*- C++ -*- -#include "tao/PortableServer/ServantRetentionStrategyFactoryImpl.h" -#include "tao/PortableServer/ServantRetentionStrategy.h" -#include "tao/debug.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -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::instance (strategy_factory_name); - - if (strategy_factory == 0) - { - if (TAO_debug_level > 1) - TAOLIB_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR, Unable to get %C\n"), - strategy_factory_name)); - - return 0; - } - - return strategy_factory->create (value); - } - - void - ServantRetentionStrategyFactoryImpl::destroy ( - ServantRetentionStrategy *strategy) - { - 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::instance (strategy_factory_name); - - if (servantretention_strategy_factory != 0) - { - servantretention_strategy_factory->destroy (strategy); - } - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL - diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h deleted file mode 100644 index e73ae1ff4d5..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp index e4e39fbe4bd..7fd93860d12 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.cpp @@ -24,12 +24,6 @@ namespace TAO { namespace Portable_Server { - ServantRetentionStrategyNonRetain::ServantRetentionStrategyNonRetain () : - poa_ (0), - sys_id_count_ (0) - { - } - void ServantRetentionStrategyNonRetain::strategy_init (TAO_Root_POA *poa) { @@ -39,7 +33,7 @@ namespace TAO void ServantRetentionStrategyNonRetain::strategy_cleanup () { - poa_ = 0; + poa_ = nullptr; } void @@ -87,12 +81,12 @@ namespace TAO throw PortableServer::POA::WrongPolicy (); } - TAO_SERVANT_LOCATION + TAO_Servant_Location ServantRetentionStrategyNonRetain::servant_present ( const PortableServer::ObjectId &/*system_id*/, PortableServer::Servant &/*servant*/) { - return TAO_SERVANT_NOT_FOUND; + return TAO_Servant_Location::Not_Found; } PortableServer::Servant diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h index 8d2e46f5336..3365ec714fd 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetain.h @@ -33,97 +33,88 @@ namespace TAO : public ServantRetentionStrategy { public: - ServantRetentionStrategyNonRetain (); + ServantRetentionStrategyNonRetain () = default; - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup(); + void strategy_cleanup() override; CORBA::ULong waiting_servant_deactivation () const; - virtual PortableServer::ObjectId * activate_object (PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void deactivate_object (const PortableServer::ObjectId &id); + void deactivate_object (const PortableServer::ObjectId &id) override; - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant find_servant ( + const PortableServer::ObjectId &system_id) override; - virtual int is_servant_in_map (PortableServer::Servant servant, - bool &wait_occurred_restart_call); + int is_servant_in_map (PortableServer::Servant servant, + bool &wait_occurred_restart_call) override; - virtual PortableServer::ObjectId *system_id_to_object_id ( - const PortableServer::ObjectId &system_id); + PortableServer::ObjectId *system_id_to_object_id ( + const PortableServer::ObjectId &system_id) override; - virtual PortableServer::Servant - user_id_to_servant (const PortableServer::ObjectId &id); + user_id_to_servant (const PortableServer::ObjectId &id) override; CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, bool indirect); - virtual TAO_SERVANT_LOCATION servant_present ( + TAO_Servant_Location servant_present ( const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant find_servant ( + 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); + TAO::Portable_Server::POA_Current_Impl &poa_current_impl) override; - virtual int find_servant_priority ( + int find_servant_priority ( const PortableServer::ObjectId &system_id, - CORBA::Short &priority); + CORBA::Short &priority) override; - virtual void deactivate_all_objects (); + void deactivate_all_objects () override; - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_user_id (PortableServer::Servant servant) override; - virtual CORBA::Object_ptr servant_to_reference ( - PortableServer::Servant servant); + CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant) override; - virtual CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority); + CORBA::Object_ptr create_reference (const char *intf, CORBA::Short priority) override; #if !defined (CORBA_E_MICRO) - virtual CORBA::Object_ptr create_reference_with_id ( + CORBA::Object_ptr create_reference_with_id ( const PortableServer::ObjectId &oid, const char *intf, - CORBA::Short priority); + CORBA::Short priority) override; #endif - virtual int rebind_using_user_id_and_system_id ( + 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); + TAO::Portable_Server::Servant_Upcall &servant_upcall) override; - virtual CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); + CORBA::Boolean servant_has_remaining_activations (PortableServer::Servant servant) override; - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id); + int unbind_using_user_id (const PortableServer::ObjectId &user_id) override; - virtual ::PortableServer::ServantRetentionPolicyValue type() const; + ::PortableServer::ServantRetentionPolicyValue type() const override; - virtual TAO_Active_Object_Map * get_active_object_map() const; + TAO_Active_Object_Map * get_active_object_map() const override; protected: - TAO_Root_POA *poa_; - std::atomic sys_id_count_; + TAO_Root_POA *poa_ {}; + std::atomic sys_id_count_ { 0 }; }; } } diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp deleted file mode 100644 index 5d5881e9582..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ServantRetentionStrategyNonRetainFactoryImpl::destroy ( - ServantRetentionStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 && !CORBA_E_COMPACT && !CORBA_E_MICRO */ diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h deleted file mode 100644 index f4003e80207..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyNonRetainFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyNonRetainFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyNonRetainFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 index efcd7935078..292e13dfcd2 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.cpp @@ -26,13 +26,6 @@ namespace TAO { namespace Portable_Server { - ServantRetentionStrategyRetain::ServantRetentionStrategyRetain () : - ServantRetentionStrategyNonRetain (), - active_object_map_ (), - waiting_servant_deactivation_ (0) - { - } - void ServantRetentionStrategyRetain::strategy_init (TAO_Root_POA *poa) { @@ -234,7 +227,7 @@ namespace TAO } } - TAO_SERVANT_LOCATION + TAO_Servant_Location ServantRetentionStrategyRetain::servant_present ( const PortableServer::ObjectId &system_id, PortableServer::Servant &servant) @@ -256,11 +249,11 @@ namespace TAO if (result == 0) { // Success - return TAO_SERVANT_FOUND; + return TAO_Servant_Location::Found; } else { - return TAO_SERVANT_NOT_FOUND; + return TAO_Servant_Location::Not_Found; } } @@ -961,13 +954,6 @@ namespace TAO return this->active_object_map_->remaining_activations (servant); } - - ::PortableServer::ServantRetentionPolicyValue - ServantRetentionStrategyRetain::type() const - { - return ::PortableServer::RETAIN; - } - TAO_Active_Object_Map * ServantRetentionStrategyRetain::get_active_object_map() const { diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h index a475bdb69ac..22eefd38cd1 100644 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h +++ b/TAO/tao/PortableServer/ServantRetentionStrategyRetain.h @@ -18,7 +18,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/Auto_Ptr.h" +#include "tao/PortableServer/Active_Object_Map.h" +#include TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -32,82 +33,67 @@ namespace TAO : public ServantRetentionStrategyNonRetain { public: - ServantRetentionStrategyRetain (); + ServantRetentionStrategyRetain () = default; - CORBA::ULong waiting_servant_deactivation () const; + CORBA::ULong waiting_servant_deactivation () const override; - virtual void strategy_init (TAO_Root_POA *poa); + void strategy_init (TAO_Root_POA *poa) override; - virtual void strategy_cleanup(); + void strategy_cleanup() override; - virtual int is_servant_in_map (PortableServer::Servant servant, - bool &wait_occurred_restart_call); + int is_servant_in_map (PortableServer::Servant servant, + bool &wait_occurred_restart_call) override; - virtual PortableServer::ObjectId * activate_object (PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - virtual void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant servant, CORBA::Short priority, - bool &wait_occurred_restart_call); + bool &wait_occurred_restart_call) override; - void deactivate_object (const PortableServer::ObjectId &id); + void deactivate_object (const PortableServer::ObjectId &id) override; - virtual PortableServer::Servant find_servant ( - const PortableServer::ObjectId &system_id); + PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id) override; - virtual PortableServer::ObjectId * system_id_to_object_id ( - const PortableServer::ObjectId &system_id); + PortableServer::ObjectId * system_id_to_object_id (const PortableServer::ObjectId &system_id) override; - virtual - PortableServer::Servant - user_id_to_servant (const PortableServer::ObjectId &id); + PortableServer::Servant user_id_to_servant (const PortableServer::ObjectId &id) override; CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &id, - bool indirect); + bool indirect) override; - virtual - TAO_SERVANT_LOCATION + TAO_Servant_Location servant_present (const PortableServer::ObjectId &system_id, - PortableServer::Servant &servant); + PortableServer::Servant &servant) override; - virtual PortableServer::Servant find_servant ( + 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); + TAO::Portable_Server::POA_Current_Impl &poa_current_impl) override; - virtual int find_servant_priority ( + int find_servant_priority ( const PortableServer::ObjectId &system_id, - CORBA::Short &priority); + CORBA::Short &priority) override; - virtual void deactivate_all_objects (); + void deactivate_all_objects () override; - virtual PortableServer::ObjectId *servant_to_user_id ( - PortableServer::Servant servant); + PortableServer::ObjectId *servant_to_user_id (PortableServer::Servant servant) override; - virtual - CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant); + CORBA::Object_ptr servant_to_reference (PortableServer::Servant servant) override; - virtual - CORBA::Object_ptr create_reference ( - const char *intf, - CORBA::Short priority); + CORBA::Object_ptr create_reference (const char *intf, CORBA::Short priority) override; #if !defined (CORBA_E_MICRO) - virtual CORBA::Object_ptr create_reference_with_id ( const PortableServer::ObjectId &oid, const char *intf, - CORBA::Short priority); + CORBA::Short priority) override; #endif - virtual ::PortableServer::ServantRetentionPolicyValue type() const; - protected: int is_user_id_in_map (const PortableServer::ObjectId &id, @@ -122,25 +108,23 @@ namespace TAO PortableServer::Servant p_servant, CORBA::Short &priority); - 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); + TAO::Portable_Server::Servant_Upcall &servant_upcall) override; - virtual CORBA::Boolean servant_has_remaining_activations ( - PortableServer::Servant servant); + PortableServer::Servant servant) override; - virtual int unbind_using_user_id ( - const PortableServer::ObjectId &user_id); + int unbind_using_user_id ( + const PortableServer::ObjectId &user_id) override; TAO_Active_Object_Map * get_active_object_map() const; private: std::unique_ptr active_object_map_; - CORBA::ULong waiting_servant_deactivation_; + CORBA::ULong waiting_servant_deactivation_ { 0 } ; }; } } diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp b/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp deleted file mode 100644 index ab5b254407c..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// -*- C++ -*- -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ServantRetentionStrategyRetainFactoryImpl::destroy ( - ServantRetentionStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h b/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h deleted file mode 100644 index 1a2d964250a..00000000000 --- a/TAO/tao/PortableServer/ServantRetentionStrategyRetainFactoryImpl.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ServantRetentionStrategyRetainFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ServantRetentionStrategyRetainFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ServantRetentionStrategyRetainFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_SERVANTRETENTIONSTRATEGYRETAIN_FACTORYIMPL_H*/ diff --git a/TAO/tao/PortableServer/Servant_Location.h b/TAO/tao/PortableServer/Servant_Location.h index 2946650b2bf..e9eefbaac43 100644 --- a/TAO/tao/PortableServer/Servant_Location.h +++ b/TAO/tao/PortableServer/Servant_Location.h @@ -8,8 +8,8 @@ */ //============================================================================= -#ifndef TAO_SERVANT_LOCATION_H -#define TAO_SERVANT_LOCATION_H +#ifndef TAO_Servant_Location_H +#define TAO_Servant_Location_H #include /**/ "ace/pre.h" @@ -23,16 +23,16 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -enum TAO_SERVANT_LOCATION +enum class TAO_Servant_Location { - TAO_SERVANT_FOUND, - TAO_DEFAULT_SERVANT, - TAO_SERVANT_MANAGER, - TAO_SERVANT_NOT_FOUND + Found, + Default_Servant, + Servant_Manager, + Not_Found }; TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" -#endif /* TAO_SERVANT_LOCATION_H */ +#endif /* TAO_Servant_Location_H */ diff --git a/TAO/tao/PortableServer/Servant_Upcall.cpp b/TAO/tao/PortableServer/Servant_Upcall.cpp index ecad0576c2e..ae36b5d7486 100644 --- a/TAO/tao/PortableServer/Servant_Upcall.cpp +++ b/TAO/tao/PortableServer/Servant_Upcall.cpp @@ -403,7 +403,7 @@ namespace TAO ex._tao_print_exception ("TAO_POA::~complete_destruction_i"); } - this->poa_ = 0; + this->poa_ = nullptr; } } } diff --git a/TAO/tao/PortableServer/ThreadStrategy.cpp b/TAO/tao/PortableServer/ThreadStrategy.cpp deleted file mode 100644 index 647081f0660..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategy.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "tao/PortableServer/ThreadStrategy.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - void - ThreadStrategy::strategy_init (TAO_Root_POA * /*poa*/) - { - } - - void - ThreadStrategy::strategy_cleanup () - { - } - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategy.h b/TAO/tao/PortableServer/ThreadStrategy.h index 289c9dcd214..6ad68bcb0cd 100644 --- a/TAO/tao/PortableServer/ThreadStrategy.h +++ b/TAO/tao/PortableServer/ThreadStrategy.h @@ -12,13 +12,12 @@ #define TAO_THREAD_STRATEGY_H #include /**/ "ace/pre.h" -#include "tao/PortableServer/Policy_Strategy.h" +#include "tao/PortableServer/ThreadPolicyC.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 @@ -28,18 +27,14 @@ namespace TAO namespace Portable_Server { class ThreadStrategy - : public Policy_Strategy { public: + ThreadStrategy () = default; + virtual ~ThreadStrategy () = default; + virtual int enter () = 0; virtual int exit () = 0; - - void strategy_init (TAO_Root_POA *poa) override; - - void strategy_cleanup() override; - - virtual ::PortableServer::ThreadPolicyValue type() const = 0; }; } } diff --git a/TAO/tao/PortableServer/ThreadStrategyFactory.h b/TAO/tao/PortableServer/ThreadStrategyFactory.h deleted file mode 100644 index bac43806fa1..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactory.h +++ /dev/null @@ -1,49 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyFactory.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) = 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 908513d3cb4..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "tao/PortableServer/ThreadStrategyFactoryImpl.h" -#include "tao/PortableServer/ThreadStrategy.h" -#include "ace/Dynamic_Service.h" -#include "ace/Log_Msg.h" - -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::instance ("ThreadStrategySingleFactory"); - - if (strategy_factory) - { - strategy = strategy_factory->create (value); - } - else - TAOLIB_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::instance ("ThreadStrategyORBControl"); - - if (!strategy) - TAOLIB_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) - { - switch (strategy->type ()) - { - case ::PortableServer::SINGLE_THREAD_MODEL : - { - ThreadStrategyFactory *strategy_factory = - ACE_Dynamic_Service::instance ("ThreadStrategySingleFactory"); - - if (strategy_factory) - { - strategy_factory->destroy (strategy); - } - break; - } - case ::PortableServer::ORB_CTRL_MODEL : - { - // Noop - break; - } - } - } - } -} - -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) - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h b/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h deleted file mode 100644 index 666793af2fd..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategyFactoryImpl.h +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategyFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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 - ThreadStrategy* create (::PortableServer::ThreadPolicyValue value) override; - - void destroy (ThreadStrategy *strategy) override; - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategyFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategyFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICYSTRATEGYFACTORYIMPL_H */ diff --git a/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp b/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp index aa99de625fe..bdd833456cd 100644 --- a/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp +++ b/TAO/tao/PortableServer/ThreadStrategyORBControl.cpp @@ -19,25 +19,7 @@ namespace TAO { return 0; } - - ::PortableServer::ThreadPolicyValue - ThreadStrategyORBControl::type () const - { - return ::PortableServer::ORB_CTRL_MODEL; - } } } -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) TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/PortableServer/ThreadStrategyORBControl.h b/TAO/tao/PortableServer/ThreadStrategyORBControl.h index 1bf7c0cf336..af3db329d0c 100644 --- a/TAO/tao/PortableServer/ThreadStrategyORBControl.h +++ b/TAO/tao/PortableServer/ThreadStrategyORBControl.h @@ -13,15 +13,13 @@ #include /**/ "ace/pre.h" -#include "tao/PortableServer/portableserver_export.h" +#include "tao/PortableServer/ThreadStrategy.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 @@ -29,22 +27,16 @@ namespace TAO { namespace Portable_Server { - class ThreadStrategyORBControl - : public ThreadStrategy + class ThreadStrategyORBControl : public ThreadStrategy { public: int enter () override; int exit () override; - - ::PortableServer::ThreadPolicyValue type() const override; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategyORBControl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategyORBControl) - TAO_END_VERSIONED_NAMESPACE_DECL #include /**/ "ace/post.h" diff --git a/TAO/tao/PortableServer/ThreadStrategySingle.cpp b/TAO/tao/PortableServer/ThreadStrategySingle.cpp index 6f58c76f9ec..08f0dba3b63 100644 --- a/TAO/tao/PortableServer/ThreadStrategySingle.cpp +++ b/TAO/tao/PortableServer/ThreadStrategySingle.cpp @@ -3,7 +3,6 @@ #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) #include "tao/PortableServer/ThreadStrategySingle.h" -#include "ace/Dynamic_Service.h" #include "ace/Log_Msg.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -23,27 +22,9 @@ namespace TAO { return lock_.release(); } - - ::PortableServer::ThreadPolicyValue - ThreadStrategySingle::type() const - { - return ::PortableServer::SINGLE_THREAD_MODEL; - } } } -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) TAO_END_VERSIONED_NAMESPACE_DECL #endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingle.h b/TAO/tao/PortableServer/ThreadStrategySingle.h index 87962311eb7..29baed0bedb 100644 --- a/TAO/tao/PortableServer/ThreadStrategySingle.h +++ b/TAO/tao/PortableServer/ThreadStrategySingle.h @@ -38,24 +38,18 @@ namespace TAO { namespace Portable_Server { - class TAO_PortableServer_Export ThreadStrategySingle : - public ThreadStrategy + class ThreadStrategySingle : public ThreadStrategy { public: int enter () override; int exit () override; - - ::PortableServer::ThreadPolicyValue type() const override; private: TAO_SYNCH_RECURSIVE_MUTEX lock_; }; } } -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategySingle) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategySingle) - TAO_END_VERSIONED_NAMESPACE_DECL #endif /* TAO_HAS_MINIMUM_POA == 0 */ diff --git a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp b/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp deleted file mode 100644 index 8b9f2a898d2..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "tao/orbconf.h" - -#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -#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" - -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 : - { - TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ThreadStrategySingleFactoryImpl")); - break; - } - } - - return strategy; - } - - void - ThreadStrategySingleFactoryImpl::destroy (ThreadStrategy *strategy) - { - strategy->strategy_cleanup (); - - delete strategy; - } - } -} - -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) -TAO_END_VERSIONED_NAMESPACE_DECL - -#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 2dbf0a018bc..00000000000 --- a/TAO/tao/PortableServer/ThreadStrategySingleFactoryImpl.h +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ThreadStrategySingleFactoryImpl.h - * - * @author Johnny Willemsen - */ -//============================================================================= - -#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) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - namespace Portable_Server - { - class ThreadStrategySingleFactoryImpl - : public ThreadStrategyFactory - { - public: - /// Create a new thread strategy - ThreadStrategy* create (::PortableServer::ThreadPolicyValue value) override; - - void destroy (ThreadStrategy *strategy) override; - }; - } -} - -ACE_STATIC_SVC_DECLARE_EXPORT (TAO_PortableServer, ThreadStrategySingleFactoryImpl) -ACE_FACTORY_DECLARE (TAO_PortableServer, ThreadStrategySingleFactoryImpl) - -TAO_END_VERSIONED_NAMESPACE_DECL - -#endif /* TAO_HAS_MINIMUM_POA == 0 */ - -#include /**/ "ace/post.h" -#endif /* TAO_PORTABLESERVER_THREADPOLICYSINGLESTRATEGYFACTORYIMPL_H*/ -- cgit v1.2.1