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

com.xlrit.gears.engine.schedule.ProcessSchedule Maven / Gradle / Ivy

package com.xlrit.gears.engine.schedule;

import com.xlrit.gears.base.schedule.ScheduledRunnable;

import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class ProcessSchedule {
	private static final Logger LOG = LoggerFactory.getLogger(ProcessSchedule.class);

	private final Environment environment;

	@SuppressWarnings("unused")
	public String forProcessKey(String processKey) {
		String property = "gears.schedule." + processKey + ".cron";
		String cron = environment.getProperty(property, ScheduledRunnable.EFFECTIVELY_NEVER);
		LOG.info("cron expression for process '{}' (property '{}'): {}", processKey, property, cron);
		return cron;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy