ru.elcor.mis.scheduler.core.Scheduler.java Source code

Java tutorial

Introduction

Here is the source code for ru.elcor.mis.scheduler.core.Scheduler.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package ru.elcor.mis.scheduler.core;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import ru.elcor.mis.scheduler.config.AppConfig;

/**
 *
 * @author Abramov A.O
 */
public class Scheduler {
    Task task;

    public Scheduler(Task task) {
        this.task = task;
    }

    public Scheduler() {

    }

    private void Config() {

    }

    public void doit() throws InterruptedException {
        ApplicationContext AppCxt = new AnnotationConfigApplicationContext(AppConfig.class);
        Job jobs = AppCxt.getBean(Job.class);
        for (int i = 0; i < 10; i++) {
            System.out.println("soy");
            Thread.sleep(1000);
        }
    }
}