X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Foransc%2Fpolicyagent%2FApplication.java;h=e4b6e5a4892ae7e0bbea9ded0f83b5555d70d17c;hb=refs%2Fchanges%2F74%2F1974%2F6;hp=717a734e489c349169a68b1d175a037a350f553c;hpb=41cbc8cef42c7b1d4ee78c8789f14bffd7d829dd;p=nonrtric.git diff --git a/policy-agent/src/main/java/org/oransc/policyagent/Application.java b/policy-agent/src/main/java/org/oransc/policyagent/Application.java index 717a734e..e4b6e5a4 100644 --- a/policy-agent/src/main/java/org/oransc/policyagent/Application.java +++ b/policy-agent/src/main/java/org/oransc/policyagent/Application.java @@ -17,16 +17,39 @@ * limitations under the License. * ========================LICENSE_END=================================== */ + package org.oransc.policyagent; +import org.oransc.policyagent.controllers.StartupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; @SpringBootApplication public class Application { + @Autowired + private StartupService startupService; + public static void main(String[] args) { SpringApplication.run(Application.class, args); } + /** + * Starts the se4rvice and reads the configuration. + * + * @param ctx + * @return + */ + @Bean + public CommandLineRunner commandLineRunner(ApplicationContext ctx) { + return args -> { + + startupService.startup(); + }; + } + }