ServantRetentionStrategyNonRetainFactoryImpl.cpp

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

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