forked from InEngine-NET/InEngine.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngineHost.cs
More file actions
39 lines (34 loc) · 1.28 KB
/
EngineHost.cs
File metadata and controls
39 lines (34 loc) · 1.28 KB
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
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace IntegrationEngine
{
public class EngineHost : IDisposable
{
EngineHostCompositionRoot engineHostCompositionRoot;
public IUnityContainer Container { get { return engineHostCompositionRoot.Container; } }
public IList<Assembly> AssembliesWithJobs { get; set; }
public EngineHost(params Assembly[] assembliesWithJobs)
{
AssembliesWithJobs = assembliesWithJobs.ToList();
}
public void Dispose()
{
if (engineHostCompositionRoot != null)
engineHostCompositionRoot.Dispose();
}
public void Initialize(bool isThreadedListenerEnabled = true,
bool isSchedulerEnabled = true,
bool isWebApiEnabled = true)
{
engineHostCompositionRoot = new EngineHostCompositionRoot(AssembliesWithJobs) {
IsWebApiEnabled = isWebApiEnabled,
IsSchedulerEnabled = isSchedulerEnabled,
IsMessageQueueListenerManagerEnabled = isThreadedListenerEnabled,
};
engineHostCompositionRoot.Configure();
}
}
}