コード例 #1
0
 public CacheInterceptor(CacheAdapter cache, ConfigurationForType configurationForType, object target)
 {
     _cache = cache;
     _configurationForType = configurationForType;
     _target           = target;
     _cachingComponent = new CachingComponent(cache, configurationForType.CacheKey, configurationForType);
 }
コード例 #2
0
ファイル: CacheInterceptor.cs プロジェクト: chenzuo/mbcache
		public CacheInterceptor(CacheAdapter cache, ConfigurationForType configurationForType, object target)
		{
			_cache = cache;
			_configurationForType = configurationForType;
			_target = target;
			_cachingComponent = new CachingComponent(cache, configurationForType.CacheKey, configurationForType);
		}
コード例 #3
0
ファイル: CacheKeyBase.cs プロジェクト: chenzuo/mbcache
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
		{
			var ret = new StringBuilder(RemoveKey(type, component));
			ret.Append(separator);
			ret.Append(method.Name);
			foreach (var parameter in method.GetParameters())
			{
				ret.Append(separatorForParameters);
				ret.Append(parameter.ParameterType);
			}
			return ret.ToString();
		}
コード例 #4
0
ファイル: CacheKeyBase.cs プロジェクト: chenzuo/mbcache
		public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			var startKey = RemoveKey(type, component, method, parameters);
			if (startKey == null)
				return new KeyAndItsDependingKeys();

			var scope = Scope();
			var completeKey = scope == null ? 
				startKey : 
				string.Concat(startKey, separator, Scope());
			return new KeyAndItsDependingKeys(completeKey, () => allRemoveKeys(completeKey));
		}
コード例 #5
0
 public CacheInterceptor(CacheAdapter cache,
                         ICacheKey cacheKey,
                         ILockObjectGenerator lockObjectGenerator,
                         ConfigurationForType configurationForType,
                         object target)
 {
     _cache                = cache;
     _cacheKey             = cacheKey;
     _lockObjectGenerator  = lockObjectGenerator;
     _configurationForType = configurationForType;
     _target               = target;
     _cachingComponent     = new CachingComponent(cache, cacheKey, configurationForType);
 }
コード例 #6
0
ファイル: CacheKeyBase.cs プロジェクト: KBoudich/mbcache
        public string Key(ComponentType type, ICachingComponent component, MethodInfo method)
        {
            var ret = new StringBuilder(Key(type, component));

            ret.Append(separator);
            ret.Append(method.Name);
            foreach (var parameter in method.GetParameters())
            {
                ret.Append(separator);
                ret.Append(parameter.ParameterType);
            }
            return(ret.ToString());
        }
コード例 #7
0
ファイル: CacheKeyBase.cs プロジェクト: jesuissur/mbcache
        private StringBuilder stringBuilderForMethodBody(ComponentType type, ICachingComponent component, MethodInfo method)
        {
            var ret = new StringBuilder(RemoveKey(type, component));

            ret.Append(separator);
            ret.Append(method.Name);
            foreach (var parameter in method.GetParameters())
            {
                ret.Append(separatorForParameters);
                ret.Append(parameter.ParameterType);
            }
            return(ret);
        }
コード例 #8
0
ファイル: CacheKeyBase.cs プロジェクト: chenzuo/mbcache
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			var ret = new StringBuilder(RemoveKey(type, component, method));
			ret.Append(separator);
			foreach (var parameter in parameters)
			{
				ret.Append(separatorForParameters);
				var parameterKey = ParameterValue(parameter);
				if (parameterKey == null)
					return null;
				checkIfSuspiousParameter(parameter, parameterKey);
				ret.Append(parameterKey);
			}

			return ret.ToString();
		}
コード例 #9
0
ファイル: CacheKeyBase.cs プロジェクト: jesuissur/mbcache
        public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
        {
            var startKey = RemoveKey(type, component, method, parameters);

            if (startKey == null)
            {
                return(new KeyAndItsDependingKeys());
            }

            var scope       = Scope();
            var completeKey = scope == null ?
                              startKey :
                              string.Concat(startKey, separator, scope);

            return(new KeyAndItsDependingKeys(completeKey, () => allRemoveKeys(completeKey)));
        }
コード例 #10
0
ファイル: CacheKeyBase.cs プロジェクト: KBoudich/mbcache
        public string Key(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
        {
            var ret = new StringBuilder(Key(type, component, method));

            ret.Append(separator);
            foreach (var parameter in parameters)
            {
                ret.Append(separatorParameterValue);
                var parameterKey = ParameterValue(parameter);
                if (parameterKey == null)
                {
                    return(null);
                }
                checkIfSuspiousParameter(parameter, parameterKey);
                ret.Append(parameterKey);
            }
            return(ret.ToString());
        }
コード例 #11
0
ファイル: CacheKeyBase.cs プロジェクト: jesuissur/mbcache
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     return(stringBuilderForMethodBody(type, component, method).ToString());
 }
コード例 #12
0
ファイル: CacheKeyBase.cs プロジェクト: jesuissur/mbcache
 public string RemoveKey(ComponentType type, ICachingComponent component)
 {
     return(string.Concat(RemoveKey(type), separator, component.UniqueId));
 }
コード例 #13
0
 public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     throw new NotImplementedException();
 }
コード例 #14
0
ファイル: CacheKeyBase.cs プロジェクト: chenzuo/mbcache
		public string RemoveKey(ComponentType type, ICachingComponent component)
		{
			return string.Concat(RemoveKey(type), separator, component.UniqueId);
		}
コード例 #15
0
 public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     return(new KeyAndItsDependingKeys(TheKey, () => new List <string>()));
 }
コード例 #16
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     return(TheKey);
 }
コード例 #17
0
			public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
			{
				return TheKey;
			}
コード例 #18
0
			public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
			{
				return TheKey;
			}
コード例 #19
0
ファイル: CacheKeyThatThrows.cs プロジェクト: chenzuo/mbcache
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
		{
			throw new NotImplementedException();
		}
コード例 #20
0
ファイル: CacheKeyThatThrows.cs プロジェクト: chenzuo/mbcache
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			throw new NotImplementedException();
		}
コード例 #21
0
			public string RemoveKey(ComponentType type, ICachingComponent component)
			{
				return TheKey;
			}
コード例 #22
0
 public string RemoveKey(ComponentType type, ICachingComponent component)
 {
     return(TheKey);
 }
コード例 #23
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     return(TheKey);
 }
コード例 #25
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     throw new NotImplementedException();
 }
コード例 #26
0
			public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
			{
				return new KeyAndItsDependingKeys(TheKey, () => new List<string>());
			}
コード例 #27
0
ファイル: CacheKeyThatThrows.cs プロジェクト: chenzuo/mbcache
		public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			throw new NotImplementedException();
		}