- Timestamp:
- 02/01/11 18:12:46 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs
r5404 r5405 75 75 /// </summary> 76 76 public void Connect(HeuristicLab.Services.Hive.Common.DataTransfer.Slave slaveInfo) { 77 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {77 using (Disposable<IHiveService> service = GetSlaveService()) { 78 78 try { 79 79 ConnState = NetworkEnum.WcfConnState.Connected; 80 80 ConnectedSince = DateTime.Now; 81 service.Obj.Hello(slaveInfo .Id/*Settings.Default.Guid*/, slaveInfo.Name, slaveInfo.Cores.Value, slaveInfo.Memory.Value);81 service.Obj.Hello(slaveInfo); 82 82 OnConnected(); 83 83 } … … 92 92 /// </summary> 93 93 public void Disconnect() { 94 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {94 using (Disposable<IHiveService> service = GetSlaveService()) { 95 95 try { 96 96 service.Obj.GoodBye(ConfigManager.Instance.GetClientInfo().Id); … … 116 116 /// </summary> 117 117 public Job GetJob(Guid jobId) { 118 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {118 using (Disposable<IHiveService> service = GetSlaveService()) { 119 119 try { 120 120 Job job = service.Obj.GetJob(jobId); … … 129 129 130 130 public JobData GetJobData(Guid jobId) { 131 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {131 using (Disposable<IHiveService> service = GetSlaveService()) { 132 132 try { 133 133 JobData jobData = service.Obj.GetJobData(jobId); … … 147 147 /// <param name="jobData"></param> 148 148 public void UpdateJob(Job job, JobData jobData) { 149 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {149 using (Disposable<IHiveService> service = GetSlaveService()) { 150 150 try { 151 151 service.Obj.UpdateJob(job, jobData); … … 158 158 159 159 public List<MessageContainer> SendHeartbeat(Heartbeat heartbeat) { 160 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {160 using (Disposable<IHiveService> service = GetSlaveService()) { 161 161 try { 162 162 List<MessageContainer> msg = service.Obj.Heartbeat(heartbeat); … … 171 171 172 172 public IEnumerable<PluginData> GetPluginDatas(List<Guid> pluginIds) { 173 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {173 using (Disposable<IHiveService> service = GetSlaveService()) { 174 174 try { 175 175 IEnumerable<PluginData> msg = service.Obj.GetPluginDatas(pluginIds); … … 184 184 185 185 public IEnumerable<Plugin> GetPlugins() { 186 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {186 using (Disposable<IHiveService> service = GetSlaveService()) { 187 187 try { 188 188 IEnumerable<Plugin> msg = service.Obj.GetPlugins(); … … 197 197 198 198 public Guid AddChildJob(Guid parentJobId, Job job, JobData jobData) { 199 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {199 using (Disposable<IHiveService> service = GetSlaveService()) { 200 200 try { 201 201 Guid msg = service.Obj.AddChildJob(parentJobId, job, jobData); … … 210 210 211 211 public IEnumerable<JobData> GetChildJobs(Guid? parentJobId) { 212 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {212 using (Disposable<IHiveService> service = GetSlaveService()) { 213 213 try { 214 214 IEnumerable<LightweightJob> msg = service.Obj.GetLightweightChildJobs(parentJobId, false, false); … … 228 228 229 229 public void DeleteChildJobs(Guid jobId) { 230 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {230 using (Disposable<IHiveService> service = GetSlaveService()) { 231 231 try { 232 232 service.Obj.DeleteChildJobs(jobId); … … 239 239 240 240 public PluginData GetConfigurationFile() { 241 using (Disposable<IHiveService> service = ServiceLocator.Instance.GetService()) {241 using (Disposable<IHiveService> service = GetSlaveService()) { 242 242 try { 243 243 PluginData msg = service.Obj.GetConfigurationFile(); … … 249 249 } 250 250 } 251 } 252 253 private static Disposable<IHiveService> GetSlaveService() { 254 return ServiceLocator.Instance.GetService("hiveslave", "hiveslave"); 251 255 } 252 256 }
Note: See TracChangeset
for help on using the changeset viewer.