ServantRetentionStrategyNonRetainFactoryImpl.cpp

Go to the documentation of this file.
00001 // ServantRetentionStrategyNonRetainFactoryImpl.cpp,v 1.8 2006/03/10 07:19:16 jtc Exp
00002 
00003 #include "tao/PortableServer/ServantRetentionStrategyNonRetainFactoryImpl.h"
00004 #include "tao/PortableServer/ServantRetentionStrategy.h"
00005 #include "tao/PortableServer/ServantRetentionStrategyNonRetain.h"
00006 #include "ace/Dynamic_Service.h"
00007 #include "ace/Log_Msg.h"
00008 
00009 ACE_RCSID (PortableServer,
00010            ServantRetentionStrategyNonRetainFactoryImpl,
00011            "ServantRetentionStrategyNonRetainFactoryImpl.cpp,v 1.8 2006/03/10 07:19:16 jtc Exp")
00012 
00013 #if (TAO_HAS_MINIMUM_POA == 0)
00014 
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016 
00017 namespace TAO
00018 {
00019   namespace Portable_Server
00020   {
00021     ServantRetentionStrategy*
00022     ServantRetentionStrategyNonRetainFactoryImpl::create (
00023       ::PortableServer::ServantRetentionPolicyValue value)
00024     {
00025       ServantRetentionStrategy* strategy = 0;
00026 
00027       switch (value)
00028       {
00029         case ::PortableServer::NON_RETAIN :
00030         {
00031           ACE_NEW_RETURN (strategy, ServantRetentionStrategyNonRetain, 0);
00032           break;
00033         }
00034         case ::PortableServer::RETAIN :
00035         {
00036           ACE_ERROR ((LM_ERROR, "Incorrect type in ServantRetentionStrategyNonRetainFactoryImpl"));
00037           break;
00038         }
00039       }
00040 
00041       return strategy;
00042     }
00043 
00044     void
00045     ServantRetentionStrategyNonRetainFactoryImpl::destroy (
00046       ServantRetentionStrategy *strategy
00047       ACE_ENV_ARG_DECL)
00048     {
00049       strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER);
00050       ACE_CHECK;
00051 
00052       delete strategy;
00053     }
00054   }
00055 }
00056 
00057 TAO_END_VERSIONED_NAMESPACE_DECL
00058 
00059 ACE_STATIC_SVC_DEFINE (
00060   ServantRetentionStrategyNonRetainFactoryImpl,
00061   ACE_TEXT ("ServantRetentionStrategyNonRetainFactory"),
00062   ACE_SVC_OBJ_T,
00063   &ACE_SVC_NAME (ServantRetentionStrategyNonRetainFactoryImpl),
00064   ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00065   0)
00066 
00067 ACE_FACTORY_NAMESPACE_DEFINE (
00068   ACE_Local_Service,
00069   ServantRetentionStrategyNonRetainFactoryImpl,
00070   TAO::Portable_Server::ServantRetentionStrategyNonRetainFactoryImpl)
00071 
00072 #endif /* TAO_HAS_MINIMUM_POA == 0 */

Generated on Thu Nov 9 12:40:44 2006 for TAO_PortableServer by doxygen 1.3.6