public ConcurrentCache(SourceProducer sourceProducer, KeyProducer keyProducer, UpdateFactory updateFactory, CreateFactory createFactory, RemovedAction removedAction = null) { _sourceFactory = sourceProducer; _updateFactory = updateFactory; _createFactory = createFactory; _keyProducer = keyProducer; _removedAction = removedAction; }
public static List <Parameter> getParameters(List <ParameterInfo> parameters) { return(parameters.Select(p => { IKey key = KeyProducer.getParameterKey(p); return new Parameter(p, key); }).ToList()); }
public static List <MethodInfoObject> extractProducers(object obj) { var methods = obj.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance).Where(m => { var alist = m.GetCustomAttributes(false).ToList(); var filtered = alist.Where(a => a.GetType() == typeof(Produce)).ToList(); return(filtered.Count() > 0); }).Select(methodInfo => new MethodInfoObject(obj, methodInfo, KeyProducer.getProduceKey(methodInfo))).ToList(); return(methods); }
protected void extractInsertKeys(object o) { var keys = KeyProducer.getInsertKeys(o); if (keys.Count() > 0) { keys.ForEach(key => { addFinalObject(key.getCode(), new FinalValue(key, o), true); }); } else { toBeInjected.Add(o); } }
public static List <Property> getPropertiesToInject(object o) { var members = getPropertiesAnnotatedWith(o.GetType(), typeof(Inject)).Select(f => new Property(f, KeyProducer.produceKey(f))).ToList(); return(members); }
public static List <Field> getFieldsToInject(object o) { var members = getFieldsAnnotatedWith(o.GetType(), typeof(Inject)).Select(p => new Field(p, KeyProducer.produceKey(p))).ToList(); return(members); }