aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Kernel/BaseKernel.cs
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-25 22:43:04 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-25 22:43:04 -0500
commit2d06095447b972c8c7239277428e2c67c8b7ca86 (patch)
tree14278bd4c0732ee962b73ff4845e5022e157a0a3 /MediaBrowser.Common/Kernel/BaseKernel.cs
parent364fbb9e0c7586afa296ddd7d739df086f4c3533 (diff)
plugin security fixes and other abstractions
Diffstat (limited to 'MediaBrowser.Common/Kernel/BaseKernel.cs')
-rw-r--r--MediaBrowser.Common/Kernel/BaseKernel.cs60
1 files changed, 5 insertions, 55 deletions
diff --git a/MediaBrowser.Common/Kernel/BaseKernel.cs b/MediaBrowser.Common/Kernel/BaseKernel.cs
index eb5381e20..5b8da5d09 100644
--- a/MediaBrowser.Common/Kernel/BaseKernel.cs
+++ b/MediaBrowser.Common/Kernel/BaseKernel.cs
@@ -40,9 +40,6 @@ namespace MediaBrowser.Common.Kernel
internal void OnConfigurationUpdated()
{
EventHelper.QueueEventIfNotNull(ConfigurationUpdated, this, EventArgs.Empty, Logger);
-
- // Notify connected clients
- TcpManager.SendWebSocketMessage("ConfigurationUpdated", Configuration);
}
#endregion
@@ -141,12 +138,6 @@ namespace MediaBrowser.Common.Kernel
}
/// <summary>
- /// Gets a value indicating whether this instance is first run.
- /// </summary>
- /// <value><c>true</c> if this instance is first run; otherwise, <c>false</c>.</value>
- public bool IsFirstRun { get; private set; }
-
- /// <summary>
/// Gets or sets a value indicating whether this instance has changes that require the entire application to restart.
/// </summary>
/// <value><c>true</c> if this instance has pending application restart; otherwise, <c>false</c>.</value>
@@ -177,12 +168,6 @@ namespace MediaBrowser.Common.Kernel
public TcpManager TcpManager { get; private set; }
/// <summary>
- /// Gets the rest services.
- /// </summary>
- /// <value>The rest services.</value>
- public IEnumerable<IRestfulService> RestServices { get; private set; }
-
- /// <summary>
/// Gets the UDP server port number.
/// This can't be configurable because then the user would have to configure their client to discover the server.
/// </summary>
@@ -280,19 +265,7 @@ namespace MediaBrowser.Common.Kernel
/// Initializes the Kernel
/// </summary>
/// <returns>Task.</returns>
- public Task Init()
- {
- IsFirstRun = !File.Exists(ApplicationPaths.SystemConfigurationFilePath);
-
- // Performs initializations that can be reloaded at anytime
- return Reload();
- }
-
- /// <summary>
- /// Performs initializations that can be reloaded at anytime
- /// </summary>
- /// <returns>Task.</returns>
- public async Task Reload()
+ public async Task Init()
{
OnReloadBeginning();
@@ -312,8 +285,6 @@ namespace MediaBrowser.Common.Kernel
// Set these to null so that they can be lazy loaded again
Configuration = null;
- Logger.Info("Version {0} initializing", ApplicationVersion);
-
await OnConfigurationLoaded().ConfigureAwait(false);
FindParts();
@@ -348,7 +319,6 @@ namespace MediaBrowser.Common.Kernel
/// </summary>
protected virtual void FindParts()
{
- RestServices = ApplicationHost.GetExports<IRestfulService>();
WebSocketListeners = ApplicationHost.GetExports<IWebSocketListener>();
Plugins = ApplicationHost.GetExports<IPlugin>();
}
@@ -426,18 +396,6 @@ namespace MediaBrowser.Common.Kernel
}
/// <summary>
- /// Gets the current application version
- /// </summary>
- /// <value>The application version.</value>
- public Version ApplicationVersion
- {
- get
- {
- return GetType().Assembly.GetName().Version;
- }
- }
-
- /// <summary>
/// Performs the pending restart.
/// </summary>
/// <returns>Task.</returns>
@@ -445,7 +403,9 @@ namespace MediaBrowser.Common.Kernel
{
if (HasPendingRestart)
{
- RestartApplication();
+ Logger.Info("Restarting the application");
+
+ ApplicationHost.Restart();
}
else
{
@@ -454,16 +414,6 @@ namespace MediaBrowser.Common.Kernel
}
/// <summary>
- /// Restarts the application.
- /// </summary>
- protected void RestartApplication()
- {
- Logger.Info("Restarting the application");
-
- ApplicationHost.Restart();
- }
-
- /// <summary>
/// Gets the system status.
/// </summary>
/// <returns>SystemInfo.</returns>
@@ -472,7 +422,7 @@ namespace MediaBrowser.Common.Kernel
return new SystemInfo
{
HasPendingRestart = HasPendingRestart,
- Version = ApplicationVersion.ToString(),
+ Version = ApplicationHost.ApplicationVersion.ToString(),
IsNetworkDeployed = ApplicationHost.CanSelfUpdate,
WebSocketPortNumber = TcpManager.WebSocketPortNumber,
SupportsNativeWebSocket = TcpManager.SupportsNativeWebSocket,