#include <Adapter_Activator.h>
Inheritance diagram for ImR_Adapter:
Public Member Functions | |
ImR_Adapter () | |
virtual CORBA::Boolean | unknown_adapter (PortableServer::POA_ptr parent, const char *name) |
Called when a POA needs to be created. | |
void | init (PortableServer::ServantLocator_ptr servant) |
Private Attributes | |
PortableServer::ServantLocator_ptr | servant_locator_ |
The ServantLocator registered in each new POA. |
|
Definition at line 16 of file Adapter_Activator.cpp.
00017 : servant_locator_ (0) 00018 { 00019 } |
|
Definition at line 22 of file Adapter_Activator.cpp. Referenced by ImR_Locator_i::init_with_orb().
00023 { 00024 servant_locator_ = servant; 00025 } |
|
Called when a POA needs to be created.
Definition at line 28 of file Adapter_Activator.cpp. References ACE_ASSERT, ACE_ERROR, and LM_ERROR.
00030 { 00031 ACE_ASSERT (! CORBA::is_nil(parent)); 00032 ACE_ASSERT (name != 0); 00033 CORBA::PolicyList policies (2); 00034 policies.length (2); 00035 00036 const char *exception_message = "Null Message"; 00037 00038 try 00039 { 00040 // Servant Retention Policy 00041 exception_message = "While PortableServer::POA::create_servant_retention_policy"; 00042 policies[0] = 00043 parent->create_servant_retention_policy (PortableServer::NON_RETAIN); 00044 00045 // Request Processing Policy 00046 exception_message = "While PortableServer::POA::create_request_processing_policy"; 00047 policies[1] = 00048 parent->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER); 00049 00050 PortableServer::POAManager_var poa_manager = 00051 parent->the_POAManager (); 00052 00053 exception_message = "While create_POA"; 00054 PortableServer::POA_var child = 00055 parent->create_POA (name, 00056 poa_manager.in (), 00057 policies); 00058 00059 exception_message = "While unknown_adapter::policy->destroy"; 00060 for (CORBA::ULong i = 0; i < policies.length (); ++i) 00061 { 00062 CORBA::Policy_ptr policy = policies[i]; 00063 policy->destroy (); 00064 } 00065 00066 exception_message = "While child->the_activator"; 00067 child->the_activator (this); 00068 00069 exception_message = "While unknown_adapter, set_servant_manager"; 00070 child->set_servant_manager (this->servant_locator_); 00071 } 00072 catch (const CORBA::Exception& ex) 00073 { 00074 ACE_ERROR ((LM_ERROR, 00075 "IMR_Adapter_Activator::unknown_adapter - %s\n", 00076 exception_message)); 00077 ex._tao_print_exception ("System Exception"); 00078 return 0; 00079 } 00080 00081 // Finally, now everything is fine 00082 return 1; 00083 } |
|
The ServantLocator registered in each new POA.
Definition at line 54 of file Adapter_Activator.h. |