Polish javadoc formatting
This commit is contained in:
parent
80ac1fb0cd
commit
fcea565433
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package org.springframework.boot.autoconfigure.amqp;
|
package org.springframework.boot.autoconfigure.amqp;
|
||||||
|
|
||||||
import com.rabbitmq.client.Channel;
|
|
||||||
import org.springframework.amqp.core.AmqpAdmin;
|
import org.springframework.amqp.core.AmqpAdmin;
|
||||||
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
||||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
|
@ -31,70 +30,89 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import com.rabbitmq.client.Channel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <P> {@link EnableAutoConfiguration Auto-configuration} for {@link RabbitTemplate}.
|
* {@link EnableAutoConfiguration Auto-configuration} for {@link RabbitTemplate}.
|
||||||
*
|
|
||||||
* <p> This configuration class is active only when the RabbitMQ and Spring AMQP client libraries are on the classpath.
|
|
||||||
*
|
|
||||||
* <P> Registers a {@link org.springframework.amqp.rabbit.core.RabbitTemplate RabbitTemplate} instance if there
|
|
||||||
* is no other bean of the same type in the context. Registers a {@link org.springframework.amqp.rabbit.connection.CachingConnectionFactory CachingConnectionFactory}
|
|
||||||
* instance if there is no other bean of the same type in the context.
|
|
||||||
*
|
|
||||||
* <p> Registers a {@link org.springframework.amqp.core.AmqpAdmin } instance as long as {@literal spring.rabbitmq.dynamic=true}.
|
|
||||||
*
|
|
||||||
* <p>
|
* <p>
|
||||||
* The {@link org.springframework.amqp.rabbit.connection.CachingConnectionFactory} honors the following properties:
|
* This configuration class is active only when the RabbitMQ and Spring AMQP client
|
||||||
* {@literal spring.rabbitmq.port} is used to specify the port to which the client should connect, and defaults to 5672.
|
* libraries are on the classpath.
|
||||||
* {@literal spring.rabbitmq.username} is used to specify the (optional) username, and
|
* <P>
|
||||||
* {@literal spring.rabbitmq.password} is used to specify the (optional) password.
|
* Registers the following beans:
|
||||||
* {@literal spring.rabbitmq.host} is used to specify the host, and defaults to {@literal localhost}.
|
* <ul>
|
||||||
* {@literal spring.rabbitmq.virtualHost} is used to specify the (optional) virtual host to which the client should connect.
|
* <li>
|
||||||
*
|
* {@link org.springframework.amqp.rabbit.core.RabbitTemplate RabbitTemplate} if there is
|
||||||
|
* no other bean of the same type in the context.</li>
|
||||||
|
* <li>
|
||||||
|
* {@link org.springframework.amqp.rabbit.connection.CachingConnectionFactory
|
||||||
|
* CachingConnectionFactory} instance if there is no other bean of the same type in the
|
||||||
|
* context.</li>
|
||||||
|
* <li>
|
||||||
|
* {@link org.springframework.amqp.core.AmqpAdmin } instance as long as
|
||||||
|
* {@literal spring.rabbitmq.dynamic=true}.</li>
|
||||||
|
* </ul>
|
||||||
|
* <p>
|
||||||
|
* The {@link org.springframework.amqp.rabbit.connection.CachingConnectionFactory} honors
|
||||||
|
* the following properties:
|
||||||
|
* <ul>
|
||||||
|
* <li>
|
||||||
|
* {@literal spring.rabbitmq.port} is used to specify the port to which the client should
|
||||||
|
* connect, and defaults to 5672.</li>
|
||||||
|
* <li>
|
||||||
|
* {@literal spring.rabbitmq.username} is used to specify the (optional) username.</li>
|
||||||
|
* <li>
|
||||||
|
* {@literal spring.rabbitmq.password} is used to specify the (optional) password.</li>
|
||||||
|
* <li>
|
||||||
|
* {@literal spring.rabbitmq.host} is used to specify the host, and defaults to
|
||||||
|
* {@literal localhost}.</li>
|
||||||
|
* <li>{@literal spring.rabbitmq.virtualHost} is used to specify the (optional) virtual
|
||||||
|
* host to which the client should connect.</li>
|
||||||
|
* </ul>
|
||||||
* @author Greg Turnquist
|
* @author Greg Turnquist
|
||||||
* @author Josh Long
|
* @author Josh Long
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnClass({RabbitTemplate.class, Channel.class})
|
@ConditionalOnClass({ RabbitTemplate.class, Channel.class })
|
||||||
@EnableConfigurationProperties(RabbitProperties.class)
|
@EnableConfigurationProperties(RabbitProperties.class)
|
||||||
public class RabbitAutoConfiguration {
|
public class RabbitAutoConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnExpression("${spring.rabbitmq.dynamic:true}")
|
@ConditionalOnExpression("${spring.rabbitmq.dynamic:true}")
|
||||||
@ConditionalOnMissingBean(AmqpAdmin.class)
|
@ConditionalOnMissingBean(AmqpAdmin.class)
|
||||||
public AmqpAdmin amqpAdmin(CachingConnectionFactory connectionFactory) {
|
public AmqpAdmin amqpAdmin(CachingConnectionFactory connectionFactory) {
|
||||||
return new RabbitAdmin(connectionFactory);
|
return new RabbitAdmin(connectionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ConnectionFactory connectionFactory;
|
private ConnectionFactory connectionFactory;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(RabbitTemplate.class)
|
@ConditionalOnMissingBean(RabbitTemplate.class)
|
||||||
public RabbitTemplate rabbitTemplate() {
|
public RabbitTemplate rabbitTemplate() {
|
||||||
return new RabbitTemplate(this.connectionFactory);
|
return new RabbitTemplate(this.connectionFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnMissingBean(ConnectionFactory.class)
|
@ConditionalOnMissingBean(ConnectionFactory.class)
|
||||||
protected static class RabbitConnectionFactoryCreator {
|
protected static class RabbitConnectionFactoryCreator {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ConnectionFactory rabbitConnectionFactory(RabbitProperties config) {
|
public ConnectionFactory rabbitConnectionFactory(RabbitProperties config) {
|
||||||
CachingConnectionFactory factory = new CachingConnectionFactory(
|
CachingConnectionFactory factory = new CachingConnectionFactory(
|
||||||
config.getHost());
|
config.getHost());
|
||||||
factory.setPort(config.getPort());
|
factory.setPort(config.getPort());
|
||||||
if (config.getUsername() != null) {
|
if (config.getUsername() != null) {
|
||||||
factory.setUsername(config.getUsername());
|
factory.setUsername(config.getUsername());
|
||||||
}
|
}
|
||||||
if (config.getPassword() != null) {
|
if (config.getPassword() != null) {
|
||||||
factory.setPassword(config.getPassword());
|
factory.setPassword(config.getPassword());
|
||||||
}
|
}
|
||||||
if (config.getVirtualHost() != null) {
|
if (config.getVirtualHost() != null) {
|
||||||
factory.setVirtualHost(config.getVirtualHost());
|
factory.setVirtualHost(config.getVirtualHost());
|
||||||
}
|
}
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -24,15 +24,14 @@ import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* <p>
|
|
||||||
* {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
* {@link org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
||||||
* Auto-configuration} for Spring's AOP support. Equivalent to enabling
|
* Auto-configuration} for Spring's AOP support. Equivalent to enabling
|
||||||
* {@link org.springframework.context.annotation.EnableAspectJAutoProxy} in your
|
* {@link org.springframework.context.annotation.EnableAspectJAutoProxy} in your
|
||||||
* configuration. The configuration will not be activated if
|
* configuration.
|
||||||
* {@literal spring.aop.auto=false}. The {@literal proxyTargetClass} attribute will be
|
* <p>
|
||||||
* {@literal false}, by default, but can be overridden by specifying
|
* The configuration will not be activated if {@literal spring.aop.auto=false}. The
|
||||||
* {@literal spring.aop.proxyTargetClass=true}.
|
* {@literal proxyTargetClass} attribute will be {@literal false}, by default, but can be
|
||||||
|
* overridden by specifying {@literal spring.aop.proxyTargetClass=true}.
|
||||||
*
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
* @author Josh Long
|
* @author Josh Long
|
||||||
|
|
|
@ -53,7 +53,8 @@ public abstract class AbstractRepositoryConfigurationSourceSupport implements
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
|
public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata,
|
||||||
|
BeanDefinitionRegistry registry) {
|
||||||
new RepositoryConfigurationDelegate(getConfigurationSource(), this.resourceLoader)
|
new RepositoryConfigurationDelegate(getConfigurationSource(), this.resourceLoader)
|
||||||
.registerRepositoriesIn(registry, getRepositoryConfigurationExtension());
|
.registerRepositoriesIn(registry, getRepositoryConfigurationExtension());
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,16 +35,19 @@ import org.springframework.data.web.config.EnableSpringDataWebSupport;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's JPA Repositories.
|
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's JPA Repositories.
|
||||||
*
|
* <p>
|
||||||
* <p> Activates when there is a bean of type {@link javax.sql.DataSource} configured in the context,
|
* Activates when there is a bean of type {@link javax.sql.DataSource} configured in the
|
||||||
* the Spring Data JPA {@link org.springframework.data.jpa.repository.JpaRepository} type is on the classpath,
|
* context, the Spring Data JPA
|
||||||
* and there is no other, existing {@link org.springframework.data.jpa.repository.JpaRepository} configured.
|
* {@link org.springframework.data.jpa.repository.JpaRepository} type is on the classpath,
|
||||||
*
|
* and there is no other, existing
|
||||||
* <p> Once in effect, the auto-configuration is the equivalent of enabling JPA repositories using
|
* {@link org.springframework.data.jpa.repository.JpaRepository} configured.
|
||||||
* the {@link org.springframework.data.jpa.repository.config.EnableJpaRepositories} annotation.
|
* <p>
|
||||||
*
|
* Once in effect, the auto-configuration is the equivalent of enabling JPA repositories
|
||||||
* <p> This configuration class will activate <em>after</em> the Hibernate auto-configuration.
|
* using the {@link org.springframework.data.jpa.repository.config.EnableJpaRepositories}
|
||||||
*
|
* annotation.
|
||||||
|
* <p>
|
||||||
|
* This configuration class will activate <em>after</em> the Hibernate auto-configuration.
|
||||||
|
*
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @author Josh Long
|
* @author Josh Long
|
||||||
* @see EnableJpaRepositories
|
* @see EnableJpaRepositories
|
||||||
|
|
|
@ -30,14 +30,19 @@ import com.mongodb.Mongo;
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Mongo
|
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's Mongo
|
||||||
* Repositories.
|
* Repositories.
|
||||||
*
|
* <p>
|
||||||
* <p> Activates when there is no bean of type {@link org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean} configured in the context,
|
* Activates when there is no bean of type
|
||||||
* the Spring Data Mongo {@link org.springframework.data.mongodb.repository.MongoRepository} type is on the classpath,
|
* {@link org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean}
|
||||||
* the Mongo client driver API is on the classpath, and there is no other configured {@link org.springframework.data.mongodb.repository.MongoRepository}.
|
* configured in the context, the Spring Data Mongo
|
||||||
*
|
* {@link org.springframework.data.mongodb.repository.MongoRepository} type is on the
|
||||||
* <p> Once in effect, the auto-configuration is the equivalent of enabling Mongo repositories using
|
* classpath, the Mongo client driver API is on the classpath, and there is no other
|
||||||
* the {@link org.springframework.data.mongodb.repository.config.EnableMongoRepositories} annotation.
|
* configured {@link org.springframework.data.mongodb.repository.MongoRepository}.
|
||||||
*
|
* <p>
|
||||||
|
* Once in effect, the auto-configuration is the equivalent of enabling Mongo repositories
|
||||||
|
* using the
|
||||||
|
* {@link org.springframework.data.mongodb.repository.config.EnableMongoRepositories}
|
||||||
|
* annotation.
|
||||||
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
* @author Oliver Gierke
|
* @author Oliver Gierke
|
||||||
* @author Josh Long
|
* @author Josh Long
|
||||||
|
|
|
@ -31,13 +31,15 @@ import org.springframework.data.mongodb.repository.config.EnableMongoRepositorie
|
||||||
import com.mongodb.Mongo;
|
import com.mongodb.Mongo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's {@link MongoTemplate}.
|
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's
|
||||||
*
|
* {@link MongoTemplate}.
|
||||||
* <p> Registers a {@link org.springframework.data.mongodb.core.MongoTemplate} bean if no other bean of the same type is configured.
|
* <p>
|
||||||
*
|
* Registers a {@link org.springframework.data.mongodb.core.MongoTemplate} bean if no
|
||||||
* <P> Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects to
|
* other bean of the same type is configured.
|
||||||
* the {@literal test} database.
|
* <P>
|
||||||
*
|
* Honors the {@literal spring.data.mongodb.database} property if set, otherwise connects
|
||||||
|
* to the {@literal test} database.
|
||||||
|
*
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
* @author Oliver Gierke
|
* @author Oliver Gierke
|
||||||
* @author Josh Long
|
* @author Josh Long
|
||||||
|
|
Loading…
Reference in New Issue