mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Polish
This commit is contained in:
parent
48c1228253
commit
11a093bdc0
@ -41,7 +41,7 @@ import org.springframework.core.type.AnnotatedTypeMetadata;
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Configuration
|
||||
@AutoConfigureBefore(JmsTemplateAutoConfiguration.class)
|
||||
@AutoConfigureBefore(JmsAutoConfiguration.class)
|
||||
@ConditionalOnClass({ ConnectionFactory.class, ActiveMQConnectionFactory.class })
|
||||
@ConditionalOnMissingBean(ConnectionFactory.class)
|
||||
public class ActiveMQAutoConfiguration {
|
||||
|
@ -29,24 +29,24 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for {@link JmsTemplate}.
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring JMS.
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(JmsTemplate.class)
|
||||
@ConditionalOnBean(ConnectionFactory.class)
|
||||
@EnableConfigurationProperties(JmsTemplateProperties.class)
|
||||
public class JmsTemplateAutoConfiguration {
|
||||
@EnableConfigurationProperties(JmsProperties.class)
|
||||
public class JmsAutoConfiguration {
|
||||
|
||||
@Autowired
|
||||
private JmsTemplateProperties properties;
|
||||
private JmsProperties properties;
|
||||
|
||||
@Autowired
|
||||
private ConnectionFactory connectionFactory;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean(JmsTemplate.class)
|
||||
@ConditionalOnMissingBean
|
||||
public JmsTemplate jmsTemplate() {
|
||||
JmsTemplate jmsTemplate = new JmsTemplate(this.connectionFactory);
|
||||
jmsTemplate.setPubSubDomain(this.properties.isPubSubDomain());
|
@ -18,8 +18,14 @@ package org.springframework.boot.autoconfigure.jms;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
/**
|
||||
* Configuration properties for JMS.
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "spring.jms")
|
||||
public class JmsTemplateProperties {
|
||||
public class JmsProperties {
|
||||
|
||||
private boolean pubSubDomain = false;
|
||||
|
@ -19,7 +19,7 @@ org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration,
|
||||
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jms.ActiveMQAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jms.JmsTemplateAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration,\
|
||||
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration,\
|
||||
|
@ -35,11 +35,11 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Tests for {@link JmsTemplateAutoConfiguration}.
|
||||
* Tests for {@link JmsAutoConfiguration}.
|
||||
*
|
||||
* @author Greg Turnquist
|
||||
*/
|
||||
public class JmsTemplateAutoConfigurationTests {
|
||||
public class JmsAutoConfigurationTests {
|
||||
|
||||
private AnnotationConfigApplicationContext context;
|
||||
|
||||
@ -206,7 +206,7 @@ public class JmsTemplateAutoConfigurationTests {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
|
||||
context.register(additionalClasses);
|
||||
context.register(ActiveMQAutoConfiguration.class,
|
||||
JmsTemplateAutoConfiguration.class);
|
||||
JmsAutoConfiguration.class);
|
||||
return context;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -28,8 +28,7 @@ import org.springframework.boot.groovy.GroovyTemplate;
|
||||
* {@link CompilerAutoConfiguration} for Groovy Templates (outside MVC).
|
||||
*
|
||||
* @author Dave Syer
|
||||
*
|
||||
* @since 1.1
|
||||
* @since 1.1.0
|
||||
*/
|
||||
public class GroovyTemplatesCompilerAutoConfiguration extends CompilerAutoConfiguration {
|
||||
|
||||
@ -40,9 +39,8 @@ public class GroovyTemplatesCompilerAutoConfiguration extends CompilerAutoConfig
|
||||
|
||||
@Override
|
||||
public void applyDependencies(DependencyCustomizer dependencies) {
|
||||
dependencies
|
||||
.ifAnyMissingClasses("groovy.text.TemplateEngine")
|
||||
.add("groovy-templates");
|
||||
dependencies.ifAnyMissingClasses("groovy.text.TemplateEngine").add(
|
||||
"groovy-templates");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,8 +22,13 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.cli.compiler.autoconfigure.GroovyTemplatesCompilerAutoConfiguration;
|
||||
|
||||
/**
|
||||
* Pseudo annotation used to trigger {@link GroovyTemplatesAutoConfiguration}.
|
||||
* Pseudo annotation used to trigger {@link GroovyTemplatesCompilerAutoConfiguration}.
|
||||
*
|
||||
* @author Dave Syer
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Target(ElementType.TYPE)
|
||||
@Documented
|
||||
|
@ -203,9 +203,9 @@ content into your application; rather pick only the properties that you need.
|
||||
flyway.prefix=V
|
||||
flyway.suffix=.sql
|
||||
flyway.enabled=true
|
||||
flyway.url= # JDBC url if you want Flyway to create its own DataSource
|
||||
flyway.user= # JDBC username if you want Flyway to create its own DataSource
|
||||
flyway.password= # JDBC password if you want Flyway to create its own DataSource
|
||||
flyway.url= # JDBC url if you want Flyway to create its own DataSource
|
||||
flyway.user= # JDBC username if you want Flyway to create its own DataSource
|
||||
flyway.password= # JDBC password if you want Flyway to create its own DataSource
|
||||
|
||||
# LIQUIBASE ({sc-spring-boot-autoconfigure}/liquibase/LiquibaseProperties.{sc-ext}[LiquibaseProperties])
|
||||
liquibase.change-log=classpath:/db/changelog/db.changelog-master.yaml
|
||||
@ -237,8 +237,8 @@ content into your application; rather pick only the properties that you need.
|
||||
|
||||
# ACTIVEMQ ({sc-spring-boot-autoconfigure}/jms/ActiveMQProperties.{sc-ext}[ActiveMQProperties])
|
||||
spring.activemq.broker-url=tcp://localhost:61616 # connection URL
|
||||
spring.activemq.user=
|
||||
spring.activemq.password=
|
||||
spring.activemq.user=
|
||||
spring.activemq.password=
|
||||
spring.activemq.in-memory=true # broker kind to create if no broker-url is specified
|
||||
spring.activemq.pooled=false
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user