@SuppressWarnings("unchecked") public static void injectContextMethods(Object requestObject, AbstractResourceInfo cri, Message message) { for (Map.Entry<Class<?>, Method> entry : cri.getContextMethods().entrySet()) { Method method = entry.getValue(); if (VALUE_CONTEXTS.contains(method.getParameterTypes()[0].getName()) && cri.isSingleton()) { continue; } Object o = JAXRSUtils.createContextValue(message, method.getGenericParameterTypes()[0], entry.getKey()); if (o != null) { if (!cri.isSingleton()) { InjectionUtils.injectThroughMethod(requestObject, method, o, message); } else { ThreadLocalProxy<Object> proxy = (ThreadLocalProxy<Object>)cri.getContextSetterProxy(method); if (proxy != null) { proxy.set(o); } } } } }
@SuppressWarnings("unchecked") public static void injectContextMethods(Object requestObject, AbstractResourceInfo cri, Message message) { for (Map.Entry<Class<?>, Method> entry : cri.getContextMethods().entrySet()) { Method method = entry.getValue(); if (method.getParameterTypes()[0] == Application.class && cri.isSingleton()) { continue; } Object o = JAXRSUtils.createContextValue(message, method.getGenericParameterTypes()[0], entry.getKey()); if (o != null) { if (!cri.isSingleton()) { InjectionUtils.injectThroughMethod(requestObject, method, o, message); } else { ThreadLocalProxy<Object> proxy = (ThreadLocalProxy<Object>)cri.getContextSetterProxy(method); if (proxy != null) { proxy.set(o); } } } } }
value = cri.getContextSetterProxy(method);
Method method = entry.getValue(); Object value = method.getParameterTypes()[0] == Application.class ? app : cri.getContextSetterProxy(method); try { if (value == InjectionUtils.extractFromMethod(instance,