Files
jellyfin-jellyfin-1/ServiceStack/ServiceStackHost.cs

43 lines
1.3 KiB
C#
Raw Normal View History

2016-11-11 14:55:12 -05:00
// 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.Services;
namespace ServiceStack
{
2017-02-12 20:07:48 -05:00
public abstract class ServiceStackHost : IDisposable
2016-11-11 14:55:12 -05:00
{
public static ServiceStackHost Instance { get; protected set; }
2017-02-12 20:07:48 -05:00
protected ServiceStackHost()
2016-11-11 14:55:12 -05:00
{
GlobalResponseFilters = new List<Action<IRequest, IResponse, object>>();
}
public abstract object CreateInstance(Type type);
public List<Action<IRequest, IResponse, object>> GlobalResponseFilters { get; set; }
2017-02-12 20:07:48 -05:00
public abstract RouteAttribute[] GetRouteAttributes(Type requestType);
2016-11-11 14:55:12 -05:00
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;
}
}
}