using MediaBrowser.Model.Updates;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Common.Kernel
{
///
/// An interface to be implemented by the applications hosting a kernel
///
public interface IApplicationHost
{
///
/// Restarts this instance.
///
void Restart();
///
/// Reloads the logger.
///
void ReloadLogger();
///
/// Gets the log file path.
///
/// The log file path.
string LogFilePath { get; }
///
/// Gets or sets a value indicating whether this instance can self update.
///
/// true if this instance can self update; otherwise, false.
bool CanSelfUpdate { get; }
///
/// Gets the failed assemblies.
///
/// The failed assemblies.
IEnumerable FailedAssemblies { get; }
///
/// Gets all concrete types.
///
/// All concrete types.
Type[] AllConcreteTypes { get; }
///
/// Gets the exports.
///
///
/// if set to true [manage liftime].
/// IEnumerable{``0}.
IEnumerable GetExports(bool manageLiftime = true);
///
/// Checks for update.
///
/// Task{CheckForUpdateResult}.
Task CheckForApplicationUpdate(CancellationToken cancellationToken, IProgress progress);
///
/// Updates the application.
///
/// Task.
Task UpdateApplication(CancellationToken cancellationToken, IProgress progress);
///
/// Creates an instance of type and resolves all constructor dependancies
///
/// The type.
/// System.Object.
object CreateInstance(Type type);
///
/// Registers a service that other classes can use as a dependancy.
///
///
/// The obj.
void RegisterSingleInstance(T obj) where T : class;
///
/// Registers the single instance.
///
///
/// The func.
void RegisterSingleInstance(Func func) where T : class;
///
/// Registers the specified func.
///
///
/// The func.
void Register(Func func) where T : class;
///
/// Registers the specified service type.
///
/// Type of the service.
/// Type of the implementation.
void Register(Type serviceType, Type implementation);
///
/// Resolves this instance.
///
///
/// ``0.
T Resolve();
///
/// Resolves this instance.
///
///
/// ``0.
T TryResolve();
}
}