Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Hive.Server.Core/3.2/DaoLocator.cs @ 3317

Last change on this file since 3317 was 3022, checked in by kgrading, 15 years ago

added the calendar in the dal and the server console. Works on every Resource (Group / Client) (#908)

File size: 1.9 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 IClientDao clientDao;
11    [ThreadStatic] private static IClientConfigDao clientConfigDao;
12    [ThreadStatic] private static IClientGroupDao clientGroupDao;
13    [ThreadStatic] private static IJobDao jobDao;
14    [ThreadStatic] private static IPluginInfoDao pluginInfoDao;
15    [ThreadStatic] private static IUptimeCalendarDao uptimeCalendarDao;
16
17    public static IClientDao ClientDao {
18      get {
19        if (clientDao == null)
20          clientDao = new ClientDao();
21        return clientDao;
22      }
23    }
24
25    public static IClientConfigDao ClientConfigDao {
26      get {
27        if(clientConfigDao == null)
28          clientConfigDao = new ClientConfigDao();
29        return clientConfigDao;
30      }
31    }
32
33    public static IClientGroupDao ClientGroupDao {
34      get {
35        if(clientGroupDao == null)
36          clientGroupDao = new ClientGroupDao();
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    public static void DestroyContext() {
66      if (ContextFactory.Context != null) {
67        ContextFactory.Context.Dispose();
68        ContextFactory.Context = null;
69      }
70    }
71
72  }
73}
Note: See TracBrowser for help on using the repository browser.