本文整理汇总了C++中portableserver::POA_var::the_activator方法的典型用法代码示例。如果您正苦于以下问题:C++ POA_var::the_activator方法的具体用法?C++ POA_var::the_activator怎么用?C++ POA_var::the_activator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::POA_var
的用法示例。
在下文中一共展示了POA_var::the_activator方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: policies
CORBA::Boolean
ImR_Adapter::unknown_adapter (PortableServer::POA_ptr parent,
const char *name)
{
ACE_ASSERT (! CORBA::is_nil(parent));
ACE_ASSERT (name != 0);
CORBA::PolicyList policies (3);
const char *exception_message = "Null Message";
policies.length (3);
try
{
// Servant Retention Policy
exception_message = "While PortableServer::POA::create_servant_retention_policy";
policies[0] =
parent->create_servant_retention_policy (PortableServer::NON_RETAIN);
// Request Processing Policy
exception_message = "While PortableServer::POA::create_request_processing_policy";
policies[1] =
parent->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT);
policies[2] =
parent->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID);
PortableServer::POAManager_var poa_manager =
parent->the_POAManager ();
exception_message = "While create_POA";
PortableServer::POA_var child =
parent->create_POA (name,
poa_manager.in (),
policies);
exception_message = "While policy->destroy";
for (CORBA::ULong i = 0; i < policies.length (); ++i)
{
CORBA::Policy_ptr policy = policies[i];
policy->destroy ();
}
exception_message = "While child->the_activator";
child->the_activator (this);
exception_message = "While set_servant";
child->set_servant (this->default_servant_);
}
catch (const CORBA::Exception& ex)
{
ORBSVCS_ERROR ((LM_ERROR,
"IMR_Adapter_Activator::unknown_adapter - %s\n",
exception_message));
ex._tao_print_exception ("System Exception");
return 0;
}
// Finally, now everything is fine
return 1;
}
示例2: reference_counted_test_i
CORBA::Boolean
Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent,
const char *name)
{
if (ACE_OS::strcmp (name, "firstPOA") == 0)
{
PortableServer::POA_var child = parent->create_POA (name,
this->poa_manager_.in (),
this->first_poa_policies_);
// Creation of firstPOA is over. Destroy the Policy objects.
for (CORBA::ULong i = 0;
i < this->first_poa_policies_.length ();
++i)
{
this->first_poa_policies_[i]->destroy ();
}
child->the_activator (this);
reference_counted_test_i *servant =
new reference_counted_test_i (this->orb_.in (),
child.in ());
child->set_servant (servant);
// This means that the ownership of <servant> now belongs to the
// POA.
servant->_remove_ref ();
// Finally everything is fine
return 1;
}
else if (ACE_OS::strcmp (name, "secondPOA") == 0)
{
PortableServer::POA_var child = parent->create_POA (name,
this->poa_manager_.in (),
this->second_poa_policies_);
// Creation of secondPOA is over. Destroy the Policy objects.
for (CORBA::ULong i = 0;
i < this->second_poa_policies_.length ();
++i)
{
this->second_poa_policies_[i]->destroy ();
}
reference_counted_test_i *servant =
new reference_counted_test_i (this->orb_.in (),
child.in ());
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId ("third test");
child->activate_object_with_id (oid.in (),
servant);
// This means that the ownership of <servant> now belongs to the
// POA.
servant->_remove_ref ();
// Finally everything is fine
return 1;
}
else
{
// Unknown POA.
return 0;
}
}