IKernel.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Common.Plugins;
  3. using MediaBrowser.Common.Serialization;
  4. using MediaBrowser.Model.Configuration;
  5. using MediaBrowser.Model.System;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Threading.Tasks;
  9. namespace MediaBrowser.Common.Kernel
  10. {
  11. /// <summary>
  12. /// Interface IKernel
  13. /// </summary>
  14. public interface IKernel
  15. {
  16. /// <summary>
  17. /// Gets the application paths.
  18. /// </summary>
  19. /// <value>The application paths.</value>
  20. BaseApplicationPaths ApplicationPaths { get; }
  21. /// <summary>
  22. /// Gets the configuration.
  23. /// </summary>
  24. /// <value>The configuration.</value>
  25. BaseApplicationConfiguration Configuration { get; }
  26. /// <summary>
  27. /// Gets the kernel context.
  28. /// </summary>
  29. /// <value>The kernel context.</value>
  30. KernelContext KernelContext { get; }
  31. /// <summary>
  32. /// Gets the protobuf serializer.
  33. /// </summary>
  34. /// <value>The protobuf serializer.</value>
  35. DynamicProtobufSerializer ProtobufSerializer { get; }
  36. /// <summary>
  37. /// Inits this instance.
  38. /// </summary>
  39. /// <returns>Task.</returns>
  40. Task Init();
  41. /// <summary>
  42. /// Reloads this instance.
  43. /// </summary>
  44. /// <returns>Task.</returns>
  45. Task Reload();
  46. /// <summary>
  47. /// Gets or sets a value indicating whether this instance has pending kernel reload.
  48. /// </summary>
  49. /// <value><c>true</c> if this instance has pending kernel reload; otherwise, <c>false</c>.</value>
  50. bool HasPendingRestart { get; }
  51. /// <summary>
  52. /// Disposes this instance.
  53. /// </summary>
  54. void Dispose();
  55. /// <summary>
  56. /// Gets the system status.
  57. /// </summary>
  58. /// <returns>SystemInfo.</returns>
  59. SystemInfo GetSystemInfo();
  60. /// <summary>
  61. /// Reloads the logger.
  62. /// </summary>
  63. void ReloadLogger();
  64. /// <summary>
  65. /// Called when [application updated].
  66. /// </summary>
  67. /// <param name="newVersion">The new version.</param>
  68. void OnApplicationUpdated(Version newVersion);
  69. /// <summary>
  70. /// Gets the name of the web application.
  71. /// </summary>
  72. /// <value>The name of the web application.</value>
  73. string WebApplicationName { get; }
  74. /// <summary>
  75. /// Gets the log file path.
  76. /// </summary>
  77. /// <value>The log file path.</value>
  78. string LogFilePath { get; }
  79. /// <summary>
  80. /// Performs the pending restart.
  81. /// </summary>
  82. void PerformPendingRestart();
  83. /// <summary>
  84. /// Gets the plugins.
  85. /// </summary>
  86. /// <value>The plugins.</value>
  87. IEnumerable<IPlugin> Plugins { get; }
  88. /// <summary>
  89. /// Gets the UDP server port number.
  90. /// </summary>
  91. /// <value>The UDP server port number.</value>
  92. int UdpServerPortNumber { get; }
  93. /// <summary>
  94. /// Gets the HTTP server URL prefix.
  95. /// </summary>
  96. /// <value>The HTTP server URL prefix.</value>
  97. string HttpServerUrlPrefix { get; }
  98. /// <summary>
  99. /// Gets a value indicating whether this instance is first run.
  100. /// </summary>
  101. /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
  102. bool IsFirstRun { get; }
  103. /// <summary>
  104. /// Gets the TCP manager.
  105. /// </summary>
  106. /// <value>The TCP manager.</value>
  107. TcpManager TcpManager { get; }
  108. /// <summary>
  109. /// Gets the web socket listeners.
  110. /// </summary>
  111. /// <value>The web socket listeners.</value>
  112. IEnumerable<IWebSocketListener> WebSocketListeners { get; }
  113. /// <summary>
  114. /// Occurs when [logger loaded].
  115. /// </summary>
  116. event EventHandler LoggerLoaded;
  117. /// <summary>
  118. /// Occurs when [reload completed].
  119. /// </summary>
  120. event EventHandler<EventArgs> ReloadCompleted;
  121. /// <summary>
  122. /// Occurs when [configuration updated].
  123. /// </summary>
  124. event EventHandler<EventArgs> ConfigurationUpdated;
  125. /// <summary>
  126. /// Gets the rest services.
  127. /// </summary>
  128. /// <value>The rest services.</value>
  129. IEnumerable<IRestfulService> RestServices { get; }
  130. }
  131. }