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.

推 型 提 供 者 和 接 收 者 的 实 例};intCORBA::ORB_varPortableServer::POA_varCosEventComm::PushConsumer_var_counter;_orb;_pushConsumer;_myPOA;int main(int argc, char* const* argv){try {// 初 始 化 ORB。CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);// 取 得 根 POA 的 引 用CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");PortableServer::POA_var rootPOA = PortableServer::POA::_narrow(obj);/ / 为 永 久 POA 创 建 策 略CORBA::PolicyList policies;policies.length(1);policies[(CORBA::ULong)0] =rootPOA->create_lifespan_policy(PortableServer::PERSISTENT);PortableServer::POAManager_var poa_manager = rootPOA->the_POAManager();// 用 正 确 的 策 略 创 建 serverPOAPortableServer::POA_var serverPOA =rootPOA->create_POA("event_service_poa", poa_manager, policies);CosEventChannelAdmin::EventChannel_var channel = NULL;PushModel* model = NULL;CosEventChannelAdmin::ProxyPushConsumer_var pushConsumer = NULL;while(true) {try {cout > cmd ) {if (cmd == 'e') {obj = orb->resolve_initial_references("EventService");channel = CosEventChannelAdmin::EventChannel::_narrow(obj);cout

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

Saved successfully!

Ooh no, something went wrong!