diff options
| author | Luke <luke.pulverenti@gmail.com> | 2017-02-12 20:17:43 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-12 20:17:43 -0500 |
| commit | 273aa822cfc37558883dbdd17647829abcf34758 (patch) | |
| tree | db858e3dfacfe4bd3aac6c701806a15203b8d63e /ServiceStack/ServiceStackHost.cs | |
| parent | 29c24420978ef324d66a381b71e0f3e3b2f294cb (diff) | |
| parent | 511a8702c29445288251fcf841c394e837db19cc (diff) | |
Merge pull request #2466 from MediaBrowser/dev
Dev
Diffstat (limited to 'ServiceStack/ServiceStackHost.cs')
| -rw-r--r-- | ServiceStack/ServiceStackHost.cs | 68 |
1 files changed, 3 insertions, 65 deletions
diff --git a/ServiceStack/ServiceStackHost.cs b/ServiceStack/ServiceStackHost.cs index 8a1db25e4..09fe9a242 100644 --- a/ServiceStack/ServiceStackHost.cs +++ b/ServiceStack/ServiceStackHost.cs @@ -6,71 +6,24 @@ 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 abstract class ServiceStackHost : IDisposable { public static ServiceStackHost Instance { get; protected set; } - protected ServiceStackHost(string serviceName) + protected ServiceStackHost() { - 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 RouteAttribute[] GetRouteAttributes(Type requestType); public abstract Func<string, object> GetParseFn(Type propertyType); @@ -85,20 +38,5 @@ namespace ServiceStack 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); - } } } |
