|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2018 the original author or authors. |
| 2 | + * Copyright 2002-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -244,20 +244,20 @@ private static void registerCacheAdvisor(Element element, ParserContext parserCo
|
244 | 244 |
|
245 | 245 | private static void registerCacheAspect(Element element, ParserContext parserContext) {
|
246 | 246 | if (!parserContext.getRegistry().containsBeanDefinition(CacheManagementConfigUtils.JCACHE_ASPECT_BEAN_NAME)) {
|
247 |
| - Object eleSource = parserContext.extractSource(element); |
| 247 | + Object source = parserContext.extractSource(element); |
248 | 248 |
|
249 |
| - BeanDefinition sourceDef = createJCacheOperationSourceBeanDefinition(element, eleSource); |
250 |
| - String sourceName = parserContext.getReaderContext().registerWithGeneratedName(sourceDef); |
| 249 | + BeanDefinition cacheOperationSourceDef = createJCacheOperationSourceBeanDefinition(element, source); |
| 250 | + String cacheOperationSourceName = parserContext.getReaderContext().registerWithGeneratedName(cacheOperationSourceDef); |
251 | 251 |
|
252 |
| - RootBeanDefinition def = new RootBeanDefinition(); |
253 |
| - def.setBeanClassName(JCACHE_ASPECT_CLASS_NAME); |
254 |
| - def.setFactoryMethodName("aspectOf"); |
255 |
| - def.getPropertyValues().add("cacheOperationSource", new RuntimeBeanReference(sourceName)); |
256 |
| - parserContext.getRegistry().registerBeanDefinition(CacheManagementConfigUtils.JCACHE_ASPECT_BEAN_NAME, def); |
| 252 | + RootBeanDefinition jcacheAspectDef = new RootBeanDefinition(); |
| 253 | + jcacheAspectDef.setBeanClassName(JCACHE_ASPECT_CLASS_NAME); |
| 254 | + jcacheAspectDef.setFactoryMethodName("aspectOf"); |
| 255 | + jcacheAspectDef.getPropertyValues().add("cacheOperationSource", new RuntimeBeanReference(cacheOperationSourceName)); |
| 256 | + parserContext.getRegistry().registerBeanDefinition(CacheManagementConfigUtils.JCACHE_ASPECT_BEAN_NAME, jcacheAspectDef); |
257 | 257 |
|
258 |
| - CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), eleSource); |
259 |
| - compositeDef.addNestedComponent(new BeanComponentDefinition(sourceDef, sourceName)); |
260 |
| - compositeDef.addNestedComponent(new BeanComponentDefinition(def, CacheManagementConfigUtils.JCACHE_ASPECT_BEAN_NAME)); |
| 258 | + CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), source); |
| 259 | + compositeDef.addNestedComponent(new BeanComponentDefinition(cacheOperationSourceDef, cacheOperationSourceName)); |
| 260 | + compositeDef.addNestedComponent(new BeanComponentDefinition(jcacheAspectDef, CacheManagementConfigUtils.JCACHE_ASPECT_BEAN_NAME)); |
261 | 261 | parserContext.registerComponent(compositeDef);
|
262 | 262 | }
|
263 | 263 | }
|
|
0 commit comments