Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broken-petclinic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s61200
broken-petclinic
Commits
3c9afdc1
Commit
3c9afdc1
authored
6 years ago
by
Stephane Nicoll
Browse files
Options
Downloads
Patches
Plain Diff
Polish
parent
5ff057d9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/springframework/samples/petclinic/system/CacheConfiguration.java
+9
-9
9 additions, 9 deletions
...ramework/samples/petclinic/system/CacheConfiguration.java
with
9 additions
and
9 deletions
src/main/java/org/springframework/samples/petclinic/system/CacheConfig.java
→
src/main/java/org/springframework/samples/petclinic/system/CacheConfig
uration
.java
+
9
−
9
View file @
3c9afdc1
package
org.springframework.samples.petclinic.system
;
import
javax.cache.configuration.Configuration
;
import
javax.cache.configuration.MutableConfiguration
;
import
org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer
;
import
org.springframework.cache.annotation.EnableCaching
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@
org
.
springframework
.
context
.
annotation
.
Configuration
@Configuration
@EnableCaching
class
CacheConfig
{
class
CacheConfig
uration
{
@Bean
public
JCacheManagerCustomizer
cacheManager
Customizer
()
{
public
JCacheManagerCustomizer
petclinicCacheConfiguration
Customizer
()
{
return
cm
->
{
Configuration
<
Object
,
Object
>
cacheConfiguration
=
createCacheConfiguration
();
cm
.
createCache
(
"vets"
,
cacheConfiguration
);
cm
.
createCache
(
"vets"
,
cacheConfiguration
());
};
}
private
Configuration
<
Object
,
Object
>
c
reateC
acheConfiguration
()
{
// Create a cache using infinite heap. A real application will want to use a
n
// implementation
dependent
configuration that will better fit your needs
private
javax
.
cache
.
configuration
.
Configuration
<
Object
,
Object
>
cacheConfiguration
()
{
// Create a cache using infinite heap. A real application will want to use a
more fine-grained configuration,
//
possibly using an
implementation
-
dependent
API
return
new
MutableConfiguration
<>().
setStatisticsEnabled
(
true
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment