2 //=============================================================================
4 * @file Adapter_Activator.cpp
6 * @author Darrell Brunsch <brunsch@cs.wustl.edu>
8 //=============================================================================
10 #include "Adapter_Activator.h"
12 #include "orbsvcs/Log_Macros.h"
13 #include "tao/PortableServer/Servant_Base.h"
15 ImR_Adapter::ImR_Adapter (void)
16 : default_servant_ (0)
21 ImR_Adapter::init (TAO_ServantBase
* servant
)
23 default_servant_
= servant
;
27 ImR_Adapter::unknown_adapter (PortableServer::POA_ptr parent
,
30 ACE_ASSERT (! CORBA::is_nil(parent
));
31 ACE_ASSERT (name
!= 0);
32 CORBA::PolicyList
policies (3);
34 const char *exception_message
= "Null Message";
38 // Servant Retention Policy
39 exception_message
= "While PortableServer::POA::create_servant_retention_policy";
41 parent
->create_servant_retention_policy (PortableServer::NON_RETAIN
);
43 // Request Processing Policy
44 exception_message
= "While PortableServer::POA::create_request_processing_policy";
47 parent
->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT
);
49 parent
->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID
);
51 PortableServer::POAManager_var poa_manager
=
52 parent
->the_POAManager ();
54 exception_message
= "While create_POA";
55 PortableServer::POA_var child
=
56 parent
->create_POA (name
,
60 exception_message
= "While policy->destroy";
61 for (CORBA::ULong i
= 0; i
< policies
.length (); ++i
)
63 CORBA::Policy_ptr policy
= policies
[i
];
67 exception_message
= "While child->the_activator";
68 child
->the_activator (this);
70 exception_message
= "While set_servant";
71 child
->set_servant (this->default_servant_
);
73 catch (const CORBA::Exception
& ex
)
75 ORBSVCS_ERROR ((LM_ERROR
,
76 "IMR_Adapter_Activator::unknown_adapter - %C\n",
78 ex
._tao_print_exception ("System Exception");
82 // Finally, now everything is fine