Commit ca09d8bb59f54d81bbe00112b637a7f250bbc721
1 parent
10ecabc5
- csak egy-két név változtatás
Showing
2 changed files
with
14 additions
and
14 deletions
Show diff stats
Vrh.Web.Reporting/Global.asax.cs
@@ -30,7 +30,7 @@ namespace Vrh.Web.Reporting | @@ -30,7 +30,7 @@ namespace Vrh.Web.Reporting | ||
30 | RouteConfig.RegisterRoutes(RouteTable.Routes); | 30 | RouteConfig.RegisterRoutes(RouteTable.Routes); |
31 | BundleConfig.RegisterBundles(BundleTable.Bundles); | 31 | BundleConfig.RegisterBundles(BundleTable.Bundles); |
32 | 32 | ||
33 | - WebServerHostedServiceStarter.Init(typeof(Vrh.iScheduler.WAHostedMonitorHangfire)); | 33 | + WebServerHostedServiceStarter.Start(typeof(Vrh.iScheduler.WAHostedMonitorHangfire)); |
34 | //IISHostedServiceStarter.Init(Vrh.iScheduler.WAHostedMonitorHangfire.Start, Vrh.iScheduler.WAHostedMonitorHangfire.Stop); | 34 | //IISHostedServiceStarter.Init(Vrh.iScheduler.WAHostedMonitorHangfire.Start, Vrh.iScheduler.WAHostedMonitorHangfire.Stop); |
35 | //IISHostedServiceStarter.Init(Vrh.iScheduler.WAHostedMonitor.Start, Vrh.iScheduler.WAHostedMonitor.Stop); | 35 | //IISHostedServiceStarter.Init(Vrh.iScheduler.WAHostedMonitor.Start, Vrh.iScheduler.WAHostedMonitor.Stop); |
36 | 36 |
Vrh.Web.Reporting/WebServerHostedServiceStarter.cs
@@ -39,9 +39,9 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | @@ -39,9 +39,9 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | ||
39 | /// IWebServerHostedServiceStarter interfészt meg kell valósítsa, bár ezt nem ellenőrzi, csak azt, | 39 | /// IWebServerHostedServiceStarter interfészt meg kell valósítsa, bár ezt nem ellenőrzi, csak azt, |
40 | /// hogy az ezt jelentő 'public static void Start();' és 'public static void Stop();' metódusok megvannak-e. | 40 | /// hogy az ezt jelentő 'public static void Start();' és 'public static void Stop();' metódusok megvannak-e. |
41 | /// </param> | 41 | /// </param> |
42 | - public static void Init(Type tt) | 42 | + public static void Start(Type tt) |
43 | { | 43 | { |
44 | - var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Init)}"); | 44 | + var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Start)}"); |
45 | try | 45 | try |
46 | { | 46 | { |
47 | //if (!tt.GetInterfaces().Contains(typeof(IWebServerHostedServiceStarter))) throw new InterfaceErrorApplicationException(tt.FullName); | 47 | //if (!tt.GetInterfaces().Contains(typeof(IWebServerHostedServiceStarter))) throw new InterfaceErrorApplicationException(tt.FullName); |
@@ -66,9 +66,9 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | @@ -66,9 +66,9 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | ||
66 | /// </summary> | 66 | /// </summary> |
67 | /// <param name="externalinitializerstartmethod">az indító metódus</param> | 67 | /// <param name="externalinitializerstartmethod">az indító metódus</param> |
68 | /// <param name="externalinitializerstopmethod">a leállító metódus</param> | 68 | /// <param name="externalinitializerstopmethod">a leállító metódus</param> |
69 | - public static void Init(List<Type> ttList) | 69 | + public static void Start(List<Type> ttList) |
70 | { | 70 | { |
71 | - var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Init)}"); | 71 | + var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Start)}"); |
72 | try | 72 | try |
73 | { | 73 | { |
74 | //if (!tt.GetInterfaces().Contains(typeof(IInterface))) throw new Exception ($"{tt.FullName} does not implement {nameof(IInterface)}!"); | 74 | //if (!tt.GetInterfaces().Contains(typeof(IInterface))) throw new Exception ($"{tt.FullName} does not implement {nameof(IInterface)}!"); |
@@ -92,19 +92,14 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | @@ -92,19 +92,14 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | ||
92 | finally { le.Write(); } | 92 | finally { le.Write(); } |
93 | } | 93 | } |
94 | 94 | ||
95 | - private class InterfaceErrorApplicationException : ApplicationException | ||
96 | - { | ||
97 | - public InterfaceErrorApplicationException(string typename, string methodname) : base($"Class '{typename}' does not implement 'public static void {methodname}()' action!") { } | ||
98 | - public InterfaceErrorApplicationException(string typename) : base($"Class '{typename}' does not implement '{nameof(IWebServerHostedServiceStarter)}' interface!") { } | ||
99 | - } | ||
100 | /// <summary> | 95 | /// <summary> |
101 | /// Egy hosted service elindítását, paraméterezését, konfigurálását és a külső iniciátor meghívást végzi. | 96 | /// Egy hosted service elindítását, paraméterezését, konfigurálását és a külső iniciátor meghívást végzi. |
102 | /// </summary> | 97 | /// </summary> |
103 | /// <param name="externalinitializerstartmethod">az indító metódus</param> | 98 | /// <param name="externalinitializerstartmethod">az indító metódus</param> |
104 | /// <param name="externalinitializerstopmethod">a leállító metódus</param> | 99 | /// <param name="externalinitializerstopmethod">a leállító metódus</param> |
105 | - public static void Init(Action externalinitializerstartmethod, Action externalinitializerstopmethod) | 100 | + public static void Start(Action externalinitializerstartmethod, Action externalinitializerstopmethod) |
106 | { | 101 | { |
107 | - var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Init)}"); | 102 | + var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Start)}"); |
108 | try | 103 | try |
109 | { | 104 | { |
110 | _SetupAutoStart<WebServerHostedServiceStarter>(le: le); | 105 | _SetupAutoStart<WebServerHostedServiceStarter>(le: le); |
@@ -118,9 +113,9 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | @@ -118,9 +113,9 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | ||
118 | /// <summary> | 113 | /// <summary> |
119 | /// Több hosted service elindítását, paraméterezését, konfigurálását és a külső iniciátorok meghívást végzi. | 114 | /// Több hosted service elindítását, paraméterezését, konfigurálását és a külső iniciátorok meghívást végzi. |
120 | /// </summary> | 115 | /// </summary> |
121 | - public static void Init(List<Tuple<Action, Action>> externalinitializerList) | 116 | + public static void Start(List<Tuple<Action, Action>> externalinitializerList) |
122 | { | 117 | { |
123 | - var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Init)}"); | 118 | + var le = new DCLogEntry(LogLevel.Information, $"{typeof(WebServerHostedServiceStarter).FullName}.{nameof(Start)}"); |
124 | try | 119 | try |
125 | { | 120 | { |
126 | _SetupAutoStart<WebServerHostedServiceStarter>(le: le); | 121 | _SetupAutoStart<WebServerHostedServiceStarter>(le: le); |
@@ -167,6 +162,11 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | @@ -167,6 +162,11 @@ namespace Vrh.Web.WebServerHostedServiceStarterNS | ||
167 | 162 | ||
168 | 163 | ||
169 | #region private members | 164 | #region private members |
165 | + private class InterfaceErrorApplicationException : ApplicationException | ||
166 | + { | ||
167 | + public InterfaceErrorApplicationException(string typename, string methodname) : base($"Class '{typename}' does not implement 'public static void {methodname}()' action!") { } | ||
168 | + public InterfaceErrorApplicationException(string typename) : base($"Class '{typename}' does not implement '{nameof(IWebServerHostedServiceStarter)}' interface!") { } | ||
169 | + } | ||
170 | void IRegisteredObject.Stop(bool immediate) { Stop(); } | 170 | void IRegisteredObject.Stop(bool immediate) { Stop(); } |
171 | private void _RegisterExternalInitializer(Action externalinitializerstartmethod, Action externalinitializerstopmethod, DCLogEntry le) | 171 | private void _RegisterExternalInitializer(Action externalinitializerstartmethod, Action externalinitializerstopmethod, DCLogEntry le) |
172 | { | 172 | { |