RequestProcessingStrategyServantLocatorFI.cpp

Go to the documentation of this file.
00001 // $Id: RequestProcessingStrategyServantLocatorFI.cpp 76898 2007-02-04 18:58:07Z johnnyw $
00002 
00003 #include "tao/orbconf.h"
00004 
00005 ACE_RCSID (PortableServer,
00006            RequestProcessingStrategyServantLocatorFactoryImpl,
00007            "$Id: RequestProcessingStrategyServantLocatorFI.cpp 76898 2007-02-04 18:58:07Z johnnyw $")
00008 
00009 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00010 
00011 #include "tao/PortableServer/RequestProcessingStrategyServantLocatorFI.h"
00012 #include "tao/PortableServer/RequestProcessingStrategy.h"
00013 #include "tao/PortableServer/RequestProcessingStrategyServantLocator.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     RequestProcessingStrategy*
00024     RequestProcessingStrategyServantLocatorFactoryImpl::create (
00025       ::PortableServer::RequestProcessingPolicyValue value,
00026       ::PortableServer::ServantRetentionPolicyValue srvalue)
00027     {
00028       RequestProcessingStrategy* strategy = 0;
00029 
00030       switch (value)
00031       {
00032         case ::PortableServer::USE_SERVANT_MANAGER :
00033         {
00034           switch (srvalue)
00035           {
00036             case ::PortableServer::RETAIN :
00037             {
00038               ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl"));
00039               break;
00040             }
00041             case ::PortableServer::NON_RETAIN :
00042             {
00043               ACE_NEW_RETURN (strategy, RequestProcessingStrategyServantLocator, 0);
00044               break;
00045             }
00046           }
00047           break;
00048         }
00049         default :
00050         {
00051           ACE_ERROR ((LM_ERROR, "Incorrect type in RequestProcessingStrategyServantLocatorFactoryImpl"));
00052           break;
00053         }
00054       }
00055 
00056       return strategy;
00057     }
00058 
00059     void
00060     RequestProcessingStrategyServantLocatorFactoryImpl::destroy (
00061       RequestProcessingStrategy *strategy)
00062     {
00063       strategy->strategy_cleanup ();
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 Tue Feb 2 17:40:54 2010 for TAO_PortableServer by  doxygen 1.4.7