Public Member Functions

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.

    {
      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;
        }
      }
    }


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines