private final ComputingCache<Interceptor<?>, InterceptorClassMetadata<?>> cdiInterceptorMetadataCache;
private final Function<Interceptor<?>, InterceptorClassMetadata<?>> interceptorToInterceptorMetadataFunction;
public InterceptorMetadataReader(final BeanManagerImpl manager) {
this.manager = manager;
final ComputingCacheBuilder cacheBuilder = ComputingCacheBuilder.newBuilder();
this.plainInterceptorMetadataCache = cacheBuilder.build(new Function<Class<?>, InterceptorClassMetadata<?>>() {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public InterceptorClassMetadata<?> apply(Class<?> key) {
EnhancedAnnotatedType<?> type = manager.getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(key, manager.getId());
InterceptorFactory<?> factory = PlainInterceptorFactory.of(key, manager);
return new InterceptorMetadataImpl(key, factory, InterceptorMetadataUtils.buildMethodMap(type, false, manager));
}
});
this.cdiInterceptorMetadataCache = cacheBuilder.build(new Function<Interceptor<?>, InterceptorClassMetadata<?>>() {
@Override
public InterceptorClassMetadata<?> apply(Interceptor<?> key) {
return CustomInterceptorMetadata.of(key);
}
});