seb-server/src/main/java/ch/ethz/seb/sebserver/SEBServerInit.java

56 lines
1.9 KiB
Java
Raw Normal View History

2019-12-12 19:47:20 +01:00
/*
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package ch.ethz.seb.sebserver;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.ethz.seb.sebserver.webservice.WebserviceInfo;
@Lazy
@Component
public class SEBServerInit {
2020-04-27 12:17:10 +02:00
public static final Logger INIT_LOGGER = LoggerFactory.getLogger("ch.ethz.seb.SEB_SERVER_INIT");
2019-12-12 19:47:20 +01:00
private final Environment environment;
private final WebserviceInfo webserviceInfo;
private boolean initialized = false;
protected SEBServerInit(final Environment environment, final WebserviceInfo webserviceInfo) {
this.environment = environment;
this.webserviceInfo = webserviceInfo;
}
public void init() {
if (!this.initialized) {
INIT_LOGGER.info("----> ___ ___ ___ ___ ");
INIT_LOGGER.info("----> / __|| __|| _ ) / __| ___ _ _ __ __ ___ _ _ ");
INIT_LOGGER.info("----> \\__ \\| _| | _ \\ \\__ \\/ -_)| '_|\\ V // -_)| '_|");
INIT_LOGGER.info("----> |___/|___||___/ |___/\\___||_| \\_/ \\___||_| ");
INIT_LOGGER.info("---->");
INIT_LOGGER.info("---->");
2020-06-04 08:52:01 +02:00
INIT_LOGGER.info("----> Version: {}", this.webserviceInfo.getSEBServerVersion());
2019-12-12 19:47:20 +01:00
INIT_LOGGER.info("---->");
INIT_LOGGER.info("----> Active profiles: {}", Arrays.toString(this.environment.getActiveProfiles()));
INIT_LOGGER.info("---->");
this.initialized = true;
}
}
}