本文整理汇总了C++中portableserver::POA_var::in方法的典型用法代码示例。如果您正苦于以下问题:C++ POA_var::in方法的具体用法?C++ POA_var::in怎么用?C++ POA_var::in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::POA_var
的用法示例。
在下文中一共展示了POA_var::in方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activate
void
TAO_ECG_UDP_Sender::new_connect (const RtecEventChannelAdmin::ConsumerQOS& sub)
{
// Activate with poa.
RtecEventComm::PushConsumer_var consumer_ref;
PortableServer::POA_var poa = this->_default_POA ();
TAO_EC_Object_Deactivator deactivator;
activate (consumer_ref,
poa.in (),
this,
deactivator);
// Connect as a consumer to the local EC.
RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
this->lcl_ec_->for_consumers ();
RtecEventChannelAdmin::ProxyPushSupplier_var proxy =
consumer_admin->obtain_push_supplier ();
ECG_Sender_Auto_Proxy_Disconnect new_proxy_disconnect (proxy.in ());
proxy->connect_push_consumer (consumer_ref.in (),
sub);
// Update resource managers.
this->supplier_proxy_ = proxy._retn ();
this->auto_proxy_disconnect_.set_command (new_proxy_disconnect);
this->set_deactivator (deactivator);
}
示例2: catch
int
TAO_IFR_Server::init_with_orb (int argc,
ACE_TCHAR *argv [],
CORBA::ORB_ptr orb,
int use_multicast_server)
{
try
{
// Get the POA from the ORB.
CORBA::Object_var poa_object =
orb->resolve_initial_references ("RootPOA");
if (CORBA::is_nil (poa_object.in ()))
{
ORBSVCS_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) IFR_Service::init_with_orb ")
ACE_TEXT ("Unable to initialize the POA.\n")),
-1);
}
PortableServer::POA_var rp =
PortableServer::POA::_narrow (poa_object.in ());
return this->init_with_poa (argc, argv, orb, rp.in(), use_multicast_server);
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("IFR_Service::init_with_orb");
throw;
}
return 0;
}
示例3:
void
TAO_Notify_Tests_Peer_T<Peer_Traits>::connect (void)
{
// Get the POA
PortableServer::POA_var poa;
LOOKUP_MANAGER->resolve (poa,
this->poa_name_.c_str ());
// set the POA
this->set_poa (poa.in ());
// Resolve the admin
typename Admin_Traits::VAR admin_var;
LOOKUP_MANAGER->resolve (admin_var,
this->admin_name_.c_str ());
typename Admin_Ext_Traits::VAR admin_ext_var =
Admin_Ext_Traits_INTERFACE::_narrow (admin_var.in ());
typename Proxy_Traits::VAR proxy_var =
this->obtain_proxy (admin_ext_var.in (),
this->qos_);
ACE_ASSERT (!CORBA::is_nil (proxy_var.in ()));
// connect supplier to proxy,
// also activates the servant as CORBA object in the POA specified.
this->connect (proxy_var.in (),
this->proxy_id_);
}
示例4: new_proxy_disconnect
void
Heartbeat_Application::connect_as_consumer (void)
{
// Activate with poa.
RtecEventComm::PushConsumer_var consumer_ref;
PortableServer::POA_var poa = this->_default_POA ();
TAO_EC_Object_Deactivator deactivator;
activate (consumer_ref,
poa.in (),
this,
deactivator);
// Obtain reference to ConsumerAdmin.
RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin =
this->ec_->for_consumers ();
// Obtain ProxyPushSupplier..
RtecEventChannelAdmin::ProxyPushSupplier_var proxy =
consumer_admin->obtain_push_supplier ();
Supplier_Proxy_Disconnect new_proxy_disconnect (proxy.in ());
// Connect this consumer.
ACE_ConsumerQOS_Factory qos;
qos.start_disjunction_group (1);
qos.insert_type (ACE_ES_EVENT_ANY, 0);
proxy->connect_push_consumer (consumer_ref.in (),
qos.get_ConsumerQOS ());
// Update resource managers.
this->supplier_proxy_disconnect_.set_command (new_proxy_disconnect);
this->set_deactivator (deactivator);
}
示例5: catch
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
try
{
CORBA::Object_var obj
= orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var poa
= PortableServer::POA::_narrow (obj.in ());
TAO_AV_CORE::instance ()->init (orb.in (),
poa.in ());
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("server::init");
return -1;
}
int result = 0;
result = FTP_SERVER::instance ()->init (argc, argv);
if (result < 0)
ACE_ERROR_RETURN ((LM_ERROR,"FTP_SERVER::init failed\n"),1);
result = FTP_SERVER::instance ()->run ();
if (result < 0)
ACE_ERROR_RETURN ((LM_ERROR,"FTP_SERVER::run failed\n"),1);
FTP_SERVER::close (); // Explicitly finalize the Unmanaged_Singleton.
return result;
}
示例6:
TAO_Stub *
TAO_DynamicImplementation::_create_stub (void)
{
// If DynamicImplementation::_this() is invoked outside of the
// context of a request invocation on a target object being served
// by the DSI servant, it raises the PortableServer::WrongPolicy
// exception. See the CORBA C++ mapping, section 1.38.3.
TAO::Portable_Server::POA_Current_Impl *poa_current_impl =
static_cast <TAO::Portable_Server::POA_Current_Impl *>
(TAO_TSS_Resources::instance ()->poa_current_impl_);
if (poa_current_impl == 0
|| this != poa_current_impl->servant ())
{
throw PortableServer::POA::WrongPolicy ();
}
PortableServer::POA_var poa =
poa_current_impl->get_POA ();
CORBA::PolicyList_var client_exposed_policies =
poa_current_impl->poa ()->client_exposed_policies (
poa_current_impl->priority ());
CORBA::RepositoryId_var pinterface =
this->_primary_interface (poa_current_impl->object_id (), poa.in ());
return
poa_current_impl->poa ()->key_to_stub (poa_current_impl->object_key (),
pinterface.in (),
poa_current_impl->priority ());
}
示例7: createPersistentPOA
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try {
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj.in());
PortableServer::POAManager_var mgr = root_poa->the_POAManager();
const char* poa_name = "MessengerService";
PortableServer::POA_var poa = createPersistentPOA(root_poa.in(), poa_name);
PortableServer::Servant_var<Messenger_i> servant1 = new Messenger_i;
PortableServer::Servant_var<Messenger_i> servant2 = new Messenger_i;
PortableServer::ObjectId_var id1 = PortableServer::string_to_ObjectId("Object1");
poa->activate_object_with_id(id1.in(), servant1.in());
PortableServer::ObjectId_var id2 = PortableServer::string_to_ObjectId("Object2");
poa->activate_object_with_id(id2.in(), servant2.in());
obj = poa->id_to_reference(id1.in());
CORBA::String_var ior1 = orb->object_to_string(obj.in());
obj = poa->id_to_reference(id2.in());
CORBA::String_var ior2 = orb->object_to_string(obj.in());
TAO_Root_POA* tpoa = dynamic_cast<TAO_Root_POA*>(poa.in());
obj = tpoa->id_to_reference_i(id1.in(), false);
CORBA::String_var direct_ior1 = orb->object_to_string(obj.in());
obj = orb->resolve_initial_references("IORTable");
IORTable::Table_var ior_table = IORTable::Table::_narrow(obj.in());
ior_table->bind("MessengerService/Object1", direct_ior1.in());
ior_table->bind("MessengerService/Object2", ior2.in());
writeIORFile(ior1.in(), ior_output_file1);
writeIORFile(ior2.in(), ior_output_file2);
mgr->activate();
std::cout << "Messenger server ready." << std::endl;
orb->run();
std::cout << "Messenger server shutting down." << std::endl;
root_poa->destroy(1,1);
orb->destroy();
return 0;
} catch(const CORBA::Exception& ex) {
std::cerr << "Server main() Caught Exception" << ex << std::endl;
}
return 1;
}
示例8: policies
int
create_POA_and_register_servant (CORBA::Policy_ptr threadpool_policy,
const char *poa_name,
PortableServer::POAManager_ptr poa_manager,
PortableServer::POA_ptr root_poa,
CORBA::ORB_ptr orb,
RTCORBA::RTORB_ptr rt_orb)
{
// Policies for the firstPOA to be created.
CORBA::PolicyList policies (3); policies.length (3);
// Implicit_activation policy.
policies[0] =
root_poa->create_implicit_activation_policy
(PortableServer::IMPLICIT_ACTIVATION);
// Thread pool policy.
policies[1] =
CORBA::Policy::_duplicate (threadpool_policy);
// Priority Model policy.
policies[2] =
rt_orb->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED, 0);
// Create the POA under the RootPOA.
PortableServer::POA_var poa =
root_poa->create_POA (poa_name,
poa_manager,
policies);
// Creation of POAs is over. Destroy the Policy objects.
for (CORBA::ULong i = 0;
i < policies.length ();
++i)
{
policies[i]->destroy ();
}
test_i *servant =
new test_i (orb,
poa.in (),
nap_time);
PortableServer::ServantBase_var safe_servant (servant);
ACE_UNUSED_ARG (safe_servant);
PortableServer::ObjectId_var id =
poa->activate_object (servant);
CORBA::Object_var object = poa->id_to_reference (id.in ());
test_var test = test::_narrow (object.in ());
int const result = write_ior_to_file (orb, test.in ());
return result;
}
示例9: catch
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
// We may want this to be alive beyond the next block.
PortableServer::Servant_var<Heartbeat_Application> app;
try
{
// Initialize ORB and POA, POA Manager, parse args.
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) == -1)
return 1;
CORBA::Object_var obj =
orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var poa =
PortableServer::POA::_narrow (obj.in ());
if (check_for_nil (poa.in (), "POA") == -1)
return 1;
PortableServer::POAManager_var manager =
poa->the_POAManager ();
// Obtain reference to EC.
obj = orb->resolve_initial_references ("Event_Service");
RtecEventChannelAdmin::EventChannel_var ec =
RtecEventChannelAdmin::EventChannel::_narrow (obj.in ());
if (check_for_nil (ec.in (), "EC") == -1)
return 1;
// Init our application.
app = new Heartbeat_Application;
if (!app.in ())
return 1;
app->init (orb, ec);
// Allow processing of CORBA requests.
manager->activate ();
// Receive events from EC.
orb->run ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Exception in Heartbeat Application:");
// Since there was an exception, application might not have had
// a chance to shutdown.
app->shutdown ();
return 1;
}
return 0;
}
示例10: findPOA
void
ImR_Locator_i::destroy_poa (const ACE_CString &poa_name)
{
PortableServer::POA_var poa = findPOA (poa_name.c_str());
if (! CORBA::is_nil (poa.in ()))
{
bool etherealize = true;
bool wait = false;
poa->destroy (etherealize, wait);
}
}
示例11: catch
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
TAO_EC_Default_Factory::init_svcs ();
try
{
// ORB initialization boiler plate...
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
CORBA::Object_var object =
orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var poa =
PortableServer::POA::_narrow (object.in ());
PortableServer::POAManager_var poa_manager =
poa->the_POAManager ();
poa_manager->activate ();
// ****************************************************************
run_test (poa.in (), 0);
run_test (poa.in (), 1);
// ****************************************************************
poa->destroy (1, 1);
orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception ("Service");
return 1;
}
return 0;
}
示例12: catch
bool
ImR_Activator_i::in_upcall (void)
{
try
{
PortableServer::POA_var poa = current_->get_POA ();
return !CORBA::is_nil (poa.in ());
}
catch (const CORBA::Exception& )
{
// no-op
}
return false;
}
示例13: id
/// Activate in the POA
void
TAO_FTEC_ProxyPushSupplier::activate (
RtecEventChannelAdmin::ProxyPushSupplier_ptr &result)
{
result =
RtecEventChannelAdmin::ProxyPushSupplier::_nil();
try{
object_id_ = Request_Context_Repository().get_object_id();
PortableServer::POA_var poa = _default_POA();
activate_object_with_id(result, poa.in(), this, id());
}
catch (const CORBA::Exception&)
{
// ignore exceptions
}
}
示例14:
void
TAO_Notify_Tests_Direct_Consumer::connect (void)
{
// Get the POA
PortableServer::POA_var poa;
LOOKUP_MANAGER->resolve (poa, this->poa_name_.c_str ());
// set the POA
this->set_poa (poa.in ());
// Activate the consumer with the default_POA_.
CosNotifyComm::StructuredPushConsumer_var consumer_ref =
this->_this ();
// Register the activated object.
LOOKUP_MANAGER->_register (consumer_ref.in (), this->name_.c_str ());
}
示例15: INTERNAL
void
TAO_ECG_Mcast_EH::open (RtecEventChannelAdmin::EventChannel_ptr ec)
{
if (!this->receiver_)
{
// We are shut down.
throw CORBA::INTERNAL();
}
if (CORBA::is_nil (ec))
{
ORBSVCS_ERROR ((LM_ERROR, "TAO_ECG_Mcast_EH::open(): "
"nil ec argument"));
throw CORBA::INTERNAL ();
}
// Create and activate Event Channel Observer.
ACE_NEW (this->observer_,
Observer (this));
if (!this->observer_.in ())
{
throw CORBA::NO_MEMORY ();
}
TAO_EC_Object_Deactivator observer_deactivator;
RtecEventChannelAdmin::Observer_var observer_ref;
PortableServer::POA_var poa =
this->observer_->_default_POA ();
activate (observer_ref,
poa.in (),
this->observer_.in (),
observer_deactivator);
RtecEventChannelAdmin::Observer_Handle handle =
ec->append_observer (observer_ref.in ());
this->observer_->set_deactivator (observer_deactivator);
this->auto_observer_disconnect_.set_command
(Observer_Disconnect_Command (handle, ec));
}