[3011] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Text;
|
---|
| 4 | using HeuristicLab.Hive.Server.DataAccess;
|
---|
| 5 | using HeuristicLab.Hive.Server.LINQDataAccess;
|
---|
| 6 |
|
---|
| 7 | namespace 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;
|
---|
[3022] | 15 | [ThreadStatic] private static IUptimeCalendarDao uptimeCalendarDao;
|
---|
[3011] | 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 |
|
---|
[3022] | 57 | public static IUptimeCalendarDao UptimeCalendarDao {
|
---|
| 58 | get {
|
---|
| 59 | if (uptimeCalendarDao == null)
|
---|
| 60 | uptimeCalendarDao = new UptimeCalendarDao();
|
---|
| 61 | return uptimeCalendarDao;
|
---|
| 62 | }
|
---|
| 63 | }
|
---|
| 64 |
|
---|
[3011] | 65 | public static void DestroyContext() {
|
---|
| 66 | if (ContextFactory.Context != null) {
|
---|
| 67 | ContextFactory.Context.Dispose();
|
---|
| 68 | ContextFactory.Context = null;
|
---|
| 69 | }
|
---|
| 70 | }
|
---|
| 71 |
|
---|
| 72 | }
|
---|
| 73 | }
|
---|