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
064f6eea
Commit
064f6eea
authored
Feb 18, 2021
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.4.x'
Closes gh-25354
parents
29ab9fd5
c5d41234
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
CacheConfigurations.java
...amework/boot/autoconfigure/cache/CacheConfigurations.java
+19
-18
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CacheConfigurations.java
View file @
064f6eea
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
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.
...
...
@@ -27,24 +27,25 @@ import org.springframework.util.Assert;
*
* @author Phillip Webb
* @author Eddú Meléndez
* @author Sebastien Deleuze
*/
@SuppressWarnings
(
"deprecation"
)
final
class
CacheConfigurations
{
private
static
final
Map
<
CacheType
,
Class
<?>
>
MAPPINGS
;
private
static
final
Map
<
CacheType
,
String
>
MAPPINGS
;
static
{
Map
<
CacheType
,
Class
<?>
>
mappings
=
new
EnumMap
<>(
CacheType
.
class
);
mappings
.
put
(
CacheType
.
GENERIC
,
GenericCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
EHCACHE
,
EhCacheCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
HAZELCAST
,
HazelcastCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
INFINISPAN
,
InfinispanCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
JCACHE
,
JCacheCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
COUCHBASE
,
CouchbaseCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
REDIS
,
RedisCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
CAFFEINE
,
CaffeineCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
SIMPLE
,
SimpleCacheConfiguration
.
class
);
mappings
.
put
(
CacheType
.
NONE
,
NoOpCacheConfiguration
.
class
);
Map
<
CacheType
,
String
>
mappings
=
new
EnumMap
<>(
CacheType
.
class
);
mappings
.
put
(
CacheType
.
GENERIC
,
GenericCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
EHCACHE
,
EhCacheCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
HAZELCAST
,
HazelcastCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
INFINISPAN
,
InfinispanCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
JCACHE
,
JCacheCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
COUCHBASE
,
CouchbaseCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
REDIS
,
RedisCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
CAFFEINE
,
CaffeineCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
SIMPLE
,
SimpleCacheConfiguration
.
class
.
getName
()
);
mappings
.
put
(
CacheType
.
NONE
,
NoOpCacheConfiguration
.
class
.
getName
()
);
MAPPINGS
=
Collections
.
unmodifiableMap
(
mappings
);
}
...
...
@@ -52,14 +53,14 @@ final class CacheConfigurations {
}
static
String
getConfigurationClass
(
CacheType
cacheType
)
{
Class
<?>
configurationClass
=
MAPPINGS
.
get
(
cacheType
);
Assert
.
state
(
configurationClass
!=
null
,
()
->
"Unknown cache type "
+
cacheType
);
return
configurationClass
.
getName
()
;
String
configurationClassName
=
MAPPINGS
.
get
(
cacheType
);
Assert
.
state
(
configurationClass
Name
!=
null
,
()
->
"Unknown cache type "
+
cacheType
);
return
configurationClass
Name
;
}
static
CacheType
getType
(
String
configurationClassName
)
{
for
(
Map
.
Entry
<
CacheType
,
Class
<?>
>
entry
:
MAPPINGS
.
entrySet
())
{
if
(
entry
.
getValue
().
getName
().
equals
(
configurationClassName
))
{
for
(
Map
.
Entry
<
CacheType
,
String
>
entry
:
MAPPINGS
.
entrySet
())
{
if
(
entry
.
getValue
().
equals
(
configurationClassName
))
{
return
entry
.
getKey
();
}
}
...
...
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