Package com.sun.faban.driver

Examples of com.sun.faban.driver.ConfigurationException


                                                    RunInfo.DRIVERURI, "name");
            if (nl.getLength() > 1) {
                String msg = "Only one operation name allowed in each " +
                        "operation mix.";
                getLogger().severe(msg);
                ConfigurationException e = new ConfigurationException(msg);
                getLogger().throwing(className, "configure", e);
                throw e;
            }
            String name = nl.item(0).getFirstChild().getNodeValue();
            nl = opMix.getElementsByTagNameNS(RunInfo.DRIVERURI, "r");
            if (nl.getLength() > 1) {
                String msg = "Only one ratio allowed for @FlatMix";
                getLogger().severe(msg);
                ConfigurationException e = new ConfigurationException(msg);
                getLogger().throwing(className, "configure", e);
                throw e;
            }
            Double ratio = new Double(nl.item(0).getFirstChild().
                    getNodeValue());
            ratioMap.put(name, ratio);
        }

        if (ratioMap.size() <= 0) {
      return;
    }

        for (int i = 0; i < operations.length; i++) {
            Double value = ratioMap.remove(operations[i].name);
            if (value == null) {
                String msg = "Configured ratio for operation " +
                        operations[i].name + " not found";
                getLogger().severe(msg);
                ConfigurationException e = new ConfigurationException(msg);
                getLogger().throwing(className, "configure", e);
                throw e;
            }
            mix[i] = value.doubleValue();
        }

        // By now, the map should be empty
        if (ratioMap.size() > 0) {
            String msg = "";
            for (Iterator<String> i = ratioMap.keySet().iterator();
                 i.hasNext();) {
                if (msg.length() > 0) {
          msg += ", ";
        }
                msg += i.next();
            }
            msg = "Invalid operation name(s) in operationMix " +
                    "configuration: " + msg + '.';
            getLogger().severe(msg);
            ConfigurationException e = new ConfigurationException(msg);
            getLogger().throwing(className, "configure", e);
            throw e;
        }
    }
View Full Code Here


        NodeList nl = e.getElementsByTagNameNS(
                        RunInfo.DRIVERURI, "cycleType");
        if (nl.getLength() > 1) {
            String msg = "Bad cycleType definition; must have only one per cycle Time";
            getLogger().severe(msg);
            ConfigurationException ce = new ConfigurationException(msg);
            getLogger().throwing(getClass().getName(), "configure", ce);
            throw ce;
        }
        if (nl.getLength() == 1) {
            String s = nl.item(0).getFirstChild().getNodeValue();
            if ("CYCLETIME".equals(s)) {
                cycleType = CycleType.CYCLETIME;
            } else if ("THINKTIME".equals(s)) {
                cycleType = CycleType.THINKTIME;
            }
            else getLogger().warning("Ignoring unknown cycletype " + s);
        }
        nl = e.getElementsByTagNameNS(
    RunInfo.DRIVERURI, "cycleDeviation");
        if (nl.getLength() > 1) {
            String msg = "Bad cycleDeviation definition; must have only one per cycle Time";
            getLogger().severe(msg);
            ConfigurationException ce = new ConfigurationException(msg);
            getLogger().throwing(getClass().getName(), "configure", ce);
            throw ce;
        }
        if (nl.getLength() == 1) {
            cycleDeviation = Double.parseDouble(nl.item(0).getFirstChild().getNodeValue());
View Full Code Here

      NodeList nl = e.getElementsByTagNameNS(
            RunInfo.DRIVERURI, "cycleMin");
    if (nl.getLength() > 1) {
        String msg = "Bad cycleMin definition; must have only one per cycleTime";
      getLogger().severe(msg);
      ConfigurationException ce = new ConfigurationException(msg);
      getLogger().throwing(getClass().getName(), "configure", ce);
      throw ce;
    }
    if (nl.getLength() == 1) {
        cycleMin = Long.parseLong(nl.item(0).getFirstChild().getNodeValue()) * Utilities.TO_NANOS;
    }
      nl = e.getElementsByTagNameNS(
            RunInfo.DRIVERURI, "cycleMean");
    if (nl.getLength() > 1) {
        String msg = "Bad cycleMean definition; must have only one per cycleTime";
      getLogger().severe(msg);
      ConfigurationException ce = new ConfigurationException(msg);
      getLogger().throwing(getClass().getName(), "configure", ce);
      throw ce;
    }
    if (nl.getLength() == 1) {
        cycleMean = Long.parseLong(nl.item(0).getFirstChild().getNodeValue()) * Utilities.TO_NANOS;
    }
      nl = e.getElementsByTagNameNS(
            RunInfo.DRIVERURI, "cycleMax");
    if (nl.getLength() > 1) {
        String msg = "Bad cycleMax definition; must have only one per cycleTime";
      getLogger().severe(msg);
      ConfigurationException ce = new ConfigurationException(msg);
      getLogger().throwing(getClass().getName(), "configure", ce);
      throw ce;
    }
    if (nl.getLength() == 1) {
        cycleMax = Long.parseLong(nl.item(0).getFirstChild().getNodeValue()) * Utilities.TO_NANOS;
    }
      nl = e.getElementsByTagNameNS(
            RunInfo.DRIVERURI, "cycleDeviation");
    if (nl.getLength() > 1) {
        String msg = "Bad cycleDeviation definition; must have only one per cycleTime";
      getLogger().severe(msg);
      ConfigurationException ce = new ConfigurationException(msg);
      getLogger().throwing(getClass().getName(), "configure", ce);
      throw ce;
    }
    if (nl.getLength() == 1) {
        truncate = Boolean.parseBoolean(nl.item(0).getFirstChild().getNodeValue());
View Full Code Here

                    sb.append(n).append(" ");
                    break;
                }
            }
            if (!found) {
                throw new ConfigurationException("Invalid <name> " + n + " in operationMix");
            }
        }
        // We now have the new set of operations in the sequence
        getLogger().info("FixedSequence Mix set to: " + sb);
        operations = new BenchmarkDefinition.Operation[newOps.size()];
View Full Code Here

        Document doc = reader.getDocument();
        XPath xPath = reader.getXPath();
        Node n = (Node) xPath.evaluate("//fa:runConfig/fd:outputDir", doc,
                                                    XPathConstants.NODE);
        if (n == null)
            throw new ConfigurationException(
                    "Element fa:runConfig/fd:outputDir not found.");

        Node textNode = n.getFirstChild(); // Fetch it's child - the text node.
        if (textNode == null) {
            if (outputDirectory == null) {
View Full Code Here

        NodeList nl = e.getElementsByTagNameNS(
                        RunInfo.DRIVERURI, "cycleTime");
  if (nl.getLength() > 1) {
            String msg = "Bad cycleTime definition; must have only one per cycleTime";
            getLogger().severe(msg);
            ConfigurationException ce = new ConfigurationException(msg);
            getLogger().throwing(getClass().getName(), "configure", ce);
            throw ce;
        }
        if (nl.getLength() == 1) {
            cycleTime = Long.parseLong(nl.item(0).getFirstChild().getNodeValue()) * Utilities.TO_NANOS;
 
View Full Code Here

        NodeList nl = e.getElementsByTagNameNS(
                        RunInfo.DRIVERURI, "cycleMin");
        if (nl.getLength() > 1) {
            String msg = "Bad cycleMin definition; must have only one per cycleTime";
            getLogger().severe(msg);
            ConfigurationException ce = new ConfigurationException(msg);
            getLogger().throwing(getClass().getName(), "configure", ce);
            throw ce;
        }
        if (nl.getLength() == 1) {
            cycleMin = Long.parseLong(nl.item(0).getFirstChild().getNodeValue())* Utilities.TO_NANOS;
        }
        nl = e.getElementsByTagNameNS(
                        RunInfo.DRIVERURI, "cycleMax");
        if (nl.getLength() > 1) {
            String msg = "Bad cycleMax definition; must have only one per cycleTime";
            getLogger().severe(msg);
            ConfigurationException ce = new ConfigurationException(msg);
            getLogger().throwing(getClass().getName(), "configure", ce);
            throw ce;
        }
        if (nl.getLength() == 1) {
            cycleMax = Long.parseLong(nl.item(0).getFirstChild().getNodeValue())* Utilities.TO_NANOS;
 
View Full Code Here

      NodeList nl = cycleTime.getElementsByTagNameNS(
              RunInfo.DRIVERURI, "classname");
        if (nl.getLength() != 1) {
          String msg = "Badly configured cycle time; you must have one and only one classname";
        getLogger().severe(msg);
        ConfigurationException ce = new ConfigurationException(msg);
        getLogger().throwing(className, "configure", ce);
        throw ce;
        }
      Cycle cycle;
      try {
          String className = nl.item(0).getFirstChild().getNodeValue();
          Class clazz = Class.forName(className);
        cycle = (Cycle) clazz.newInstance();
        cycle.configure(cycleTime);
        } catch (Exception e) {
          String msg = "Can't create cycle";
        getLogger().severe(msg);
        ConfigurationException ce = new ConfigurationException(msg, e);
        getLogger().throwing(className, "configure", ce);
        throw ce;
      }
      NodeList names = cycleTime.getElementsByTagNameNS(
          RunInfo.DRIVERURI, "name");
View Full Code Here

        // Scan for max of minList and report it as a min scale.
        if (minList.size() > 0) {
            for (int minScale : minList)
                if (minScale > maxMinScale)
                    maxMinScale = minScale;
            throw new ConfigurationException("Scale must be at least " +
                    maxMinScale + ".");
        }

        return totalAgentCnt;
    }
View Full Code Here

                    } else {
                        String msg = "Can only configure 1 agentImpl for " +
                                "local runs.\nDetected " + benchDef.
                                drivers[driverToRun].name + " and " +
                                benchDef.drivers[i].name + " set to run.";
                        throw new ConfigurationException(msg);
                    }
                } else if (runInfo.driverConfigs[i].numAgents > 1) {
                    String msg = "Can only configure 1 agentImpl for local " +
                            "runs.\n" + benchDef.drivers[i].name + " is set to " +
                            runInfo.driverConfigs[i].numAgents + " agents.";
                    throw new ConfigurationException(msg);
                }
      }
        } else {
            driverToRun = 0;
            runInfo.driverConfigs[0].numAgents = 1;
        }

        if (driverToRun < 0) {
      throw new ConfigurationException("No driver configured to run.");
    }

        logger.config("Starting single, in-process " +
                      benchDef.drivers[driverToRun].name + "Agent.");
View Full Code Here

TOP

Related Classes of com.sun.faban.driver.ConfigurationException

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.