void ServantPluginImpl::init_debug_adbroker( Broker::Manager_var& mgr ) { manager_ = mgr; if ( ! CORBA::is_nil( manager_ ) ) { try { Broker::Session_var broker = manager_->getSession( L"debug" ); if ( ! CORBA::is_nil( broker ) ) broker->connect( "user", "pass", "debug", 0 ); } catch ( CORBA::Exception& ex ) { adportable::debug(__FILE__, __LINE__) << ex._info().c_str(); return; } connect( this, SIGNAL( signal_notify_update( unsigned long ) ) , this, SLOT( handle_notify_update( unsigned long ) ) ); Broker::Logger_var logger = manager_->getLogger(); if ( ! CORBA::is_nil( logger.in() ) ) { logger->register_handler( logHandler_._this() ); Broker::LogMessage msg; msg.tv_sec = msg.tv_usec = 0; msg.text = L"init_abroker initialized"; logger->log( msg ); } } }
void initialize_broker_session() { brokerEvent_.reset( new brokerevent_i ); brokerEvent_->assign_message( [=]( const std::string& text ){ handle_message( text ); }); brokerEvent_->assign_portfolio_created( [=]( const std::wstring& file ){ handle_portfolio_created( file ); }); brokerEvent_->assign_folium_added( [=]( const std::wstring& token , const std::wstring& path , const std::wstring& folderId ){ handle_folium_added( token, path, folderId ); }); brokerSession_->connect( "user", "pass", "acquire", brokerEvent_->_this() ); }