Examples of Clock


Examples of com.netflix.astyanax.Clock

public class TimeUUIDTest {
    @Test
    @Ignore
    public void testMicrosResolution() {
        Clock clock = new MicrosecondsSyncClock();
        long time = clock.getCurrentTime();

        UUID uuid = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
        long uuidTime = TimeUUIDUtils.getMicrosTimeFromUUID(uuid);

        Assert.assertEquals(time / 10000, uuidTime / 10000);
View Full Code Here

Examples of com.trevor.king.Mines.objects.Clock

        screen = new Screen(WIDTH, HEIGHT);
        mines = new Minefield(FIELD_X, FIELD_Y, NUM_MINES, MINE_SIZE, MINE_SIZE, BUFFER, EDGE, screen);

        score = NUM_MINES;

        clock = new Clock();
        mouse = new Mouse();
        addMouseListener(mouse);

    }
View Full Code Here

Examples of com.twitter.common.util.Clock

  private Capture<Command> replayAndCreateLifecycle() {
    Capture<Command> shutdownCommand = createCapture();
    shutdownRegistry.addAction(capture(shutdownCommand));

    Clock clock = createMock(Clock.class);

    control.replay();

    schedulerLifecycle = new SchedulerLifecycle(
        driverFactory,
View Full Code Here

Examples of common.Clock

    event.generateMatches();
    event.flushMatchList();

    //Clock counter test
    Clock eventDuration = new Clock(ClockType.COUNTER);
    eventDuration.start();
    try {
      Thread.sleep(5000);
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    // Timeout occurs
    Clock timeout = new Clock(ClockType.TIMEOUT);
    timeout.start();

    try {
      Thread.sleep(65000);
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
View Full Code Here

Examples of data.Clock

  }

  @Override
  public void update(Observable o, Object arg) {
    if(arg instanceof Clock) {
      Clock clock = (Clock) arg;
      hour.setText(String.valueOf(format.format(clock.getHours())));
      minute.setText(String.valueOf(format.format(clock.getMinutes())));
     
    } else if(arg instanceof HourAdjustState) {
      hour.setForeground(Color.GRAY);
      hour.setFont(fontEditing);
    } else if(arg instanceof MinuteAdjustState) {
View Full Code Here

Examples of io.s4.util.clock.Clock

        }

        coreContext = new FileSystemXmlApplicationContext(coreConfigFileUrls, coreContext);
        ApplicationContext context = coreContext;       
       
        Clock s4Clock = (Clock) context.getBean("clock");
        if (s4Clock instanceof EventClock && seedTime > 0) {
            EventClock s4EventClock = (EventClock)s4Clock;
            s4EventClock.updateTime(seedTime);
            System.out.println("Intializing event clock time with seed time " + s4EventClock.getCurrentTime());
        }
View Full Code Here

Examples of java.time.Clock

   * @throws Exception If an unexpected error occurs.
   */
  @Test
  public void testClockFixed() throws Exception {
    // A clock which always returns a fixed date/time - in this case 'now', in UTC
    Clock clock = Clock.fixed(Instant.now(), ZoneId.of("UTC"));

    Instant instant1 = clock.instant();
    Thread.sleep(1);
    Instant instant2 = clock.instant();

    assertThat(instant2, is(instant1));
  }
View Full Code Here

Examples of javax.media.Clock

      if (rendererNode != null) {
       
        final Renderer renderer = rendererNode.getRenderer();
        if (renderer instanceof Clock)
        {
          final Clock rendererAsClock = (Clock) renderer;
          try
          {
            TimeBase timeBase = rendererAsClock.getTimeBase();
           
            // With JMF, this ends up as a com.sun.media.renderer.audio.AudioRenderer$AudioTimeBase@49bdc9d8
            // TODO: what do we do in between getting and setting?
            // probably what we need to do is somehow use this clock as our clock.
            // TODO: this is starting to make sense to me.  An audio renderer differs from a video renderer in that
            // the audio renderer has to determine time, therefore it is the master clock.  The video has to be synched with
            // the audio, not the other way around.
           
            rendererAsClock.setTimeBase(timeBase)// this seems unnecessary, but it does cause the audio renderer to set its master clock.
          } catch (IncompatibleTimeBaseException e)
          {
            logger.log(Level.WARNING, "" + e, e);
            postControllerErrorEvent("" + e);
            return false;
View Full Code Here

Examples of krati.retention.clock.Clock

            GenericArray<GenericRecord> items = (GenericArray<GenericRecord>)response.get("results");
           
            for(GenericRecord item : items) {
                K key = deserializeKey((ByteBuffer)item.get("key"));
                V value = deserializeValue((ByteBuffer)item.get("value"));
                Clock clock = deserializeClock((ByteBuffer)item.get("clock"));
                map.put(key, new SimpleEvent<V>(value, clock));
            }
           
            return getPosition(response.get("position").toString());
        } catch (IOException e) {
View Full Code Here

Examples of org.activiti.engine.runtime.Clock

  public void testProcessInstanceStartEvents() throws Exception {
    recordEvents();

    final SimpleSimulationRun.Builder builder = new SimpleSimulationRun.Builder();
    // init simulation run
    Clock clock = new ThreadLocalClock(new DefaultClockFactory());
    ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault();
    config.setClock(clock);
    SimulationProcessEngineFactory simulationProcessEngineFactory = new SimulationProcessEngineFactory(config);
    final ProcessEngineImpl simProcessEngine = simulationProcessEngineFactory.getObject();
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.