Package org.glassfish.flashlight.datatree

Examples of org.glassfish.flashlight.datatree.TreeNode


            report.setMessage(localStrings.getLocalString("mrdr.null",
                            "MonitoringRuntimeDataRegistry is null"));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(localStrings.getLocalString("mrdr.null",
                            "MonitoringRuntimeDataRegistry server node is null"));
            return report;
View Full Code Here


    private long getFirstTreeNodeAsLong(TreeNode parent, String name) {

        List<TreeNode> nodes = parent.getNodes(name);

        if(!nodes.isEmpty()) {
            TreeNode node = nodes.get(0);
            Object val = node.getValue();
            if(val != null) {
                try {
                    CountStatistic cs = (CountStatistic)val;
                    return cs.getCount();
                } catch (Exception e) {
View Full Code Here

*/
public class TreeNodeFactory {
   
    public static TreeNode createTreeNode (String name, Object instance,
            String category){
        TreeNode tn = new TreeNodeImpl (name, category);
        tn.setEnabled (true);
        return tn;
    }
View Full Code Here

    }
   
    public static TreeNode createMethodInvoker (String name, Object instance,
            String category, Method m){
          
        TreeNode tn = new MethodInvokerImpl();
        tn.setName(name);
        ((MethodInvoker)tn).setInstance (instance);
        ((MethodInvoker)tn).setMethod (m);
        tn.setCategory(category);
        tn.setEnabled(true);
        return tn;
    }
View Full Code Here

            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry is null"));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry server node is null"));
            return report;
        }

        long errorCount = 0;
        long maxTime = 0;
        double processingTime = 0;
        long requestCount = 0;

        List<TreeNode> tnL = serverNode.getNodes("server.web.request.*");
        for (TreeNode tn : tnL) {
            if (tn.hasChildNodes()) {
                continue;
            }

View Full Code Here

            return null;
        }
        completeName = encodePath(completeName);
        Pattern pattern = Pattern.compile(AbstractTreeNode.REGEX);
        String[] tokens = pattern.split(completeName);
        TreeNode n = findNodeInTree(tokens);

        if (n == null)
            n = findNodeInTreeNormalized(completeName);

        return n;
View Full Code Here

    // which is the value.
    private TreeNode findNodeInTree(String[] tokens) {
        if (tokens == null) {
            return null;
        }
        TreeNode child = getChild(tokens[0]);

        if (child == null)
            child = getChild(decodeName(tokens[0]));

        if (child == null)
View Full Code Here

    public TreeNode getPossibleParentNode(String pattern) {
        // simplify by bailing out early if preconditions are not met...
        if (pattern == null || pattern.length() <= 0 || pattern.indexOf('*') >= 0)
            return null;

        TreeNode node = null;
        int longest = 0;

        for (TreeNode n : traverse(true)) {
            String aname = n.getCompletePathName();

View Full Code Here

        if (!ok(desiredName))
            return null;

        desiredName = decodeNameToDots(desiredName);
        TreeNode node = normalizedChildren.get(desiredName);

        // one more try.  GUI sometimes chops off the starting "server".
        if (node == null && !desiredName.startsWith("server.")) {
            node = normalizedChildren.get("server." + desiredName);
View Full Code Here

            }

            // get the Parent node and delete all children nodes (only that we know of)
            String parentNodePath = spre.getParentTreeNodePath();
            List<String> childNodeNames = spre.getChildTreeNodeNames();
            TreeNode rootNode = mrdr.get(instanceName);
            if ((rootNode != null) && (parentNodePath != null)) {
                // This has to return one node
                List<TreeNode> nodeList = rootNode.getNodes(parentNodePath, false, true);
                if (nodeList.size() > 0) {
                    TreeNode parentNode = nodeList.get(0);
                    //Remove each of the child nodes
                    Collection<TreeNode> childNodes = parentNode.getChildNodes();
                    for (TreeNode childNode : childNodes) {
                        if (childNodeNames.contains(childNode.getName())) {
                            parentNode.removeChild(childNode);
                        }
                    }
                    if (!parentNode.hasChildNodes())
                        removeParentNode(parentNode);
                }
            }

            //get the handles and unregister the listeners from Flashlight
View Full Code Here

TOP

Related Classes of org.glassfish.flashlight.datatree.TreeNode

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.