IKernel.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. void 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 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 plug-in security manager.
  75. /// </summary>
  76. /// <value>The plug-in security manager.</value>
  77. ISecurityManager SecurityManager { get; set; }
  78. /// <summary>
  79. /// Occurs when [configuration updated].
  80. /// </summary>
  81. event EventHandler<EventArgs> ConfigurationUpdated;
  82. /// <summary>
  83. /// Notifies the pending restart.
  84. /// </summary>
  85. void NotifyPendingRestart();
  86. /// <summary>
  87. /// Gets the XML configuration.
  88. /// </summary>
  89. /// <param name="type">The type.</param>
  90. /// <param name="path">The path.</param>
  91. /// <returns>System.Object.</returns>
  92. object GetXmlConfiguration(Type type, string path);
  93. /// <summary>
  94. /// Limits simultaneous access to various resources
  95. /// </summary>
  96. /// <value>The resource pools.</value>
  97. ResourcePool ResourcePools { get; set; }
  98. }
  99. }