/*- * ============LICENSE_START======================================================= * ONAP : CCSDK.apps * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END========================================================= */ package org.onap.ccsdk.apps.ms.neng.core; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.scheduling.annotation.EnableAsync; /** * Entry point for the micro-service -- it starts up the application. */ @SpringBootApplication @ComponentScan(basePackages = "org.onap.ccsdk") @EnableAsync public class Application extends SpringBootServletInitializer { private Logger log = LoggerFactory.getLogger(Application.class); /** * Configures the application. */ @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Application.class); } /** * Entry point for the application. */ public static void main(String[] args) { SpringApplication.run(Application.class, args); } /** * Prints diagnostic information after application startup. */ @Bean public CommandLineRunner commandLineRunner(ApplicationContext ctx) { return args -> { log.info("################################"); log.info("Inspecting the beans provided by Spring Boot:"); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { log.info(beanName); } log.info("################################"); }; } }