2
0

IKernel.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Common.Plugins;
  3. using MediaBrowser.Model.Configuration;
  4. using MediaBrowser.Model.System;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Threading.Tasks;
  8. namespace MediaBrowser.Common.Kernel
  9. {
  10. /// <summary>
  11. /// Interface IKernel
  12. /// </summary>
  13. public interface IKernel
  14. {
  15. /// <summary>
  16. /// Gets the application paths.
  17. /// </summary>
  18. /// <value>The application paths.</value>
  19. IApplicationPaths ApplicationPaths { get; }
  20. /// <summary>
  21. /// Gets the configuration.
  22. /// </summary>
  23. /// <value>The configuration.</value>
  24. BaseApplicationConfiguration Configuration { get; }
  25. /// <summary>
  26. /// Gets the kernel context.
  27. /// </summary>
  28. /// <value>The kernel context.</value>
  29. KernelContext KernelContext { get; }
  30. /// <summary>
  31. /// Inits this instance.
  32. /// </summary>
  33. /// <returns>Task.</returns>
  34. Task Init();
  35. /// <summary>
  36. /// Reloads this instance.
  37. /// </summary>
  38. /// <returns>Task.</returns>
  39. Task Reload();
  40. /// <summary>
  41. /// Gets or sets a value indicating whether this instance has pending kernel reload.
  42. /// </summary>
  43. /// <value><c>true</c> if this instance has pending kernel reload; otherwise, <c>false</c>.</value>
  44. bool HasPendingRestart { get; }
  45. /// <summary>
  46. /// Disposes this instance.
  47. /// </summary>
  48. void Dispose();
  49. /// <summary>
  50. /// Gets the system status.
  51. /// </summary>
  52. /// <returns>SystemInfo.</returns>
  53. SystemInfo GetSystemInfo();
  54. /// <summary>
  55. /// Reloads the logger.
  56. /// </summary>
  57. void ReloadLogger();
  58. /// <summary>
  59. /// Called when [application updated].
  60. /// </summary>
  61. /// <param name="newVersion">The new version.</param>
  62. void OnApplicationUpdated(Version newVersion);
  63. /// <summary>
  64. /// Gets the name of the web application.
  65. /// </summary>
  66. /// <value>The name of the web application.</value>
  67. string WebApplicationName { get; }
  68. /// <summary>
  69. /// Gets the log file path.
  70. /// </summary>
  71. /// <value>The log file path.</value>
  72. string LogFilePath { get; }
  73. /// <summary>
  74. /// Performs the pending restart.
  75. /// </summary>
  76. void PerformPendingRestart();
  77. /// <summary>
  78. /// Gets the plugins.
  79. /// </summary>
  80. /// <value>The plugins.</value>
  81. IEnumerable<IPlugin> Plugins { get; }
  82. /// <summary>
  83. /// Gets the UDP server port number.
  84. /// </summary>
  85. /// <value>The UDP server port number.</value>
  86. int UdpServerPortNumber { get; }
  87. /// <summary>
  88. /// Gets the HTTP server URL prefix.
  89. /// </summary>
  90. /// <value>The HTTP server URL prefix.</value>
  91. string HttpServerUrlPrefix { get; }
  92. /// <summary>
  93. /// Gets a value indicating whether this instance is first run.
  94. /// </summary>
  95. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  96. bool IsFirstRun { get; }
  97. /// <summary>
  98. /// Gets the TCP manager.
  99. /// </summary>
  100. /// <value>The TCP manager.</value>
  101. TcpManager TcpManager { get; }
  102. /// <summary>
  103. /// Gets the web socket listeners.
  104. /// </summary>
  105. /// <value>The web socket listeners.</value>
  106. IEnumerable<IWebSocketListener> WebSocketListeners { get; }
  107. /// <summary>
  108. /// Occurs when [logger loaded].
  109. /// </summary>
  110. event EventHandler LoggerLoaded;
  111. /// <summary>
  112. /// Occurs when [reload completed].
  113. /// </summary>
  114. event EventHandler<EventArgs> ReloadCompleted;
  115. /// <summary>
  116. /// Occurs when [configuration updated].
  117. /// </summary>
  118. event EventHandler<EventArgs> ConfigurationUpdated;
  119. /// <summary>
  120. /// Gets the rest services.
  121. /// </summary>
  122. /// <value>The rest services.</value>
  123. IEnumerable<IRestfulService> RestServices { get; }
  124. /// <summary>
  125. /// Notifies the pending restart.
  126. /// </summary>
  127. void NotifyPendingRestart();
  128. /// <summary>
  129. /// Gets the XML configuration.
  130. /// </summary>
  131. /// <param name="type">The type.</param>
  132. /// <param name="path">The path.</param>
  133. /// <returns>System.Object.</returns>
  134. object GetXmlConfiguration(Type type, string path);
  135. }
  136. }