}
private void renderView(final String viewId, Map<String, ?> viewData) {
TaskWatch watch = new TaskWatch("Rendering view " + viewId);
final ViewRenderer renderer = rendererMap.get(viewId);
if (renderer == null) {
throw new IllegalArgumentException("Unable to find view id: " + viewId);
}
currentViewData = viewData != null ? viewData : new HashMap<String, Object>();
Component comp = null;
try {
comp = watch.watchTask("Really rendering", new Callable<Component>() {
@Override
public Component call() throws Exception {
return renderer.render(currentViewData);
}
});
} catch (Exception e) {
throw new RuntimeException(e);
}