Package com.graphaware.runtime.schedule

Examples of com.graphaware.runtime.schedule.FixedDelayTimingStrategy


        if (timingStrategy == null) {
            return AdaptiveTimingStrategy.defaultConfiguration();
        }

        if (timingStrategy instanceof FixedDelayTimingStrategy) {
            FixedDelayTimingStrategy strategy = (FixedDelayTimingStrategy) timingStrategy;

            if (config.get(INITIAL_DELAY_SETTING) != null) {
                strategy = strategy.withInitialDelay(config.get(INITIAL_DELAY_SETTING));
            }

            if (config.get(DELAY_SETTING) != null) {
                strategy = strategy.withDelay(config.get(DELAY_SETTING));
            }

            return strategy;
        }

        if (timingStrategy instanceof AdaptiveTimingStrategy) {
            AdaptiveTimingStrategy strategy = (AdaptiveTimingStrategy) timingStrategy;

            if (config.get(DELAY_SETTING) != null) {
                strategy = strategy.withDefaultDelayMillis(config.get(DELAY_SETTING));
            }

            if (config.get(MAX_DELAY_SETTING) != null) {
                strategy = strategy.withMaximumDelayMillis(config.get(MAX_DELAY_SETTING));
            }

            if (config.get(MIN_DELAY_SETTING) != null) {
                strategy = strategy.withMinimumDelayMillis(config.get(MIN_DELAY_SETTING));
            }

            if (config.get(BUSY_THRESHOLD_SETTING) != null) {
                strategy = strategy.withBusyThreshold(config.get(BUSY_THRESHOLD_SETTING));
            }

            if (config.get(MAX_SAMPLES_SETTING) != null) {
                strategy = strategy.withMaxSamples(config.get(MAX_SAMPLES_SETTING));
            }

            if (config.get(MAX_TIME_SETTING) != null) {
                strategy = strategy.withMaxTime(config.get(MAX_TIME_SETTING));
            }

            return strategy;
        }
View Full Code Here

TOP

Related Classes of com.graphaware.runtime.schedule.FixedDelayTimingStrategy

Copyright © 2018 www.massapicom. 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.