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

3
import com.alicp.jetcache.anno.aop.CacheAdvisor;
4
import com.alicp.jetcache.anno.aop.JetCacheInterceptor;
5
import org.springframework.beans.BeansException;
6
import org.springframework.beans.factory.config.BeanDefinition;
7
import org.springframework.context.ApplicationContext;
8
import org.springframework.context.ApplicationContextAware;
9
import org.springframework.context.annotation.Bean;
10
import org.springframework.context.annotation.Configuration;
11
import org.springframework.context.annotation.ImportAware;
12
import org.springframework.context.annotation.Role;
13
import org.springframework.core.annotation.AnnotationAttributes;
14
import org.springframework.core.type.AnnotationMetadata;
15

16
/**
17
 * Created on 2016/11/16.
18
 *
19
 * @author huangli
20
 */
21
@Configuration
22
public class JetCacheProxyConfiguration implements ImportAware, ApplicationContextAware {
×
23

24
    protected AnnotationAttributes enableMethodCache;
25
    private ApplicationContext applicationContext;
26

27
    @Override
28
    public void setImportMetadata(AnnotationMetadata importMetadata) {
29
        this.enableMethodCache = AnnotationAttributes.fromMap(
×
30
                importMetadata.getAnnotationAttributes(EnableMethodCache.class.getName(), false));
×
31
        if (this.enableMethodCache == null) {
×
32
            throw new IllegalArgumentException(
×
33
                    "@EnableMethodCache is not present on importing class " + importMetadata.getClassName());
×
34
        }
35
    }
×
36

37
    @Override
38
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
39
        this.applicationContext = applicationContext;
×
40
    }
×
41

42
    @Bean(name = CacheAdvisor.CACHE_ADVISOR_BEAN_NAME)
43
    @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
44
    public CacheAdvisor jetcacheAdvisor(JetCacheInterceptor jetCacheInterceptor) {
45
        CacheAdvisor advisor = new CacheAdvisor();
×
46
        advisor.setAdvice(jetCacheInterceptor);
×
47
        advisor.setBasePackages(this.enableMethodCache.getStringArray("basePackages"));
×
48
        advisor.setOrder(this.enableMethodCache.<Integer>getNumber("order"));
×
49
        return advisor;
×
50
    }
51

52
    @Bean
53
    @Role(BeanDefinition.ROLE_INFRASTRUCTURE)
54
    public JetCacheInterceptor jetCacheInterceptor() {
55
        return new JetCacheInterceptor();
×
56
    }
57

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