- Timestamp:
- 01/08/09 17:17:38 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Contracts/HeuristicLab.Hive.Contracts.csproj
r1001 r1099 85 85 <Compile Include="BusinessObjects\User.cs" /> 86 86 <Compile Include="BusinessObjects\UserGroup.cs" /> 87 <Compile Include="Interfaces\IClientFacade.cs" /> 87 88 <Compile Include="ResponseObject.cs" /> 88 89 <Compile Include="Interfaces\IClientManager.cs" /> -
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r1096 r1099 19 19 public class ClientCommunicator: IClientCommunicator { 20 20 int nrOfJobs = 0; 21 Dictionary<Guid, DateTime> lastHeartbeats; 21 Dictionary<Guid, DateTime> lastHeartbeats = 22 new Dictionary<Guid,DateTime>(); 22 23 23 24 IClientAdapter clientAdapter; … … 57 58 } else { 58 59 DateTime lastHbOfClient = lastHeartbeats[client.ClientId]; 59 int diff = lastHbOfClient.CompareTo(DateTime.Now);60 Console.WriteLine(dif f);60 TimeSpan dif = DateTime.Now.Subtract(lastHbOfClient); 61 Console.WriteLine(dif); 61 62 } 62 63 } else { … … 124 125 } 125 126 127 [MethodImpl(MethodImplOptions.Synchronized)] 126 128 public ResponseJob PullJob(Guid clientId) { 127 129 ResponseJob response = new ResponseJob(); … … 144 146 } 145 147 148 [MethodImpl(MethodImplOptions.Synchronized)] 146 149 public ResponseResultReceived SendJobResult(JobResult result, bool finished) { 147 150 ResponseResultReceived response = new ResponseResultReceived(); -
trunk/sources/HeuristicLab.Hive.Server.Core/HeuristicLab.Hive.Server.Core.csproj
r1008 r1099 67 67 <ItemGroup> 68 68 <Compile Include="ClientCommunicator.cs" /> 69 <Compile Include="ClientFacade.cs" /> 69 70 <Compile Include="ClientManager.cs" /> 70 71 <Compile Include="DbTestApp.cs" /> -
trunk/sources/HeuristicLab.Hive.Server.Core/ServerConsoleFacade.cs
r1086 r1099 30 30 namespace HeuristicLab.Hive.Server.Core { 31 31 public class ServerConsoleFacade: IServerConsoleFacade { 32 private IClientManager clientManager = new ClientManager(); 33 private IJobManager jobManager = new JobManager(); 34 private IUserRoleManager userRoleManager = new UserRoleManager(); 32 private IClientManager clientManager = 33 ServiceLocator.GetClientManager(); 34 35 private IJobManager jobManager = 36 ServiceLocator.GetJobManager(); 37 38 private IUserRoleManager userRoleManager = 39 ServiceLocator.GetUserRoleManager(); 35 40 36 41 private String loginName = null; -
trunk/sources/HeuristicLab.Hive.Server.Core/ServiceLocator.cs
r1088 r1099 24 24 using System.Runtime.CompilerServices; 25 25 using HeuristicLab.Hive.Contracts.Interfaces; 26 using HeuristicLab.Hive.Server.Core; 26 27 27 28 /// <summary> … … 34 35 private static ITransactionManager transManager = null; 35 36 37 private static IClientManager clientManager = null; 38 39 private static IJobManager jobManager = null; 40 41 private static IUserRoleManager userRoleManager = null; 42 43 private static IClientCommunicator clientCommunicator = null; 44 45 private static ILifecycleManager lifecycleManager = null; 46 36 47 private static IClientAdapter clientAdapter = null; 37 48 … … 50 61 private static IJobResultsAdapter jobResultsAdapter = null; 51 62 52 private static ILifecycleManager lifecycleManager = null;53 63 54 64 /// <summary> … … 66 76 67 77 /// <summary> 78 /// Gets the client manager 79 /// </summary> 80 /// <returns></returns> 81 [MethodImpl(MethodImplOptions.Synchronized)] 82 public static IClientManager GetClientManager() { 83 if (clientManager == null) 84 clientManager = new ClientManager(); 85 86 return clientManager; 87 } 88 89 /// <summary> 90 /// Gets the job manager 91 /// </summary> 92 /// <returns></returns> 93 [MethodImpl(MethodImplOptions.Synchronized)] 94 public static IJobManager GetJobManager() { 95 if (jobManager == null) 96 jobManager = new JobManager(); 97 98 return jobManager; 99 } 100 101 /// <summary> 102 /// Gets the user role manager 103 /// </summary> 104 /// <returns></returns> 105 [MethodImpl(MethodImplOptions.Synchronized)] 106 public static IUserRoleManager GetUserRoleManager() { 107 if (userRoleManager == null) 108 userRoleManager = new UserRoleManager(); 109 110 return userRoleManager; 111 } 112 113 /// <summary> 114 /// Gets the client Communicator 115 /// </summary> 116 /// <returns></returns> 117 [MethodImpl(MethodImplOptions.Synchronized)] 118 public static IClientCommunicator GetClientCommunicator() { 119 if (clientCommunicator == null) 120 clientCommunicator = new ClientCommunicator(); 121 122 return clientCommunicator; 123 } 124 125 /// <summary> 126 /// Gets the lifecycle manager 127 /// </summary> 128 /// <returns></returns> 129 [MethodImpl(MethodImplOptions.Synchronized)] 130 public static ILifecycleManager GetLifecycleManager() { 131 if (lifecycleManager == null) { 132 lifecycleManager = new LifecycleManager(); 133 } 134 135 return lifecycleManager; 136 } 137 138 /// <summary> 68 139 /// Gets the client database adapter 69 140 /// </summary> … … 168 239 return jobResultsAdapter; 169 240 } 170 171 /// <summary>172 /// Gets the lifecycle manager173 /// </summary>174 /// <returns></returns>175 [MethodImpl(MethodImplOptions.Synchronized)]176 public static ILifecycleManager GetLifecycleManager() {177 if (lifecycleManager == null) {178 lifecycleManager = discoveryService.GetInstances<ILifecycleManager>()[0];179 }180 181 return lifecycleManager;182 }183 241 } -
trunk/sources/HeuristicLab.Hive.Server/HiveServerApplication.cs
r1084 r1099 57 57 58 58 private ServiceHost StartClientCommunicator(Uri uriTcp) { 59 IClient Communicator[] clientCommunicatorInstances =60 discService.GetInstances<IClient Communicator>();59 IClientFacade[] clientCommunicatorInstances = 60 discService.GetInstances<IClientFacade>(); 61 61 62 62 if (clientCommunicatorInstances.Length > 0) {
Note: See TracChangeset
for help on using the changeset viewer.