001package voyeur; 002/*- 003 * ########################################################################## 004 * Local Area Network Voyeur 005 * %% 006 * Copyright (C) 2019 - 2022 Allen D. Ball 007 * %% 008 * Licensed under the Apache License, Version 2.0 (the "License"); 009 * you may not use this file except in compliance with the License. 010 * You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, software 015 * distributed under the License is distributed on an "AS IS" BASIS, 016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 017 * See the License for the specific language governing permissions and 018 * limitations under the License. 019 * ########################################################################## 020 */ 021import lombok.NoArgsConstructor; 022import lombok.ToString; 023import lombok.extern.log4j.Log4j2; 024import org.springframework.boot.SpringApplication; 025import org.springframework.boot.autoconfigure.SpringBootApplication; 026import org.springframework.boot.builder.SpringApplicationBuilder; 027import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 028import org.springframework.context.ApplicationContext; 029 030/** 031 * {@link SpringApplication} {@link Launcher}. 032 * 033 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball} 034 */ 035@SpringBootApplication 036@NoArgsConstructor @ToString @Log4j2 037public class Launcher extends SpringBootServletInitializer { 038 private static ApplicationContext context = null; 039 040 /** 041 * Standard {@link SpringApplication} {@code main(String[])} 042 * entry point. 043 * 044 * @param argv The command line argument vector. 045 * 046 * @throws Exception If the function does not catch 047 * {@link Exception}. 048 */ 049 public static void main(String[] argv) throws Exception { 050 context = SpringApplication.run(Launcher.class, argv); 051 } 052 053 @Override 054 protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { 055 return builder.sources(Launcher.class); 056 } 057}