Changeset 7290 for branches/RegressionBenchmarks/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
- Timestamp:
- 01/08/12 19:13:14 (12 years ago)
- Location:
- branches/RegressionBenchmarks
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RegressionBenchmarks
- Property svn:ignore
-
old new 18 18 bin 19 19 protoc.exe 20 *.user
-
- Property svn:mergeinfo changed
/trunk/sources merged: 7209,7214,7216-7230,7233-7239,7241,7243-7252,7254,7256-7261,7265-7266,7272-7275,7277,7280,7283
- Property svn:ignore
-
branches/RegressionBenchmarks/HeuristicLab.Clients.Hive/3.3
- Property svn:ignore
-
old new 2 2 Plugin.cs 3 3 bin 4 *.vs10x
-
- Property svn:ignore
-
branches/RegressionBenchmarks/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs
r7255 r7290 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 59 59 public T CallHiveService<T>(Func<IHiveService, T> call) { 60 60 HiveServiceClient client = NewServiceClient(); 61 HandleAnonymousUser(client); 62 61 63 try { 62 64 return call(client); 63 } finally { 65 } 66 finally { 64 67 try { 65 68 client.Close(); … … 73 76 public void CallHiveService(Action<IHiveService> call) { 74 77 HiveServiceClient client = NewServiceClient(); 78 HandleAnonymousUser(client); 79 75 80 try { 76 81 call(client); 77 } finally { 82 } 83 finally { 78 84 try { 79 85 client.Close(); … … 84 90 } 85 91 } 92 93 private void HandleAnonymousUser(HiveServiceClient client) { 94 if (client.ClientCredentials.UserName.UserName == Settings.Default.AnonymousUserName) { 95 try { 96 client.Close(); 97 } 98 catch (Exception) { 99 client.Abort(); 100 } 101 throw new AnonymousUserException(); 102 } 103 } 86 104 } 87 105 }
Note: See TracChangeset
for help on using the changeset viewer.