> Ice::Identity XCFInterceptor::registerInterceptor(const std::string& name, const DispatcherInterceptorPtr& interceptor)throw(NameNotFoundException, CommunicationException){ > > IceUtil::RecMutex::Lock lock(_mutex); > > _interceptor_logger->trace("registerInterceptor(name, DispatcherInterceptor)", "called for Name: " + name); > > Remote::Interceptor::DispatcherInterceptDistributorPrx distributor; > > Ice::Identity id; > > Remote::Interceptor::DispatcherInterceptorPrx intProxyOneWay; > > Remote::DispatcherInfoDic::iterator k = _dispatchers.find(name); > > if (k == _dispatchers.end()){ > > NameNotFoundException ex; > _interceptor_logger->warning("registerInterceptor : No Dispatcher registered under this name."); > ex.reason = "No Dispatcher registered under this name."; > throw ex; > }else { > try { > id = Ice::stringToIdentity(IceUtil::generateUUID()); > > Remote::Interceptor::DispatcherInterceptorPrx intProxy = Remote::Interceptor::DispatcherInterceptorPrx::uncheckedCast(objectAdapter()->add(interceptor, id)); > > if (not intProxy) { > CommunicationException ex; > ex.reason = "Can't initialize InterceptorProxy."; > throw ex; > } > > //DEBUG > //!!!!!!THIS IS NOT WORKING!!!!!!!!!!!!!!! > intProxy->ice_ping(); > > intProxyOneWay = Remote::Interceptor::DispatcherInterceptorPrx::uncheckedCast(intProxy->ice_oneway()); > > distributor = k->second->getInterceptDistributor(); > > distributor->registerInterceptor(intProxyOneWay); > > _interceptors[id] = interceptor; > _interceptorPrxs[id] = intProxyOneWay; > _distributors[id] = distributor; > _interceptor_logger->trace("registerInterceptor", "Done."); > return id; > }catch (...) { > try { > distributor->unregisterInterceptor(intProxyOneWay); > }catch(...){} > try { > objectAdapter()->remove(id); > }catch(...){} > CommunicationException ex; > _interceptor_logger->warning("registerInterceptor : Couldn't contact Dispatcher."); > ex.reason = "Couldn't contact Dispatcher."; > throw ex; > } > } > }