X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=sparkybe-onap-application%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fsparky%2FApplication.java;h=693617b7b008b4e9488143efa9e430d7a5dacd46;hb=b505658d523507b2aa8eec564b599ce1e2b1956a;hp=548a48b9159514f36078ea5e17eaed48eb9ea832;hpb=a0727ffb7ee413d56f0b969c8f47861510ee8d98;p=aai%2Fsparky-be.git diff --git a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java index 548a48b..693617b 100644 --- a/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java +++ b/sparkybe-onap-application/src/main/java/org/onap/aai/sparky/Application.java @@ -18,92 +18,22 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -/** - * This copy of Woodstox XML processor is licensed under the - * Apache (Software) License, version 2.0 ("the License"). - * See the License for details about distribution rights, and the - * specific rights regarding derivate works. - * - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/ - * - * A copy is also included in the downloadable source code package - * containing Woodstox, in file "ASL2.0", under the same directory - * as this file. - */ package org.onap.aai.sparky; -import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.servlet.CamelHttpTransportServlet; -import org.apache.camel.model.rest.RestBindingMode; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.servlet.ServletRegistrationBean; -import org.springframework.boot.web.support.SpringBootServletInitializer; -import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; @SpringBootApplication -public class Application /*extends SpringBootServletInitializer */ { +public class Application { - private @Autowired AutowireCapableBeanFactory beanFactory; - public static void main(String[] args) { - ApplicationContext applicationContext = SpringApplication.run(Application.class, args); - - /*for (String name : applicationContext.getBeanDefinitionNames()) { - System.out.println(name); - }*/ + SpringApplication.run(Application.class, args); } - - /* @Component - class RestApi extends RouteBuilder { - - @Override - public void configure() { - - //restConfiguration().component("restlet").contextPath("/rs").bindingMode(RestBindingMode.json); - - - /*rest("/books").description("Books REST service") - .get("/").description("The list of all the books") - .route().routeId("books-api") - .bean(Database.class, "findBooks") - .endRest() - .get("order/{id}").description("Details of an order by id") - .route().routeId("order-api") - .bean(Database.class, "findOrder(${header.id})");*/ - /* } - }*/ - - - /* - * TODO: we need to figure out the initialization required for our restlets - */ - - /*@Bean - public ServletRegistrationBean restletBootstrapInitialization() { - - SpringServerServlet serverServlet = new SpringServerServlet(); - ServletRegistrationBean regBean = new ServletRegistrationBean( serverServlet, "/rest/*"); - - - Map params = new HashMap(); - - params.put("org.restlet.component", "restletComponent"); - - regBean.setInitParameters(params); - - return regBean; - }*/ - - /* * This initialization code enabled access to aai-ui-proxy-processor @@ -117,36 +47,6 @@ public class Application /*extends SpringBootServletInitializer */ { return servlet; } - /* @Bean - public EmbeddedServletContainerFactory servletContainerFactory() { - return new TomcatEmbeddedServletContainerFactory() { - - /* - * Stackoverflow solution for adding a WAR into our embedded tomcat runtime - * https://stackoverflow.com/questions/31374726/spring-boot-how-to-add-another-war-files-to-the-embedded-tomcat - */ - - - /* @Override - protected TomcatEmbeddedServletContainer getTomcatEmbeddedServletContainer(Tomcat tomcat) { - // Ensure that the webapps directory exists - System.out.println("catalina base = " + tomcat.getServer().getCatalinaBase()); - new File(tomcat.getServer().getCatalinaBase(), "webapps").mkdirs(); - - try { - Context context = tomcat.addWebapp("/services/aai/webapp", "X:\\2018_dev\\OSEAAI\\NUC-7257-spring-boot-conversion\\onap_sparky-be\\src\\main\\resources\\extApps\\aai.war"); - - // Allow the webapp to load classes from your fat jar - context.setParentClassLoader(getClass().getClassLoader()); - } catch (ServletException ex) { - throw new IllegalStateException("Failed to add webapp", ex); - } - return super.getTomcatEmbeddedServletContainer(tomcat); - } - - }; - }*/ - /** * bind LoginFilter */