-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBaseService.cs
91 lines (74 loc) · 3.29 KB
/
BaseService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using ExpressBase.Common.Constants;
using ExpressBase.Common.Data;
using ExpressBase.Common.ServiceClients;
using ServiceStack;
using ServiceStack.Logging;
using ServiceStack.Messaging;
using ServiceStack.RabbitMq;
namespace ExpressBase.StaticFileServer
{
public class BaseService : Service
{
protected EbConnectionFactory EbConnectionFactory { get; private set; }
private EbConnectionFactory _infraConnectionFactory = null;
protected RabbitMqProducer MessageProducer3 { get; private set; }
protected RabbitMqQueueClient MessageQueueClient { get; private set; }
protected EbServerEventClient ServerEventClient { get; private set; }
protected EbMqClient MqClient { get; private set; }
protected EbConnectionFactory InfraConnectionFactory
{
get
{
if (_infraConnectionFactory == null)
_infraConnectionFactory = new EbConnectionFactory(CoreConstants.EXPRESSBASE, this.Redis);
return _infraConnectionFactory;
}
}
public BaseService()
{
}
public BaseService(IEbConnectionFactory _dbf)
{
Log.Info("In Base Service 1");
this.EbConnectionFactory = _dbf as EbConnectionFactory;
}
public BaseService(IEbConnectionFactory _dbf, IEbServerEventClient _sec)
{
this.EbConnectionFactory = _dbf as EbConnectionFactory;
this.ServerEventClient = _sec as EbServerEventClient;
}
public BaseService(IEbConnectionFactory _dbf, IEbMqClient _mqc)
{
this.EbConnectionFactory = _dbf as EbConnectionFactory;
this.MqClient = _mqc as EbMqClient;
}
public BaseService(IEbConnectionFactory _dbf, IEbServerEventClient _sec, IEbMqClient _mqc)
{
this.EbConnectionFactory = _dbf as EbConnectionFactory;
this.ServerEventClient = _sec as EbServerEventClient;
this.MqClient = _mqc as EbMqClient;
}
public BaseService(IEbConnectionFactory _dbf, IMessageProducer _msp, IMessageQueueClient _mqc, IEbServerEventClient _sec, IEbMqClient _mq)
{
this.EbConnectionFactory = _dbf as EbConnectionFactory;
this.MessageProducer3 = _msp as RabbitMqProducer;
this.MessageQueueClient = _mqc as RabbitMqQueueClient;
this.ServerEventClient = _sec as EbServerEventClient;
this.MqClient = _mq as EbMqClient;
}
public BaseService(IEbConnectionFactory _dbf, IMessageProducer _msp, IMessageQueueClient _mqc, IEbServerEventClient _sec)
{
this.EbConnectionFactory = _dbf as EbConnectionFactory;
this.MessageProducer3 = _msp as RabbitMqProducer;
this.MessageQueueClient = _mqc as RabbitMqQueueClient;
this.ServerEventClient = _sec as EbServerEventClient;
}
public BaseService(IEbConnectionFactory _dbf, IMessageProducer _msp, IMessageQueueClient _mqc)
{
this.EbConnectionFactory = _dbf as EbConnectionFactory;
this.MessageProducer3 = _msp as RabbitMqProducer;
this.MessageQueueClient = _mqc as RabbitMqQueueClient;
}
public ILog Log { get { return LogManager.GetLogger(GetType()); } }
}
}