package com.sourcefellows.patterns.observer;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

    public static void main(String[] args) {

        ConfigurableApplicationContext context =
                new ClassPathXmlApplicationContext("services.xml");

        var myAppListener = new MyAppListener();
        context.addApplicationListener(myAppListener);

        context.start();
        context.stop();

        context.close();
        context.removeApplicationListener(myAppListener);

    }

}
