aboutsummaryrefslogtreecommitdiff
path: root/ServiceStack/ServiceStackHost.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-02-24 15:21:11 -0500
committerGitHub <noreply@github.com>2017-02-24 15:21:11 -0500
commitcd6b7f3bdc5bcbc6c68131cc40b71b68ac1b73a6 (patch)
tree48b8f6d94e3f762a486aa1c4fa6937cf23c18dee /ServiceStack/ServiceStackHost.cs
parentc07e774ca9c0f234ec6899e17fc70301d1990290 (diff)
parent66a844e6399f1d79be8e10ea098ba6768e0d123b (diff)
Merge pull request #2489 from MediaBrowser/beta
Beta
Diffstat (limited to 'ServiceStack/ServiceStackHost.cs')
-rw-r--r--ServiceStack/ServiceStackHost.cs104
1 files changed, 0 insertions, 104 deletions
diff --git a/ServiceStack/ServiceStackHost.cs b/ServiceStack/ServiceStackHost.cs
deleted file mode 100644
index 8a1db25e4..000000000
--- a/ServiceStack/ServiceStackHost.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) Service Stack LLC. All Rights Reserved.
-// License: https://raw.github.com/ServiceStack/ServiceStack/master/license.txt
-
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading.Tasks;
-using MediaBrowser.Model.Logging;
-using MediaBrowser.Model.Services;
-using ServiceStack.Host;
-
-namespace ServiceStack
-{
- public abstract partial class ServiceStackHost : IDisposable
- {
- public static ServiceStackHost Instance { get; protected set; }
-
- protected ServiceStackHost(string serviceName)
- {
- ServiceName = serviceName;
- ServiceController = CreateServiceController();
-
- RestPaths = new List<RestPath>();
- Metadata = new ServiceMetadata();
- GlobalRequestFilters = new List<Action<IRequest, IResponse, object>>();
- GlobalResponseFilters = new List<Action<IRequest, IResponse, object>>();
- }
-
- public abstract void Configure();
-
- public abstract object CreateInstance(Type type);
-
- protected abstract ServiceController CreateServiceController();
-
- public virtual ServiceStackHost Init()
- {
- Instance = this;
-
- ServiceController.Init();
- Configure();
-
- ServiceController.AfterInit();
-
- return this;
- }
-
- public virtual ServiceStackHost Start(string urlBase)
- {
- throw new NotImplementedException("Start(listeningAtUrlBase) is not supported by this AppHost");
- }
-
- public string ServiceName { get; set; }
-
- public ServiceMetadata Metadata { get; set; }
-
- public ServiceController ServiceController { get; set; }
-
- public List<RestPath> RestPaths = new List<RestPath>();
-
- public List<Action<IRequest, IResponse, object>> GlobalRequestFilters { get; set; }
-
- public List<Action<IRequest, IResponse, object>> GlobalResponseFilters { get; set; }
-
- public abstract T TryResolve<T>();
- public abstract T Resolve<T>();
-
- public virtual MediaBrowser.Model.Services.RouteAttribute[] GetRouteAttributes(Type requestType)
- {
- return requestType.AllAttributes<MediaBrowser.Model.Services.RouteAttribute>();
- }
-
- public abstract object GetTaskResult(Task task, string requestName);
-
- public abstract Func<string, object> GetParseFn(Type propertyType);
-
- public abstract void SerializeToJson(object o, Stream stream);
- public abstract void SerializeToXml(object o, Stream stream);
- public abstract object DeserializeXml(Type type, Stream stream);
- public abstract object DeserializeJson(Type type, Stream stream);
-
- public virtual void Dispose()
- {
- //JsConfig.Reset(); //Clears Runtime Attributes
-
- Instance = null;
- }
-
- protected abstract ILogger Logger
- {
- get;
- }
-
- public void OnLogError(Type type, string message)
- {
- Logger.Error(message);
- }
-
- public void OnLogError(Type type, string message, Exception ex)
- {
- Logger.ErrorException(message, ex);
- }
- }
-}