12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

显 式 实 现 双 向 IIOPQuote::QuoteServer_var quoter = Quote::QuoteServer::_bind("/QuoteServer_poa",oid);// 建 立 回 调 对 象 ...... 先 取 得 RootPOACORBA::Object_var obj = orb->resolve_initial_references("RootPOA");PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(obj);PortableServer::POAManager_var the_manager = rootPOA->the_POAManager();PortableServer::POA_var consumer_poa;// 建 立 一 个 策 略 。CORBA::Any policy_value;policy_value create_POA("QuoteConsumer_poa", the_manager, policies);QuoteConsumerImpl* consumer = new QuoteConsumerImpl;oid = PortableServer::string_to_ObjectId("consumer");consumer_poa->activate_object_with_id(oid, consumer);the_manager->activate();CORBA::Object_var obj = quoter->set_policy_overrides(policies,CORBA::ADD_OVERRIDE);quoter = Quote::QuoteServer::_narrow(obj);obj = consumer_poa->id_to_reference(oid);Quote::QuoteConsumer_var quote_consumer =Quote::QuoteConsumer::_narrow(obj);quoter->registerConsumer(quote_consumer.in());cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!