All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.drools.solon.KieSchedule Maven / Gradle / Ivy

There is a newer version: 3.0.0-M4
Show newest version
package com.drools.solon;


import java.util.concurrent.TimeUnit;

import com.drools.solon.util.ScheduledThreadPoolExecutorUtil;

/**
 * @author Karas
 * @date 2019/9/27
 * @since 1.0.0
 */
public class KieSchedule {

    private final KieTemplate kieTemplate;

    public KieSchedule(KieTemplate kieTemplate) {
        this.kieTemplate = kieTemplate;
    }

    public void execute() {
        Long update = kieTemplate.getUpdate();
        if (update == null || update <= 0L) {
            update = 30L;
        }
        ScheduledThreadPoolExecutorUtil.RULE_SCHEDULE.
                scheduleAtFixedRate(new RuleCache(kieTemplate),
                1, update, TimeUnit.SECONDS);

        //ScheduledThreadPoolExecutorUtil.CACHE_KIE.scheduleAtFixedRate(new Runnable() {
        //    @Override
        //    public void run() {
        //
        //    }
        //}, 1, 1, TimeUnit.SECONDS);
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy