removed unneeded startup processes

This commit is contained in:
Luke Pulverenti
2013-04-07 18:09:48 -04:00
parent 8308528e6c
commit f5620c81be
15 changed files with 44 additions and 316 deletions

View File

@@ -61,12 +61,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <value>The HTTP listener.</value>
private IDisposable HttpListener { get; set; }
/// <summary>
/// Gets or sets the protobuf serializer.
/// </summary>
/// <value>The protobuf serializer.</value>
private IProtobufSerializer ProtobufSerializer { get; set; }
/// <summary>
/// Occurs when [web socket connected].
/// </summary>
@@ -88,18 +82,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// Initializes a new instance of the <see cref="HttpServer" /> class.
/// </summary>
/// <param name="applicationHost">The application host.</param>
/// <param name="protobufSerializer">The protobuf serializer.</param>
/// <param name="logger">The logger.</param>
/// <param name="serverName">Name of the server.</param>
/// <param name="defaultRedirectpath">The default redirectpath.</param>
/// <exception cref="System.ArgumentNullException">urlPrefix</exception>
public HttpServer(IApplicationHost applicationHost, IProtobufSerializer protobufSerializer, ILogger logger, string serverName, string defaultRedirectpath)
public HttpServer(IApplicationHost applicationHost, ILogger logger, string serverName, string defaultRedirectpath)
: base()
{
if (protobufSerializer == null)
{
throw new ArgumentNullException("protobufSerializer");
}
if (logger == null)
{
throw new ArgumentNullException("logger");
@@ -119,7 +108,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer
ServerName = serverName;
DefaultRedirectPath = defaultRedirectpath;
ProtobufSerializer = protobufSerializer;
_logger = logger;
ApplicationHost = applicationHost;
@@ -562,9 +550,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer
_logger.Info("Calling EndpointHost.ConfigureHost");
EndpointHost.ConfigureHost(this, ServerName, CreateServiceManager());
_logger.Info("Registering protobuf as a content type filter");
ContentTypeFilters.Register(ContentType.ProtoBuf, (reqCtx, res, stream) => ProtobufSerializer.SerializeToStream(res, stream), (type, stream) => ProtobufSerializer.DeserializeFromStream(stream, type));
_logger.Info("Calling ServiceStack AppHost.Init");
Init();
}

View File

@@ -1,7 +1,6 @@
using MediaBrowser.Common;
using MediaBrowser.Common.Net;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
namespace MediaBrowser.Server.Implementations.HttpServer
{
@@ -14,14 +13,13 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// Creates the server.
/// </summary>
/// <param name="applicationHost">The application host.</param>
/// <param name="protobufSerializer">The protobuf serializer.</param>
/// <param name="logger">The logger.</param>
/// <param name="serverName">Name of the server.</param>
/// <param name="defaultRedirectpath">The default redirectpath.</param>
/// <returns>IHttpServer.</returns>
public static IHttpServer CreateServer(IApplicationHost applicationHost, IProtobufSerializer protobufSerializer, ILogger logger, string serverName, string defaultRedirectpath)
public static IHttpServer CreateServer(IApplicationHost applicationHost, ILogger logger, string serverName, string defaultRedirectpath)
{
return new HttpServer(applicationHost, protobufSerializer, logger, serverName, defaultRedirectpath);
return new HttpServer(applicationHost, logger, serverName, defaultRedirectpath);
}
}
}

View File

@@ -48,7 +48,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
/// <summary>
/// The _protobuf serializer
/// </summary>
private readonly IProtobufSerializer _protobufSerializer;
private readonly IJsonSerializer _jsonSerializer;
/// <summary>
/// The _app paths
@@ -59,22 +59,22 @@ namespace MediaBrowser.Server.Implementations.Sqlite
/// Initializes a new instance of the <see cref="SQLiteUserDataRepository" /> class.
/// </summary>
/// <param name="appPaths">The app paths.</param>
/// <param name="protobufSerializer">The protobuf serializer.</param>
/// <param name="jsonSerializer">The json serializer.</param>
/// <param name="logManager">The log manager.</param>
/// <exception cref="System.ArgumentNullException">protobufSerializer</exception>
public SQLiteDisplayPreferencesRepository(IApplicationPaths appPaths, IProtobufSerializer protobufSerializer, ILogManager logManager)
public SQLiteDisplayPreferencesRepository(IApplicationPaths appPaths, IJsonSerializer jsonSerializer, ILogManager logManager)
: base(logManager)
{
if (protobufSerializer == null)
if (jsonSerializer == null)
{
throw new ArgumentNullException("protobufSerializer");
throw new ArgumentNullException("jsonSerializer");
}
if (appPaths == null)
{
throw new ArgumentNullException("appPaths");
}
_protobufSerializer = protobufSerializer;
_jsonSerializer = jsonSerializer;
_appPaths = appPaths;
}
@@ -124,7 +124,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
cancellationToken.ThrowIfCancellationRequested();
var serialized = _protobufSerializer.SerializeToBytes(displayPreferences);
var serialized = _jsonSerializer.SerializeToBytes(displayPreferences);
cancellationToken.ThrowIfCancellationRequested();
@@ -180,7 +180,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
{
using (var stream = GetStream(reader, 0))
{
return _protobufSerializer.DeserializeFromStream<DisplayPreferences>(stream);
return _jsonSerializer.DeserializeFromStream<DisplayPreferences>(stream);
}
}
}

View File

@@ -49,7 +49,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
/// <summary>
/// The _protobuf serializer
/// </summary>
private readonly IProtobufSerializer _protobufSerializer;
private readonly IJsonSerializer _jsonSerializer;
/// <summary>
/// The _app paths
@@ -60,22 +60,22 @@ namespace MediaBrowser.Server.Implementations.Sqlite
/// Initializes a new instance of the <see cref="SQLiteUserDataRepository" /> class.
/// </summary>
/// <param name="appPaths">The app paths.</param>
/// <param name="protobufSerializer">The protobuf serializer.</param>
/// <param name="jsonSerializer">The json serializer.</param>
/// <param name="logManager">The log manager.</param>
/// <exception cref="System.ArgumentNullException">protobufSerializer</exception>
public SQLiteUserDataRepository(IApplicationPaths appPaths, IProtobufSerializer protobufSerializer, ILogManager logManager)
public SQLiteUserDataRepository(IApplicationPaths appPaths, IJsonSerializer jsonSerializer, ILogManager logManager)
: base(logManager)
{
if (protobufSerializer == null)
if (jsonSerializer == null)
{
throw new ArgumentNullException("protobufSerializer");
throw new ArgumentNullException("jsonSerializer");
}
if (appPaths == null)
{
throw new ArgumentNullException("appPaths");
}
_protobufSerializer = protobufSerializer;
_jsonSerializer = jsonSerializer;
_appPaths = appPaths;
}
@@ -139,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
cancellationToken.ThrowIfCancellationRequested();
var serialized = _protobufSerializer.SerializeToBytes(userData);
var serialized = _jsonSerializer.SerializeToBytes(userData);
cancellationToken.ThrowIfCancellationRequested();
@@ -208,7 +208,7 @@ namespace MediaBrowser.Server.Implementations.Sqlite
{
using (var stream = GetStream(reader, 0))
{
return _protobufSerializer.DeserializeFromStream<UserItemData>(stream);
return _jsonSerializer.DeserializeFromStream<UserItemData>(stream);
}
}
}