IKernel.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. /// Called when [application updated].
  50. /// </summary>
  51. /// <param name="newVersion">The new version.</param>
  52. void OnApplicationUpdated(Version newVersion);
  53. /// <summary>
  54. /// Gets the name of the web application.
  55. /// </summary>
  56. /// <value>The name of the web application.</value>
  57. string WebApplicationName { get; }
  58. /// <summary>
  59. /// Performs the pending restart.
  60. /// </summary>
  61. void PerformPendingRestart();
  62. /// <summary>
  63. /// Gets the plugins.
  64. /// </summary>
  65. /// <value>The plugins.</value>
  66. IEnumerable<IPlugin> Plugins { get; }
  67. /// <summary>
  68. /// Gets the UDP server port number.
  69. /// </summary>
  70. /// <value>The UDP server port number.</value>
  71. int UdpServerPortNumber { get; }
  72. /// <summary>
  73. /// Gets the HTTP server URL prefix.
  74. /// </summary>
  75. /// <value>The HTTP server URL prefix.</value>
  76. string HttpServerUrlPrefix { get; }
  77. /// <summary>
  78. /// Gets the TCP manager.
  79. /// </summary>
  80. /// <value>The TCP manager.</value>
  81. IServerManager ServerManager { get; }
  82. /// <summary>
  83. /// Gets the web socket listeners.
  84. /// </summary>
  85. /// <value>The web socket listeners.</value>
  86. IEnumerable<IWebSocketListener> WebSocketListeners { get; }
  87. /// <summary>
  88. /// Occurs when [reload completed].
  89. /// </summary>
  90. event EventHandler<EventArgs> ReloadCompleted;
  91. /// <summary>
  92. /// Occurs when [configuration updated].
  93. /// </summary>
  94. event EventHandler<EventArgs> ConfigurationUpdated;
  95. /// <summary>
  96. /// Notifies the pending restart.
  97. /// </summary>
  98. void NotifyPendingRestart();
  99. /// <summary>
  100. /// Gets the XML configuration.
  101. /// </summary>
  102. /// <param name="type">The type.</param>
  103. /// <param name="path">The path.</param>
  104. /// <returns>System.Object.</returns>
  105. object GetXmlConfiguration(Type type, string path);
  106. }
  107. }