Last change
on this file since 3011 was
3011,
checked in by kgrading, 15 years ago
|
changed the complete DAL to LINQ 2 SQL (with the exception of the job streaming), did a lot of refactoring, Introduced DTOs (that are named DTOs for better understanding), added the spring.NET Interceptor, reintroduced transactions and cleaned up the whole JobResult thing and updated a part of the config merger (#830)
|
File size:
1.6 KB
|
Line | |
---|
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;
|
---|
15 |
|
---|
16 | public static IClientDao ClientDao {
|
---|
17 | get {
|
---|
18 | if (clientDao == null)
|
---|
19 | clientDao = new ClientDao();
|
---|
20 | return clientDao;
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | public static IClientConfigDao ClientConfigDao {
|
---|
25 | get {
|
---|
26 | if(clientConfigDao == null)
|
---|
27 | clientConfigDao = new ClientConfigDao();
|
---|
28 | return clientConfigDao;
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | public static IClientGroupDao ClientGroupDao {
|
---|
33 | get {
|
---|
34 | if(clientGroupDao == null)
|
---|
35 | clientGroupDao = new ClientGroupDao();
|
---|
36 | return clientGroupDao;
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 | public static IJobDao JobDao {
|
---|
41 | get {
|
---|
42 | if(jobDao == null)
|
---|
43 | jobDao = new JobDao();
|
---|
44 | return jobDao;
|
---|
45 | }
|
---|
46 | }
|
---|
47 |
|
---|
48 | public static IPluginInfoDao PluginInfoDao {
|
---|
49 | get {
|
---|
50 | if(pluginInfoDao == null)
|
---|
51 | pluginInfoDao = new PluginInfoDao();
|
---|
52 | return pluginInfoDao;
|
---|
53 | }
|
---|
54 | }
|
---|
55 |
|
---|
56 | public static void DestroyContext() {
|
---|
57 | if (ContextFactory.Context != null) {
|
---|
58 | ContextFactory.Context.Dispose();
|
---|
59 | ContextFactory.Context = null;
|
---|
60 | }
|
---|
61 | }
|
---|
62 |
|
---|
63 | }
|
---|
64 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.