@Override public Set<String> getChildrenNames(String childType) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(childType)) { Statistics childStatistics = statistics.getChild(childType); Set<String>result = new HashSet<String>(); for(String name:childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName))) { result.add(name); } return result; } else { return super.getChildrenNames(childType); } } 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 Collections.emptySet(); } }
@Override public Set<String> getChildrenNames(String childType) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(childType)) { Statistics childStatistics = statistics.getChild(childType); Set<String>result = new HashSet<String>(); for(String name:childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName))) { result.add(name); } return result; } else { return super.getChildrenNames(childType); } } 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 Collections.emptySet(); } }
@Override public Set<ResourceEntry> getChildren(String childType) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(childType)) { Set<ResourceEntry> result = new HashSet<ResourceEntry>(); Statistics childStatistics = statistics.getChild(childType); for (String name : childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName))) { result.add(new PlaceholderResource.PlaceholderResourceEntry(childType, name)); } return result; } else { return super.getChildren(childType); } } 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 Collections.emptySet(); } }
@Override public Set<ResourceEntry> getChildren(String childType) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(childType)) { Set<ResourceEntry> result = new HashSet<ResourceEntry>(); Statistics childStatistics = statistics.getChild(childType); for (String name : childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName))) { result.add(new PlaceholderResource.PlaceholderResourceEntry(childType, name)); } return result; } else { return super.getChildren(childType); } } 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 Collections.emptySet(); } }
@Override public boolean hasChild(PathElement element) { try { Statistics statistics = getStatistics(); // if element key matches, check if element value also matches if (statistics.getChildrenNames().contains(element.getKey())) { Statistics childStatistics = statistics.getChild(element.getKey()); return childStatistics != null && childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName)).contains(element.getValue()); } else { return super.hasChild(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 false; } }
@Override public boolean hasChild(PathElement element) { try { Statistics statistics = getStatistics(); // if element key matches, check if element value also matches if (statistics.getChildrenNames().contains(element.getKey())) { Statistics childStatistics = statistics.getChild(element.getKey()); return childStatistics != null && childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName)).contains(element.getValue()); } else { return super.hasChild(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 false; } }
@Override public Resource getChild(PathElement element) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(element.getKey())) { Statistics childStatistics = statistics.getChild(element.getKey()); return childStatistics != null && childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName)).contains(element.getValue()) ? PlaceholderResource.INSTANCE : null; } else { return super.getChild(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.getChild(element); } }
@Override public Resource getChild(PathElement element) { try { Statistics statistics = getStatistics(); if (statistics.getChildrenNames().contains(element.getKey())) { Statistics childStatistics = statistics.getChild(element.getKey()); return childStatistics != null && childStatistics.getDynamicChildrenNames(entityManagerFactoryLookup, PathWrapper.path(puName)).contains(element.getValue()) ? PlaceholderResource.INSTANCE : null; } else { return super.getChild(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.getChild(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); } }