Code example for ScheduledExecutorService

Methods: scheduleWithFixedDelay

0
            throws ConnectionLostException { 
        if (!signalMap.containsKey(ULTRASOUND_HEIGHT)) {
            logger.info("creating ultrasound signal");
             
            IoioSignal signal = new UltrasoundSignal(ioio, pin);
            futures.add(scheduler.scheduleWithFixedDelay(signal, 0, interval,
                    TimeUnit.MILLISECONDS));
            signalMap.put(ULTRASOUND_HEIGHT, signal);
        } 
        return signalMap.get(ULTRASOUND_HEIGHT);
    } 
     
    /* 
     * (non-Javadoc) 
     *  
     * @see com.barbermot.pilot.signal.SignalManager#getGpsAltitudeSignal(int) 
     */ 
    @Override 
    public Signal getGpsAltitudeSignal(int interval) {
        if (!signalMap.containsKey(GPS_HEIGHT)) {
            createGpsSignals(interval);