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

tech.rsqn.streamsdemo.server.ServerMain Maven / Gradle / Ivy

package tech.rsqn.streamsdemo.server;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.support.GenericXmlApplicationContext;

import java.util.Arrays;

/**
 * Created by mandrewes on 25/06/14.
 */
public class ServerMain {
    static final Logger log = LoggerFactory.getLogger(ServerMain.class);

    public static void main(String[] args) {
        try {
            ServerMain m = new ServerMain();
            m.launch(args);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public String[] getApplicationContextLocations() {
        return new String[]{"spring/startup-ctx.xml"};
    }

    public void launch(String[] args) {
        log.info("Launching ApplicationContext " + Arrays.toString(getApplicationContextLocations()));

        try {
            GenericXmlApplicationContext ctx = new GenericXmlApplicationContext(getApplicationContextLocations());
            log.info("Launching ApplicationContext " + Arrays.toString(getApplicationContextLocations()));
            ctx.getBean("jetty");
            log.info("Graceful exit");
        } finally {
            log.info("Exiting");
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy