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


Java Profile類代碼示例

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


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

示例1: commandLineRunner

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("trace")
@Bean
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
    return args -> {

        System.out.println("Let's inspect the beans provided by Spring Boot:\n");

        String[] beanNames = ctx.getBeanDefinitionNames();
        Arrays.sort(beanNames);
        for (String beanName : beanNames) {
            System.out.println(beanName);
        }

        System.out.println("---");
    };
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:17,代碼來源:CalendarClientApplication.java

示例2: commandLineRunner

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("trace")
@Bean
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
    return args -> {

        System.out.println("Let's inspect the beans provided by Spring Boot:\n");

        String[] beanNames = ctx.getBeanDefinitionNames();
        Arrays.sort(beanNames);
        for (String beanName : beanNames) {
            logger.debug(beanName);
        }

        logger.debug("---");
    };
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:17,代碼來源:CalendarApplication.java

示例3: embeddedServletContainerCustomizer

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Bean
@Profile("!docker")
public EmbeddedServletContainerCustomizer embeddedServletContainerCustomizer() {
    return (container -> {

        container.setContextPath(lyreProperties.getContextPath());

        if (!lyreProperties.isEnableRemoteConnections()) {
            try {
                InetAddress inetAddress = InetAddress.getByAddress(new byte[]{127, 0, 0, 1});
                container.setAddress(inetAddress);
            } catch (UnknownHostException e) {
                //supressed exception
            }
        }

        container.setPort(lyreProperties.getPort());
    });
}
 
開發者ID:groovylabs,項目名稱:lyre,代碼行數:20,代碼來源:Lyre.java

示例4: client

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("kubernetes")
@Bean
/*
 * Load the CloudantClient from the Kubernetes Secrets file.
 * This method is only loaded when the kubernetes profile is activated
 */
public CloudantClient client() throws IOException {

	String secrets = readKubeSecretsFiles();
	String secretsJson = StringUtils.newStringUtf8(Base64.decodeBase64(secrets));
	ObjectMapper mapper = new ObjectMapper();
	Map<String, Object> map = new HashMap<String, Object>();

	// convert JSON string to Map
	map = mapper.readValue(secretsJson, new TypeReference<Map<String, String>>(){});

	String username = (String) map.get("username");
	String password = (String) map.get("password");
	String url = "http://" + map.get("username") + ".cloudant.com";

	return ClientBuilder.url(new URL(url))
			.username(username)
			.password(password)
			.build();
}
 
開發者ID:IBM,項目名稱:spring-boot-continuous-delivery,代碼行數:26,代碼來源:Application.java

示例5: commandLineRunner

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Bean
@Profile({"development", "debug"})
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
    return args -> {
        log.debug("Let's inspect the beans provided by Spring Boot:");

        String[] beanNames = ctx.getBeanDefinitionNames();
        Arrays.sort(beanNames);
        for (String beanName : beanNames) {
            log.debug(beanName);
        }

    };
}
 
開發者ID:amvnetworks,項目名稱:amv-access-api-poc,代碼行數:15,代碼來源:ApplicationConfig.java

示例6: internalConfigController

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("standalone")
@ConditionalOnBean(name = "configurationPropertiesEnvironmentManager")
@Bean
@RefreshScope
public MvcEndpoint internalConfigController() {
    return new ConfigurationStateController(casProperties);
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:8,代碼來源:CasReportsConfiguration.java

示例7: nettyContext

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("default")
@Bean
public NettyContext nettyContext(ApplicationContext context) {
    HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context).build();
    ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
    HttpServer httpServer = HttpServer.create("localhost", this.port);
    return httpServer.newHandler(adapter).block();
}
 
開發者ID:hantsy,項目名稱:spring-reactive-sample,代碼行數:9,代碼來源:Application.java

示例8: commandLineRunner

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("trace")
@Bean
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
    return args -> {

        System.out.println("Let's inspect the beans provided by Spring Boot:");

        String[] beanNames = ctx.getBeanDefinitionNames();
        Arrays.sort(beanNames);
        for (String beanName : beanNames) {
            System.out.println(beanName);
        }

    };
}
 
開發者ID:PacktPublishing,項目名稱:Spring-Security-Third-Edition,代碼行數:16,代碼來源:CalendarApplication.java

示例9: nettyContext

import org.springframework.context.annotation.Profile; //導入依賴的package包/類
@Profile("default")
@Bean
public NettyContext nettyContext(ApplicationContext context) {
    HttpHandler handler = WebHttpHandlerBuilder.applicationContext(context)
        .exceptionHandler(exceptionHandler())
        .build();
    ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
    HttpServer httpServer = HttpServer.create("localhost", this.port);
    return httpServer.newHandler(adapter).block();
}
 
開發者ID:hantsy,項目名稱:spring-reactive-sample,代碼行數:11,代碼來源:Application.java


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