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
6075682e
Commit
6075682e
authored
Feb 24, 2016
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polishing
- Code formatting - Javadoc warnings - Deprecation warnings
parent
1c715ab2
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
73 additions
and
57 deletions
+73
-57
RabbitAnnotationDrivenConfiguration.java
...toconfigure/amqp/RabbitAnnotationDrivenConfiguration.java
+2
-4
CacheManagerCustomizer.java
...work/boot/autoconfigure/cache/CacheManagerCustomizer.java
+1
-0
CacheManagerCustomizerInvoker.java
...ot/autoconfigure/cache/CacheManagerCustomizerInvoker.java
+13
-11
HazelcastCacheConfiguration.java
...boot/autoconfigure/cache/HazelcastCacheConfiguration.java
+3
-2
HazelcastInstanceConfiguration.java
...t/autoconfigure/cache/HazelcastInstanceConfiguration.java
+4
-3
InfinispanCacheConfiguration.java
...oot/autoconfigure/cache/InfinispanCacheConfiguration.java
+2
-1
DefaultJmsListenerContainerFactoryConfigurer.java
...ure/jms/DefaultJmsListenerContainerFactoryConfigurer.java
+0
-1
JmsAnnotationDrivenConfiguration.java
...t/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java
+1
-2
EmbeddedMongoAutoConfiguration.java
...figure/mongo/embedded/EmbeddedMongoAutoConfiguration.java
+1
-1
CacheAutoConfigurationTests.java
...boot/autoconfigure/cache/CacheAutoConfigurationTests.java
+42
-25
CacheManagerCustomizerInvokerTests.java
...toconfigure/cache/CacheManagerCustomizerInvokerTests.java
+2
-3
JmsAutoConfigurationTests.java
...ork/boot/autoconfigure/jms/JmsAutoConfigurationTests.java
+1
-2
pom.xml
spring-boot-devtools/pom.xml
+0
-1
TomcatEmbeddedWebappClassLoader.java
...text/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java
+1
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitAnnotationDrivenConfiguration.java
View file @
6075682e
...
@@ -43,8 +43,7 @@ class RabbitAnnotationDrivenConfiguration {
...
@@ -43,8 +43,7 @@ class RabbitAnnotationDrivenConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
SimpleRabbitListenerContainerFactoryConfigurer
rabbitListenerContainerFactoryConfigurer
()
{
public
SimpleRabbitListenerContainerFactoryConfigurer
rabbitListenerContainerFactoryConfigurer
()
{
SimpleRabbitListenerContainerFactoryConfigurer
configurer
=
SimpleRabbitListenerContainerFactoryConfigurer
configurer
=
new
SimpleRabbitListenerContainerFactoryConfigurer
();
new
SimpleRabbitListenerContainerFactoryConfigurer
();
configurer
.
setRabbitProperties
(
this
.
properties
);
configurer
.
setRabbitProperties
(
this
.
properties
);
return
configurer
;
return
configurer
;
}
}
...
@@ -54,8 +53,7 @@ class RabbitAnnotationDrivenConfiguration {
...
@@ -54,8 +53,7 @@ class RabbitAnnotationDrivenConfiguration {
public
SimpleRabbitListenerContainerFactory
rabbitListenerContainerFactory
(
public
SimpleRabbitListenerContainerFactory
rabbitListenerContainerFactory
(
SimpleRabbitListenerContainerFactoryConfigurer
configurer
,
SimpleRabbitListenerContainerFactoryConfigurer
configurer
,
ConnectionFactory
connectionFactory
)
{
ConnectionFactory
connectionFactory
)
{
SimpleRabbitListenerContainerFactory
factory
=
SimpleRabbitListenerContainerFactory
factory
=
new
SimpleRabbitListenerContainerFactory
();
new
SimpleRabbitListenerContainerFactory
();
configurer
.
configure
(
factory
,
connectionFactory
);
configurer
.
configure
(
factory
,
connectionFactory
);
return
factory
;
return
factory
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizer.java
View file @
6075682e
...
@@ -22,6 +22,7 @@ import org.springframework.cache.CacheManager;
...
@@ -22,6 +22,7 @@ import org.springframework.cache.CacheManager;
* Callback interface that can be implemented by beans wishing to customize the cache
* Callback interface that can be implemented by beans wishing to customize the cache
* manager before it is fully initialized, in particular to tune its configuration.
* manager before it is fully initialized, in particular to tune its configuration.
*
*
* @param <C> The type of the {@link CacheManager}
* @author Stephane Nicoll
* @author Stephane Nicoll
* @since 1.3.3
* @since 1.3.3
*/
*/
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizerInvoker.java
View file @
6075682e
...
@@ -41,28 +41,30 @@ class CacheManagerCustomizerInvoker implements ApplicationContextAware {
...
@@ -41,28 +41,30 @@ class CacheManagerCustomizerInvoker implements ApplicationContextAware {
private
ConfigurableApplicationContext
applicationContext
;
private
ConfigurableApplicationContext
applicationContext
;
/**
/**
* Customize the specified {@link CacheManager}. Locates all
{@link CacheManagerCustomizer}
* Customize the specified {@link CacheManager}. Locates all
*
beans able to handle the specified instance and invoke
*
{@link CacheManagerCustomizer} beans able to handle the specified instance and
* {@link CacheManagerCustomizer#customize(CacheManager)} on them.
*
invoke
{@link CacheManagerCustomizer#customize(CacheManager)} on them.
* @param cacheManager the cache manager to customize
* @param cacheManager the cache manager to customize
*/
*/
public
void
customize
(
CacheManager
cacheManager
)
{
public
void
customize
(
CacheManager
cacheManager
)
{
List
<
CacheManagerCustomizer
<
CacheManager
>>
customizers
=
findCustomizers
(
cacheManager
);
List
<
CacheManagerCustomizer
<
CacheManager
>>
customizers
=
findCustomizers
(
cacheManager
);
AnnotationAwareOrderComparator
.
sort
(
customizers
);
AnnotationAwareOrderComparator
.
sort
(
customizers
);
for
(
CacheManagerCustomizer
<
CacheManager
>
customizer
:
customizers
)
{
for
(
CacheManagerCustomizer
<
CacheManager
>
customizer
:
customizers
)
{
customizer
.
customize
(
cacheManager
);
customizer
.
customize
(
cacheManager
);
}
}
}
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
private
List
<
CacheManagerCustomizer
<
CacheManager
>>
findCustomizers
(
CacheManager
cacheManager
)
{
private
List
<
CacheManagerCustomizer
<
CacheManager
>>
findCustomizers
(
CacheManager
cacheManager
)
{
if
(
this
.
applicationContext
==
null
)
{
if
(
this
.
applicationContext
==
null
)
{
return
Collections
.
emptyList
();
return
Collections
.
emptyList
();
}
}
Map
<
String
,
CacheManagerCustomizer
>
map
=
BeanFactoryUtils
Map
<
String
,
CacheManagerCustomizer
>
map
=
BeanFactoryUtils
.
beansOfTypeIncludingAncestors
(
this
.
applicationContext
.
getBeanFactory
(),
CacheManagerCustomizer
.
class
);
.
beansOfTypeIncludingAncestors
(
this
.
applicationContext
.
getBeanFactory
(),
List
<
CacheManagerCustomizer
<
CacheManager
>>
customizers
CacheManagerCustomizer
.
class
);
=
new
ArrayList
<
CacheManagerCustomizer
<
CacheManager
>>();
List
<
CacheManagerCustomizer
<
CacheManager
>>
customizers
=
new
ArrayList
<
CacheManagerCustomizer
<
CacheManager
>>();
for
(
CacheManagerCustomizer
customizer
:
map
.
values
())
{
for
(
CacheManagerCustomizer
customizer
:
map
.
values
())
{
Class
<?>
target
=
GenericTypeResolver
.
resolveTypeArgument
(
Class
<?>
target
=
GenericTypeResolver
.
resolveTypeArgument
(
customizer
.
getClass
(),
CacheManagerCustomizer
.
class
);
customizer
.
getClass
(),
CacheManagerCustomizer
.
class
);
...
@@ -73,9 +75,9 @@ class CacheManagerCustomizerInvoker implements ApplicationContextAware {
...
@@ -73,9 +75,9 @@ class CacheManagerCustomizerInvoker implements ApplicationContextAware {
return
customizers
;
return
customizers
;
}
}
@Override
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
if
(
applicationContext
instanceof
ConfigurableApplicationContext
)
{
if
(
applicationContext
instanceof
ConfigurableApplicationContext
)
{
this
.
applicationContext
=
(
ConfigurableApplicationContext
)
applicationContext
;
this
.
applicationContext
=
(
ConfigurableApplicationContext
)
applicationContext
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastCacheConfiguration.java
View file @
6075682e
...
@@ -41,10 +41,11 @@ import org.springframework.context.annotation.Import;
...
@@ -41,10 +41,11 @@ import org.springframework.context.annotation.Import;
* @see HazelcastConfigResourceCondition
* @see HazelcastConfigResourceCondition
*/
*/
@Configuration
@Configuration
@ConditionalOnClass
({
HazelcastInstance
.
class
,
HazelcastCacheManager
.
class
})
@ConditionalOnClass
({
HazelcastInstance
.
class
,
HazelcastCacheManager
.
class
})
@ConditionalOnMissingBean
(
CacheManager
.
class
)
@ConditionalOnMissingBean
(
CacheManager
.
class
)
@Conditional
(
CacheCondition
.
class
)
@Conditional
(
CacheCondition
.
class
)
@Import
({
HazelcastInstanceConfiguration
.
Existing
.
class
,
HazelcastInstanceConfiguration
.
Specific
.
class
})
@Import
({
HazelcastInstanceConfiguration
.
Existing
.
class
,
HazelcastInstanceConfiguration
.
Specific
.
class
})
class
HazelcastCacheConfiguration
{
class
HazelcastCacheConfiguration
{
}
}
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/HazelcastInstanceConfiguration.java
View file @
6075682e
...
@@ -61,7 +61,8 @@ abstract class HazelcastInstanceConfiguration {
...
@@ -61,7 +61,8 @@ abstract class HazelcastInstanceConfiguration {
location
).
getHazelcastInstance
();
location
).
getHazelcastInstance
();
return
new
CloseableHazelcastCacheManager
(
cacheHazelcastInstance
);
return
new
CloseableHazelcastCacheManager
(
cacheHazelcastInstance
);
}
}
HazelcastCacheManager
cacheManager
=
new
HazelcastCacheManager
(
existingHazelcastInstance
);
HazelcastCacheManager
cacheManager
=
new
HazelcastCacheManager
(
existingHazelcastInstance
);
this
.
customizerInvoker
.
customize
(
cacheManager
);
this
.
customizerInvoker
.
customize
(
cacheManager
);
return
cacheManager
;
return
cacheManager
;
}
}
...
@@ -90,14 +91,14 @@ abstract class HazelcastInstanceConfiguration {
...
@@ -90,14 +91,14 @@ abstract class HazelcastInstanceConfiguration {
@Bean
@Bean
public
HazelcastCacheManager
cacheManager
()
throws
IOException
{
public
HazelcastCacheManager
cacheManager
()
throws
IOException
{
HazelcastCacheManager
cacheManager
=
new
HazelcastCacheManager
(
hazelcastInstance
());
HazelcastCacheManager
cacheManager
=
new
HazelcastCacheManager
(
hazelcastInstance
());
this
.
customizerInvoker
.
customize
(
cacheManager
);
this
.
customizerInvoker
.
customize
(
cacheManager
);
return
cacheManager
;
return
cacheManager
;
}
}
}
}
/**
/**
* {@link HazelcastConfigResourceCondition} that checks if the
* {@link HazelcastConfigResourceCondition} that checks if the
* {@code spring.cache.hazelcast.config} configuration key is defined.
* {@code spring.cache.hazelcast.config} configuration key is defined.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/InfinispanCacheConfiguration.java
View file @
6075682e
...
@@ -60,7 +60,8 @@ public class InfinispanCacheConfiguration {
...
@@ -60,7 +60,8 @@ public class InfinispanCacheConfiguration {
@Bean
@Bean
public
SpringEmbeddedCacheManager
cacheManager
(
public
SpringEmbeddedCacheManager
cacheManager
(
EmbeddedCacheManager
embeddedCacheManager
)
{
EmbeddedCacheManager
embeddedCacheManager
)
{
SpringEmbeddedCacheManager
cacheManager
=
new
SpringEmbeddedCacheManager
(
embeddedCacheManager
);
SpringEmbeddedCacheManager
cacheManager
=
new
SpringEmbeddedCacheManager
(
embeddedCacheManager
);
this
.
customizerInvoker
.
customize
(
cacheManager
);
this
.
customizerInvoker
.
customize
(
cacheManager
);
return
cacheManager
;
return
cacheManager
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/DefaultJmsListenerContainerFactoryConfigurer.java
View file @
6075682e
...
@@ -63,7 +63,6 @@ public final class DefaultJmsListenerContainerFactoryConfigurer {
...
@@ -63,7 +63,6 @@ public final class DefaultJmsListenerContainerFactoryConfigurer {
this
.
jmsProperties
=
jmsProperties
;
this
.
jmsProperties
=
jmsProperties
;
}
}
/**
/**
* Configure the specified jms listener container factory. The factory can be further
* Configure the specified jms listener container factory. The factory can be further
* tuned and default settings can be overridden.
* tuned and default settings can be overridden.
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAnnotationDrivenConfiguration.java
View file @
6075682e
...
@@ -54,8 +54,7 @@ class JmsAnnotationDrivenConfiguration {
...
@@ -54,8 +54,7 @@ class JmsAnnotationDrivenConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public
DefaultJmsListenerContainerFactoryConfigurer
jmsListenerContainerFactoryConfigurer
()
{
public
DefaultJmsListenerContainerFactoryConfigurer
jmsListenerContainerFactoryConfigurer
()
{
DefaultJmsListenerContainerFactoryConfigurer
configurer
=
DefaultJmsListenerContainerFactoryConfigurer
configurer
=
new
DefaultJmsListenerContainerFactoryConfigurer
();
new
DefaultJmsListenerContainerFactoryConfigurer
();
configurer
.
setDestinationResolver
(
this
.
destinationResolver
);
configurer
.
setDestinationResolver
(
this
.
destinationResolver
);
configurer
.
setTransactionManager
(
this
.
transactionManager
);
configurer
.
setTransactionManager
(
this
.
transactionManager
);
configurer
.
setJmsProperties
(
this
.
properties
);
configurer
.
setJmsProperties
(
this
.
properties
);
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java
View file @
6075682e
...
@@ -113,7 +113,7 @@ public class EmbeddedMongoAutoConfiguration {
...
@@ -113,7 +113,7 @@ public class EmbeddedMongoAutoConfiguration {
private
ArtifactStoreBuilder
getArtifactStore
(
Logger
logger
)
{
private
ArtifactStoreBuilder
getArtifactStore
(
Logger
logger
)
{
return
new
ExtractedArtifactStoreBuilder
().
defaults
(
Command
.
MongoD
)
return
new
ExtractedArtifactStoreBuilder
().
defaults
(
Command
.
MongoD
)
.
download
(
new
DownloadConfigBuilder
().
defaultsForCommand
(
Command
.
MongoD
)
.
download
(
new
DownloadConfigBuilder
().
defaultsForCommand
(
Command
.
MongoD
)
.
progressListener
(
new
Slf4jProgressListener
(
logger
)));
.
progressListener
(
new
Slf4jProgressListener
(
logger
))
.
build
()
);
}
}
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"stop"
)
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"stop"
)
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java
View file @
6075682e
...
@@ -393,8 +393,10 @@ public class CacheAutoConfigurationTests {
...
@@ -393,8 +393,10 @@ public class CacheAutoConfigurationTests {
HazelcastCacheManager
.
class
);
HazelcastCacheManager
.
class
);
HazelcastInstance
actual
=
getHazelcastInstance
(
cacheManager
);
HazelcastInstance
actual
=
getHazelcastInstance
(
cacheManager
);
assertThat
(
actual
,
sameInstance
(
hazelcastInstance
));
assertThat
(
actual
,
sameInstance
(
hazelcastInstance
));
assertThat
(
actual
.
getConfig
().
getConfigurationUrl
(),
equalTo
(
new
ClassPathResource
(
assertThat
(
actual
.
getConfig
().
getConfigurationUrl
(),
"org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml"
).
getURL
()));
equalTo
(
new
ClassPathResource
(
"org/springframework/boot/autoconfigure/cache/hazelcast-specific.xml"
)
.
getURL
()));
cacheManager
.
getCache
(
"foobar"
);
cacheManager
.
getCache
(
"foobar"
);
assertThat
(
cacheManager
.
getCacheNames
(),
containsInAnyOrder
(
"foobar"
));
assertThat
(
cacheManager
.
getCacheNames
(),
containsInAnyOrder
(
"foobar"
));
assertThat
(
cacheManager
.
getCacheNames
(),
hasSize
(
1
));
assertThat
(
cacheManager
.
getCacheNames
(),
hasSize
(
1
));
...
@@ -431,7 +433,8 @@ public class CacheAutoConfigurationTests {
...
@@ -431,7 +433,8 @@ public class CacheAutoConfigurationTests {
HazelcastCacheManager
.
class
);
HazelcastCacheManager
.
class
);
HazelcastInstance
hazelcastInstance
=
this
.
context
HazelcastInstance
hazelcastInstance
=
this
.
context
.
getBean
(
HazelcastInstance
.
class
);
.
getBean
(
HazelcastInstance
.
class
);
assertThat
(
getHazelcastInstance
(
cacheManager
),
equalTo
((
Object
)
hazelcastInstance
));
assertThat
(
getHazelcastInstance
(
cacheManager
),
equalTo
((
Object
)
hazelcastInstance
));
assertThat
(
hazelcastInstance
.
getConfig
().
getConfigurationFile
(),
assertThat
(
hazelcastInstance
.
getConfig
().
getConfigurationFile
(),
equalTo
(
new
ClassPathResource
(
mainConfig
).
getFile
()));
equalTo
(
new
ClassPathResource
(
mainConfig
).
getFile
()));
}
}
...
@@ -610,22 +613,27 @@ public class CacheAutoConfigurationTests {
...
@@ -610,22 +613,27 @@ public class CacheAutoConfigurationTests {
return
type
.
cast
(
cacheManager
);
return
type
.
cast
(
cacheManager
);
}
}
private
void
testCustomizers
(
Class
<?>
config
,
String
cacheType
,
String
...
expectedCustomizerNames
)
{
@SuppressWarnings
(
"rawtypes"
)
private
void
testCustomizers
(
Class
<?>
config
,
String
cacheType
,
String
...
expectedCustomizerNames
)
{
load
(
config
,
"spring.cache.type="
+
cacheType
);
load
(
config
,
"spring.cache.type="
+
cacheType
);
CacheManager
cacheManager
=
validateCacheManager
(
CacheManager
.
class
);
CacheManager
cacheManager
=
validateCacheManager
(
CacheManager
.
class
);
List
<
String
>
expected
=
new
ArrayList
<
String
>();
List
<
String
>
expected
=
new
ArrayList
<
String
>();
expected
.
addAll
(
Arrays
.
asList
(
expectedCustomizerNames
));
expected
.
addAll
(
Arrays
.
asList
(
expectedCustomizerNames
));
Map
<
String
,
CacheManagerTestCustomizer
>
map
=
Map
<
String
,
CacheManagerTestCustomizer
>
map
=
this
.
context
this
.
context
.
getBeansOfType
(
CacheManagerTestCustomizer
.
class
);
.
getBeansOfType
(
CacheManagerTestCustomizer
.
class
);
for
(
Map
.
Entry
<
String
,
CacheManagerTestCustomizer
>
entry
:
map
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
CacheManagerTestCustomizer
>
entry
:
map
.
entrySet
())
{
if
(
expected
.
contains
(
entry
.
getKey
()))
{
if
(
expected
.
contains
(
entry
.
getKey
()))
{
expected
.
remove
(
entry
.
getKey
());
expected
.
remove
(
entry
.
getKey
());
assertThat
(
"Customizer with name "
+
entry
.
getKey
()
+
" should have been "
+
assertThat
(
"invoked"
,
entry
.
getValue
().
cacheManager
,
sameInstance
(
cacheManager
));
"Customizer with name "
+
entry
.
getKey
()
+
" should have been "
+
"invoked"
,
entry
.
getValue
().
cacheManager
,
sameInstance
(
cacheManager
));
}
}
else
{
else
{
assertThat
(
"Customizer with name "
+
entry
.
getKey
()
+
" should not have been"
+
assertThat
(
"Customizer with name "
+
entry
.
getKey
()
"invoked"
,
entry
.
getValue
().
cacheManager
,
nullValue
());
+
" should not have been"
+
"invoked"
,
entry
.
getValue
().
cacheManager
,
nullValue
());
}
}
}
}
assertThat
(
"The following customizers should have been invoked: "
+
expected
,
assertThat
(
"The following customizers should have been invoked: "
+
expected
,
...
@@ -641,7 +649,8 @@ public class CacheAutoConfigurationTests {
...
@@ -641,7 +649,8 @@ public class CacheAutoConfigurationTests {
this
.
context
=
applicationContext
;
this
.
context
=
applicationContext
;
}
}
private
static
HazelcastInstance
getHazelcastInstance
(
HazelcastCacheManager
cacheManager
)
{
private
static
HazelcastInstance
getHazelcastInstance
(
HazelcastCacheManager
cacheManager
)
{
return
(
HazelcastInstance
)
new
DirectFieldAccessor
(
cacheManager
)
return
(
HazelcastInstance
)
new
DirectFieldAccessor
(
cacheManager
)
.
getPropertyValue
(
"hazelcastInstance"
);
.
getPropertyValue
(
"hazelcastInstance"
);
}
}
...
@@ -681,7 +690,8 @@ public class CacheAutoConfigurationTests {
...
@@ -681,7 +690,8 @@ public class CacheAutoConfigurationTests {
}
}
@Configuration
@Configuration
@Import
({
GenericCacheConfiguration
.
class
,
CacheManagerCustomizersConfiguration
.
class
})
@Import
({
GenericCacheConfiguration
.
class
,
CacheManagerCustomizersConfiguration
.
class
})
static
class
GenericCacheAndCustomizersConfiguration
{
static
class
GenericCacheAndCustomizersConfiguration
{
}
}
...
@@ -697,7 +707,7 @@ public class CacheAutoConfigurationTests {
...
@@ -697,7 +707,7 @@ public class CacheAutoConfigurationTests {
}
}
@Configuration
@Configuration
@Import
({
RedisCacheConfiguration
.
class
,
CacheManagerCustomizersConfiguration
.
class
})
@Import
({
RedisCacheConfiguration
.
class
,
CacheManagerCustomizersConfiguration
.
class
})
static
class
RedisCacheAndCustomizersConfiguration
{
static
class
RedisCacheAndCustomizersConfiguration
{
}
}
...
@@ -775,8 +785,8 @@ public class CacheAutoConfigurationTests {
...
@@ -775,8 +785,8 @@ public class CacheAutoConfigurationTests {
}
}
@Configuration
@Configuration
@ImportAutoConfiguration
({
CacheAutoConfiguration
.
class
,
@ImportAutoConfiguration
({
CacheAutoConfiguration
.
class
,
HazelcastAutoConfiguration
.
class
})
HazelcastAutoConfiguration
.
class
})
static
class
HazelcastAndCacheConfiguration
{
static
class
HazelcastAndCacheConfiguration
{
}
}
...
@@ -795,7 +805,7 @@ public class CacheAutoConfigurationTests {
...
@@ -795,7 +805,7 @@ public class CacheAutoConfigurationTests {
}
}
@Configuration
@Configuration
@Import
({
GenericCacheConfiguration
.
class
,
RedisCacheConfiguration
.
class
})
@Import
({
GenericCacheConfiguration
.
class
,
RedisCacheConfiguration
.
class
})
static
class
CustomCacheManagerConfiguration
{
static
class
CustomCacheManagerConfiguration
{
@Bean
@Bean
...
@@ -806,7 +816,7 @@ public class CacheAutoConfigurationTests {
...
@@ -806,7 +816,7 @@ public class CacheAutoConfigurationTests {
}
}
@Configuration
@Configuration
@Import
({
GenericCacheConfiguration
.
class
,
RedisCacheConfiguration
.
class
})
@Import
({
GenericCacheConfiguration
.
class
,
RedisCacheConfiguration
.
class
})
static
class
CustomCacheManagerFromSupportConfiguration
static
class
CustomCacheManagerFromSupportConfiguration
extends
CachingConfigurerSupport
{
extends
CachingConfigurerSupport
{
...
@@ -831,7 +841,7 @@ public class CacheAutoConfigurationTests {
...
@@ -831,7 +841,7 @@ public class CacheAutoConfigurationTests {
}
}
@Configuration
@Configuration
@Import
({
GenericCacheConfiguration
.
class
,
RedisCacheConfiguration
.
class
})
@Import
({
GenericCacheConfiguration
.
class
,
RedisCacheConfiguration
.
class
})
static
class
CustomCacheResolverConfiguration
extends
CachingConfigurerSupport
{
static
class
CustomCacheResolverConfiguration
extends
CachingConfigurerSupport
{
@Override
@Override
...
@@ -869,37 +879,44 @@ public class CacheAutoConfigurationTests {
...
@@ -869,37 +879,44 @@ public class CacheAutoConfigurationTests {
@Bean
@Bean
public
CacheManagerCustomizer
<
SimpleCacheManager
>
genericCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
SimpleCacheManager
>
genericCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
SimpleCacheManager
>()
{
};
return
new
CacheManagerTestCustomizer
<
SimpleCacheManager
>()
{
};
}
}
@Bean
@Bean
public
CacheManagerCustomizer
<
RedisCacheManager
>
redisCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
RedisCacheManager
>
redisCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
RedisCacheManager
>()
{
};
return
new
CacheManagerTestCustomizer
<
RedisCacheManager
>()
{
};
}
}
@Bean
@Bean
public
CacheManagerCustomizer
<
EhCacheCacheManager
>
ehCacheCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
EhCacheCacheManager
>
ehCacheCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
EhCacheCacheManager
>()
{
};
return
new
CacheManagerTestCustomizer
<
EhCacheCacheManager
>()
{
};
}
}
@Bean
@Bean
public
CacheManagerCustomizer
<
HazelcastCacheManager
>
hazelcastCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
HazelcastCacheManager
>
hazelcastCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
HazelcastCacheManager
>()
{
};
return
new
CacheManagerTestCustomizer
<
HazelcastCacheManager
>()
{
};
}
}
@Bean
@Bean
public
CacheManagerCustomizer
<
SpringEmbeddedCacheManager
>
infinispanCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
SpringEmbeddedCacheManager
>
infinispanCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
SpringEmbeddedCacheManager
>()
{
};
return
new
CacheManagerTestCustomizer
<
SpringEmbeddedCacheManager
>()
{
};
}
}
@Bean
@Bean
public
CacheManagerCustomizer
<
GuavaCacheManager
>
guavaCacheManagerCustomizer
()
{
public
CacheManagerCustomizer
<
GuavaCacheManager
>
guavaCacheManagerCustomizer
()
{
return
new
CacheManagerTestCustomizer
<
GuavaCacheManager
>()
{
};
return
new
CacheManagerTestCustomizer
<
GuavaCacheManager
>()
{
};
}
}
}
}
static
abstract
class
CacheManagerTestCustomizer
<
C
extends
CacheManager
>
implements
CacheManagerCustomizer
<
C
>
{
static
abstract
class
CacheManagerTestCustomizer
<
C
extends
CacheManager
>
implements
CacheManagerCustomizer
<
C
>
{
private
C
cacheManager
;
private
C
cacheManager
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheManagerCustomizerInvokerTests.java
View file @
6075682e
...
@@ -54,7 +54,8 @@ public class CacheManagerCustomizerInvokerTests {
...
@@ -54,7 +54,8 @@ public class CacheManagerCustomizerInvokerTests {
@Test
@Test
public
void
customizeSimpleCacheManager
()
{
public
void
customizeSimpleCacheManager
()
{
load
(
SimpleConfiguration
.
class
,
"spring.cache.type=simple"
);
load
(
SimpleConfiguration
.
class
,
"spring.cache.type=simple"
);
ConcurrentMapCacheManager
cacheManager
=
this
.
context
.
getBean
(
ConcurrentMapCacheManager
.
class
);
ConcurrentMapCacheManager
cacheManager
=
this
.
context
.
getBean
(
ConcurrentMapCacheManager
.
class
);
assertThat
(
cacheManager
.
getCacheNames
(),
containsInAnyOrder
(
"one"
,
"two"
));
assertThat
(
cacheManager
.
getCacheNames
(),
containsInAnyOrder
(
"one"
,
"two"
));
assertThat
(
cacheManager
.
getCacheNames
(),
hasSize
(
2
));
assertThat
(
cacheManager
.
getCacheNames
(),
hasSize
(
2
));
}
}
...
@@ -68,7 +69,6 @@ public class CacheManagerCustomizerInvokerTests {
...
@@ -68,7 +69,6 @@ public class CacheManagerCustomizerInvokerTests {
verifyZeroInteractions
(
context
);
verifyZeroInteractions
(
context
);
}
}
private
void
load
(
Class
<?>
config
,
String
...
environment
)
{
private
void
load
(
Class
<?>
config
,
String
...
environment
)
{
AnnotationConfigApplicationContext
applicationContext
=
new
AnnotationConfigApplicationContext
();
AnnotationConfigApplicationContext
applicationContext
=
new
AnnotationConfigApplicationContext
();
EnvironmentTestUtils
.
addEnvironment
(
applicationContext
,
environment
);
EnvironmentTestUtils
.
addEnvironment
(
applicationContext
,
environment
);
...
@@ -78,7 +78,6 @@ public class CacheManagerCustomizerInvokerTests {
...
@@ -78,7 +78,6 @@ public class CacheManagerCustomizerInvokerTests {
this
.
context
=
applicationContext
;
this
.
context
=
applicationContext
;
}
}
@Configuration
@Configuration
@EnableCaching
@EnableCaching
static
class
SimpleConfiguration
{
static
class
SimpleConfiguration
{
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfigurationTests.java
View file @
6075682e
...
@@ -471,8 +471,7 @@ public class JmsAutoConfigurationTests {
...
@@ -471,8 +471,7 @@ public class JmsAutoConfigurationTests {
JmsListenerContainerFactory
<?>
customListenerContainerFactory
(
JmsListenerContainerFactory
<?>
customListenerContainerFactory
(
DefaultJmsListenerContainerFactoryConfigurer
configurer
,
DefaultJmsListenerContainerFactoryConfigurer
configurer
,
ConnectionFactory
connectionFactory
)
{
ConnectionFactory
connectionFactory
)
{
DefaultJmsListenerContainerFactory
factory
=
DefaultJmsListenerContainerFactory
factory
=
new
DefaultJmsListenerContainerFactory
();
new
DefaultJmsListenerContainerFactory
();
configurer
.
configure
(
factory
,
connectionFactory
);
configurer
.
configure
(
factory
,
connectionFactory
);
factory
.
setCacheLevel
(
DefaultMessageListenerContainer
.
CACHE_CONSUMER
);
factory
.
setCacheLevel
(
DefaultMessageListenerContainer
.
CACHE_CONSUMER
);
return
factory
;
return
factory
;
...
...
spring-boot-devtools/pom.xml
View file @
6075682e
...
@@ -99,7 +99,6 @@
...
@@ -99,7 +99,6 @@
<dependency>
<dependency>
<groupId>
org.eclipse.jetty.websocket
</groupId>
<groupId>
org.eclipse.jetty.websocket
</groupId>
<artifactId>
websocket-client
</artifactId>
<artifactId>
websocket-client
</artifactId>
<version>
${jetty.version}
</version>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedWebappClassLoader.java
View file @
6075682e
...
@@ -59,7 +59,7 @@ public class TomcatEmbeddedWebappClassLoader extends WebappClassLoader {
...
@@ -59,7 +59,7 @@ public class TomcatEmbeddedWebappClassLoader extends WebappClassLoader {
checkPackageAccess
(
name
);
checkPackageAccess
(
name
);
// Perform the actual load
// Perform the actual load
boolean
delegateLoad
=
(
this
.
delegate
||
filter
(
name
));
boolean
delegateLoad
=
(
this
.
delegate
||
filter
(
name
,
true
));
if
(
delegateLoad
)
{
if
(
delegateLoad
)
{
resultClass
=
(
resultClass
==
null
?
loadFromParent
(
name
)
:
resultClass
);
resultClass
=
(
resultClass
==
null
?
loadFromParent
(
name
)
:
resultClass
);
...
...
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