public override IRemoteSupplier lookup(System.String supplierName) { MessageEnvelope message = new MessageEnvelope(); MessageBody body = new MessageBody(); LookupRequest request = new LookupRequest(); request.SupplierName = supplierName; body.selectLookupRequest(request); message.Body = body; message.Id = this.ToString(); IRemoteSupplier supplier = null; lock (clients) { foreach (ITransport client in clients) { MessageEnvelope result = client.call(message, callTimeout); if (result.Body.LookupResult.Code.Value == LookupResultCode.EnumType.success) { supplier = new RemoteSupplier(supplierName, client); break; } } } if (supplier == null) { throw new Exception("Error when accessing to supplier '" + supplierName + "'! Unable to find any suitable supplier!"); } return(supplier); }
public RemoteMessageQueue(string queuePath, RemoteSupplier supplier) { this.supplier = supplier; this.queuePath = queuePath; start(); }