Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
bedf2edf
Commit
bedf2edf
authored
Jul 15, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update auto-configuration @Bean methods to return most specific type
Closes gh-2536 Closes gh-2403
parent
a9737c01
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
151 additions
and
142 deletions
+151
-142
AuditAutoConfiguration.java
...rk/boot/actuate/autoconfigure/AuditAutoConfiguration.java
+2
-2
CrshAutoConfiguration.java
...ork/boot/actuate/autoconfigure/CrshAutoConfiguration.java
+12
-12
EndpointWebMvcAutoConfiguration.java
...ctuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
+13
-12
EndpointWebMvcHypermediaManagementContextConfiguration.java
...dpointWebMvcHypermediaManagementContextConfiguration.java
+8
-8
HealthIndicatorAutoConfiguration.java
...tuate/autoconfigure/HealthIndicatorAutoConfiguration.java
+4
-4
MetricFilterAutoConfiguration.java
.../actuate/autoconfigure/MetricFilterAutoConfiguration.java
+1
-2
MetricRepositoryAutoConfiguration.java
...uate/autoconfigure/MetricRepositoryAutoConfiguration.java
+8
-8
MetricsDropwizardAutoConfiguration.java
...ate/autoconfigure/MetricsDropwizardAutoConfiguration.java
+1
-2
TraceRepositoryAutoConfiguration.java
...tuate/autoconfigure/TraceRepositoryAutoConfiguration.java
+3
-3
RabbitAutoConfiguration.java
...work/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
+1
-1
BatchAutoConfiguration.java
...work/boot/autoconfigure/batch/BatchAutoConfiguration.java
+7
-7
CacheAutoConfiguration.java
...work/boot/autoconfigure/cache/CacheAutoConfiguration.java
+1
-1
InfinispanCacheConfiguration.java
...oot/autoconfigure/cache/InfinispanCacheConfiguration.java
+2
-1
JacksonAutoConfiguration.java
.../boot/autoconfigure/jackson/JacksonAutoConfiguration.java
+1
-1
DataSourceTransactionManagerAutoConfiguration.java
...e/jdbc/DataSourceTransactionManagerAutoConfiguration.java
+2
-2
EmbeddedDataSourceConfiguration.java
...t/autoconfigure/jdbc/EmbeddedDataSourceConfiguration.java
+2
-3
JmsAnnotationDrivenConfiguration.java
...t/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java
+2
-2
ActiveMQConnectionFactoryConfiguration.java
.../jms/activemq/ActiveMQConnectionFactoryConfiguration.java
+24
-10
ArtemisConnectionFactoryConfiguration.java
...re/jms/artemis/ArtemisConnectionFactoryConfiguration.java
+2
-2
ArtemisXAConnectionFactoryConfiguration.java
.../jms/artemis/ArtemisXAConnectionFactoryConfiguration.java
+2
-2
HornetQConnectionFactoryConfiguration.java
...re/jms/hornetq/HornetQConnectionFactoryConfiguration.java
+2
-2
HornetQXAConnectionFactoryConfiguration.java
.../jms/hornetq/HornetQXAConnectionFactoryConfiguration.java
+3
-3
JooqAutoConfiguration.java
...mework/boot/autoconfigure/jooq/JooqAutoConfiguration.java
+3
-2
MongoDataAutoConfiguration.java
.../boot/autoconfigure/mongo/MongoDataAutoConfiguration.java
+2
-2
RedisAutoConfiguration.java
...work/boot/autoconfigure/redis/RedisAutoConfiguration.java
+4
-4
SecurityAutoConfiguration.java
...oot/autoconfigure/security/SecurityAutoConfiguration.java
+2
-2
SpringBootWebSecurityConfiguration.java
...onfigure/security/SpringBootWebSecurityConfiguration.java
+1
-1
OAuth2RestOperationsConfiguration.java
...rity/oauth2/client/OAuth2RestOperationsConfiguration.java
+3
-3
ResourceServerTokenServicesConfiguration.java
...h2/resource/ResourceServerTokenServicesConfiguration.java
+4
-4
FacebookAutoConfiguration.java
.../boot/autoconfigure/social/FacebookAutoConfiguration.java
+1
-2
LinkedInAutoConfiguration.java
.../boot/autoconfigure/social/LinkedInAutoConfiguration.java
+2
-3
SocialWebAutoConfiguration.java
...boot/autoconfigure/social/SocialWebAutoConfiguration.java
+3
-4
TwitterAutoConfiguration.java
...k/boot/autoconfigure/social/TwitterAutoConfiguration.java
+2
-3
AtomikosJtaConfiguration.java
...toconfigure/transaction/jta/AtomikosJtaConfiguration.java
+6
-6
BitronixJtaConfiguration.java
...toconfigure/transaction/jta/BitronixJtaConfiguration.java
+7
-6
VelocityAutoConfiguration.java
...oot/autoconfigure/velocity/VelocityAutoConfiguration.java
+1
-2
MultipartAutoConfiguration.java
...rk/boot/autoconfigure/web/MultipartAutoConfiguration.java
+1
-1
WebMvcAutoConfiguration.java
...ework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
+3
-3
WebSocketAutoConfiguration.java
...t/autoconfigure/websocket/WebSocketAutoConfiguration.java
+3
-4
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/AuditAutoConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -60,7 +60,7 @@ public class AuditAutoConfiguration {
@ConditionalOnMissingBean
(
AuditEventRepository
.
class
)
protected
static
class
AuditEventRepositoryConfiguration
{
@Bean
public
AuditEventRepository
auditEventRepository
()
throws
Exception
{
public
InMemory
AuditEventRepository
auditEventRepository
()
throws
Exception
{
return
new
InMemoryAuditEventRepository
();
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -124,28 +124,28 @@ public class CrshAutoConfiguration {
@Bean
@ConditionalOnProperty
(
prefix
=
"shell"
,
name
=
"auth"
,
havingValue
=
"jaas"
)
@ConditionalOnMissingBean
(
{
CrshShellAuthenticationProperties
.
class
}
)
public
CrshShell
AuthenticationProperties
jaasAuthenticationProperties
()
{
@ConditionalOnMissingBean
(
CrshShellAuthenticationProperties
.
class
)
public
Jaas
AuthenticationProperties
jaasAuthenticationProperties
()
{
return
new
JaasAuthenticationProperties
();
}
@Bean
@ConditionalOnProperty
(
prefix
=
"shell"
,
name
=
"auth"
,
havingValue
=
"key"
)
@ConditionalOnMissingBean
(
{
CrshShellAuthenticationProperties
.
class
}
)
public
CrshShell
AuthenticationProperties
keyAuthenticationProperties
()
{
@ConditionalOnMissingBean
(
CrshShellAuthenticationProperties
.
class
)
public
Key
AuthenticationProperties
keyAuthenticationProperties
()
{
return
new
KeyAuthenticationProperties
();
}
@Bean
@ConditionalOnProperty
(
prefix
=
"shell"
,
name
=
"auth"
,
havingValue
=
"simple"
,
matchIfMissing
=
true
)
@ConditionalOnMissingBean
(
{
CrshShellAuthenticationProperties
.
class
}
)
public
CrshShell
AuthenticationProperties
simpleAuthenticationProperties
()
{
@ConditionalOnMissingBean
(
CrshShellAuthenticationProperties
.
class
)
public
Simple
AuthenticationProperties
simpleAuthenticationProperties
()
{
return
new
SimpleAuthenticationProperties
();
}
@Bean
@ConditionalOnMissingBean
(
{
PluginLifeCycle
.
class
}
)
public
PluginLifeCycle
shellBootstrap
()
{
@ConditionalOnMissingBean
(
PluginLifeCycle
.
class
)
public
CrshBootstrapBean
shellBootstrap
()
{
CrshBootstrapBean
bootstrapBean
=
new
CrshBootstrapBean
();
bootstrapBean
.
setConfig
(
this
.
properties
.
asCrshShellConfig
());
return
bootstrapBean
;
...
...
@@ -156,7 +156,7 @@ public class CrshAutoConfiguration {
*/
@Configuration
@ConditionalOnProperty
(
prefix
=
"shell"
,
name
=
"auth"
,
havingValue
=
"spring"
,
matchIfMissing
=
true
)
@ConditionalOnBean
(
{
AuthenticationManager
.
class
}
)
@ConditionalOnBean
(
AuthenticationManager
.
class
)
@AutoConfigureAfter
(
CrshAutoConfiguration
.
class
)
public
static
class
AuthenticationManagerAdapterAutoConfiguration
{
...
...
@@ -164,13 +164,13 @@ public class CrshAutoConfiguration {
private
ManagementServerProperties
management
;
@Bean
public
CRaSHPlugin
<?>
shellAuthenticationManager
()
{
public
AuthenticationManagerAdapter
shellAuthenticationManager
()
{
return
new
AuthenticationManagerAdapter
();
}
@Bean
@ConditionalOnMissingBean
(
{
CrshShellAuthenticationProperties
.
class
}
)
public
CrshShell
AuthenticationProperties
springAuthenticationProperties
()
{
@ConditionalOnMissingBean
(
CrshShellAuthenticationProperties
.
class
)
public
Spring
AuthenticationProperties
springAuthenticationProperties
()
{
// In case no shell.auth property is provided fall back to Spring Security
// based authentication and get role to access shell from
// ManagementServerProperties.
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -18,7 +18,6 @@ package org.springframework.boot.actuate.autoconfigure;
import
java.io.IOException
;
import
javax.servlet.Filter
;
import
javax.servlet.FilterChain
;
import
javax.servlet.Servlet
;
import
javax.servlet.ServletException
;
...
...
@@ -91,11 +90,12 @@ import org.springframework.web.servlet.DispatcherServlet;
@ConditionalOnClass
({
Servlet
.
class
,
DispatcherServlet
.
class
})
@ConditionalOnWebApplication
@AutoConfigureAfter
({
PropertyPlaceholderAutoConfiguration
.
class
,
EmbeddedServletContainerAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
ManagementServerPropertiesAutoConfiguration
.
class
,
RepositoryRestMvcAutoConfiguration
.
class
,
HypermediaAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
})
EmbeddedServletContainerAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
ManagementServerPropertiesAutoConfiguration
.
class
,
RepositoryRestMvcAutoConfiguration
.
class
,
HypermediaAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
})
public
class
EndpointWebMvcAutoConfiguration
implements
ApplicationContextAware
,
BeanFactoryAware
,
SmartInitializingSingleton
{
BeanFactoryAware
,
SmartInitializingSingleton
{
private
static
final
Log
logger
=
LogFactory
.
getLog
(
EndpointWebMvcAutoConfiguration
.
class
);
...
...
@@ -130,7 +130,7 @@ BeanFactoryAware, SmartInitializingSingleton {
if
(
managementPort
==
ManagementServerPort
.
DIFFERENT
&&
this
.
applicationContext
instanceof
EmbeddedWebApplicationContext
&&
((
EmbeddedWebApplicationContext
)
this
.
applicationContext
)
.
getEmbeddedServletContainer
()
!=
null
)
{
.
getEmbeddedServletContainer
()
!=
null
)
{
createChildManagementContext
();
}
if
(
managementPort
==
ManagementServerPort
.
SAME
...
...
@@ -150,7 +150,7 @@ BeanFactoryAware, SmartInitializingSingleton {
EmbeddedServletContainerAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
);
CloseEventPropagationListener
.
addIfPossible
(
this
.
applicationContext
,
childContext
);
.
addIfPossible
(
this
.
applicationContext
,
childContext
);
try
{
childContext
.
refresh
();
managementContextResolver
().
setApplicationContext
(
childContext
);
...
...
@@ -193,7 +193,8 @@ BeanFactoryAware, SmartInitializingSingleton {
protected
static
class
ApplicationContextFilterConfiguration
{
@Bean
public
Filter
applicationContextIdFilter
(
ApplicationContext
context
)
{
public
ApplicationContextHeaderFilter
applicationContextIdFilter
(
ApplicationContext
context
)
{
return
new
ApplicationContextHeaderFilter
(
context
);
}
...
...
@@ -222,7 +223,7 @@ BeanFactoryAware, SmartInitializingSingleton {
@Override
protected
void
doFilterInternal
(
HttpServletRequest
request
,
HttpServletResponse
response
,
FilterChain
filterChain
)
throws
ServletException
,
IOException
{
throws
ServletException
,
IOException
{
if
(
this
.
properties
==
null
)
{
this
.
properties
=
this
.
applicationContext
.
getBean
(
ManagementServerProperties
.
class
);
...
...
@@ -241,7 +242,7 @@ BeanFactoryAware, SmartInitializingSingleton {
* parent to a child.
*/
private
static
class
CloseEventPropagationListener
implements
ApplicationListener
<
ContextClosedEvent
>
{
ApplicationListener
<
ContextClosedEvent
>
{
private
final
ApplicationContext
parentContext
;
...
...
@@ -276,7 +277,7 @@ BeanFactoryAware, SmartInitializingSingleton {
}
private
static
class
OnManagementMvcCondition
extends
SpringBootCondition
implements
ConfigurationCondition
{
ConfigurationCondition
{
@Override
public
ConfigurationPhase
getConfigurationPhase
()
{
...
...
@@ -325,7 +326,7 @@ BeanFactoryAware, SmartInitializingSingleton {
return
((
managementPort
==
null
)
||
(
serverPort
==
null
&&
managementPort
.
equals
(
8080
))
||
(
managementPort
!=
0
&&
managementPort
.
equals
(
serverPort
))
?
SAME
:
DIFFERENT
);
:
DIFFERENT
);
}
private
static
Integer
getPortProperty
(
Environment
environment
,
String
prefix
)
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/EndpointWebMvcHypermediaManagementContextConfiguration.java
View file @
bedf2edf
...
...
@@ -16,8 +16,6 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
;
import
static
org
.
springframework
.
hateoas
.
mvc
.
ControllerLinkBuilder
.
linkTo
;
import
java.io.IOException
;
import
java.lang.reflect.Type
;
import
java.util.Map
;
...
...
@@ -84,6 +82,8 @@ import com.fasterxml.jackson.annotation.JsonUnwrapped;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement
;
import
static
org
.
springframework
.
hateoas
.
mvc
.
ControllerLinkBuilder
.
linkTo
;
/**
* Configuration for hypermedia in HTTP endpoints.
*
...
...
@@ -136,7 +136,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
@Configuration
(
"EndpointHypermediaAutoConfiguration.MissingResourceCondition"
)
@ConditionalOnResource
(
resources
=
"classpath:/META-INF/spring-data-rest/hal-browser/index.html"
)
protected
static
class
MissingSpringDataRestResourceCondition
extends
SpringBootCondition
{
SpringBootCondition
{
@Override
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
...
...
@@ -175,7 +175,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
}
private
static
class
NotSpringDataRestHomePageCondition
extends
SpringBootCondition
{
SpringBootCondition
{
@Override
public
ConditionOutcome
getMatchOutcome
(
ConditionContext
context
,
...
...
@@ -302,7 +302,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
public
Object
beforeBodyWrite
(
Object
body
,
MethodParameter
returnType
,
MediaType
selectedContentType
,
Class
<?
extends
HttpMessageConverter
<?>>
selectedConverterType
,
ServerHttpRequest
request
,
ServerHttpResponse
response
)
{
ServerHttpRequest
request
,
ServerHttpResponse
response
)
{
if
(
request
instanceof
ServletServerHttpRequest
)
{
beforeBodyWrite
(
body
,
(
ServletServerHttpRequest
)
request
);
}
...
...
@@ -383,7 +383,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
public
Object
beforeBodyWrite
(
Object
body
,
MethodParameter
returnType
,
MediaType
selectedContentType
,
Class
<?
extends
HttpMessageConverter
<?>>
selectedConverterType
,
ServerHttpRequest
request
,
ServerHttpResponse
response
)
{
ServerHttpRequest
request
,
ServerHttpResponse
response
)
{
if
(
request
instanceof
ServletServerHttpRequest
)
{
return
beforeBodyWrite
(
body
,
returnType
,
selectedContentType
,
selectedConverterType
,
(
ServletServerHttpRequest
)
request
,
...
...
@@ -395,7 +395,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
private
Object
beforeBodyWrite
(
Object
body
,
MethodParameter
returnType
,
MediaType
selectedContentType
,
Class
<?
extends
HttpMessageConverter
<?>>
selectedConverterType
,
ServletServerHttpRequest
request
,
ServerHttpResponse
response
)
{
ServletServerHttpRequest
request
,
ServerHttpResponse
response
)
{
if
(
body
==
null
||
body
instanceof
Resource
)
{
// Assume it already was handled or it already has its links
return
body
;
...
...
@@ -420,7 +420,7 @@ public class EndpointWebMvcHypermediaManagementContextConfiguration {
@SuppressWarnings
(
"unchecked"
)
private
HttpMessageConverter
<
Object
>
findConverter
(
Class
<?
extends
HttpMessageConverter
<?>>
selectedConverterType
,
MediaType
mediaType
)
{
MediaType
mediaType
)
{
if
(
this
.
converterCache
.
containsKey
(
mediaType
))
{
return
(
HttpMessageConverter
<
Object
>)
this
.
converterCache
.
get
(
mediaType
);
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/HealthIndicatorAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -92,8 +92,8 @@ public class HealthIndicatorAutoConfiguration {
private
HealthIndicatorAutoConfigurationProperties
configurationProperties
=
new
HealthIndicatorAutoConfigurationProperties
();
@Bean
@ConditionalOnMissingBean
public
HealthAggregator
healthAggregator
()
{
@ConditionalOnMissingBean
(
HealthAggregator
.
class
)
public
Ordered
HealthAggregator
healthAggregator
()
{
OrderedHealthAggregator
healthAggregator
=
new
OrderedHealthAggregator
();
if
(
this
.
configurationProperties
.
getOrder
()
!=
null
)
{
healthAggregator
.
setStatusOrder
(
this
.
configurationProperties
.
getOrder
());
...
...
@@ -103,7 +103,7 @@ public class HealthIndicatorAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
HealthIndicator
.
class
)
public
HealthIndicator
applicationHealthIndicator
()
{
public
Application
HealthIndicator
applicationHealthIndicator
()
{
return
new
ApplicationHealthIndicator
();
}
...
...
@@ -264,7 +264,7 @@ public class HealthIndicatorAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
name
=
"diskSpaceHealthIndicator"
)
public
HealthIndicator
diskSpaceHealthIndicator
(
public
DiskSpace
HealthIndicator
diskSpaceHealthIndicator
(
DiskSpaceHealthIndicatorProperties
properties
)
{
return
new
DiskSpaceHealthIndicator
(
properties
);
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricFilterAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -16,7 +16,6 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
;
import
javax.servlet.Filter
;
import
javax.servlet.Servlet
;
import
javax.servlet.ServletRegistration
;
...
...
@@ -56,7 +55,7 @@ public class MetricFilterAutoConfiguration {
private
GaugeService
gaugeService
;
@Bean
public
Filter
metricFilter
()
{
public
Metrics
Filter
metricFilter
()
{
return
new
MetricsFilter
(
this
.
counterService
,
this
.
gaugeService
);
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricRepositoryAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -91,14 +91,14 @@ public class MetricRepositoryAutoConfiguration {
private
MetricWriter
writer
;
@Bean
@ConditionalOnMissingBean
public
CounterService
counterService
()
{
@ConditionalOnMissingBean
(
CounterService
.
class
)
public
Default
CounterService
counterService
()
{
return
new
DefaultCounterService
(
this
.
writer
);
}
@Bean
@ConditionalOnMissingBean
public
GaugeService
gaugeService
()
{
@ConditionalOnMissingBean
(
GaugeService
.
class
)
public
Default
GaugeService
gaugeService
()
{
return
new
DefaultGaugeService
(
this
.
writer
);
}
...
...
@@ -130,14 +130,14 @@ public class MetricRepositoryAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
public
CounterService
counterService
(
CounterBuffers
writer
)
{
@ConditionalOnMissingBean
(
CounterService
.
class
)
public
Buffer
CounterService
counterService
(
CounterBuffers
writer
)
{
return
new
BufferCounterService
(
writer
);
}
@Bean
@ConditionalOnMissingBean
public
GaugeService
gaugeService
(
GaugeBuffers
writer
)
{
@ConditionalOnMissingBean
(
GaugeService
.
class
)
public
Buffer
GaugeService
gaugeService
(
GaugeBuffers
writer
)
{
return
new
BufferGaugeService
(
writer
);
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/MetricsDropwizardAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
actuate
.
autoconfigure
;
import
org.springframework.boot.actuate.endpoint.MetricReaderPublicMetrics
;
import
org.springframework.boot.actuate.endpoint.PublicMetrics
;
import
org.springframework.boot.actuate.metrics.CounterService
;
import
org.springframework.boot.actuate.metrics.GaugeService
;
import
org.springframework.boot.actuate.metrics.dropwizard.DropwizardMetricServices
;
...
...
@@ -56,7 +55,7 @@ public class MetricsDropwizardAutoConfiguration {
}
@Bean
public
PublicMetrics
dropwizardPublicMetrics
(
MetricRegistry
metricRegistry
)
{
public
MetricReader
PublicMetrics
dropwizardPublicMetrics
(
MetricRegistry
metricRegistry
)
{
MetricRegistryMetricReader
reader
=
new
MetricRegistryMetricReader
(
metricRegistry
);
return
new
MetricReaderPublicMetrics
(
reader
);
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/TraceRepositoryAutoConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -31,9 +31,9 @@ import org.springframework.context.annotation.Configuration;
@Configuration
public
class
TraceRepositoryAutoConfiguration
{
@ConditionalOnMissingBean
@ConditionalOnMissingBean
(
TraceRepository
.
class
)
@Bean
public
TraceRepository
traceRepository
()
{
public
InMemory
TraceRepository
traceRepository
()
{
return
new
InMemoryTraceRepository
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -106,7 +106,7 @@ public class RabbitAutoConfiguration {
protected
static
class
RabbitConnectionFactoryCreator
{
@Bean
public
ConnectionFactory
rabbitConnectionFactory
(
RabbitProperties
config
)
public
C
achingC
onnectionFactory
rabbitConnectionFactory
(
RabbitProperties
config
)
throws
Exception
{
RabbitConnectionFactoryBean
factory
=
new
RabbitConnectionFactoryBean
();
if
(
config
.
getHost
()
!=
null
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -29,7 +29,6 @@ import org.springframework.batch.core.launch.JobOperator;
import
org.springframework.batch.core.launch.support.SimpleJobOperator
;
import
org.springframework.batch.core.repository.JobRepository
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ExitCodeGenerator
;
import
org.springframework.boot.autoconfigure.AutoConfigureAfter
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnBean
;
...
...
@@ -93,7 +92,7 @@ public class BatchAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public
ExitCodeGenerator
jobExecutionExitCodeGenerator
()
{
public
JobExecution
ExitCodeGenerator
jobExecutionExitCodeGenerator
()
{
return
new
JobExecutionExitCodeGenerator
();
}
...
...
@@ -112,9 +111,10 @@ public class BatchAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
public
JobOperator
jobOperator
(
JobExplorer
jobExplorer
,
JobLauncher
jobLauncher
,
ListableJobLocator
jobRegistry
,
JobRepository
jobRepository
)
throws
Exception
{
@ConditionalOnMissingBean
(
JobOperator
.
class
)
public
SimpleJobOperator
jobOperator
(
JobExplorer
jobExplorer
,
JobLauncher
jobLauncher
,
ListableJobLocator
jobRegistry
,
JobRepository
jobRepository
)
throws
Exception
{
SimpleJobOperator
factory
=
new
SimpleJobOperator
();
factory
.
setJobExplorer
(
jobExplorer
);
factory
.
setJobLauncher
(
jobLauncher
);
...
...
@@ -139,7 +139,7 @@ public class BatchAutoConfiguration {
// Boot in the JPA auto configuration.
@Bean
@ConditionalOnBean
(
name
=
"entityManagerFactory"
)
public
BatchConfigurer
jpaBatchConfigurer
(
DataSource
dataSource
,
public
Ba
sicBa
tchConfigurer
jpaBatchConfigurer
(
DataSource
dataSource
,
EntityManagerFactory
entityManagerFactory
)
{
return
new
BasicBatchConfigurer
(
this
.
properties
,
dataSource
,
entityManagerFactory
);
...
...
@@ -147,7 +147,7 @@ public class BatchAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
name
=
"entityManagerFactory"
)
public
BatchConfigurer
basicBatchConfigurer
(
DataSource
dataSource
)
{
public
Ba
sicBa
tchConfigurer
basicBatchConfigurer
(
DataSource
dataSource
)
{
return
new
BasicBatchConfigurer
(
this
.
properties
,
dataSource
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -66,7 +66,7 @@ public class CacheAutoConfiguration {
@Bean
@Role
(
BeanDefinition
.
ROLE_INFRASTRUCTURE
)
public
static
BeanFactory
PostProcessor
cacheAutoConfigurationValidatorPostProcessor
()
{
public
static
CacheManagerValidator
PostProcessor
cacheAutoConfigurationValidatorPostProcessor
()
{
return
new
CacheManagerValidatorPostProcessor
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/InfinispanCacheConfiguration.java
View file @
bedf2edf
...
...
@@ -54,7 +54,8 @@ public class InfinispanCacheConfiguration {
private
ConfigurationBuilder
defaultConfigurationBuilder
;
@Bean
public
CacheManager
cacheManager
(
EmbeddedCacheManager
embeddedCacheManager
)
{
public
SpringEmbeddedCacheManager
cacheManager
(
EmbeddedCacheManager
embeddedCacheManager
)
{
return
new
SpringEmbeddedCacheManager
(
embeddedCacheManager
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -97,7 +97,7 @@ public class JacksonAutoConfiguration {
private
JacksonProperties
jacksonProperties
;
@Bean
public
Module
jodaDateTimeSerializationModule
()
{
public
Simple
Module
jodaDateTimeSerializationModule
()
{
SimpleModule
module
=
new
SimpleModule
();
JacksonJodaDateFormat
jacksonJodaFormat
=
getJacksonJodaDateFormat
();
if
(
jacksonJodaFormat
!=
null
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -52,9 +52,9 @@ public class DataSourceTransactionManagerAutoConfiguration implements Ordered {
private
DataSource
dataSource
;
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
(
PlatformTransactionManager
.
class
)
@ConditionalOnBean
(
DataSource
.
class
)
public
Platform
TransactionManager
transactionManager
()
{
public
DataSource
TransactionManager
transactionManager
()
{
return
new
DataSourceTransactionManager
(
this
.
dataSource
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/EmbeddedDataSourceConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
jdbc
;
import
javax.annotation.PreDestroy
;
import
javax.sql.DataSource
;
import
org.springframework.beans.factory.BeanClassLoaderAware
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -48,7 +47,7 @@ public class EmbeddedDataSourceConfiguration implements BeanClassLoaderAware {
}
@Bean
public
DataSourc
e
dataSource
()
{
public
EmbeddedDatabas
e
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
.
setType
(
EmbeddedDatabaseConnection
.
get
(
this
.
classLoader
).
getType
());
this
.
database
=
builder
.
setName
(
this
.
name
).
build
();
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java
View file @
bedf2edf
...
...
@@ -79,8 +79,8 @@ class JmsAnnotationDrivenConfiguration {
protected
static
class
JndiConfiguration
{
@Bean
@ConditionalOnMissingBean
public
DestinationResolver
destinationResolver
()
{
@ConditionalOnMissingBean
(
DestinationResolver
.
class
)
public
Jndi
DestinationResolver
destinationResolver
()
{
JndiDestinationResolver
resolver
=
new
JndiDestinationResolver
();
resolver
.
setFallbackToDynamicDestination
(
true
);
return
resolver
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -20,7 +20,9 @@ import javax.jms.ConnectionFactory;
import
org.apache.activemq.ActiveMQConnectionFactory
;
import
org.apache.activemq.pool.PooledConnectionFactory
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -30,22 +32,34 @@ import org.springframework.context.annotation.Configuration;
* @author Greg Turnquist
* @author Stephane Nicoll
* @author Phillip Webb
* @author Andy Wilkinson
* @since 1.1.0
*/
@Configuration
@ConditionalOnMissingBean
(
ConnectionFactory
.
class
)
class
ActiveMQConnectionFactoryConfiguration
{
@Bean
public
ConnectionFactory
jmsConnectionFactory
(
ActiveMQProperties
properties
)
{
ActiveMQConnectionFactory
connectionFactory
=
new
ActiveMQConnectionFactoryFactory
(
properties
).
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
);
if
(
properties
.
isPooled
())
{
PooledConnectionFactory
pool
=
new
PooledConnectionFactory
();
pool
.
setConnectionFactory
(
connectionFactory
);
return
pool
;
@ConditionalOnClass
(
PooledConnectionFactory
.
class
)
static
class
PooledConnectionFactoryConfiguration
{
@Bean
@ConditionalOnProperty
(
prefix
=
"spring.activemq"
,
name
=
"pooled"
,
havingValue
=
"true"
,
matchIfMissing
=
false
)
public
PooledConnectionFactory
pooledJmsConnectionFactory
(
ActiveMQProperties
properties
)
{
PooledConnectionFactory
pooledConnectionFactory
=
new
PooledConnectionFactory
();
pooledConnectionFactory
.
setConnectionFactory
(
new
ActiveMQConnectionFactoryFactory
(
properties
)
.
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
));
return
pooledConnectionFactory
;
}
return
connectionFactory
;
}
@Bean
@ConditionalOnProperty
(
prefix
=
"spring.activemq"
,
name
=
"pooled"
,
havingValue
=
"false"
,
matchIfMissing
=
true
)
public
ActiveMQConnectionFactory
jmsConnectionFactory
(
ActiveMQProperties
properties
)
{
return
new
ActiveMQConnectionFactoryFactory
(
properties
)
.
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
);
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisConnectionFactoryConfiguration.java
View file @
bedf2edf
...
...
@@ -35,8 +35,8 @@ import org.springframework.context.annotation.Configuration;
class
ArtemisConnectionFactoryConfiguration
{
@Bean
public
ConnectionFactory
jmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
ArtemisProperties
properties
)
{
public
ActiveMQConnectionFactory
jmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
ArtemisProperties
properties
)
{
return
new
ArtemisConnectionFactoryFactory
(
beanFactory
,
properties
)
.
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisXAConnectionFactoryConfiguration.java
View file @
bedf2edf
...
...
@@ -53,8 +53,8 @@ class ArtemisXAConnectionFactoryConfiguration {
}
@Bean
public
ConnectionFactory
nonXaJmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
ArtemisProperties
properties
)
{
public
ActiveMQXAConnectionFactory
nonXaJmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
ArtemisProperties
properties
)
{
return
new
ArtemisConnectionFactoryFactory
(
beanFactory
,
properties
)
.
createConnectionFactory
(
ActiveMQXAConnectionFactory
.
class
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQConnectionFactoryConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -35,7 +35,7 @@ import org.springframework.context.annotation.Configuration;
class
HornetQConnectionFactoryConfiguration
{
@Bean
public
ConnectionFactory
jmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
public
HornetQ
ConnectionFactory
jmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
HornetQProperties
properties
)
{
return
new
HornetQConnectionFactoryFactory
(
beanFactory
,
properties
)
.
createConnectionFactory
(
HornetQConnectionFactory
.
class
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/hornetq/HornetQXAConnectionFactoryConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -53,8 +53,8 @@ class HornetQXAConnectionFactoryConfiguration {
}
@Bean
public
ConnectionFactory
nonXaJmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
HornetQProperties
properties
)
{
public
HornetQConnectionFactory
nonXaJmsConnectionFactory
(
ListableBeanFactory
beanFactory
,
HornetQProperties
properties
)
{
return
new
HornetQConnectionFactoryFactory
(
beanFactory
,
properties
)
.
createConnectionFactory
(
HornetQConnectionFactory
.
class
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -64,12 +64,13 @@ public class JooqAutoConfiguration {
@Bean
@ConditionalOnBean
(
PlatformTransactionManager
.
class
)
public
TransactionProvider
transactionProvider
(
PlatformTransactionManager
txManager
)
{
public
SpringTransactionProvider
transactionProvider
(
PlatformTransactionManager
txManager
)
{
return
new
SpringTransactionProvider
(
txManager
);
}
@Bean
public
ExecuteListenerProvider
jooqExceptionTranslatorExecuteListenerProvider
()
{
public
Default
ExecuteListenerProvider
jooqExceptionTranslatorExecuteListenerProvider
()
{
return
new
DefaultExecuteListenerProvider
(
new
JooqExceptionTranslator
());
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/MongoDataAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -102,8 +102,8 @@ public class MongoDataAutoConfiguration implements BeanClassLoaderAware {
}
@Bean
@ConditionalOnMissingBean
public
MongoDbFactory
mongoDbFactory
(
MongoClient
mongo
)
throws
Exception
{
@ConditionalOnMissingBean
(
MongoDbFactory
.
class
)
public
Simple
MongoDbFactory
mongoDbFactory
(
MongoClient
mongo
)
throws
Exception
{
String
database
=
this
.
properties
.
getMongoClientDatabase
();
return
new
SimpleMongoDbFactory
(
mongo
,
database
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/redis/RedisAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -132,8 +132,8 @@ public class RedisAutoConfiguration {
AbstractRedisConfiguration
{
@Bean
@ConditionalOnMissingBean
public
R
edisConnectionFactory
redisConnectionFactory
()
@ConditionalOnMissingBean
(
RedisConnectionFactory
.
class
)
public
J
edisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
return
applyProperties
(
new
JedisConnectionFactory
(
getSentinelConfig
()));
}
...
...
@@ -149,8 +149,8 @@ public class RedisAutoConfiguration {
AbstractRedisConfiguration
{
@Bean
@ConditionalOnMissingBean
public
R
edisConnectionFactory
redisConnectionFactory
()
@ConditionalOnMissingBean
(
RedisConnectionFactory
.
class
)
public
J
edisConnectionFactory
redisConnectionFactory
()
throws
UnknownHostException
{
return
applyProperties
(
createJedisConnectionFactory
());
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -54,8 +54,8 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
public
class
SecurityAutoConfiguration
{
@Bean
@ConditionalOnMissingBean
public
AuthenticationEventPublisher
authenticationEventPublisher
(
@ConditionalOnMissingBean
(
AuthenticationEventPublisher
.
class
)
public
Default
AuthenticationEventPublisher
authenticationEventPublisher
(
ApplicationEventPublisher
publisher
)
{
return
new
DefaultAuthenticationEventPublisher
(
publisher
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java
View file @
bedf2edf
...
...
@@ -94,7 +94,7 @@ public class SpringBootWebSecurityConfiguration {
@Bean
@ConditionalOnMissingBean
({
IgnoredPathsWebSecurityConfigurerAdapter
.
class
})
public
WebSecurityConfigurer
<
WebSecurity
>
ignoredPathsWebSecurityConfigurerAdapter
()
{
public
IgnoredPathsWebSecurityConfigurerAdapter
ignoredPathsWebSecurityConfigurerAdapter
()
{
return
new
IgnoredPathsWebSecurityConfigurerAdapter
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2RestOperationsConfiguration.java
View file @
bedf2edf
...
...
@@ -102,7 +102,7 @@ public class OAuth2RestOperationsConfiguration {
}
@Bean
public
OAuth2ClientContext
oauth2ClientContext
()
{
public
Default
OAuth2ClientContext
oauth2ClientContext
()
{
return
new
DefaultOAuth2ClientContext
(
new
DefaultAccessTokenRequest
());
}
...
...
@@ -119,7 +119,7 @@ public class OAuth2RestOperationsConfiguration {
@Bean
@Scope
(
value
=
"session"
,
proxyMode
=
ScopedProxyMode
.
INTERFACES
)
public
OAuth2ClientContext
oauth2ClientContext
()
{
public
Default
OAuth2ClientContext
oauth2ClientContext
()
{
return
new
DefaultOAuth2ClientContext
(
this
.
accessTokenRequest
);
}
...
...
@@ -147,7 +147,7 @@ public class OAuth2RestOperationsConfiguration {
@Bean
@Scope
(
value
=
"request"
,
proxyMode
=
ScopedProxyMode
.
INTERFACES
)
public
OAuth2ClientContext
oauth2ClientContext
()
{
public
Default
OAuth2ClientContext
oauth2ClientContext
()
{
DefaultOAuth2ClientContext
context
=
new
DefaultOAuth2ClientContext
(
new
DefaultAccessTokenRequest
());
Authentication
principal
=
SecurityContextHolder
.
getContext
()
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerTokenServicesConfiguration.java
View file @
bedf2edf
...
...
@@ -146,7 +146,7 @@ public class ResourceServerTokenServicesConfiguration {
private
ResourceServerProperties
resource
;
@Bean
public
Re
sourceServer
TokenServices
remoteTokenServices
()
{
public
Re
mote
TokenServices
remoteTokenServices
()
{
RemoteTokenServices
services
=
new
RemoteTokenServices
();
services
.
setCheckTokenEndpointUrl
(
this
.
resource
.
getTokenInfoUri
());
services
.
setClientId
(
this
.
resource
.
getClientId
());
...
...
@@ -182,7 +182,7 @@ public class ResourceServerTokenServicesConfiguration {
@Bean
@ConditionalOnMissingBean
({
ConnectionFactoryLocator
.
class
,
ResourceServerTokenServices
.
class
})
public
ResourceServer
TokenServices
userInfoTokenServices
()
{
public
UserInfo
TokenServices
userInfoTokenServices
()
{
UserInfoTokenServices
services
=
new
UserInfoTokenServices
(
this
.
sso
.
getUserInfoUri
(),
this
.
sso
.
getClientId
());
services
.
setTokenType
(
this
.
sso
.
getTokenType
());
...
...
@@ -206,7 +206,7 @@ public class ResourceServerTokenServicesConfiguration {
@Bean
@ConditionalOnMissingBean
(
ResourceServerTokenServices
.
class
)
public
ResourceServer
TokenServices
userInfoTokenServices
()
{
public
UserInfo
TokenServices
userInfoTokenServices
()
{
UserInfoTokenServices
services
=
new
UserInfoTokenServices
(
this
.
sso
.
getUserInfoUri
(),
this
.
sso
.
getClientId
());
services
.
setRestTemplate
(
this
.
restTemplate
);
...
...
@@ -233,7 +233,7 @@ public class ResourceServerTokenServicesConfiguration {
@Bean
@ConditionalOnMissingBean
(
ResourceServerTokenServices
.
class
)
public
ResourceServer
TokenServices
jwtTokenServices
()
{
public
Default
TokenServices
jwtTokenServices
()
{
DefaultTokenServices
services
=
new
DefaultTokenServices
();
services
.
setTokenStore
(
jwtTokenStore
());
return
services
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/FacebookAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -38,7 +38,6 @@ import org.springframework.social.connect.ConnectionRepository;
import
org.springframework.social.connect.web.GenericConnectionStatusView
;
import
org.springframework.social.facebook.api.Facebook
;
import
org.springframework.social.facebook.connect.FacebookConnectionFactory
;
import
org.springframework.web.servlet.View
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Social connectivity with
...
...
@@ -74,7 +73,7 @@ public class FacebookAutoConfiguration {
@Bean
(
name
=
{
"connect/facebookConnect"
,
"connect/facebookConnected"
})
@ConditionalOnProperty
(
prefix
=
"spring.social"
,
name
=
"auto-connection-views"
)
public
View
facebookConnectView
()
{
public
GenericConnectionStatus
View
facebookConnectView
()
{
return
new
GenericConnectionStatusView
(
"facebook"
,
"Facebook"
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/LinkedInAutoConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -38,7 +38,6 @@ import org.springframework.social.connect.ConnectionRepository;
import
org.springframework.social.connect.web.GenericConnectionStatusView
;
import
org.springframework.social.linkedin.api.LinkedIn
;
import
org.springframework.social.linkedin.connect.LinkedInConnectionFactory
;
import
org.springframework.web.servlet.View
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Social connectivity with
...
...
@@ -74,7 +73,7 @@ public class LinkedInAutoConfiguration {
@Bean
(
name
=
{
"connect/linkedinConnect"
,
"connect/linkedinConnected"
})
@ConditionalOnProperty
(
prefix
=
"spring.social"
,
name
=
"auto-connection-views"
)
public
View
linkedInConnectView
()
{
public
GenericConnectionStatus
View
linkedInConnectView
()
{
return
new
GenericConnectionStatusView
(
"linkedin"
,
"LinkedIn"
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/SocialWebAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -50,7 +50,6 @@ import org.springframework.social.connect.web.SignInAdapter;
import
org.springframework.social.connect.web.thymeleaf.SpringSocialDialect
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.servlet.ViewResolver
;
import
org.springframework.web.servlet.view.BeanNameViewResolver
;
import
org.thymeleaf.spring4.SpringTemplateEngine
;
...
...
@@ -98,9 +97,9 @@ public class SocialWebAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
(
BeanNameViewResolver
.
class
)
@ConditionalOnMissingBean
@ConditionalOnProperty
(
prefix
=
"spring.social"
,
name
=
"auto-connection-views"
)
public
ViewResolver
beanNameViewResolver
()
{
public
BeanName
ViewResolver
beanNameViewResolver
()
{
BeanNameViewResolver
viewResolver
=
new
BeanNameViewResolver
();
viewResolver
.
setOrder
(
Integer
.
MIN_VALUE
);
return
viewResolver
;
...
...
@@ -108,7 +107,7 @@ public class SocialWebAutoConfiguration {
@Bean
@ConditionalOnBean
(
SignInAdapter
.
class
)
@ConditionalOnMissingBean
(
ProviderSignInController
.
class
)
@ConditionalOnMissingBean
public
ProviderSignInController
signInController
(
ConnectionFactoryLocator
factoryLocator
,
UsersConnectionRepository
usersRepository
,
SignInAdapter
signInAdapter
)
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/social/TwitterAutoConfiguration.java
View file @
bedf2edf
/*
* Copyright 2012-201
4
the original author or authors.
* Copyright 2012-201
5
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.
...
...
@@ -39,7 +39,6 @@ import org.springframework.social.connect.web.GenericConnectionStatusView;
import
org.springframework.social.twitter.api.Twitter
;
import
org.springframework.social.twitter.api.impl.TwitterTemplate
;
import
org.springframework.social.twitter.connect.TwitterConnectionFactory
;
import
org.springframework.web.servlet.View
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for Spring Social connectivity with
...
...
@@ -79,7 +78,7 @@ public class TwitterAutoConfiguration {
@Bean
(
name
=
{
"connect/twitterConnect"
,
"connect/twitterConnected"
})
@ConditionalOnProperty
(
prefix
=
"spring.social"
,
name
=
"auto-connection-views"
)
public
View
twitterConnectView
()
{
public
GenericConnectionStatus
View
twitterConnectView
()
{
return
new
GenericConnectionStatusView
(
"twitter"
,
"Twitter"
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/AtomikosJtaConfiguration.java
View file @
bedf2edf
...
...
@@ -68,8 +68,8 @@ class AtomikosJtaConfiguration {
}
@Bean
(
initMethod
=
"init"
,
destroyMethod
=
"shutdownForce"
)
@ConditionalOnMissingBean
public
UserTransactionService
userTransactionService
(
@ConditionalOnMissingBean
(
UserTransactionService
.
class
)
public
UserTransactionService
Imp
userTransactionService
(
AtomikosProperties
atomikosProperties
)
{
Properties
properties
=
new
Properties
();
if
(
StringUtils
.
hasText
(
this
.
jtaProperties
.
getTransactionManagerId
()))
{
...
...
@@ -100,8 +100,8 @@ class AtomikosJtaConfiguration {
}
@Bean
@ConditionalOnMissingBean
public
XADataSourceWrapper
xaDataSourceWrapper
()
{
@ConditionalOnMissingBean
(
XADataSourceWrapper
.
class
)
public
Atomikos
XADataSourceWrapper
xaDataSourceWrapper
()
{
return
new
AtomikosXADataSourceWrapper
();
}
...
...
@@ -122,8 +122,8 @@ class AtomikosJtaConfiguration {
static
class
AtomikosJtaJmsConfiguration
{
@Bean
@ConditionalOnMissingBean
public
XAConnectionFactoryWrapper
xaConnectionFactoryWrapper
()
{
@ConditionalOnMissingBean
(
XAConnectionFactoryWrapper
.
class
)
public
Atomikos
XAConnectionFactoryWrapper
xaConnectionFactoryWrapper
()
{
return
new
AtomikosXAConnectionFactoryWrapper
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/jta/BitronixJtaConfiguration.java
View file @
bedf2edf
...
...
@@ -37,6 +37,7 @@ import org.springframework.transaction.PlatformTransactionManager;
import
org.springframework.transaction.jta.JtaTransactionManager
;
import
org.springframework.util.StringUtils
;
import
bitronix.tm.BitronixTransactionManager
;
import
bitronix.tm.TransactionManagerServices
;
import
bitronix.tm.jndi.BitronixContext
;
...
...
@@ -80,16 +81,16 @@ class BitronixJtaConfiguration {
}
@Bean
@ConditionalOnMissingBean
public
TransactionManager
bitronixTransactionManager
(
@ConditionalOnMissingBean
(
TransactionManager
.
class
)
public
Bitronix
TransactionManager
bitronixTransactionManager
(
bitronix
.
tm
.
Configuration
configuration
)
{
// Inject configuration to force ordering
return
TransactionManagerServices
.
getTransactionManager
();
}
@Bean
@ConditionalOnMissingBean
public
XADataSourceWrapper
xaDataSourceWrapper
()
{
@ConditionalOnMissingBean
(
XADataSourceWrapper
.
class
)
public
Bitronix
XADataSourceWrapper
xaDataSourceWrapper
()
{
return
new
BitronixXADataSourceWrapper
();
}
...
...
@@ -108,8 +109,8 @@ class BitronixJtaConfiguration {
static
class
BitronixJtaJmsConfiguration
{
@Bean
@ConditionalOnMissingBean
public
XAConnectionFactoryWrapper
xaConnectionFactoryWrapper
()
{
@ConditionalOnMissingBean
(
XAConnectionFactoryWrapper
.
class
)
public
Bitronix
XAConnectionFactoryWrapper
xaConnectionFactoryWrapper
()
{
return
new
BitronixXAConnectionFactoryWrapper
();
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -45,7 +45,6 @@ import org.springframework.util.Assert;
import
org.springframework.web.servlet.resource.ResourceUrlEncodingFilter
;
import
org.springframework.web.servlet.view.velocity.VelocityConfig
;
import
org.springframework.web.servlet.view.velocity.VelocityConfigurer
;
import
org.springframework.web.servlet.view.velocity.VelocityViewResolver
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for Velocity.
...
...
@@ -130,7 +129,7 @@ public class VelocityAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
name
=
"velocityViewResolver"
)
@ConditionalOnProperty
(
name
=
"spring.velocity.enabled"
,
matchIfMissing
=
true
)
public
VelocityViewResolver
velocityViewResolver
()
{
public
Embedded
VelocityViewResolver
velocityViewResolver
()
{
EmbeddedVelocityViewResolver
resolver
=
new
EmbeddedVelocityViewResolver
();
this
.
properties
.
applyToViewResolver
(
resolver
);
return
resolver
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/MultipartAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -62,7 +62,7 @@ public class MultipartAutoConfiguration {
}
@Bean
(
name
=
DispatcherServlet
.
MULTIPART_RESOLVER_BEAN_NAME
)
@ConditionalOnMissingBean
(
value
=
MultipartResolver
.
class
)
@ConditionalOnMissingBean
(
MultipartResolver
.
class
)
public
StandardServletMultipartResolver
multipartResolver
()
{
return
new
StandardServletMultipartResolver
();
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -147,7 +147,7 @@ public class WebMvcAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
(
InternalResourceViewResolver
.
class
)
@ConditionalOnMissingBean
public
InternalResourceViewResolver
defaultViewResolver
()
{
InternalResourceViewResolver
resolver
=
new
InternalResourceViewResolver
();
resolver
.
setPrefix
(
this
.
mvcProperties
.
getView
().
getPrefix
());
...
...
@@ -156,7 +156,7 @@ public class WebMvcAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
(
RequestContextListener
.
class
)
@ConditionalOnMissingBean
public
RequestContextListener
requestContextListener
()
{
return
new
RequestContextListener
();
}
...
...
@@ -183,7 +183,7 @@ public class WebMvcAutoConfiguration {
}
@Bean
@ConditionalOnMissingBean
(
LocaleResolver
.
class
)
@ConditionalOnMissingBean
@ConditionalOnProperty
(
prefix
=
"spring.mvc"
,
name
=
"locale"
)
public
LocaleResolver
localeResolver
()
{
return
new
FixedLocaleResolver
(
this
.
mvcProperties
.
getLocale
());
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/websocket/WebSocketAutoConfiguration.java
View file @
bedf2edf
...
...
@@ -25,7 +25,6 @@ import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -60,7 +59,7 @@ public class WebSocketAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
name
=
"websocketContainerCustomizer"
)
public
EmbeddedServl
etContainerCustomizer
websocketContainerCustomizer
()
{
public
TomcatWebSock
etContainerCustomizer
websocketContainerCustomizer
()
{
return
new
TomcatWebSocketContainerCustomizer
();
}
...
...
@@ -72,7 +71,7 @@ public class WebSocketAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
name
=
"websocketContainerCustomizer"
)
public
EmbeddedServl
etContainerCustomizer
websocketContainerCustomizer
()
{
public
JettyWebSock
etContainerCustomizer
websocketContainerCustomizer
()
{
return
new
JettyWebSocketContainerCustomizer
();
}
...
...
@@ -84,7 +83,7 @@ public class WebSocketAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
name
=
"websocketContainerCustomizer"
)
public
EmbeddedServl
etContainerCustomizer
websocketContainerCustomizer
()
{
public
UndertowWebSock
etContainerCustomizer
websocketContainerCustomizer
()
{
return
new
UndertowWebSocketContainerCustomizer
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment