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


Java DefaultProfileUtil類代碼示例

本文整理匯總了Java中org.jhipster.store.config.DefaultProfileUtil的典型用法代碼示例。如果您正苦於以下問題:Java DefaultProfileUtil類的具體用法?Java DefaultProfileUtil怎麽用?Java DefaultProfileUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: configure

import org.jhipster.store.config.DefaultProfileUtil; //導入依賴的package包/類
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    /**
     * set a default to use when no profile is configured.
     */
    DefaultProfileUtil.addDefaultProfile(application.application());
    return application.sources(StoreApp.class);
}
 
開發者ID:oktadeveloper,項目名稱:jhipster-microservices-example,代碼行數:9,代碼來源:ApplicationWebXml.java

示例2: main

import org.jhipster.store.config.DefaultProfileUtil; //導入依賴的package包/類
/**
 * Main method, used to run the application.
 *
 * @param args the command line arguments
 * @throws UnknownHostException if the local host name could not be resolved into an address
 */
public static void main(String[] args) throws UnknownHostException {
    SpringApplication app = new SpringApplication(StoreApp.class);
    DefaultProfileUtil.addDefaultProfile(app);
    Environment env = app.run(args).getEnvironment();
    String protocol = "http";
    if (env.getProperty("server.ssl.key-store") != null) {
        protocol = "https";
    }
    log.info("\n----------------------------------------------------------\n\t" +
            "Application '{}' is running! Access URLs:\n\t" +
            "Local: \t\t{}://localhost:{}\n\t" +
            "External: \t{}://{}:{}\n\t" +
            "Profile(s): \t{}\n----------------------------------------------------------",
        env.getProperty("spring.application.name"),
        protocol,
        env.getProperty("server.port"),
        protocol,
        InetAddress.getLocalHost().getHostAddress(),
        env.getProperty("server.port"),
        env.getActiveProfiles());

    String configServerStatus = env.getProperty("configserver.status");
    log.info("\n----------------------------------------------------------\n\t" +
            "Config Server: \t{}\n----------------------------------------------------------",
        configServerStatus == null ? "Not found or not setup for this application" : configServerStatus);
}
 
開發者ID:oktadeveloper,項目名稱:jhipster-microservices-example,代碼行數:33,代碼來源:StoreApp.java

示例3: getActiveProfiles

import org.jhipster.store.config.DefaultProfileUtil; //導入依賴的package包/類
@GetMapping("/profile-info")
public ProfileInfoVM getActiveProfiles() {
    String[] activeProfiles = DefaultProfileUtil.getActiveProfiles(env);
    return new ProfileInfoVM(activeProfiles, getRibbonEnv(activeProfiles));
}
 
開發者ID:oktadeveloper,項目名稱:jhipster-microservices-example,代碼行數:6,代碼來源:ProfileInfoResource.java


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