@Override public Set<ResourceEntry> getChildren(String childType) { if (ENTITYCACHE.equals(childType)) { Set<ResourceEntry> result = new HashSet<ResourceEntry>(); for (String name : getCacheRegionNames()) { result.add(new PlaceholderResource.PlaceholderResourceEntry(ENTITYCACHE, name)); } return result; } else if (ENTITY.equals(childType)) { Set<ResourceEntry> result = new HashSet<ResourceEntry>(); for (String name : getEntityNames()) { result.add(new PlaceholderResource.PlaceholderResourceEntry(ENTITY, name)); } return result; } else if (COLLECTION.equals(childType)) { Set<ResourceEntry> result = new HashSet<ResourceEntry>(); for (String name : getCollectionNames()) { result.add(new PlaceholderResource.PlaceholderResourceEntry(COLLECTION, name)); } return result; } else if (QUERYCACHE.equals(childType)) { Set<ResourceEntry> result = new HashSet<ResourceEntry>(); for (String name : getQueryNames()) { result.add(new PlaceholderResource.PlaceholderResourceEntry(QUERYCACHE, name)); } return result; } else { return super.getChildren(childType); } }
@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(); } }