void IHostResolver.Publish(string callbackUri, string role, string tag) { var uri = Helpers.TryCatch(_log, () => new Uri(callbackUri), ex => Helpers.ThrowNew<HostResolverException>(ex, _log, "Failed to parse callbackUri '{0}'", callbackUri)); var publisher = new Publisher { CallbackUri = uri, Role = role, Tag = tag }; publish(publisher); }
private void send_hello_message_of(Publisher publisher) { var edm = new EndpointDiscoveryMetadata { Address = _self.wcf.Address }; edm.ListenUris.Add(publisher.CallbackUri); edm.Scopes.Add(_self.resolvingScope); edm.ContractTypeNames.Add(new XmlQualifiedName(publisher.Role)); _self.wcf.SendHelloMessage(edm); }
void IManager.Publish(Publisher publisher) { _self.repo.Add(publisher); send_hello_message_of(publisher); trace("{0}.{1} is published at '{2}'", publisher.Role, publisher.Tag, publisher.CallbackUri); }
private void publish(Publisher publisher) { _self.thread.PostAction( () => _manager.Publish(publisher)); }
void IRepository.Remove(Publisher publisher) { bool wasThere = _publishers.Remove(publisher); if (wasThere) _counters.Discovery_State_ActivePublishers--; }
void IRepository.Add(Publisher publisher) { _publishers.Add(publisher); _counters.Discovery_State_ActivePublishers++; }