Refine search
@Configuration @EnableDubbo(scanBasePackages = "org.apache.dubbo.demo.consumer.comp") @PropertySource("classpath:/spring/dubbo-consumer.properties") @ComponentScan(value = {"org.apache.dubbo.demo.consumer.comp"}) static class ConsumerConfiguration { } }
@Configuration @EnableDubbo(scanBasePackages = "org.apache.dubbo.demo.provider") @PropertySource("classpath:/spring/dubbo-provider.properties") static class ProviderConfiguration { @Bean public RegistryConfig registryConfig() { RegistryConfig registryConfig = new RegistryConfig(); registryConfig.setAddress("multicast://224.5.6.7:1234"); return registryConfig; } } }
@EnableAspectJAutoProxy @EnableEurekaClient @Configuration @PropertySource(value = {"classpath:adminservice.properties"}) @EnableAutoConfiguration @EnableTransactionManagement @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, ApolloBizConfig.class, AdminServiceApplication.class}) public class AdminServiceApplication { public static void main(String[] args) { SpringApplication.run(AdminServiceApplication.class, args); } }
/** * Spring boot application entry point * * @author Jason Song(song_s@ctrip.com) */ @EnableEurekaServer @EnableAspectJAutoProxy @EnableAutoConfiguration // (exclude = EurekaClientConfigBean.class) @Configuration @EnableTransactionManagement @PropertySource(value = {"classpath:configservice.properties"}) @ComponentScan(basePackageClasses = {ApolloCommonConfig.class, ApolloBizConfig.class, ConfigServiceApplication.class, ApolloMetaServiceConfig.class}) public class ConfigServiceApplication { public static void main(String[] args) throws Exception { SpringApplication.run(ConfigServiceApplication.class, args); } }
@Configuration @PropertySource( value = { "classpath:org/springframework/context/annotation/p1.properties", "classpath:org/springframework/context/annotation/p2.properties" }) static class ConfigWithMultipleResourceLocations { }
@Configuration @PropertySources({ @PropertySource(name = "psName", value = "classpath:org/springframework/context/annotation/p1.properties"), @PropertySource(name = "psName", value = "classpath:org/springframework/context/annotation/missing.properties", ignoreResourceNotFound=true), @PropertySource(name = "psName", value = "classpath:${myPath}/missing.properties", ignoreResourceNotFound=true), @PropertySource(name = "psName", value = "classpath:org/springframework/context/annotation/p2.properties") }) static class ConfigWithIgnoredPropertySource { }
@Configuration @PropertySource( name = "psName", value = { "classpath:org/springframework/context/annotation/p1.properties", "classpath:org/springframework/context/annotation/p2.properties" }) static class ConfigWithNameAndMultipleResourceLocations { }
@Configuration @PropertySource( value = { "classpath:org/springframework/context/annotation/p1.properties", "classpath:org/springframework/context/annotation/p2.properties", "classpath:org/springframework/context/annotation/p3.properties", "classpath:org/springframework/context/annotation/p4.properties" }) static class ConfigWithFourResourceLocations { }
@Configuration @PropertySource("classpath:/org/springframework/test/context/env/explicit.properties") static class Config { /* no user beans required for these tests */ }
@Configuration @PropertySource(value = "classpath:org/springframework/context/annotation/p2.properties", factory = MyCustomFactory.class) static class WithCustomFactory { }
@Configuration @PropertySource("classpath:org/springframework/context/annotation/p2.properties") static class P2Config { }
@Configuration @PropertySource(value="classpath:${unresolvable}/p1.properties") static class ConfigWithUnresolvablePlaceholder { }
@Configuration @PropertySource(value = {}) static class ConfigWithEmptyResourceLocations { }
@Configuration @PropertySources({ @PropertySource(name = "psName", value = "classpath:org/springframework/context/annotation/p1.properties"), @PropertySource(name = "psName", value = "classpath:org/springframework/context/annotation/missing.properties"), @PropertySource(name = "psName", value = "classpath:org/springframework/context/annotation/p2.properties") }) static class ConfigWithMissingPropertySource { }
@Configuration @PropertySource(value="classpath:${path.to.properties}/p1.properties") static class ConfigWithResolvablePlaceholder { @Inject Environment env; @Bean public TestBean testBean() { return new TestBean(env.getProperty("testbean.name")); } }
@Configuration @PropertySource(value="classpath:${unresolvable:org/springframework/context/annotation}/p1.properties") static class ConfigWithUnresolvablePlaceholderAndDefault { @Inject Environment env; @Bean public TestBean testBean() { return new TestBean(env.getProperty("testbean.name")); } }
@Configuration @PropertySource(name="p1", value="classpath:org/springframework/context/annotation/p1.properties") static class ConfigWithExplicitName { @Inject Environment env; @Bean public TestBean testBean() { return new TestBean(env.getProperty("testbean.name")); } }
@Configuration @PropertySource("classpath:org/springframework/context/annotation/p1.properties") static class ConfigWithImplicitName { @Inject Environment env; @Bean public TestBean testBean() { return new TestBean(env.getProperty("testbean.name")); } }
/** * @author Mahmoud Ben Hassine */ @Configuration @PropertySource("classpath:remote-partitioning.properties") public class BrokerConfiguration { @Value("${broker.url}") private String brokerUrl; @Bean public ActiveMQConnectionFactory connectionFactory() { ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(); connectionFactory.setBrokerURL(this.brokerUrl); connectionFactory.setTrustAllPackages(true); return connectionFactory; } }
@Configuration @PropertySource(name="p1", value="classpath:org/springframework/context/annotation/p1.properties") @ComponentScan("org.springframework.context.annotation.spr12111") static class ConfigWithTestProfileBeans { @Inject Environment env; @Bean @Profile("test") public TestBean testBean() { return new TestBean(env.getProperty("testbean.name")); } }