IKernel.cs 3.9 KB

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