IKernel.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. /// Occurs when [has pending restart changed].
  17. /// </summary>
  18. event EventHandler HasPendingRestartChanged;
  19. /// <summary>
  20. /// Gets the application paths.
  21. /// </summary>
  22. /// <value>The application paths.</value>
  23. IApplicationPaths ApplicationPaths { get; }
  24. /// <summary>
  25. /// Gets the configuration.
  26. /// </summary>
  27. /// <value>The configuration.</value>
  28. BaseApplicationConfiguration Configuration { get; }
  29. /// <summary>
  30. /// Gets the kernel context.
  31. /// </summary>
  32. /// <value>The kernel context.</value>
  33. KernelContext KernelContext { get; }
  34. /// <summary>
  35. /// Inits this instance.
  36. /// </summary>
  37. /// <returns>Task.</returns>
  38. Task Init();
  39. /// <summary>
  40. /// Gets or sets a value indicating whether this instance has pending kernel reload.
  41. /// </summary>
  42. /// <value><c>true</c> if this instance has pending kernel reload; otherwise, <c>false</c>.</value>
  43. bool HasPendingRestart { get; }
  44. /// <summary>
  45. /// Gets the system status.
  46. /// </summary>
  47. /// <returns>SystemInfo.</returns>
  48. SystemInfo GetSystemInfo();
  49. /// <summary>
  50. /// Called when [application updated].
  51. /// </summary>
  52. /// <param name="newVersion">The new version.</param>
  53. void OnApplicationUpdated(Version newVersion);
  54. /// <summary>
  55. /// Gets the name of the web application.
  56. /// </summary>
  57. /// <value>The name of the web application.</value>
  58. string WebApplicationName { get; }
  59. /// <summary>
  60. /// Performs the pending restart.
  61. /// </summary>
  62. void PerformPendingRestart();
  63. /// <summary>
  64. /// Gets the plugins.
  65. /// </summary>
  66. /// <value>The plugins.</value>
  67. IEnumerable<IPlugin> Plugins { get; }
  68. /// <summary>
  69. /// Gets the UDP server port number.
  70. /// </summary>
  71. /// <value>The UDP server port number.</value>
  72. int UdpServerPortNumber { get; }
  73. /// <summary>
  74. /// Gets the HTTP server URL prefix.
  75. /// </summary>
  76. /// <value>The HTTP server URL prefix.</value>
  77. string HttpServerUrlPrefix { get; }
  78. /// <summary>
  79. /// Gets the plug-in security manager.
  80. /// </summary>
  81. /// <value>The plug-in security manager.</value>
  82. ISecurityManager SecurityManager { get; set; }
  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. /// <summary>
  108. /// Removes the plugin.
  109. /// </summary>
  110. /// <param name="plugin">The plugin.</param>
  111. void RemovePlugin(IPlugin plugin);
  112. }
  113. }