Updated logging to include the class/method so that it is more obvious where these...
[ACE_TAO.git] / TAO / tao / PortableServer / ThreadStrategySingleFactoryImpl.cpp
blob8b9f2a898d2a2311e8623bde220c84f0f8058996
1 #include "tao/orbconf.h"
3 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
5 #include "tao/PortableServer/ThreadStrategySingleFactoryImpl.h"
6 #include "tao/PortableServer/ThreadStrategy.h"
7 #include "tao/PortableServer/ThreadStrategySingle.h"
8 #include "ace/Dynamic_Service.h"
9 #include "ace/Log_Msg.h"
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 namespace TAO
15 namespace Portable_Server
17 ThreadStrategy*
18 ThreadStrategySingleFactoryImpl::create (
19 ::PortableServer::ThreadPolicyValue value)
21 ThreadStrategy* strategy = 0;
23 switch (value)
25 case ::PortableServer::SINGLE_THREAD_MODEL :
27 ACE_NEW_RETURN (strategy, ThreadStrategySingle, 0);
28 break;
30 case ::PortableServer::ORB_CTRL_MODEL :
32 TAOLIB_ERROR ((LM_ERROR, "Incorrect type in ThreadStrategySingleFactoryImpl"));
33 break;
37 return strategy;
40 void
41 ThreadStrategySingleFactoryImpl::destroy (ThreadStrategy *strategy)
43 strategy->strategy_cleanup ();
45 delete strategy;
50 ACE_STATIC_SVC_DEFINE (
51 ThreadStrategySingleFactoryImpl,
52 ACE_TEXT ("ThreadStrategySingleFactory"),
53 ACE_SVC_OBJ_T,
54 &ACE_SVC_NAME (ThreadStrategySingleFactoryImpl),
55 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
58 ACE_FACTORY_NAMESPACE_DEFINE (
59 ACE_Local_Service,
60 ThreadStrategySingleFactoryImpl,
61 TAO::Portable_Server::ThreadStrategySingleFactoryImpl)
62 TAO_END_VERSIONED_NAMESPACE_DECL
64 #endif /* TAO_HAS_MINIMUM_POA == 0 */