IKernel.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Common.Plugins;
  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
  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. /// Disposes this instance.
  42. /// </summary>
  43. void Dispose();
  44. /// <summary>
  45. /// Gets the system status.
  46. /// </summary>
  47. /// <returns>SystemInfo.</returns>
  48. SystemInfo GetSystemInfo();
  49. /// <summary>
  50. /// Reloads the logger.
  51. /// </summary>
  52. void ReloadLogger();
  53. /// <summary>
  54. /// Called when [application updated].
  55. /// </summary>
  56. /// <param name="newVersion">The new version.</param>
  57. void OnApplicationUpdated(Version newVersion);
  58. /// <summary>
  59. /// Gets the name of the web application.
  60. /// </summary>
  61. /// <value>The name of the web application.</value>
  62. string WebApplicationName { get; }
  63. /// <summary>
  64. /// Gets the log file path.
  65. /// </summary>
  66. /// <value>The log file path.</value>
  67. string LogFilePath { get; }
  68. /// <summary>
  69. /// Performs the pending restart.
  70. /// </summary>
  71. void PerformPendingRestart();
  72. /// <summary>
  73. /// Gets the plugins.
  74. /// </summary>
  75. /// <value>The plugins.</value>
  76. IEnumerable<IPlugin> Plugins { get; }
  77. /// <summary>
  78. /// Gets the UDP server port number.
  79. /// </summary>
  80. /// <value>The UDP server port number.</value>
  81. int UdpServerPortNumber { get; }
  82. /// <summary>
  83. /// Gets the HTTP server URL prefix.
  84. /// </summary>
  85. /// <value>The HTTP server URL prefix.</value>
  86. string HttpServerUrlPrefix { get; }
  87. /// <summary>
  88. /// Gets the TCP manager.
  89. /// </summary>
  90. /// <value>The TCP manager.</value>
  91. TcpManager TcpManager { get; }
  92. /// <summary>
  93. /// Gets the web socket listeners.
  94. /// </summary>
  95. /// <value>The web socket listeners.</value>
  96. IEnumerable<IWebSocketListener> WebSocketListeners { get; }
  97. /// <summary>
  98. /// Occurs when [logger loaded].
  99. /// </summary>
  100. event EventHandler LoggerLoaded;
  101. /// <summary>
  102. /// Occurs when [reload completed].
  103. /// </summary>
  104. event EventHandler<EventArgs> ReloadCompleted;
  105. /// <summary>
  106. /// Occurs when [configuration updated].
  107. /// </summary>
  108. event EventHandler<EventArgs> ConfigurationUpdated;
  109. /// <summary>
  110. /// Notifies the pending restart.
  111. /// </summary>
  112. void NotifyPendingRestart();
  113. /// <summary>
  114. /// Gets the XML configuration.
  115. /// </summary>
  116. /// <param name="type">The type.</param>
  117. /// <param name="path">The path.</param>
  118. /// <returns>System.Object.</returns>
  119. object GetXmlConfiguration(Type type, string path);
  120. }
  121. }