Fixes JIRA issue SGF-259 involving circular dependencies between an Async Event Queue and corresponding, registered Async Event Listener.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.gemfire.config;
|
||||
|
||||
import org.springframework.beans.factory.config.RuntimeBeanReference;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
|
||||
import org.springframework.beans.factory.xml.ParserContext;
|
||||
@@ -46,6 +47,10 @@ public class AsyncEventQueueParser extends AbstractSingleBeanDefinitionParser {
|
||||
|
||||
builder.addPropertyValue("asyncEventListener", asyncEventListener);
|
||||
|
||||
if (asyncEventListener instanceof RuntimeBeanReference) {
|
||||
builder.addDependsOn(((RuntimeBeanReference) asyncEventListener).getBeanName());
|
||||
}
|
||||
|
||||
String cacheRefAttribute = element.getAttribute("cache-ref");
|
||||
|
||||
String cacheName = (StringUtils.hasText(cacheRefAttribute) ? cacheRefAttribute
|
||||
@@ -79,6 +84,7 @@ public class AsyncEventQueueParser extends AbstractSingleBeanDefinitionParser {
|
||||
|
||||
int i = 0;
|
||||
String name = regionName + ".asyncEventQueue#" + i;
|
||||
|
||||
while (parserContext.getRegistry().isBeanNameInUse(name)) {
|
||||
i++;
|
||||
name = regionName + ".asyncEventQueue#" + i;
|
||||
|
||||
Reference in New Issue
Block a user