2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.ccsdk.apps.ms.neng.core;
23 import java.util.Arrays;
24 import org.springframework.boot.CommandLineRunner;
25 import org.springframework.boot.SpringApplication;
26 import org.springframework.boot.autoconfigure.SpringBootApplication;
27 import org.springframework.boot.builder.SpringApplicationBuilder;
28 import org.springframework.boot.web.support.SpringBootServletInitializer;
29 import org.springframework.context.ApplicationContext;
30 import org.springframework.context.annotation.Bean;
31 import org.springframework.context.annotation.ComponentScan;
32 import org.springframework.scheduling.annotation.EnableAsync;
35 * Entry point for the micro-service -- it starts up the application.
37 @SpringBootApplication
38 @ComponentScan(basePackages = "org.onap.ccsdk")
40 public class Application extends SpringBootServletInitializer {
42 * Configures the application.
45 protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
46 return application.sources(Application.class);
50 * Entry point for the application.
52 public static void main(String[] args) throws Exception {
53 SpringApplication.run(Application.class, args);
57 * Prints diagnostic information after application startup.
60 public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
62 System.out.println("################################");
63 System.out.println("Inspecting the beans provided by Spring Boot:");
64 String[] beanNames = ctx.getBeanDefinitionNames();
65 Arrays.sort(beanNames);
66 for (String beanName : beanNames) {
67 System.out.println(beanName);
69 System.out.println("################################");