IKernel.cs 3.8 KB

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