Exemplo n.º 1
0
 public CacheInterceptor(CacheAdapter cache, ConfigurationForType configurationForType, object target)
 {
     _cache = cache;
     _configurationForType = configurationForType;
     _target           = target;
     _cachingComponent = new CachingComponent(cache, configurationForType.CacheKey, configurationForType);
 }
Exemplo n.º 2
0
		public CacheInterceptor(CacheAdapter cache, ConfigurationForType configurationForType, object target)
		{
			_cache = cache;
			_configurationForType = configurationForType;
			_target = target;
			_cachingComponent = new CachingComponent(cache, configurationForType.CacheKey, configurationForType);
		}
Exemplo n.º 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();
		}
Exemplo n.º 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));
		}
Exemplo n.º 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);
 }
Exemplo n.º 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());
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
		}
Exemplo n.º 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)));
        }
Exemplo n.º 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());
        }
Exemplo n.º 11
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     return(stringBuilderForMethodBody(type, component, method).ToString());
 }
Exemplo n.º 12
0
 public string RemoveKey(ComponentType type, ICachingComponent component)
 {
     return(string.Concat(RemoveKey(type), separator, component.UniqueId));
 }
Exemplo n.º 13
0
 public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 14
0
		public string RemoveKey(ComponentType type, ICachingComponent component)
		{
			return string.Concat(RemoveKey(type), separator, component.UniqueId);
		}
Exemplo n.º 15
0
 public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     return(new KeyAndItsDependingKeys(TheKey, () => new List <string>()));
 }
Exemplo n.º 16
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     return(TheKey);
 }
Exemplo n.º 17
0
			public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
			{
				return TheKey;
			}
Exemplo n.º 18
0
			public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
			{
				return TheKey;
			}
Exemplo n.º 19
0
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
		{
			throw new NotImplementedException();
		}
Exemplo n.º 20
0
		public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			throw new NotImplementedException();
		}
Exemplo n.º 21
0
			public string RemoveKey(ComponentType type, ICachingComponent component)
			{
				return TheKey;
			}
Exemplo n.º 22
0
 public string RemoveKey(ComponentType type, ICachingComponent component)
 {
     return(TheKey);
 }
Exemplo n.º 23
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 24
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     return(TheKey);
 }
Exemplo n.º 25
0
 public string RemoveKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable <object> parameters)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 26
0
			public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
			{
				return new KeyAndItsDependingKeys(TheKey, () => new List<string>());
			}
Exemplo n.º 27
0
		public KeyAndItsDependingKeys GetAndPutKey(ComponentType type, ICachingComponent component, MethodInfo method, IEnumerable<object> parameters)
		{
			throw new NotImplementedException();
		}