ImplicitActivationStrategyFactoryImpl.cpp

Go to the documentation of this file.
00001 // $Id: ImplicitActivationStrategyFactoryImpl.cpp 76551 2007-01-24 13:42:44Z johnnyw $
00002 
00003 #include "tao/PortableServer/ImplicitActivationStrategyFactoryImpl.h"
00004 #include "ace/Dynamic_Service.h"
00005 #include "tao/PortableServer/ImplicitActivationStrategyImplicit.h"
00006 #include "tao/PortableServer/ImplicitActivationStrategyExplicit.h"
00007 
00008 ACE_RCSID (PortableServer,
00009            ImplicitActivationStrategyFactoryImpl,
00010            "$Id: ImplicitActivationStrategyFactoryImpl.cpp 76551 2007-01-24 13:42:44Z johnnyw $")
00011 
00012 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00013 
00014 namespace TAO
00015 {
00016   namespace Portable_Server
00017   {
00018     ImplicitActivationStrategy*
00019     ImplicitActivationStrategyFactoryImpl::create (
00020       ::PortableServer::ImplicitActivationPolicyValue value)
00021     {
00022       ImplicitActivationStrategy* strategy = 0;
00023       const char * strategy_name = 0;
00024 
00025       switch (value)
00026       {
00027         case ::PortableServer::IMPLICIT_ACTIVATION :
00028         {
00029           strategy_name = "ImplicitActivationStrategyImplicit";
00030           break;
00031         }
00032         case ::PortableServer::NO_IMPLICIT_ACTIVATION :
00033         {
00034           strategy_name = "ImplicitActivationStrategyExplicit";
00035           break;
00036         }
00037       }
00038 
00039       strategy =
00040         ACE_Dynamic_Service<ImplicitActivationStrategy>::instance (strategy_name);
00041 
00042       if (strategy == 0)
00043         ACE_ERROR ((LM_ERROR,
00044                     ACE_TEXT ("(%P|%t) ERROR, Unable to get %s\n"),
00045                     strategy_name));
00046 
00047       return strategy;
00048     }
00049 
00050     void
00051     ImplicitActivationStrategyFactoryImpl::destroy (
00052       ImplicitActivationStrategy * /*strategy*/
00053       )
00054     {
00055       // Noop because both types are singletons
00056     }
00057   }
00058 }
00059 
00060 TAO_END_VERSIONED_NAMESPACE_DECL
00061 
00062 ACE_FACTORY_NAMESPACE_DEFINE (
00063   ACE_Local_Service,
00064   ImplicitActivationStrategyFactoryImpl,
00065   TAO_VERSIONED_NAMESPACE_NAME::TAO::Portable_Server::ImplicitActivationStrategyFactoryImpl)
00066 
00067 
00068 ACE_STATIC_SVC_DEFINE (
00069   ImplicitActivationStrategyFactoryImpl,
00070   ACE_TEXT ("ImplicitActivationStrategyFactory"),
00071   ACE_SVC_OBJ_T,
00072   &ACE_SVC_NAME (ImplicitActivationStrategyFactoryImpl),
00073   ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00074   0)
00075 

Generated on Tue Feb 2 17:40:54 2010 for TAO_PortableServer by  doxygen 1.4.7