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

com.github.lontime.extspring.components.BaseSchedulerComponentExt Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.github.lontime.extspring.components;

import java.util.stream.Collectors;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;

import com.github.lontime.base.commonj.components.ComponentInterfaceHelper;
import com.github.lontime.base.scheduler.SchedulerInstance;
import com.github.lontime.base.scheduler.listeners.LocalTaskInterface;

/**
 * CopperComponentExt.
 * @author lontime
 * @since 1.0
 */
public class BaseSchedulerComponentExt implements InitializingBean {

    private ObjectProvider localTask;

    @Autowired
    public void setLocalTask(ObjectProvider localTask) {
        this.localTask = localTask;
    }

    @Override
    public void afterPropertiesSet() {
        ComponentInterfaceHelper.register(localTask.stream()
                .filter(s -> s.getClazz() == LocalTaskInterface.class)
                .collect(Collectors.toList()));
        SchedulerInstance.get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy