RequestProcessingStrategyServantLocatorFI.cpp

Go to the documentation of this file.
00001 // RequestProcessingStrategyServantLocatorFI.cpp,v 1.8 2006/06/20 07:15:16 jwillemsen Exp
00002 
00003 #include "tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h"
00004 #include "tao/PortableServer/RequestProcessingStrategy.h"
00005 #include "tao/PortableServer/RequestProcessingStrategyServantLocator.h"
00006 #include "ace/Dynamic_Service.h"
00007 #include "ace/Log_Msg.h"
00008 
00009 ACE_RCSID (PortableServer,
00010            RequestProcessingStrategyServantLocatorFactoryImpl,
00011            "RequestProcessingStrategyServantLocatorFI.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     RequestProcessingStrategyServantLocatorFactoryImpl::create (
00023       ::PortableServer::RequestProcessingPolicyValue value,
00024       ::PortableServer::ServantRetentionPolicyValue srvalue)
00025     {
00026       RequestProcessingStrategy* strategy = 0;
00027 
00028       switch (value)
00029       {
00030         case ::PortableServer::USE_SERVANT_MANAGER :
00031         {
00032           switch (srvalue)
00033           {
00034             case ::PortableServer::RETAIN :
00035             {
00036               ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl"));
00037               break;
00038             }
00039             case ::PortableServer::NON_RETAIN :
00040             {
00041               ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantLocator, 0);
00042               break;
00043             }
00044           }
00045           break;
00046         }
00047         default :
00048         {
00049           ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl"));
00050           break;
00051         }
00052       }
00053 
00054       return strategy;
00055     }
00056 
00057     void
00058     RequestProcessingStrategyServantLocatorFactoryImpl::destroy (
00059       RequestProcessingStrategy *strategy
00060       ACE_ENV_ARG_DECL)
00061     {
00062       strategy->strategy_cleanup (ACE_ENV_SINGLE_ARG_PARAMETER);
00063       ACE_CHECK;
00064 
00065       delete strategy;
00066     }
00067   }
00068 }
00069 
00070 TAO_END_VERSIONED_NAMESPACE_DECL
00071 
00072 ACE_STATIC_SVC_DEFINE (
00073   RequestProcessingStrategyServantLocatorFactoryImpl,
00074   ACE_TEXT ("RequestProcessingStrategyServantLocatorFactory"),
00075   ACE_SVC_OBJ_T,
00076   &ACE_SVC_NAME (RequestProcessingStrategyServantLocatorFactoryImpl),
00077   ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00078   0)
00079 
00080 ACE_FACTORY_NAMESPACE_DEFINE (
00081   ACE_Local_Service,
00082   RequestProcessingStrategyServantLocatorFactoryImpl,
00083   TAO::Portable_Server::RequestProcessingStrategyServantLocatorFactoryImpl)
00084 
00085 
00086 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00087 

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