- Timestamp:
- 07/06/13 11:38:38 (11 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9665-9666,9675
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
r9456 r9700 35 35 } 36 36 37 private HiveServiceLocator() { 38 } 39 37 40 private string username; 38 41 public string Username { … … 47 50 } 48 51 52 public int EndpointRetries { get; private set; } 53 54 public string WorkingEndpoint { get; private set; } 55 49 56 private HiveServiceClient NewServiceClient() { 50 HiveServiceClient cl; 57 if (EndpointRetries >= Settings.Default.MaxEndpointRetries) { 58 return CreateClient(WorkingEndpoint); 59 } 60 61 var configurations = Settings.Default.EndpointConfigurationPriorities; 62 63 Exception exception = null; 64 foreach (var endpointConfigurationName in configurations) { 65 try { 66 var cl = CreateClient(endpointConfigurationName); 67 cl.Open(); 68 WorkingEndpoint = endpointConfigurationName; 69 return cl; 70 } 71 catch (Exception exc) { 72 exception = exc; 73 EndpointRetries++; 74 } 75 } 76 77 throw exception ?? new Exception("No endpoint for Hive service found."); 78 } 79 80 private HiveServiceClient CreateClient(string endpointConfigurationName) { 81 HiveServiceClient cl = null; 82 51 83 if (string.IsNullOrEmpty(username) && string.IsNullOrEmpty(password)) 52 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>( );84 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName); 53 85 else 54 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>( null, null, username, password);86 cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName, null, username, password); 55 87 56 88 return cl;
Note: See TracChangeset
for help on using the changeset viewer.