#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) throw (CORBA::SystemException) |
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_ANY_EXCEPTION, ACE_ASSERT, ACE_CATCHANY, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_ERROR, ACE_PRINT_EXCEPTION, ACE_TRY, ACE_TRY_CHECK, TAO::unbounded_object_reference_sequence< Policy, Policy_var >::length(), and LM_ERROR.
00032 { 00033 ACE_ASSERT (! CORBA::is_nil(parent)); 00034 ACE_ASSERT (name != 0); 00035 CORBA::PolicyList policies (2); 00036 policies.length (2); 00037 00038 const char *exception_message = "Null Message"; 00039 00040 ACE_TRY 00041 { 00042 // Servant Retention Policy 00043 exception_message = "While PortableServer::POA::create_servant_retention_policy"; 00044 policies[0] = 00045 parent->create_servant_retention_policy (PortableServer::NON_RETAIN ACE_ENV_ARG_PARAMETER); 00046 ACE_TRY_CHECK; 00047 00048 // Request Processing Policy 00049 exception_message = "While PortableServer::POA::create_request_processing_policy"; 00050 policies[1] = 00051 parent->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER ACE_ENV_ARG_PARAMETER); 00052 ACE_TRY_CHECK; 00053 00054 PortableServer::POAManager_var poa_manager = 00055 parent->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); 00056 ACE_TRY_CHECK; 00057 00058 exception_message = "While create_POA"; 00059 PortableServer::POA_var child = 00060 parent->create_POA (name, 00061 poa_manager.in (), 00062 policies 00063 ACE_ENV_ARG_PARAMETER); 00064 ACE_TRY_CHECK; 00065 00066 exception_message = "While unknown_adapter::policy->destroy"; 00067 for (CORBA::ULong i = 0; i < policies.length (); ++i) 00068 { 00069 CORBA::Policy_ptr policy = policies[i]; 00070 policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); 00071 ACE_TRY_CHECK; 00072 } 00073 00074 exception_message = "While child->the_activator"; 00075 child->the_activator (this ACE_ENV_ARG_PARAMETER); 00076 ACE_TRY_CHECK; 00077 00078 exception_message = "While unknown_adapter, set_servant_manager"; 00079 child->set_servant_manager (this->servant_locator_ ACE_ENV_ARG_PARAMETER); 00080 ACE_TRY_CHECK; 00081 } 00082 ACE_CATCHANY 00083 { 00084 ACE_ERROR ((LM_ERROR, 00085 "IMR_Adapter_Activator::unknown_adapter - %s\n", 00086 exception_message)); 00087 ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "System Exception"); 00088 return 0; 00089 } 00090 ACE_ENDTRY; 00091 00092 // Finally, now everything is fine 00093 return 1; 00094 } |
|
The ServantLocator registered in each new POA.
Definition at line 56 of file Adapter_Activator.h. |