Changeset 970
- Timestamp:
- 12/11/08 16:41:05 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Server.Core/ClientCommunicator.cs
r941 r970 16 16 /// </summary> 17 17 public class ClientCommunicator: IClientCommunicator { 18 LinkedList<long> jobs;19 18 int nrOfJobs = 1; 20 19 21 20 IClientAdapter clientAdapter; 21 IJobAdapter jobAdapter; 22 22 23 23 public ClientCommunicator() { 24 clientAdapter = ServiceLocator.GetClientAdapter(); 24 clientAdapter = ServiceLocator.GetClientAdapter(); 25 jobAdapter = ServiceLocator.GetJobAdapter(); 25 26 26 jobs = new LinkedList<long>();27 for (long i = 0; i < nrOfJobs; i++) {28 jobs.AddFirst(i);29 }30 27 } 31 28 … … 59 56 response.StatusMessage = ApplicationConstants.RESPONSE_COMMUNICATOR_HARDBEAT_RECEIVED; 60 57 response.ActionRequest = new List<MessageContainer>(); 61 if (jobs.Count > 0) 58 List<Job> allJobs = new List<Job>(jobAdapter.GetAllJobs()); 59 if (allJobs.Count > 0) 62 60 response.ActionRequest.Add(new MessageContainer(MessageContainer.MessageType.FetchJob)); 63 61 else … … 70 68 ResponseJob response = new ResponseJob(); 71 69 lock (this) { 72 if (jobs.Last != null) { 73 response.JobId = jobs.Last.Value; 74 jobs.RemoveLast(); 70 LinkedList<Job> allJobs = new LinkedList<Job>(jobAdapter.GetAllJobs()); 71 if (allJobs.Last != null) { 72 response.JobId = allJobs.Last.Value.JobId; 73 jobAdapter.DeleteJob(allJobs.Last.Value); 75 74 response.SerializedJob = PersistenceManager.SaveToGZip(new TestJob()); 76 75 response.Success = true;
Note: See TracChangeset
for help on using the changeset viewer.