Exemplo n.º 1
0
        public static ICache LoadCacheImplementation(string cacheClassName, ISettingsProvider settingsProvider, PubSubJobsExecutor executor = null)
        {
            Type pubSubType = null;

            if (!cacheClassName.IsNullOrEmpty())
            {
                pubSubType = Type.GetType(cacheClassName);
            }
            if (executor != null)
            {
                return((ICache)pubSubType?
                       .GetConstructor(new Type[] {
                    typeof(ISettingsProvider),
                    typeof(PubSubJobsExecutor)
                })
                       .Invoke(new object[] {
                    settingsProvider,
                    executor
                }));
            }
            else
            {
                return((ICache)pubSubType?
                       .GetConstructor(new Type[] {
                    typeof(ISettingsProvider)
                })
                       .Invoke(new object[] {
                    settingsProvider
                }));
            }
        }
Exemplo n.º 2
0
 public FileBasedPubSubCache(ISettingsProvider settingsProvider, PubSubJobsExecutor executor = null, string cacheInstanceKey = null) : base(new FileBasedPubSub(GetCacheControlPath(settingsProvider), executor), cacheInstanceKey)
 {
 }