TAO::Portable_Server::ThreadStrategyFactoryImpl Class Reference

#include <ThreadStrategyFactoryImpl.h>

Inheritance diagram for TAO::Portable_Server::ThreadStrategyFactoryImpl:

Inheritance graph
[legend]
Collaboration diagram for TAO::Portable_Server::ThreadStrategyFactoryImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ThreadStrategycreate (::PortableServer::ThreadPolicyValue value)
 Create a new servant retention strategy.
virtual void destroy (ThreadStrategy *strategy)
 Cleanup the given strategy instance.

Detailed Description

Definition at line 32 of file ThreadStrategyFactoryImpl.h.


Member Function Documentation

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.

References ACE_ERROR, ACE_TEXT(), TAO::Portable_Server::ThreadStrategyFactory::create(), ACE_Dynamic_Service< TYPE >::instance(), and LM_ERROR.

00021     {
00022       ThreadStrategy* strategy = 0;
00023 
00024       switch (value)
00025       {
00026         case ::PortableServer::SINGLE_THREAD_MODEL :
00027         {
00028           ThreadStrategyFactory *strategy_factory =
00029             ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategySingleFactory");
00030 
00031           if (strategy_factory != 0)
00032             strategy = strategy_factory->create (value);
00033           else
00034             ACE_ERROR ((LM_ERROR,
00035                         ACE_TEXT ("(%P|%t) %p\n"),
00036                         ACE_TEXT ("ERROR, Unable to get ")
00037                         ACE_TEXT ("ThreadStrategySingleFactory")));
00038 
00039           break;
00040         }
00041         case ::PortableServer::ORB_CTRL_MODEL :
00042         {
00043           strategy =
00044             ACE_Dynamic_Service<ThreadStrategy>::instance ("ThreadStrategyORBControl");
00045 
00046           if (strategy == 0)
00047             ACE_ERROR ((LM_ERROR,
00048                         ACE_TEXT ("(%P|%t) %p\n"),
00049                         ACE_TEXT ("ERROR, Unable to get ")
00050                         ACE_TEXT ("ThreadStrategyORBControl")));
00051 
00052           break;
00053         }
00054       }
00055 
00056       return strategy;
00057     }

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.

References TAO::Portable_Server::ThreadStrategy::type().

00063     {
00064       switch (strategy->type ())
00065       {
00066         case ::PortableServer::SINGLE_THREAD_MODEL :
00067         {
00068           ThreadStrategyFactory *strategy_factory =
00069             ACE_Dynamic_Service<ThreadStrategyFactory>::instance ("ThreadStrategySingleFactory");
00070 
00071           if (strategy_factory != 0)
00072             {
00073               strategy_factory->destroy (strategy);
00074             }
00075           break;
00076         }
00077         case ::PortableServer::ORB_CTRL_MODEL :
00078         {
00079           // Noop
00080           break;
00081         }
00082       }
00083     }


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:41:53 2010 for TAO_PortableServer by  doxygen 1.4.7