Package org.jipijapa.management.spi

Examples of org.jipijapa.management.spi.Statistics


    }

    @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( IllegalStateException e) {  // WFLY-2436 ignore unexpected exceptions (e.g. JIPI-27 may throw an IllegalStateException)
View Full Code Here


    }

    @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);
            }
        }
View Full Code Here

    }

    @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);
View Full Code Here

    }

    @Override
    public boolean hasChildren(String childType) {
        try {
            Statistics statistics = getStatistics();
            if (statistics.getChildrenNames().contains(childType)) {
                Statistics childStatistics = statistics.getChild(childType);
                return childStatistics != null && childStatistics.getNames().size() > 0;
            } else {
                return super.hasChildren(childType);
            }
        }
        catch( IllegalStateException e) {  // WFLY-2436 ignore unexpected exceptions (e.g. JIPI-27 may throw an IllegalStateException)
View Full Code Here

        }
    }

    @Override
    public Resource navigate(PathAddress address) {
        Statistics statistics = getStatistics();
        if (address.size() > 0 && statistics.getChildrenNames().contains(address.getElement(0).getKey())) {
            if (address.size() > 1) {
                throw new NoSuchResourceException(address.getElement(1));
            }
            return PlaceholderResource.INSTANCE;
        } else {
View Full Code Here

    @Override
    public Set<String> getChildTypes() {
        try {
            Set<String> result = new HashSet<String>(super.getChildTypes());
            Statistics statistics = getStatistics();
            result.addAll(statistics.getChildrenNames());
            return result;
        }
        catch( IllegalStateException e) {  // WFLY-2436 ignore unexpected exceptions (e.g. JIPI-27 may throw an IllegalStateException)
            JPA_LOGGER.unexpectedStatisticsProblem(e);
            return Collections.EMPTY_SET;
View Full Code Here

    }

    @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);
View Full Code Here

    }

    @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);
View Full Code Here

    }

    @Override
    public void registerChild(PathElement address, Resource resource) {
        try {
            Statistics statistics = getStatistics();
            if (statistics.getChildrenNames().contains(address.getKey())) {
                throw JpaLogger.ROOT_LOGGER.resourcesOfTypeCannotBeRegistered(address.getKey());
            } else {
                super.registerChild(address, resource);
            }
        }
View Full Code Here

        }
    }

    @Override
    public Resource removeChild(PathElement address) {
        Statistics statistics = getStatistics();
        if (statistics.getChildrenNames().contains(address.getKey())) {
            throw JpaLogger.ROOT_LOGGER.resourcesOfTypeCannotBeRemoved(address.getKey());
        } else {
            return super.removeChild(address);
        }
    }
View Full Code Here

TOP

Related Classes of org.jipijapa.management.spi.Statistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.