Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Slave/3.3/TraceCom.cs @ 6989

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

#1680:

  • 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;
24namespace HeuristicLab.Clients.Hive.SlaveCore {
25
26  /// <summary>
27  /// Class for writing the client communication to Trace
28  /// </summary>
29  public class TraceCom : IClientCom {
30    private ISlaveCommunication clientCom;
31
32    public TraceCom() {
33      clientCom = new TraceSlaveCommunication();
34    }
35
36    public ISlaveCommunication GetSlaveCom() {
37      return clientCom;
38    }
39
40    public void Close() {
41      // Nothing to do here ...
42    }
43
44    #region Private Class
45    private class TraceSlaveCommunication : ISlaveCommunication {
46
47      public TraceSlaveCommunication() {
48
49      }
50
51      public StatusCommons Subscribe() {
52        Trace.WriteLine("Subscribe");
53        return new StatusCommons();
54      }
55
56      public bool Unsubscribe() {
57        Trace.WriteLine("Unsubscribe");
58        return false;
59      }
60
61      public void Restart() {
62        Trace.WriteLine("Restart");
63      }
64
65      public void Sleep() {
66        Trace.WriteLine("Sleep");
67      }
68
69      public void PauseAll() {
70        Trace.WriteLine("PauseAll");
71      }
72
73      public void StopAll() {
74        Trace.WriteLine("StopAll");
75      }
76
77      public void AbortAll() {
78        Trace.WriteLine("AbortAll");
79      }
80
81      public void LogMessage(string message) {
82        Trace.WriteLine(message);
83      }
84
85      public void StatusChanged(StatusCommons status) {
86        Trace.WriteLine("StatusChanged: " + status);
87      }
88
89      public void Shutdown() {
90        Trace.WriteLine("Shutdown");
91      }
92    }
93
94    #endregion
95  }
96}
Note: See TracBrowser for help on using the repository browser.