/** * Load data from middleware into {@link #data} field. * <p>In case of error sets {@link #dataLoadError} field to the exception object.</p> * @param params datasource parameters, as described in {@link CollectionDatasource#refresh(java.util.Map)} */ protected void loadData(Map<String, Object> params) { Security security = AppBeans.get(Security.NAME); if (!security.isEntityOpPermitted(metaClass, EntityOp.READ)) { return; } String tag = getLoggingTag("CDS"); StopWatch sw = new Slf4JStopWatch(tag, LoggerFactory.getLogger(UIPerformanceLogger.class)); if (needLoading()) { LoadContext context = beforeLoadData(params); if (context == null) { return; } try { Collection<T> entities = dataSupplier.loadList(context); afterLoadData(params, context, entities); } catch (Throwable e) { dataLoadError = e; } } sw.stop(); }