in chatterbox-twitter/chatterbox-twitter-impl/src/main/java/org/apache/tomee/chatterbox/twitter/adapter/TwitterResourceAdapter.java [279:315]
public void onStatus(final Status status) {
final String username = status.getUser().getScreenName();
final Response response = RESPONSE_MAP.remove(username);
if (response != null && response.getDialog() != null) {
// pull the response object from the map
final Object dialog = response.getDialog();
try {
final List<Method> matchingMethods = findMatchingMethods(dialog.getClass(), status);
if (dialog.getClass().isAnnotationPresent(InvokeAllMatches.class)) {
for (final Method method : matchingMethods) {
LOGGER.log(Level.INFO, "Invoking method " + method.toString() + " for " + getNormalizedText(status));
final Object[] values = getValues(method, status);
final Object result = method.invoke(dialog, values);
processResponse(status, result);
}
} else {
final Method method = matchingMethods.get(0);
LOGGER.log(Level.INFO, "Invoking method " + method.toString() + " for " + getNormalizedText(status));
final Object[] values = getValues(method, status);
final Object result = method.invoke(dialog, values);
processResponse(status, result);
}
} catch (IllegalAccessException | InvocationTargetException e) {
LOGGER.severe("Unable to call response object:" + e.getMessage());
RESPONSE_MAP.remove(status.getUser().getScreenName());
}
} else {
for (final EndpointTarget endpointTarget : this.targets.values()) {
endpointTarget.invoke(status);
}
}
}