@Override public Resource requireChild(PathElement element) { if (ENTITYCACHE.equals(element.getKey())) { if (hasCacheRegion(element)) { return PlaceholderResource.INSTANCE; } throw new NoSuchResourceException(element); } else if (ENTITY.equals(element.getKey())) { if (hasEntity(element)) { return PlaceholderResource.INSTANCE; } throw new NoSuchResourceException(element); } else if (COLLECTION.equals(element.getKey())) { if (hasCollection(element)) { return PlaceholderResource.INSTANCE; } throw new NoSuchResourceException(element); } else if (QUERYCACHE.equals(element.getKey())) { if (hasQuery(element)) { return PlaceholderResource.INSTANCE; } throw new NoSuchResourceException(element); } else { return super.requireChild(element); } }
@Override public Resource requireChild(PathElement element) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(element.getKey())) { Statistics childStatistics = statistics.getChild(element.getKey()); if (childStatistics != null && childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName)).contains(element.getValue())) { return PlaceholderResource.INSTANCE; } throw new NoSuchResourceException(element); } else { return super.requireChild(element); } } catch (RuntimeException e) { // WFLY-2436 ignore unexpected exceptions (e.g. JIPI-27 may throw an IllegalStateException) // WFLY-10413 : also make sure to catch HibernateExceptions ROOT_LOGGER.unexpectedStatisticsProblem(e); return super.requireChild(element); } }
@Override public Resource requireChild(PathElement element) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(element.getKey())) { Statistics childStatistics = statistics.getChild(element.getKey()); if (childStatistics != null && childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName)).contains(element.getValue())) { return PlaceholderResource.INSTANCE; } throw new NoSuchResourceException(element); } else { return super.requireChild(element); } } catch (RuntimeException e) { // WFLY-2436 ignore unexpected exceptions (e.g. JIPI-27 may throw an IllegalStateException) // WFLY-10413 : also make sure to catch HibernateExceptions ROOT_LOGGER.unexpectedStatisticsProblem(e); return super.requireChild(element); } }