- Timestamp:
- 11/26/08 16:49:55 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r816 r830 76 76 clientCommunicator.LoginCompleted += new EventHandler<LoginCompletedEventArgs>(ClientCommunicator_LoginCompleted); 77 77 clientCommunicator.PullJobCompleted += new EventHandler<PullJobCompletedEventArgs>(ClientCommunicator_PullJobCompleted); 78 clientCommunicator.SendJobResultCompleted += new EventHandler<SendJobResultCompletedEventArgs>(ClientCommunicator_SendJobResultCompleted); 78 79 clientCommunicator.LoginAsync(clientInfo); 79 80 … … 141 142 private void GetFinishedJob(object jobId) { 142 143 long jId = (long)jobId; 143 byte[] obj= engines[jId].GetFinishedJob();144 byte[] sJob = engines[jId].GetFinishedJob(); 144 145 146 JobResult jobResult = new JobResult { JobId = jId, Result = sJob, Client = null }; 147 clientCommunicator.SendJobResultAsync(jobResult, true); 148 145 149 AppDomain.Unload(appDomains[jId]); 146 150 appDomains.Remove(jId); 147 151 engines.Remove(jId); 152 Status.CurrentJobs--; 153 Debug.WriteLine("Decrement CurrentJobs to:" + Status.CurrentJobs.ToString()); 148 154 149 Status.CurrentJobs--;150 Debug.WriteLine("Decrement CurrentJobs to:" + Status.CurrentJobs.ToString());151 155 } 152 156 … … 159 163 bool sandboxed = false; 160 164 161 IJob job = new TestJob { JobId = e.Result.JobId };165 //IJob job = new TestJob { JobId = e.Result.JobId }; 162 166 163 167 PluginManager pm = PluginManager.Manager; … … 165 169 166 170 //AppDomain appDomain = CreateNewAppDomain(sandboxed); 167 appDomains.Add( job.JobId, appDomain);171 appDomains.Add(e.Result.JobId, appDomain); 168 172 169 173 Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName); 170 engine.JobId = job.JobId;174 engine.JobId = e.Result.JobId; 171 175 engine.Queue = MessageQueue.GetInstance(); 172 engine.Start( );173 engines.Add(e ngine.JobId, engine);176 engine.Start(e.Result.SerializedJob); 177 engines.Add(e.Result.JobId, engine); 174 178 175 179 Status.CurrentJobs++; … … 178 182 } 179 183 180 /// <summary> 181 /// Simulator Class for new Jobs. will be replaced with fetching Jobs from the Interface 182 /// </summary> 183 /// <returns></returns> 184 private IJob CreateNewJob() { 185 Random random = new Random(); 186 IJob job = new TestJob(); 187 job.JobId = random.Next(); 188 return job; 184 void ClientCommunicator_SendJobResultCompleted(object sender, SendJobResultCompletedEventArgs e) { 185 // TODO Removing of the Engines & AppDomains should happen here, not in the GetFinishedJob Method. 189 186 } 190 187 } -
trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/Executor.cs
r816 r830 38 38 public MessageQueue Queue { get; set; } 39 39 40 public void Start() { 40 public void Start(byte[] serializedJob) { 41 Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob); 41 42 Job.JobStopped += new EventHandler(Job_JobStopped); 42 43 Job.Start();
Note: See TracChangeset
for help on using the changeset viewer.