ru.elcor.mis.scheduler.point.EndPoint.java Source code

Java tutorial

Introduction

Here is the source code for ru.elcor.mis.scheduler.point.EndPoint.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.point;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import ru.elcor.mis.scheduler.config.AppConfig;
import ru.elcor.mis.scheduler.core.Job;

/**
 *
 * @author Abramov A.O
 */
public class EndPoint {
    public static void main(String[] args) {
        try {
            doit();
        } catch (InterruptedException ex) {
            Logger.getLogger(EndPoint.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public static void doit() throws InterruptedException {
        ApplicationContext AppCxt = new AnnotationConfigApplicationContext(AppConfig.class);
        // System.setProperty("setCron", "0-59 * * * * *");
        Job jobs = AppCxt.getBean(Job.class);

        for (int i = 0; i < 10; i++) {
            System.out.println("soy");
            Thread.sleep(1000);
        }
    }
}