當前位置: 首頁>>代碼示例>>Java>>正文


Java SpringApplication.setWebEnvironment方法代碼示例

本文整理匯總了Java中org.springframework.boot.SpringApplication.setWebEnvironment方法的典型用法代碼示例。如果您正苦於以下問題:Java SpringApplication.setWebEnvironment方法的具體用法?Java SpringApplication.setWebEnvironment怎麽用?Java SpringApplication.setWebEnvironment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.boot.SpringApplication的用法示例。


在下文中一共展示了SpringApplication.setWebEnvironment方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(final String[] args) {

        System.setProperty("vertx.disableDnsResolver", "true");
        System.setProperty("vertx.logger-delegate-factory-class-name", "io.vertx.core.logging.SLF4JLogDelegateFactory");

        final File logbackFile = new File("logback.xml");
        if (logbackFile.exists()) {
            System.setProperty("logging.config", logbackFile.getAbsolutePath());
        }

        final SpringApplication application = new SpringApplication(GatewayMS.class);
        application.setBannerMode(Mode.OFF);
        application.setWebEnvironment(false);
        application.run(args);

    }
 
開發者ID:trajano,項目名稱:app-ms,代碼行數:17,代碼來源:GatewayMS.java

示例2: run

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
/**
 * Bootstrap the microservice application.
 *
 * @param applicationClass
 *            JAX-RS Application class
 * @param extraSources
 *            extra source classes.
 * @param args
 *            command line arguments
 */
public static void run(final Class<? extends Application> applicationClass,
    final Class<?>[] extraSources,
    final String... args) {

    if (!microserviceEngineIterator.hasNext()) {
        throw new LinkageError("No MicroserviceEngine was defined");
    }
    final MicroserviceEngine microserviceEngine = microserviceEngineIterator.next();
    if (microserviceEngineIterator.hasNext()) {
        throw new LinkageError(format("Multiple MicroserviceEngine was defined, %s, %s and possibly more", microserviceEngine, microserviceEngineIterator.next()));
    }
    if (Microservice.applicationClass != null) {
        throw new LinkageError("Another Application class has already been registered in this JVM.");
    }
    Microservice.applicationClass = applicationClass;

    final Object[] bootstrapObjects = microserviceEngine.bootstrap();
    final Object[] sources = new Object[extraSources.length + bootstrapObjects.length];

    System.arraycopy(extraSources, 0, sources, 0, extraSources.length);
    System.arraycopy(bootstrapObjects, 0, sources, extraSources.length, bootstrapObjects.length);

    final SpringApplication springApplication = new SpringApplication(sources);
    springApplication.setWebEnvironment(false);
    springApplication
        .setBannerMode(Mode.OFF);
    springApplication.run(args);
}
 
開發者ID:trajano,項目名稱:app-ms,代碼行數:39,代碼來源:Microservice.java

示例3: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
	((ch.qos.logback.classic.Logger) logger).setLevel(ch.qos.logback.classic.Level.TRACE);
	SpringApplication app = new SpringApplication(new Object[]{ScooldServer.class});
	initConfig();
	app.setAdditionalProfiles(Config.ENVIRONMENT);
	app.setWebEnvironment(true);
	app.run(args);
}
 
開發者ID:Erudika,項目名稱:scoold,代碼行數:9,代碼來源:ScooldServer.java

示例4: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication sa = new SpringApplication(Launcher.class);
    sa.setWebEnvironment(true);
    sa.run(args);

    String os = System.getProperty("os.name");

    log.info("OS: " + System.getProperty("os.name") + ", Arch: " + System.getProperty("os.arch"));

    if ((os.contains("Windows") || os.contains("Linux"))
            && !System.getProperty("os.arch").equalsIgnoreCase("arm")
            && !System.getProperty("os.arch").equalsIgnoreCase("arm-linux")
            ) {
        SocketContext.nasSupported = true;
        log.info("JDA-NAS supported system detected. Enabled native audio sending.");

        Integer customBuffer = config.getBufferDurationMs();
        if (customBuffer != null) {
            log.info("Setting buffer to {}ms", customBuffer);
        } else {
            log.info("Using default buffer");
        }
    } else {
        log.warn("This system and architecture appears to not support native audio sending! "
                + "GC pauses may cause your bot to stutter during playback.");
    }
}
 
開發者ID:Frederikam,項目名稱:Lavalink,代碼行數:28,代碼來源:Launcher.java

示例5: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(BotOrchestratorApplication.class);
    app.setWebEnvironment(false);
    ConfigurableApplicationContext ctx = app.run(args);

}
 
開發者ID:corydissinger,項目名稱:mtgo-best-bot,代碼行數:7,代碼來源:BotOrchestratorApplication.java

示例6: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) throws InterruptedException {
    SpringApplication springApplication = new SpringApplication(Application.class);
    springApplication.setWebEnvironment(false);
    springApplication.run(args);
}
 
開發者ID:zouzhirong,項目名稱:configx,代碼行數:6,代碼來源:Application.java

示例7: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(MintingApplication.class);
    app.setBannerMode(Banner.Mode.OFF);
    app.setWebEnvironment(false);
    app.run(args);
}
 
開發者ID:modum-io,項目名稱:tokenapp-backend,代碼行數:7,代碼來源:MintingApplication.java

示例8: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(RatesApplication.class);
    app.setBannerMode(Banner.Mode.OFF);
    app.setWebEnvironment(false);
    app.run(args);
}
 
開發者ID:modum-io,項目名稱:tokenapp-backend,代碼行數:7,代碼來源:RatesApplication.java

示例9: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
	SpringApplication application = new SpringApplication(ReleaserApplication.class);
	application.setWebEnvironment(false);
	application.run(args);
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-release-tools,代碼行數:6,代碼來源:ReleaserApplication.java

示例10: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
	SpringApplication app = new SpringApplication(TicketBookingBackEndApplication.class);
	app.setWebEnvironment(true);
	app.run(args);
}
 
開發者ID:SkyeBeFreeman,項目名稱:ticket-booking-back-end,代碼行數:6,代碼來源:TicketBookingBackEndApplication.java

示例11: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
	SpringApplication springApplication = new SpringApplication(MessageApplication.class);
	springApplication.setWebEnvironment(false);
	springApplication.run(args);
	logger.info("SpringBoot lemon-message Start Success");
}
 
開發者ID:lemon-china,項目名稱:lemon-dubbo-message,代碼行數:7,代碼來源:MessageApplication.java

示例12: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
	SpringApplication app = new SpringApplication(Application.class);
	app.setWebEnvironment(false);
	app.run(args);
}
 
開發者ID:ctodb,項目名稱:push,代碼行數:6,代碼來源:Application.java

示例13: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(Application.class);
    app.setWebEnvironment(false);
    app.run(args);
}
 
開發者ID:phpdragon,項目名稱:JavaSamples,代碼行數:6,代碼來源:Application.java

示例14: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(App.class);
    app.setWebEnvironment(false);
    app.run(args);
}
 
開發者ID:phpdragon,項目名稱:JavaSamples,代碼行數:6,代碼來源:App.java

示例15: main

import org.springframework.boot.SpringApplication; //導入方法依賴的package包/類
public static void main(String[] args) {
    SpringApplication app = new SpringApplication(CrowDemon.class);
    app.setBannerMode(Banner.Mode.OFF);
    app.setWebEnvironment(false);
    app.run(args);
}
 
開發者ID:blacklabelops,項目名稱:crow,代碼行數:7,代碼來源:CrowDemon.java


注:本文中的org.springframework.boot.SpringApplication.setWebEnvironment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。