Examples of Timer


Examples of org.apache.openejb.jee.Timer

                if (scheduleAnnotation != null) {
                    scheduleAnnotationList.add(scheduleAnnotation);
                }

                for (javax.ejb.Schedule schedule : scheduleAnnotationList) {
                    Timer timer = new Timer();
                    timer.setPersistent(schedule.persistent());
                    timer.setInfo((schedule.info() == null || schedule.info().isEmpty()) ? null : schedule.info());
                    timer.setTimezone((schedule.timezone() == null || schedule.timezone().isEmpty()) ? null : schedule.timezone());
                    //Copy TimerSchedule
                    TimerSchedule timerSchedule = new TimerSchedule();
                    timerSchedule.setSecond(schedule.second());
                    timerSchedule.setMinute(schedule.minute());
                    timerSchedule.setHour(schedule.hour());
                    timerSchedule.setDayOfWeek(schedule.dayOfWeek());
                    timerSchedule.setDayOfMonth(schedule.dayOfMonth());
                    timerSchedule.setMonth(schedule.month());
                    timerSchedule.setYear(schedule.year());
                    timer.setSchedule(timerSchedule);
                    //Copy Method Signature
                    timer.setTimeoutMethod(new NamedMethod(method.get()));

                    timers.add(timer);
                }
            }
        }
View Full Code Here

Examples of org.apache.samza.metrics.Timer

    Gauge<String> gauge1 = registry.newGauge("testg", "a", "1");
    Gauge<String> gauge2 = registry.newGauge("testg", "b", "2");
    Gauge<String> gauge3 = registry.newGauge("testg", "c", "3");
    Gauge<String> gauge4 = registry.newGauge("testg2", "d", "4");

    Timer timer1 = registry.newTimer("testt", "a");
    Timer timer2 = registry.newTimer("testt", "b");
    Timer timer3 = registry.newTimer("testt2", "c");

    counter1.inc();
    counter2.inc(2);
    counter3.inc(4);

    gauge1.set("5");
    gauge2.set("6");
    gauge3.set("7");
    gauge4.set("8");

    timer1.update(1L);
    timer2.update(2L);
    timer3.update(3L);

    assertEquals(1, counter1.getCount());
    assertEquals(2, counter2.getCount());
    assertEquals(4, counter3.getCount());
    assertEquals("5", gauge1.getValue());
    assertEquals("6", gauge2.getValue());
    assertEquals("7", gauge3.getValue());
    assertEquals("8", gauge4.getValue());
    assertEquals(1, timer1.getSnapshot().getAverage(), 0);
    assertEquals(2, timer2.getSnapshot().getAverage(), 0);
    assertEquals(3, timer3.getSnapshot().getAverage(), 0);
  }
View Full Code Here

Examples of org.apache.servicemix.timers.Timer

                    store.store(correlationId, aggregation);
                    if (timeout != null) {
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("Scheduling timeout at " + timeout + " for aggregate " + correlationId);
                        }
                        Timer t = getTimerManager().schedule(new TimerListener() {
                            public void timerExpired(Timer timer) {
                                AbstractAggregator.this.onTimeout(processCorrelationId, correlationId, timer);
                            }
                        }, timeout);
                        timers.put(correlationId, t);
View Full Code Here

Examples of org.apache.uima.internal.util.Timer

    init();
  }

  public void runAE(boolean doCasReset) {
    setStatusbarMessage("Running Annotator.");
    Timer timer = new Timer();
    timer.start();
    if (this.ae == null) {
      JOptionPane.showMessageDialog(this, "No AE loaded.", "Error", JOptionPane.ERROR_MESSAGE);
      return;
    }
    internalRunAE(doCasReset);
    timer.stop();
    setStatusbarMessage("Done running AE " + this.ae.getAnalysisEngineMetaData().getName() + " in "
        + timer.getTimeSpan() + ".");
    updateIndexTree(true);
    this.allAnnotationViewerItem.setEnabled(false);
    this.isDirty = false;
    this.runOnCasMenuItem.setEnabled(true);
  }
View Full Code Here

Examples of org.auraframework.impl.context.LoggingContextImpl.Timer

    public LoggingTimerTest(String name) {
        super(name);
    }
   
    public void testTimer() throws Exception {
        Timer timer = new Timer("foo");
        assertEquals("Uninitialized timer has a totalTime", -1, timer.getTime());
        assertEquals("Timer name is wrong", "foo", timer.getName());
       
        timer.start();
        assertEquals("Running timer has a totalTime", -1, timer.getTime());
       
        timer.stop();
        assertTrue("Completed timer has no totalTime", timer.getTime() >= 0);
       
        timer.reset();
        assertEquals("Reseted timer has a totalTime", -1, timer.getTime());
    }
View Full Code Here

Examples of org.commoncrawl.async.Timer

      _reconnectDelay = INITIAL_RECONNECT_DELAY;
      connect();
    }
    // otherwise schedule a timer base on current reconnect interval
    else {
      _reconnectTimer = new Timer(_reconnectDelay, false,

      new Timer.Callback() {

        // @Override
        public void timerFired(Timer timer) {
View Full Code Here

Examples of org.drools.core.marshalling.impl.ProtobufMessages.Timers.Timer

            ProtobufMessages.Timers.Builder _timers = ProtobufMessages.Timers.newBuilder();
            for ( TimerJobInstance timer : sortedTimers ) {
                JobContext jctx = ((SelfRemovalJobContext) timer.getJobContext()).getJobContext();
                TimersOutputMarshaller writer = outCtx.writersByClass.get( jctx.getClass() );
                Timer _timer = writer.serialize( jctx, outCtx );
                if ( _timer != null ) {
                    _timers.addTimer( _timer );
                }
            }
            return _timers.build();
View Full Code Here

Examples of org.drools.core.time.impl.Timer

        String repeatLimitString = extractParam(timerString, "repeat-limit");
        int repeatLimit = repeatLimitString != null ? Integer.parseInt( repeatLimitString ) : -1;
       
        String body = timerString.substring( colonPos + 1, semicolonPos > 0 ? semicolonPos : timerString.length() ).trim();
       
        Timer timer = null;
        if ( "cron".equals( protocol ) ) {
            try {
                timer = new CronTimer( createMVELExpr(startDate, context), createMVELExpr(endDate, context), repeatLimit, new CronExpression( body ) );
            } catch ( ParseException e ) {
                DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
View Full Code Here

Examples of org.drools.marshalling.impl.ProtobufMessages.Timers.Timer

           
            ProtobufMessages.Timers.Builder _timers = ProtobufMessages.Timers.newBuilder();
            for ( TimerJobInstance timer : sortedTimers ) {
                JobContext jctx = ((SelfRemovalJobContext) timer.getJobContext()).getJobContext();
                TimersOutputMarshaller writer = outCtx.writersByClass.get( jctx.getClass() );
                Timer _timer = writer.serialize( jctx, outCtx );
                _timers.addTimer( _timer );
            }
            return _timers.build();
        }
        return null;
View Full Code Here

Examples of org.drools.process.core.timer.Timer

        getRuleSetNode().setRuleFlowGroup(ruleFlowGroup);
        return this;
    }
   
    public RuleSetNodeFactory timer(long delay, long period, String dialect, String action) {
      Timer timer = new Timer();
      timer.setDelay(delay);
      timer.setPeriod(period);
      getRuleSetNode().addTimer(timer, new DroolsConsequenceAction(dialect, action));
      return this;
    }
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.