package com.gyee.alarm;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class ApplicationReadyEventListener implements
        ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    private CalculateServer calculateServer;

    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        System.out.println("ApplicationReadyEvent start!");
        System.out.println("listener: " + event.toString());
        calculateServer.start();
    }

}