• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alibaba / jetcache / #405

16 Apr 2024 05:58AM UTC coverage: 0.0% (-88.9%) from 88.866%
#405

push

areyouok
add encoding to fix coverage report

0 of 5353 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/jetcache-anno/src/main/java/com/alicp/jetcache/anno/support/JetCacheBaseBeans.java
1
/**
2
 * Created on 2022/08/03.
3
 */
4
package com.alicp.jetcache.anno.support;
5

6
import com.alicp.jetcache.SimpleCacheManager;
7
import com.alicp.jetcache.support.StatInfo;
8
import org.springframework.beans.factory.annotation.Autowired;
9
import org.springframework.context.ApplicationContext;
10
import org.springframework.context.annotation.Bean;
11

12
import java.util.function.Consumer;
13

14
/**
15
 * used in non-spring-boot projects.
16
 *
17
 * @author huangli
18
 */
19
public class JetCacheBaseBeans {
×
20

21
    protected SpringConfigProvider createConfigProvider() {
22
        return new SpringConfigProvider();
×
23
    }
24

25
    @Bean(destroyMethod = "shutdown")
26
    public SpringConfigProvider springConfigProvider(
27
            @Autowired ApplicationContext applicationContext,
28
            @Autowired GlobalCacheConfig globalCacheConfig,
29
            @Autowired(required = false) EncoderParser encoderParser,
30
            @Autowired(required = false) KeyConvertorParser keyConvertorParser,
31
            @Autowired(required = false) Consumer<StatInfo> metricsCallback) {
32
        SpringConfigProvider cp = createConfigProvider();
×
33
        cp.setApplicationContext(applicationContext);
×
34
        cp.setGlobalCacheConfig(globalCacheConfig);
×
35

36
        if (encoderParser != null) {
×
37
            cp.setEncoderParser(encoderParser);
×
38
        }
39

40
        if (keyConvertorParser != null) {
×
41
            cp.setKeyConvertorParser(keyConvertorParser);
×
42
        }
43

44
        if (metricsCallback != null) {
×
45
            cp.setMetricsCallback(metricsCallback);
×
46
        }
47
        cp.init();
×
48
        return cp;
×
49
    }
50

51
    @Bean(name = "jcCacheManager",destroyMethod = "close")
52
    public SimpleCacheManager cacheManager(@Autowired ConfigProvider configProvider) {
53
        SimpleCacheManager cacheManager = new SimpleCacheManager();
×
54
        cacheManager.setCacheBuilderTemplate(configProvider.getCacheBuilderTemplate());
×
55
        return cacheManager;
×
56
    }
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc