throws Exception {
ExtDirectPollResponse directPollResponse = new ExtDirectPollResponse();
directPollResponse.setName(event);
MethodInfo methodInfo = methodInfoCache.get(beanName, method);
boolean streamResponse;
Class<?> jsonView = null;
if (methodInfo != null) {
streamResponse = configurationService.getConfiguration().isStreamResponse()
|| methodInfo.isStreamResponse();
try {
Object[] parameters = configurationService.getParametersResolver()
.prepareParameters(request, response, locale, methodInfo);
if (configurationService.getConfiguration().isSynchronizeOnSession()
|| methodInfo.isSynchronizeOnSession()) {
HttpSession session = request.getSession(false);
if (session != null) {
Object mutex = WebUtils.getSessionMutex(session);
synchronized (mutex) {
Object result = ExtDirectSpringUtil.invoke(
configurationService.getApplicationContext(),
beanName, methodInfo, parameters);
if (result instanceof ModelAndJsonView) {
ModelAndJsonView modelAndJsonView = (ModelAndJsonView) result;
directPollResponse.setData(modelAndJsonView.getModel());
jsonView = getJsonView(modelAndJsonView,
methodInfo.getJsonView());
}
else {
directPollResponse.setData(result);
jsonView = getJsonView(result, methodInfo.getJsonView());
}
}
}
else {
Object result = ExtDirectSpringUtil.invoke(
configurationService.getApplicationContext(), beanName,
methodInfo, parameters);
if (result instanceof ModelAndJsonView) {
ModelAndJsonView modelAndJsonView = (ModelAndJsonView) result;
directPollResponse.setData(modelAndJsonView.getModel());
jsonView = getJsonView(modelAndJsonView,
methodInfo.getJsonView());
}
else {
directPollResponse.setData(result);
jsonView = getJsonView(result, methodInfo.getJsonView());
}
}
}
else {
Object result = ExtDirectSpringUtil.invoke(
configurationService.getApplicationContext(), beanName,
methodInfo, parameters);
if (result instanceof ModelAndJsonView) {
ModelAndJsonView modelAndJsonView = (ModelAndJsonView) result;
directPollResponse.setData(modelAndJsonView.getModel());
jsonView = getJsonView(modelAndJsonView, methodInfo.getJsonView());
}
else {
directPollResponse.setData(result);
jsonView = getJsonView(result, methodInfo.getJsonView());
}
}
}
catch (Exception e) {