/**
* @see CachingListenerValidator#validate(Object, int, ParserContext)
*/
public void validate(Object cachingListener, int index,
ParserContext parserContext) throws IllegalStateException {
BeanDefinitionRegistry registry = parserContext.getRegistry();
BeanDefinition beanDefinition = null;
if (cachingListener instanceof RuntimeBeanReference) {
String beanName = ((RuntimeBeanReference) cachingListener).getBeanName();
beanDefinition = registry.getBeanDefinition(beanName);
} else if (cachingListener instanceof BeanDefinitionHolder) {
beanDefinition = ((BeanDefinitionHolder) cachingListener)
.getBeanDefinition();
} else {