@Override
public void run() {
userActionsLog.trace("Menu item {} triggered", item.getId());
StopWatch sw = createStopWatch(item);
Object beanInstance = beanLocator.get(bean);
try {
Method methodWithParams = MethodUtils.getAccessibleMethod(beanInstance.getClass(), beanMethod, Map.class);
if (methodWithParams != null) {
methodWithParams.invoke(beanInstance, params);
return;
}
Method methodWithScreen = MethodUtils.getAccessibleMethod(beanInstance.getClass(), beanMethod, FrameOwner.class);
if (methodWithScreen != null) {
methodWithScreen.invoke(beanInstance, origin);
return;
}
MethodUtils.invokeMethod(beanInstance, beanMethod, (Object[]) null);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
throw new RuntimeException("Unable to execute bean method", e);
}
sw.stop();
}