示例#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
		public CacheInterceptor(CacheAdapter cache, ConfigurationForType configurationForType, object target)
		{
			_cache = cache;
			_configurationForType = configurationForType;
			_target = target;
			_cachingComponent = new CachingComponent(cache, configurationForType.CacheKey, configurationForType);
		}
示例#3
0
		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
		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
        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
        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
		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
        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
        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
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     return(stringBuilderForMethodBody(type, component, method).ToString());
 }
示例#12
0
 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
		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
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
		{
			throw new NotImplementedException();
		}
示例#20
0
		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
		public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			throw new NotImplementedException();
		}