本文整理汇总了C++中portableserver::POA_ptr::get_servant方法的典型用法代码示例。如果您正苦于以下问题:C++ POA_ptr::get_servant方法的具体用法?C++ POA_ptr::get_servant怎么用?C++ POA_ptr::get_servant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::POA_ptr
的用法示例。
在下文中一共展示了POA_ptr::get_servant方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
void
test_get_servant_with_no_set (PortableServer::POA_ptr poa)
{
bool succeed = false;
try
{
// Getting the default servant without one set whould give a NoServant
// exception
PortableServer::Servant servant =
poa->get_servant ();
ACE_UNUSED_ARG (servant);
}
catch (const PortableServer::POA::NoServant& )
{
succeed = true;
}
catch (const CORBA::Exception&)
{
}
if (!succeed)
{
ACE_ERROR ((LM_ERROR,
"(%t) ERROR, get servant without one set failed\n"));
}
}
示例2: INTERNAL
CosNotifyFilter::MappingFilter_ptr
FilterFactoryImpl::create_mapping_filter(const char* constraint_grammar,
const CORBA::Any& default_value)
throw (CosNotifyFilter::InvalidGrammar)
{
FilterFactoryImpl::CREATE_MAPPING_FILTER[1] = constraint_grammar;
if (_tidorb->trace != NULL)
_tidorb->print_trace(TIDorb::util::TR_USER,
"FilterFactoryImpl::crete_mapping_filter");
PortableServer::POA_ptr poa = globalMappingDiscriminatorPOA();
TIDorb::util::StringBuffer buffer_id;
try {
if (PersistenceManager::isActive())
buffer_id << PersistenceManager::getDB()->getUID();
else
buffer_id << "0";
}
catch (const CORBA::Exception& e1) {
if (_tidorb->trace != NULL)
_tidorb->print_trace(TIDorb::util::TR_ERROR,
"FilterFactoryImpl::crete_mapping_filter Persistence Manager failed",
e1);
throw CORBA::INTERNAL("Persistence Manager failed");
}
MappingFilterData* filterData = new MappingFilterData(buffer_id.str().data(),
default_value);
try {
(dynamic_cast<MappingFilterImpl*> (poa->get_servant()))->register_data( filterData );
}
catch (const CORBA::Exception& e) {
}
if (PersistenceManager::isActive()) {
PersistenceManager::getDB()->save_data( filterData );
PersistenceManager::getDB()->update_data(PersistenceDB::ATTR_DISCRIMINATOR,
filterData);
}
return NotifReference::mappingDiscriminatorReference(filterData->poa,
filterData->id);
}
示例3: InvalidGrammar
CosNotifyFilter::Filter_ptr
FilterFactoryImpl::create_filter(const char* constraint_grammar)
throw (CosNotifyFilter::InvalidGrammar)
{
FilterFactoryImpl::CREATE_FILTER[1] = constraint_grammar;
if (_tidorb->trace != NULL)
_tidorb->print_trace(TIDorb::util::TR_USER,
"FilterFactoryImpl::crete_filter ");
if (strcmp(constraint_grammar, util::parser::TIDParser::_CONSTRAINT_GRAMMAR))
{
throw CosNotifyFilter::InvalidGrammar();
}
PortableServer::POA_ptr poa = globalFilterPOA();
TIDorb::util::StringBuffer buffer_id;
try {
if (PersistenceManager::isActive())
buffer_id << PersistenceManager::getDB()->getUID();
else
buffer_id << "0";
}
catch (const CORBA::Exception& e1) {
if (_tidorb->trace != NULL)
_tidorb->print_trace(TIDorb::util::TR_ERROR,
"FilterFactoryImpl::crete_filter Persistence Manager failed", e1);
throw CORBA::INTERNAL("Persistence Manager failed");
}
FilterData* filterData = new FilterData(buffer_id.str().data(), poa);
try {
(dynamic_cast<FilterImpl*> (poa->get_servant()))->register_data( filterData );
} catch (CORBA::Exception& e) {}
if (PersistenceManager::isActive()) {
(PersistenceManager::getDB())->save_data( filterData );
(PersistenceManager::getDB())->update_data(PersistenceDB::ATTR_DISCRIMINATOR,
filterData);
}
return NotifReference::discriminatorReference(filterData->poa,
filterData->id);
}