Ejemplo n.º 1
0
 private void checkContextMethod(Method m, Object provider) {
   Class<?> type = m.getParameterTypes()[0];
   if (type.isInterface() || type == Application.class) {
     checkContextClass(type);
     addContextMethod(type, m, provider);
   }
 }
Ejemplo n.º 2
0
 private void findContextFields(Class<?> cls, Object provider) {
   if (cls == Object.class || cls == null) {
     return;
   }
   for (Field f : cls.getDeclaredFields()) {
     for (Annotation a : f.getAnnotations()) {
       if (a.annotationType() == Context.class) {
         contextFields = addContextField(contextFields, f);
         if (f.getType().isInterface()) {
           checkContextClass(f.getType());
           addToMap(getFieldProxyMap(true), f, getFieldThreadLocalProxy(f, provider));
         }
       }
     }
   }
   findContextFields(cls.getSuperclass(), provider);
 }