| 1 | |
package org.kuali.student.common.test.spring; |
| 2 | |
|
| 3 | |
import org.springframework.context.ApplicationEvent; |
| 4 | |
import org.springframework.context.ApplicationListener; |
| 5 | |
import org.springframework.context.event.ContextRefreshedEvent; |
| 6 | |
|
| 7 | 0 | public class PersistObjectsListener implements ApplicationListener { |
| 8 | |
private PersistObjectsBean persistObjectsBean; |
| 9 | |
|
| 10 | |
@Override |
| 11 | |
public void onApplicationEvent(ApplicationEvent event) { |
| 12 | 0 | if (event instanceof ContextRefreshedEvent) { |
| 13 | 0 | persistObjectsBean.loadData(); |
| 14 | |
} |
| 15 | 0 | } |
| 16 | |
|
| 17 | |
public void setPersistObjectsBean(PersistObjectsBean persistObjectsBean) { |
| 18 | 0 | this.persistObjectsBean = persistObjectsBean; |
| 19 | 0 | } |
| 20 | |
|
| 21 | |
} |