00001
00002
00003 #include "tao/PortableServer/RequestProcessingStrategyDefaultServantFI.h"
00004 #include "tao/PortableServer/RequestProcessingStrategy.h"
00005 #include "tao/PortableServer/RequestProcessingStrategyDefaultServant.h"
00006 #include "ace/Dynamic_Service.h"
00007 #include "ace/Log_Msg.h"
00008
00009 ACE_RCSID (PortableServer,
00010 RequestProcessingStrategyDefaultServantFI,
00011 "RequestProcessingStrategyDefaultServantFI.cpp,v 1.8 2006/06/20 07:15:16 jwillemsen Exp")
00012
00013 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00014
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016
00017 namespace TAO
00018 {
00019 namespace Portable_Server
00020 {
00021 RequestProcessingStrategy*
00022 RequestProcessingStrategyDefaultServantFactoryImpl::create (
00023 ::PortableServer::RequestProcessingPolicyValue value,
00024 ::PortableServer::ServantRetentionPolicyValue )
00025 {
00026 RequestProcessingStrategy* strategy = 0;
00027
00028 switch (value)
00029 {
00030 case ::PortableServer::USE_DEFAULT_SERVANT :
00031 {
00032 ACE_NEW_RETURN (strategy, RequestProcessingStrategyDefaultServant, 0);
00033 break;
00034 }
00035 default :
00036 {
00037 ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyDefaultServantFactoryImpl"));
00038 break;
00039 }
00040 }
00041
00042 return strategy;
00043 }
00044
00045 void
00046 RequestProcessingStrategyDefaultServantFactoryImpl::destroy (
00047 RequestProcessingStrategy *strategy
00048 ACE_ENV_ARG_DECL)
00049 {
00050 strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER);
00051 ACE_CHECK;
00052
00053 delete strategy;
00054 }
00055 }
00056 }
00057
00058 TAO_END_VERSIONED_NAMESPACE_DECL
00059
00060 ACE_STATIC_SVC_DEFINE (
00061 RequestProcessingStrategyDefaultServantFactoryImpl,
00062 ACE_TEXT ("RequestProcessingStrategyDefaultServantFactory"),
00063 ACE_SVC_OBJ_T,
00064 &ACE_SVC_NAME (RequestProcessingStrategyDefaultServantFactoryImpl),
00065 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00066 0)
00067
00068 ACE_FACTORY_NAMESPACE_DEFINE (
00069 ACE_Local_Service,
00070 RequestProcessingStrategyDefaultServantFactoryImpl,
00071 TAO::Portable_Server::RequestProcessingStrategyDefaultServantFactoryImpl)
00072
00073
00074 #endif
00075