SEC-1593: Added tests to try to reproduce issue.

This commit is contained in:
Luke Taylor
2010-11-03 19:37:25 +00:00
parent 1c8d28501c
commit b9a98613eb
2 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
package org.springframework.security;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import java.util.*;
/**
* @author Luke Taylor
*/
public class BeanNameCollectingPostProcessor implements BeanPostProcessor {
Set<String> beforeInitPostProcessedBeans = new HashSet<String>();
Set<String> afterInitPostProcessedBeans = new HashSet<String>();
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (beanName != null) {
beforeInitPostProcessedBeans.add(beanName);
}
return bean;
}
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (beanName != null) {
afterInitPostProcessedBeans.add(beanName);
}
return bean;
}
}