Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Clients.Hive.Slave/3.3/TraceCom.cs @ 11328

Last change on this file since 11328 was 8242, checked in by spimming, 12 years ago

#1888:

  • slave worker role initial commit
  • start client communication service optionally
  • make slave client communication interchangeable ('PipeCom', 'TraceCom')
File size: 2.5 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System.Diagnostics;
23using HeuristicLab.Clients.Hive.SlaveCore.ServiceContracts;
24
25namespace HeuristicLab.Clients.Hive.SlaveCore {
26
27  /// <summary>
28  /// Class for writing the client communication to Trace
29  /// </summary>
30  public class TraceCom : IClientCom {
31    private ISlaveCommunication clientCom;
32
33    public TraceCom() {
34      clientCom = new TraceSlaveCommunication();
35    }
36
37    public ISlaveCommunication GetSlaveCom() {
38      return clientCom;
39    }
40
41    public void Close() {
42      // Nothing to do here ...
43    }
44
45    #region Private Class
46    private class TraceSlaveCommunication : ISlaveCommunication {
47
48      public TraceSlaveCommunication() {
49
50      }
51
52      public StatusCommons Subscribe() {
53        Trace.WriteLine("Subscribe");
54        return new StatusCommons();
55      }
56
57      public bool Unsubscribe() {
58        Trace.WriteLine("Unsubscribe");
59        return false;
60      }
61
62      public void Restart() {
63        Trace.WriteLine("Restart");
64      }
65
66      public void Sleep() {
67        Trace.WriteLine("Sleep");
68      }
69
70      public void PauseAll() {
71        Trace.WriteLine("PauseAll");
72      }
73
74      public void StopAll() {
75        Trace.WriteLine("StopAll");
76      }
77
78      public void AbortAll() {
79        Trace.WriteLine("AbortAll");
80      }
81
82      public void LogMessage(string message) {
83        Trace.WriteLine(message);
84      }
85
86      public void StatusChanged(StatusCommons status) {
87        Trace.WriteLine("StatusChanged: " + status);
88      }
89
90      public void Shutdown() {
91        Trace.WriteLine("Shutdown");
92      }
93    }
94
95    #endregion
96  }
97}
Note: See TracBrowser for help on using the repository browser.