Examples of Monitor


Examples of org.apache.tuscany.sca.monitor.Monitor

        }
    }

    @Override
    public XMLStreamReader createXMLStreamReader(String arg0, Reader arg1) throws XMLStreamException {
        Monitor monitor = monitorFactory.getContextMonitor();
        initializeSchemas(monitor);
        if (hasSchemas) {
            return new ValidatingXMLStreamReader(inputFactory.createXMLStreamReader(arg0, arg1), aggregatedSchema, monitor);
        } else {
            return inputFactory.createXMLStreamReader(arg0, arg1);
View Full Code Here

Examples of org.apache.tuscany.sca.monitor.Monitor

            monitor.problem(problem);
        }
    }

    public Object read(XMLStreamReader source, ProcessorContext context) throws ContributionReadException, XMLStreamException {
        Monitor monitor = context.getMonitor();
        // Delegate to the processor associated with the element QName
        int event = source.getEventType();
        if (event == XMLStreamConstants.START_DOCUMENT) {
            source.nextTag();
        }
View Full Code Here

Examples of org.apache.tuscany.sca.monitor.Monitor

     * @param context TODO
     * @return The model
     * @throws ContributionReadException
     */
    public <M> M read(InputStream is, Class<M> type, ProcessorContext context) throws ContributionReadException {
        Monitor monitor = context.getMonitor();
        try {
            XMLStreamReader reader;
            try {
                reader = inputFactory.createXMLStreamReader(is);
                try {
View Full Code Here

Examples of org.apache.uima.aae.monitor.Monitor

  protected boolean exceedsThreshold(String aThresholdToCheck, String endpoint,
          AnalysisEngineController controller) {
    Threshold threshold = getThreshold(aThresholdToCheck, endpoint);
    if (threshold != null) {
      Monitor monitor = controller.getMonitor();
      Statistic statistic = null;
      if ((statistic = monitor.getStatistic(endpoint, aThresholdToCheck)) == null) {
        statistic = new LongNumericStatistic(aThresholdToCheck);
        monitor.addStatistic(endpoint, statistic);
      }
      if (statistic instanceof LongNumericStatistic) {
        ((LongNumericStatistic) statistic).increment();
        if (threshold.exceeded(((LongNumericStatistic) statistic).getValue())) {
          return true;
View Full Code Here

Examples of org.directmemory.measures.Monitor

  public MethodRule benchmarkRun = new BenchmarkRule();

  private static Logger logger=LoggerFactory.getLogger(SerializerTest.class);
  private void testSerializer(String name, Serializer serializer, int size, int howMany) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException {
    logger.info("begin " + serializer.getClass().toString());
        Monitor stopWatch = Monitor.get("serializer." + name + "." + size + "bytes");
        Monitor stopWatch2 = Monitor.get("deserializer." + name + "." + size + "bytes");
    DummyPojo pojo = new DummyPojo("test", size);
    for (int i = 0; i < howMany; i++) {
          long split = stopWatch.start();
      final byte[] array = serializer.serialize(pojo, pojo.getClass());
      stopWatch.stop(split);
      long split2 = stopWatch2.start();
      DummyPojo check = (DummyPojo) serializer.deserialize(array, pojo.getClass());
      stopWatch2.stop(split2);
      assertNotNull("object has not been serialized", check);
      assertEquals(pojo.name, check.name);
    }
    logger.info("end serialize " + serializer.getClass().toString() + "\r\n" + stopWatch.toString());
    logger.info("end deserialize " + serializer.getClass().toString() + "\r\n" + stopWatch2.toString());
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Monitor

            Rectangle displayBounds = null;
            try {
              boolean ok = false;
              Monitor[] monitors = shell.getDisplay().getMonitors();
              for (int i = 0; i < monitors.length; i++) {
                Monitor monitor = monitors[i];
                displayBounds = monitor.getBounds();
                if (displayBounds.contains(endBounds.x, endBounds.y)) {
                  ok = true;
                  break;
                }
              }
View Full Code Here

Examples of org.eclipse.swt.widgets.Monitor

    int x = (int) (WIDTH_NO_PADDING * (value > maxValue ? 1 : (double) value
        / maxValue));
    location.x -= PADDING_X0 + x;

    Rectangle bounds = new Rectangle(location.x, location.y, WIDTH, HEIGHT);
    Monitor mouseMonitor = shell.getMonitor();
    Monitor[] monitors = display.getMonitors();
    for (int i = 0; i < monitors.length; i++) {
      Monitor monitor = monitors[i];
      if (monitor.getBounds().contains(location)) {
        mouseMonitor = monitor;
        break;
      }
    }
    Rectangle monitorBounds = mouseMonitor.getBounds();
View Full Code Here

Examples of org.eclipse.swt.widgets.Monitor

   * Get the Client Area of the primary Monitor.
   *
   * @return Returns the Client Area of the primary Monitor.
   */
  private Rectangle getPrimaryClientArea() {
    Monitor primaryMonitor = getShell().getDisplay().getPrimaryMonitor();
    return (primaryMonitor != null) ? primaryMonitor.getClientArea() : getShell().getDisplay().getClientArea();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Monitor

   * Get the Client Area of the primary Monitor.
   *
   * @return Returns the Client Area of the primary Monitor.
   */
  private Rectangle getPrimaryClientArea() {
    Monitor primaryMonitor = fShell.getDisplay().getPrimaryMonitor();
    return (primaryMonitor != null) ? primaryMonitor.getClientArea() : fShell.getDisplay().getClientArea();
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.Monitor

   * Get the Client Area of the primary Monitor.
   *
   * @return Returns the Client Area of the primary Monitor.
   */
  private Rectangle getPrimaryClientArea() {
    Monitor primaryMonitor = fShell.getDisplay().getPrimaryMonitor();
    return (primaryMonitor != null) ? primaryMonitor.getClientArea() : fShell.getDisplay().getClientArea();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.