All checks were successful
Locusworks Team/eight-track/pipeline/head This commit looks good
79 lines
3.5 KiB
Java
79 lines
3.5 KiB
Java
/*
|
|
*
|
|
* Project: Eight Track, File: EightTrackLauncher.java
|
|
*
|
|
* Copyright 2019-2021 Locusworks LLC.
|
|
* All rights reserved. Federal copyright law prohibits unauthorized reproduction by
|
|
* any means and imposes fines up to $25,000 for violation. No part of this material
|
|
* may be reproduced, transmitted, transcribed, stored in a retrieval system, copied,
|
|
* modified, duplicated, adapted or translated into another program language in any
|
|
* form or by any means, electronic, mechanical, photocopying, recording, or
|
|
* otherwise, without the prior written permission from Locusworks. Locusworks
|
|
* affirms that Eight-Track(R) software and data is subject to United States
|
|
* Government Purpose Rights. Contact Locusworks, 1313 Lawnview Drive
|
|
* Forney TX 75126, (802) 488-0438, for commercial licensing opportunities.
|
|
*
|
|
* IN NO EVENT SHALL LOCUSWORKS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
|
* INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT
|
|
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF LOCUSWORKS HAS BEEN
|
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. NO RESPONSIBILITY IS ASSUMED BY
|
|
* LOCUSWORKS FOR ITS USE, OR FOR ANY INFRINGEMENTS OF PATENTS OR OTHER RIGHTS OF
|
|
* THIRD PARTIES RESULTING FROM ITS USE. LOCUSWORKS SPECIFICALLY DISCLAIMS ANY
|
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND
|
|
* ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS
|
|
* IS". LOCUSWORKS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
|
|
* ENHANCEMENTS, OR MODIFICATIONS.
|
|
*/
|
|
package net.locusworks.discord.eighttrack.main;
|
|
|
|
import java.io.IOException;
|
|
import javax.security.auth.login.LoginException;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.ApplicationArguments;
|
|
import org.springframework.boot.ApplicationRunner;
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
import net.locusworks.discord.eighttrack.services.ConfigurationService;
|
|
import net.locusworks.discord.eighttrack.services.EightTrackService;
|
|
import net.locusworks.logger.ApplicationLogger;
|
|
import net.locusworks.logger.ApplicationLoggerFactory;
|
|
import net.locusworks.logger.ApplicationLoggerInitializer;
|
|
import net.locusworks.logger.LogLevel;
|
|
|
|
@SpringBootApplication(scanBasePackages = {"net.locusworks.discord.eighttrack"})
|
|
@EnableAutoConfiguration
|
|
@EnableScheduling
|
|
public class EightTrackLauncher implements ApplicationRunner {
|
|
|
|
@Autowired
|
|
private ConfigurationService confService;
|
|
|
|
@Autowired
|
|
private EightTrackService service;
|
|
|
|
public static void main(String[] args) throws LoginException, IOException {
|
|
new SpringApplicationBuilder(EightTrackLauncher.class).headless(true).run(args);
|
|
}
|
|
|
|
@Override
|
|
public void run(ApplicationArguments args) throws Exception {
|
|
ApplicationLoggerFactory.init(new ApplicationLoggerInitializer() {
|
|
|
|
@Override
|
|
public LogLevel initialize() {
|
|
return LogLevel.getEnum(confService.getLogLevel());
|
|
}
|
|
});
|
|
|
|
ApplicationLogger logger = ApplicationLoggerFactory.getLogger(EightTrackLauncher.class);
|
|
logger.info("Starting Eight-Track");
|
|
|
|
service.begin();
|
|
}
|
|
}
|