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

org.khasanof.config.service.runnable.RunnableServicesAutoConfiguration Maven / Gradle / Ivy

The newest version!
package org.khasanof.config.service.runnable;

import org.khasanof.collector.AssembleMethods;
import org.khasanof.constants.FluentConstants;
import org.khasanof.service.FindBeansOfTypeService;
import org.khasanof.service.runnable.PostProcessor;
import org.springframework.context.annotation.Configuration;

/**
 * @author Nurislom
 * @see org.khasanof.config.service.runnable
 * @since 2/4/2024 10:24 PM
 */
@Configuration
public class RunnableServicesAutoConfiguration implements AssembleMethods {

    private final FindBeansOfTypeService findBeansOfTypeService;

    public RunnableServicesAutoConfiguration(FindBeansOfTypeService findBeansOfTypeService) {
        this.findBeansOfTypeService = findBeansOfTypeService;
    }

    /**
     * PostProcessor Runner
     */
    @Override
    public void assemble() {
        findBeansOfTypeService.findAllByList(PostProcessor.class)
                .forEach(Runnable::run);
    }

    @Override
    public int getOrder() {
        return FluentConstants.HIGH_ORDER;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy