#include <ThreadStrategyFactoryImpl.h>
Public Member Functions | |
virtual ThreadStrategy * | create (::PortableServer::ThreadPolicyValue value) |
Create a new servant retention strategy. | |
virtual void | destroy (ThreadStrategy *strategy) |
Cleanup the given strategy instance. |
Definition at line 32 of file ThreadStrategyFactoryImpl.h.
ThreadStrategy * TAO::Portable_Server::ThreadStrategyFactoryImpl::create | ( | ::PortableServer::ThreadPolicyValue | value | ) | [virtual] |
Create a new servant retention strategy.
Implements TAO::Portable_Server::ThreadStrategyFactory.
Definition at line 19 of file ThreadStrategyFactoryImpl.cpp.
{ ThreadStrategy* strategy = 0; switch (value) { case ::PortableServer::SINGLE_THREAD_MODEL : { ThreadStrategyFactory *strategy_factory = ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategySingleFactory"); if (strategy_factory != 0) strategy = strategy_factory->create (value); else ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("ERROR, Unable to get ") ACE_TEXT ("ThreadStrategySingleFactory"))); break; } case ::PortableServer::ORB_CTRL_MODEL : { strategy = ACE_Dynamic_Service<ThreadStrategy>::instance ("ThreadStrategyORBControl"); if (strategy == 0) ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("ERROR, Unable to get ") ACE_TEXT ("ThreadStrategyORBControl"))); break; } } return strategy; }
void TAO::Portable_Server::ThreadStrategyFactoryImpl::destroy | ( | ThreadStrategy * | strategy | ) | [virtual] |
Cleanup the given strategy instance.
Implements TAO::Portable_Server::ThreadStrategyFactory.
Definition at line 60 of file ThreadStrategyFactoryImpl.cpp.
{ switch (strategy->type ()) { case ::PortableServer::SINGLE_THREAD_MODEL : { ThreadStrategyFactory *strategy_factory = ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategySingleFactory"); if (strategy_factory != 0) { strategy_factory->destroy (strategy); } break; } case ::PortableServer::ORB_CTRL_MODEL : { // Noop break; } } }