本文整理汇总了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);
}
示例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);
}
示例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));
}