Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/DaoLocator.cs @ 4267

Last change on this file since 4267 was 4267, checked in by cneumuel, 14 years ago

renamed all database entities from "Client" to "Slave" (#1157)
made slave-heartbeats synchronous, also they send HBs when timetable disallows them to calculate. they will appear on the server as Idle bis IsAllowedToCalculate will be false (#1159)

File size: 1.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using HeuristicLab.Hive.Server.DataAccess;
5using HeuristicLab.Hive.Server.LINQDataAccess;
6
7namespace HeuristicLab.Hive.Server.Core {
8  public class DaoLocator {
9   
10    [ThreadStatic] private static ISlaveDao clientDao;
11    [ThreadStatic] private static ISlaveConfigDao clientConfigDao;
12    [ThreadStatic] private static ISlaveGroupDao clientGroupDao;
13    [ThreadStatic] private static IJobDao jobDao;
14    [ThreadStatic] private static IPluginInfoDao pluginInfoDao;
15    [ThreadStatic] private static IUptimeCalendarDao uptimeCalendarDao;
16
17    public static ISlaveDao SlaveDao {
18      get {
19        if (clientDao == null)
20          clientDao = new SlaveDao();
21        return clientDao;
22      }
23    }
24
25    public static ISlaveConfigDao SlaveConfigDao {
26      get {
27        if(clientConfigDao == null)
28          clientConfigDao = new SlaveConfigDao();
29        return clientConfigDao;
30      }
31    }
32
33    public static ISlaveGroupDao SlaveGroupDao {
34      get {
35        if(clientGroupDao == null)
36          clientGroupDao = new SlaveGroupDao();
37        return clientGroupDao;
38      }
39    }
40
41    public static IJobDao JobDao {
42      get {
43        if(jobDao == null)
44          jobDao = new JobDao();
45        return jobDao;
46      }
47    }
48
49    public static IPluginInfoDao PluginInfoDao {
50      get {
51        if(pluginInfoDao == null)
52          pluginInfoDao = new PluginInfoDao();
53        return pluginInfoDao;
54      }
55    }
56
57    public static IUptimeCalendarDao UptimeCalendarDao {
58      get {
59        if (uptimeCalendarDao == null)
60          uptimeCalendarDao = new UptimeCalendarDao();
61        return uptimeCalendarDao;
62      }
63    }
64  }
65}
Note: See TracBrowser for help on using the repository browser.