当前位置: 首页>>代码示例>>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;未经允许,请勿转载。