More tests update
[ACE_TAO.git] / TAO / tests / POA / FindPOA / Adapter_Activator.cpp
blob21ccbf46fe1f95bb759bec31d9a0c4b1d814bae1
1 // -*- C++ -*-
2 #include "Adapter_Activator.h"
4 #if (TAO_HAS_MINIMUM_POA == 0)
5 #if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
7 #include "tao/PortableServer/POAManagerC.h"
8 #include "tao/PortableServer/PortableServer.h"
10 Adapter_Activator::Adapter_Activator (
11 PortableServer::POAManager_ptr pm)
12 : poa_manager_ (PortableServer::POAManager::_duplicate (pm))
16 CORBA::Boolean
17 Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent,
18 const char *name)
20 // Default policies
21 CORBA::PolicyList default_policies;
23 // This assumes that the lock on the parent is recursive
24 PortableServer::POA_var child =
25 parent->create_POA (name, this->poa_manager_.in (), default_policies);
27 try
29 child->the_activator (this);
31 catch (const ::CORBA::Exception&)
33 (void) child->destroy (1, 1);
35 return false;
38 // Finally everything is fine
39 return true;
42 #endif
43 #endif /* TAO_HAS_MINIMUM_POA == 0 */