it.uniroma2.art.semanticturkey.app.Application Maven / Gradle / Ivy
The newest version!
package it.uniroma2.art.semanticturkey.app;
import it.uniroma2.art.semanticturkey.SemanticTurkey;
import it.uniroma2.art.semanticturkey.mdr.bindings.configuration.MDRBindingsConfiguration;
import it.uniroma2.art.semanticturkey.pf4j.STRootWebApplicationContext;
import it.uniroma2.art.semanticturkey.spring.STCoreFrameworkConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.boot.context.event.ApplicationFailedEvent;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Import;
/**
* Main class of the Semantic Turkey application.
*
* @author Manuel Fiorelli
*/
@SpringBootApplication
@Import({
STCoreFrameworkConfiguration.class, // configuration of the core framework
MDRBindingsConfiguration.class
})
public class Application {
public static void main(String[] args) {
var app = new SpringApplication(Application.class) {
@Override
protected ConfigurableApplicationContext createApplicationContext() {
return new STRootWebApplicationContext();
}
};
app.addListeners((ApplicationEnvironmentPreparedEvent event) -> SemanticTurkey.initialize(event.getEnvironment()));
app.addListeners((ApplicationReadyEvent event) -> System.out.println("ST Started"));
app.addListeners((ApplicationFailedEvent event) -> System.out.println("ST Failed to Start"));
app.run(args);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy