IKernel.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using MediaBrowser.Common.Plugins;
  2. using MediaBrowser.Common.Security;
  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 : IDisposable
  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. /// Gets or sets a value indicating whether this instance has pending kernel reload.
  37. /// </summary>
  38. /// <value><c>true</c> if this instance has pending kernel reload; otherwise, <c>false</c>.</value>
  39. bool HasPendingRestart { get; }
  40. /// <summary>
  41. /// Gets the system status.
  42. /// </summary>
  43. /// <returns>SystemInfo.</returns>
  44. SystemInfo GetSystemInfo();
  45. /// <summary>
  46. /// Called when [application updated].
  47. /// </summary>
  48. /// <param name="newVersion">The new version.</param>
  49. void OnApplicationUpdated(Version newVersion);
  50. /// <summary>
  51. /// Gets the name of the web application.
  52. /// </summary>
  53. /// <value>The name of the web application.</value>
  54. string WebApplicationName { get; }
  55. /// <summary>
  56. /// Performs the pending restart.
  57. /// </summary>
  58. void PerformPendingRestart();
  59. /// <summary>
  60. /// Gets the plugins.
  61. /// </summary>
  62. /// <value>The plugins.</value>
  63. IEnumerable<IPlugin> Plugins { get; }
  64. /// <summary>
  65. /// Gets the UDP server port number.
  66. /// </summary>
  67. /// <value>The UDP server port number.</value>
  68. int UdpServerPortNumber { get; }
  69. /// <summary>
  70. /// Gets the HTTP server URL prefix.
  71. /// </summary>
  72. /// <value>The HTTP server URL prefix.</value>
  73. string HttpServerUrlPrefix { get; }
  74. /// <summary>
  75. /// Gets the TCP manager.
  76. /// </summary>
  77. /// <value>The TCP manager.</value>
  78. IServerManager ServerManager { get; }
  79. /// <summary>
  80. /// Gets the plug-in security manager.
  81. /// </summary>
  82. /// <value>The plug-in security manager.</value>
  83. ISecurityManager SecurityManager { get; set; }
  84. /// <summary>
  85. /// Gets the web socket listeners.
  86. /// </summary>
  87. /// <value>The web socket listeners.</value>
  88. IEnumerable<IWebSocketListener> WebSocketListeners { get; }
  89. /// <summary>
  90. /// Occurs when [reload completed].
  91. /// </summary>
  92. event EventHandler<EventArgs> ReloadCompleted;
  93. /// <summary>
  94. /// Occurs when [configuration updated].
  95. /// </summary>
  96. event EventHandler<EventArgs> ConfigurationUpdated;
  97. /// <summary>
  98. /// Notifies the pending restart.
  99. /// </summary>
  100. void NotifyPendingRestart();
  101. /// <summary>
  102. /// Gets the XML configuration.
  103. /// </summary>
  104. /// <param name="type">The type.</param>
  105. /// <param name="path">The path.</param>
  106. /// <returns>System.Object.</returns>
  107. object GetXmlConfiguration(Type type, string path);
  108. /// <summary>
  109. /// Limits simultaneous access to various resources
  110. /// </summary>
  111. /// <value>The resource pools.</value>
  112. ResourcePool ResourcePools { get; set; }
  113. /// <summary>
  114. /// Removes the plugin.
  115. /// </summary>
  116. /// <param name="plugin">The plugin.</param>
  117. void RemovePlugin(IPlugin plugin);
  118. }
  119. }