本文整理汇总了C++中portableserver::POA_ptr::the_POAManager方法的典型用法代码示例。如果您正苦于以下问题:C++ POA_ptr::the_POAManager方法的具体用法?C++ POA_ptr::the_POAManager怎么用?C++ POA_ptr::the_POAManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::POA_ptr
的用法示例。
在下文中一共展示了POA_ptr::the_POAManager方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Test_i::Test_i (CORBA::Short server_num,
Terminator &terminator,
PortableServer::POA_ptr pa,
PortableServer::POA_ptr pb)
: mgr_a (pa->the_POAManager ()),
mgr_b (pb->the_POAManager ()),
server_num_ (server_num),
terminator_ (terminator)
{
}
示例2:
void
TAO_Notify_POA_Helper::create_i (
PortableServer::POA_ptr parent_poa,
const char* poa_name,
CORBA::PolicyList &policy_list)
{
PortableServer::POAManager_var manager =
parent_poa->the_POAManager ();
// Create the child POA.
this->poa_ = parent_poa->create_POA (poa_name, manager.in (), policy_list);
if (DEBUG_LEVEL > 0)
{
CORBA::String_var the_name = this->poa_->the_name ();
ORBSVCS_DEBUG ((LM_DEBUG, "Created POA : %C\n", the_name.in ()));
}
/*
// Destroy the policies
for (CORBA::ULong index = 0; index < policy_list.length (); ++index)
{
policy_list[index]->destroy ();
}
*/
}
示例3: policies
PortableServer::POA_ptr
setup_poa (PortableServer::POA_ptr root_poa)
{
// Policies for the childPOA to be created.
CORBA::PolicyList policies (2);
policies.length (2);
// Tell the POA to use a servant manager.
policies[0] =
root_poa->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER);
// Allow implicit activation.
policies[1] =
root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION);
PortableServer::POAManager_var poa_manager =
root_poa->the_POAManager ();
// Create POA as child of RootPOA with the above policies. This POA
// will use a SERVANT_ACTIVATOR because of RETAIN policy.
PortableServer::POA_var child_poa =
root_poa->create_POA ("childPOA",
poa_manager.in (),
policies);
// Creation of childPOAs is over. Destroy the Policy objects.
for (CORBA::ULong i = 0;
i < policies.length ();
++i)
{
policies[i]->destroy ();
}
return child_poa._retn ();
}
示例4:
PortableServer::POA_ptr
createPOA (PortableServer::POA_ptr root_poa,
bool share_mgr,
const char* poa_name)
{
PortableServer::LifespanPolicy_var life =
root_poa->create_lifespan_policy(PortableServer::PERSISTENT);
PortableServer::IdAssignmentPolicy_var assign =
root_poa->create_id_assignment_policy(PortableServer::USER_ID);
CORBA::PolicyList pols;
pols.length(2);
pols[0] = PortableServer::LifespanPolicy::_duplicate(life.in());
pols[1] = PortableServer::IdAssignmentPolicy::_duplicate(assign.in());
PortableServer::POAManager_var mgr = PortableServer::POAManager::_nil();
if (share_mgr)
{
mgr = root_poa->the_POAManager();
}
PortableServer::POA_var poa =
root_poa->create_POA(poa_name, mgr.in(), pols);
life->destroy();
assign->destroy();
return poa._retn();
}
示例5: 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;
}
示例6: OrganizationProxyTests
/*!
* @brief Constructor
*/
OrganizationProxyTests()
{
int argc = 0;
char** argv = NULL;
m_pORB = CORBA::ORB_init(argc, argv);
m_pPOA = PortableServer::POA::_narrow(
m_pORB->resolve_initial_references("RootPOA"));
m_pPOA->the_POAManager()->activate();
}
示例7: test_add_master_manager
/*!
* @brief tests for is_master(), createINSManager(), findManager(), add_master_manager(), get_master_managers(), remove_master_manager()
*
*
*/
void test_add_master_manager()
{
::RTM::ManagerServant *pman = new ::RTM::ManagerServant();
RTM::ManagerList* list;
try
{
::RTC::ReturnCode_t ret;
CORBA::Boolean cbret;
cbret = pman->is_master();
// is_master(), default is false
CPPUNIT_ASSERT(!cbret);
// get_master_managers()
list = pman->get_master_managers();
CPPUNIT_ASSERT_EQUAL(0, (int)list->length());
// createINSManager()
bool bret = pman->createINSManager();
CPPUNIT_ASSERT(bret);
bret = pman->createINSManager();
CPPUNIT_ASSERT(!bret);
std::string host_port("localhost:2810");
RTM::Manager_var owner;
// findManager()
owner = pman->findManager(host_port.c_str());
// add_master_manager()
ret = pman->add_master_manager(owner);
CPPUNIT_ASSERT_EQUAL(RTC::RTC_OK, ret);
list = pman->get_master_managers();
CPPUNIT_ASSERT_EQUAL(1, (int)list->length());
// remove_master_manager()
ret = pman->remove_master_manager(RTM::Manager::_duplicate(owner));
CPPUNIT_ASSERT_EQUAL(RTC::RTC_OK, ret);
list = pman->get_master_managers();
CPPUNIT_ASSERT_EQUAL(0, (int)list->length());
CORBA::Object_var obj;
obj = m_pORB->resolve_initial_references("omniINSPOA");
PortableServer::POA_ptr poa = PortableServer::POA::_narrow(obj);
poa->the_POAManager()->deactivate(false, true);
}
catch(CORBA::SystemException& e)
{
std::cout << "test_add_master_manager() SystemException: " << e._name() << std::endl;
}
catch (...)
{
std::cout << "test_add_master_manager() other Exception" << std::endl;
}
delete list;
delete pman;
}
示例8: argc
/*!
* @brief Constructor
*/
OutPortConnectorTests()
{
int argc(0);
char** argv(NULL);
m_pORB = CORBA::ORB_init(argc, argv);
m_pPOA = PortableServer::POA::_narrow(
m_pORB->resolve_initial_references("RootPOA"));
m_pPOA->the_POAManager()->activate();
}
示例9:
int
Locator_Repository::init (PortableServer::POA_ptr root_poa,
PortableServer::POA_ptr imr_poa,
const char* this_ior)
{
this->imr_ior_ = this_ior;
int err = init_repo(imr_poa);
if (err != 0)
{
return err;
}
// Activate the two poa managers
PortableServer::POAManager_var poaman =
root_poa->the_POAManager ();
poaman->activate ();
poaman = imr_poa->the_POAManager ();
poaman->activate ();
return err;
}
示例10:
int
TAO_CosEventChannelFactory_i::init (PortableServer::POA_ptr poa,
const char* child_poa_name,
CosNaming::NamingContext_ptr naming)
{
// Check if we have a parent poa.
if (CORBA::is_nil (poa))
return -1;
this->naming_ = CosNaming::NamingContext::_duplicate (naming);
// Save the naming context.
// Create a UNIQUE_ID and USER_ID policy because we want the POA
// to detect duplicates for us.
PortableServer::IdUniquenessPolicy_var idpolicy =
poa->create_id_uniqueness_policy (PortableServer::UNIQUE_ID);
PortableServer::IdAssignmentPolicy_var assignpolicy =
poa->create_id_assignment_policy (PortableServer::USER_ID);
// Create a PolicyList
CORBA::PolicyList policy_list;
policy_list.length (2);
policy_list [0] =
PortableServer::IdUniquenessPolicy::_duplicate (idpolicy.in ());
policy_list [1] =
PortableServer::IdAssignmentPolicy::_duplicate (assignpolicy.in ());
PortableServer::POAManager_ptr manager =
poa->the_POAManager ();
// @@ Pradeep : TODO - find a way to destroy the policy_list if we return here.
// Create the child POA.
this->poa_ = poa->create_POA (child_poa_name,
manager,
policy_list);
idpolicy->destroy ();
assignpolicy->destroy ();
//this->poa_ = PortableServer::POA::_duplicate (poa);
// uncomment this if we want to use the parent poa for some reason.
return 0;
}
示例11: GCServantLocator
PortableServer::POA_ptr ossie::corba::createGCPOA(PortableServer::POA_ptr parent, const std::string& name)
{
CORBA::PolicyList policy_list;
policy_list.length(2);
policy_list[0] = parent->create_servant_retention_policy(PortableServer::NON_RETAIN);
policy_list[1] = parent->create_request_processing_policy(PortableServer::USE_SERVANT_MANAGER);
PortableServer::POAManager_var poa_mgr = parent->the_POAManager();
PortableServer::POA_var poa = parent->create_POA(name.c_str(), poa_mgr, policy_list);
for (size_t ii = 0; ii < policy_list.length(); ++ii) {
policy_list[ii]->destroy();
}
GCServantLocator* manager = new GCServantLocator();
PortableServer::ServantManager_var manager_ref = manager->_this();
poa->set_servant_manager(manager_ref);
manager->_remove_ref();
return poa._retn();
}
示例12: main
//.........这里部分代码省略.........
ssl_port = strdup(argv[i+1]);
}
if (strcmp(argv[i], "-ORB_ssl_private_key") == 0)
{
for (int j = 1; j < argc; j++) {
if (strcmp(argv[j], "-ORB_ssl_certificate") == 0) {
ssl_config = true;
break;
}
}
}
}
new_argv[new_argc - 2] = "-ORB_iiop_orb_port";
new_argv[new_argc - 1] = port;
int orb_argc = port_given ? argc : new_argc;
char ** orb_argv = port_given ? argv : new_argv;
//
// ORB initialization
//
my_global_orb = CORBA::ORB_init(orb_argc, orb_argv);
// Get internal ORB
TIDorb::core::TIDORB* m_orb =
dynamic_cast<TIDorb::core::TIDORB*> (CORBA::ORB::_duplicate(my_global_orb));
//
// Getting RootPOA & Manager references
//
CORBA::Object_var poa_obj = my_global_orb->resolve_initial_references("RootPOA");
PortableServer::POA_ptr rootPOA = PortableServer::POA::_narrow(poa_obj);
PortableServer::POAManager_var manager = rootPOA->the_POAManager();
//
// NamingContexts POA creation
//
CORBA::PolicyList policies;
policies.length(4);
policies[0] = rootPOA->create_servant_retention_policy(PortableServer::RETAIN);
policies[1] = rootPOA->create_request_processing_policy(
PortableServer::USE_SERVANT_MANAGER);
policies[2] = rootPOA->create_id_assignment_policy(PortableServer::USER_ID);
policies[3] = rootPOA->create_lifespan_policy(PortableServer::PERSISTENT);
PortableServer::POA_var namingContextsPOA =
rootPOA->create_POA("namingContextsPOA", manager, policies);
PortableServer::POAManager_var namingContextsManager =
namingContextsPOA->the_POAManager();
//
// BindingIterators POA creation
//
CORBA::PolicyList bindingIterators_policies;
bindingIterators_policies.length(2);
bindingIterators_policies[0] =
rootPOA->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL);
bindingIterators_policies[1] =
rootPOA->create_id_assignment_policy(PortableServer::USER_ID);
示例13: if
//.........这里部分代码省略.........
thread_pool_policy = rt_orb->create_threadpool_policy (threadpool_id_1);
ACE_DEBUG ((LM_DEBUG,
"Activated thread pool\n"));
}
if (bands_.length () != 0)
{
// Create a bands policy.
bands_policy =
rt_orb->create_priority_banded_connection_policy (this->bands_);
ACE_DEBUG ((LM_DEBUG,
"Activated Bands\n"));
}
CORBA::PolicyList poa_policy_list;
if (lanes_.length () == 0 && bands_.length () == 0)
{
if (thread_pool_)
{
poa_policy_list.length (2);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = thread_pool_policy;
}
else
{
poa_policy_list.length (1);
poa_policy_list[0] = priority_model_policy;
}
}
else if (lanes_.length () != 0 && bands_.length () == 0)
{
if (thread_pool_)
{
poa_policy_list.length (3);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = lanes_policy;
poa_policy_list[2] = thread_pool_policy;
}
else
{
poa_policy_list.length (2);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = lanes_policy;
}
}
else if (lanes_.length () == 0 && bands_.length () != 0)
{
if (thread_pool_)
{
poa_policy_list.length (3);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = bands_policy;
poa_policy_list[2] = thread_pool_policy;
}
else
{
poa_policy_list.length (2);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = bands_policy;
}
}
else
{
if (thread_pool_)
{
poa_policy_list.length (4);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = lanes_policy;
poa_policy_list[2] = bands_policy;
poa_policy_list[3] = thread_pool_policy;
}
else
{
poa_policy_list.length (3);
poa_policy_list[0] = priority_model_policy;
poa_policy_list[1] = lanes_policy;
poa_policy_list[2] = bands_policy;
}
}
ACE_DEBUG ((LM_DEBUG,
"Initialized POA Policy\n"));
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG, "creating POA %C\n", POA_name_.c_str ()));
// Get the POA Manager.
PortableServer::POAManager_var poa_manager =
parent_poa->the_POAManager ();
PortableServer::POA_var poa =
parent_poa->create_POA (POA_name_.c_str (),
poa_manager.in (),
poa_policy_list);
}
示例14: main
int main(int argc,char *argv [])
{
CORBA::ORB_ptr orb_ptr;
try
{
/************************************************************************/
/* INICIALIZAMOS LA PARTE DEL ORB */
/************************************************************************/
int alt_argc = 0;
char ** alt_argv;
const char * orb_id="Test_TIDNotification";
orb_ptr=CORBA::ORB_init(argc, argv, orb_id);
if (!orb_ptr)
{
cerr<<"El ORB es null"<<endl;
return -1;
}
CORBA::Object_ptr delegado_POA;
PortableServer::POA_ptr rootPOA;
try
{
delegado_POA = orb_ptr->resolve_initial_references("RootPOA");
}
catch ( CORBA::ORB::InvalidName ex )
{
ex._name();
return -1;
}
rootPOA = PortableServer::_POAHelper::narrow( delegado_POA,true );
PortableServer::POAManager_var poa_manager = rootPOA->the_POAManager();
CORBA::PolicyList_var policies = NULL;
policies = new CORBA::PolicyList(2);
policies->length(2);
// Valores cambiados
(*policies)[0] = rootPOA->create_lifespan_policy
( PortableServer::PERSISTENT );
(*policies)[1] = rootPOA->create_id_assignment_policy
( PortableServer::USER_ID );
PortableServer::POA_var consumerPOA = rootPOA->create_POA("consumerPOA", poa_manager, *policies );
/***********************************************************************/
/* OBTENEMOS LA FACTORIA DEL CANAL DE EVENTOS Y CREAMOS EL CANAL */
/**********************************************************************/
CORBA::Object_ptr delegado_event_channel_factory;
delegado_event_channel_factory=orb_ptr->string_to_object(argv[1]);
CosNotifyChannelAdmin::EventChannelFactory_var factory;
factory = CosNotifyChannelAdmin::EventChannelFactory::_narrow(delegado_event_channel_factory);
if (CORBA::is_nil(factory)) {
cerr << "[server] ERROR: factoria nula " << endl;
return -1;
}
CosNotifyChannelAdmin::EventChannel_var channel;
//CosNotifyChannelAdmin::EventChannel_var channelv[10];
CosNotification::QoSProperties initial_qos;
CosNotification::AdminProperties initial_admin;
CosNotifyChannelAdmin::ChannelID id;
//CosNotifyChannelAdmin::ChannelID idv[10];
// // Politicas Soportadas:
// initial_qos.length(9);
// initial_qos[0].name = CORBA::string_dup("OrderPolicy");
// initial_qos[0].value <<= CosNotification::FifoOrder; // Any Fifo Priority Deadline
// initial_qos[1].name = CORBA::string_dup("EventReliability");
// initial_qos[1].value <<= CosNotification::BestEffort; // Persistent
// initial_qos[2].name = CORBA::string_dup("ConnectionReliability");
// initial_qos[2].value <<= CosNotification::BestEffort; // Persistent
// initial_qos[3].name = CORBA::string_dup("Priority");
// initial_qos[3].value <<= CosNotification::HighestPriority; // Highest, Default
// initial_qos[4].name = CORBA::string_dup("StartTime");
// initial_qos[4].value <<= *(new TimeBase::UtcT(
// TIDorb::core::util::Time::currentTimeMillis(),
// 0,0,0));
// initial_qos[5].name = CORBA::string_dup("StopTime");
// initial_qos[5].value <<= *(new TimeBase::UtcT(
// TIDorb::core::util::Time::currentTimeMillis(),
// 0,0,0));
// initial_qos[6].name = CORBA::string_dup("Timeout");
// initial_qos[6].value <<= (TimeBase::TimeT)TIDorb::core::util::Time::currentTimeMillis();
// initial_qos[7].name = CORBA::string_dup("StartTimeSupported");
// initial_qos[7].value <<= (CORBA::Boolean) 0;
// initial_qos[8].name = CORBA::string_dup("StopTimeSupported");
// initial_qos[8].value <<= (CORBA::Boolean) 1;
//.........这里部分代码省略.........