/** * Returns the dependency callback instances * @return the dependency callback instances */ public Object[] getInstances() { if (m_callbackInstance == null) { return m_component.getInstances(); } else { return new Object[] { m_callbackInstance }; } }
private void invokeCallbacks(Component component, Object callbackInstance, String callback, String defaultCallback) { boolean logIfNotFound = (callback != null); callback = callback != null ? callback : defaultCallback; ComponentContext ctx = (ComponentContext) component; Object[] instances = callbackInstance != null ? new Object[] { callbackInstance } : ctx.getInstances(); ctx.invokeCallbackMethod(instances, callback, new Class[][] {{ Component.class }, {}}, new Object[][] {{ component }, {}}, logIfNotFound); }
if (m_accept2Type != null) { Object componentInstance = Stream.of(getComponentContext().getInstances()) .filter(instance -> Helpers.getClass(instance).equals(m_accept2Type)) .findFirst()