• 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/SpringConfigProvider.java
1
package com.alicp.jetcache.anno.support;
2

3
import com.alicp.jetcache.CacheManager;
4
import com.alicp.jetcache.anno.method.SpringCacheContext;
5
import com.alicp.jetcache.support.StatInfo;
6
import org.springframework.beans.BeansException;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.context.ApplicationContext;
9
import org.springframework.context.ApplicationContextAware;
10

11
import java.util.function.Consumer;
12

13
/**
14
 * Created on 2016/12/1.
15
 *
16
 * @author huangli
17
 */
18
public class SpringConfigProvider extends ConfigProvider implements ApplicationContextAware {
19
    private ApplicationContext applicationContext;
20

21
    public SpringConfigProvider() {
22
        super();
×
23
        encoderParser = new DefaultSpringEncoderParser();
×
24
        keyConvertorParser = new DefaultSpringKeyConvertorParser();
×
25
    }
×
26

27
    @Override
28
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
29
        this.applicationContext = applicationContext;
×
30
    }
×
31

32
    @Override
33
    protected void doInit() {
34
        if (encoderParser instanceof ApplicationContextAware) {
×
35
            ((ApplicationContextAware) encoderParser).setApplicationContext(applicationContext);
×
36
        }
37
        if (keyConvertorParser instanceof ApplicationContextAware) {
×
38
            ((ApplicationContextAware) keyConvertorParser).setApplicationContext(applicationContext);
×
39
        }
40
        super.doInit();
×
41
    }
×
42

43
    @Override
44
    public CacheContext newContext(CacheManager cacheManager) {
45
        return new SpringCacheContext(cacheManager, this, globalCacheConfig, applicationContext);
×
46
    }
47

48
    @Autowired(required = false)
49
    @Override
50
    public void setEncoderParser(EncoderParser encoderParser) {
51
        super.setEncoderParser(encoderParser);
×
52
    }
×
53

54
    @Autowired(required = false)
55
    @Override
56
    public void setKeyConvertorParser(KeyConvertorParser keyConvertorParser) {
57
        super.setKeyConvertorParser(keyConvertorParser);
×
58
    }
×
59

60
    @Autowired(required = false)
61
    @Override
62
    public void setMetricsCallback(Consumer<StatInfo> metricsCallback) {
63
        super.setMetricsCallback(metricsCallback);
×
64
    }
×
65

66
}
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