@SuppressWarnings("unchecked") protected void invokeInjectionMethod(Object o, Method m) { Class[] dependencies = m.getParameterTypes(); Annotation[][] parameterAnnotations = m.getParameterAnnotations(); Object[] params = new Object[dependencies.length]; if (getLog().isTraceEnabled()) getLog() .tracef( "Injecting dependencies for method [%s] on an instance of [%s].", m, o.getClass().getName()); for (int i = 0; i < dependencies.length; i++) { params[i] = getOrCreateComponent( dependencies[i], getComponentName(dependencies[i], parameterAnnotations, i)); } ReflectionUtil.invokeAccessibly(o, m, params); }
void invoke() { ReflectionUtil.invokeAccessibly(component.instance, method, null); }