this.sleep(pollFrequency);
sleep(pollFrequency);
        public void run() {            logger.logOptional(name, "poller running");            while (!pollingFinished) {                try {                    int value = dataSource.getData();                    logger.logOptional(name, "poller measure obtained " +                        value);                    if (minInstancesChanged()) {                        setTargetInstances(targetInstances);                    }                    measures.add(new Integer(value));                    if (measures.size() > repeatMeasures) {                        logger.logOptional(name,                            "poller has sufficient measures to proceed");                        measures.remove(0);                        // we now have enough measures to start testing...                        if (stabilizationCounter > 0) {                            // don't do anything if not stabilized...                            logger.logOptional(name, "poller not stabilized yet");                            stabilizationCounter--;                        } else {                            logger.logOptional(name, "poller stabilized");                            // have enough measures and are stabilised...                            // note it would be more efficient to keep a running total (adding and subtracting                            // values as they are added and removed from the vector                            // also would be more eficient to multiply the thresholds by the repeats once, not do                            // the averaging division each time.                            // keeping the logic here, however, makes it easier to maintain and modify during testing...!                            int avg = 0;                            for (Enumeration e = measures.elements();                                    e.hasMoreElements();) {                                avg += ((Integer) e.nextElement()).intValue();                            }                            avg = avg / repeatMeasures;                            logger.logOptional(name,                                "poller average of repeat measures is " + avg);                            if (avg > upperThreshold) {                                logger.logOptional(name,                                    "poller upper threshold met...");                                if (isAuto) {                                    setTargetInstances(currentInstances + 1);                                }                            } else if (avg < lowerThreshold) {                                logger.logOptional(name,                                    "poller lower threshold met...");                                if (isAuto) {                                    setTargetInstances(currentInstances - 1);                                }                            }                        }                    }                    logger.logOptional(name, "poller sleeping");                    this.sleep(pollFrequency);                    logger.logOptional(name, "poller awake");                } catch (Exception e) {                    logger.logOptional(name, "excpetion caught in the poller");                    e.printStackTrace();                }            }            logger.logOptional(name, "poller stopped");        }