Revision 484431ef
Added by Katja Luther over 12 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmApplicationAwareDefaultImport.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.HashMap; |
13 | 13 |
import java.util.Map; |
14 |
import java.util.Set; |
|
15 | 14 |
|
16 | 15 |
import org.apache.log4j.Logger; |
17 | 16 |
import org.springframework.beans.BeansException; |
... | ... | |
44 | 43 |
/* (non-Javadoc) |
45 | 44 |
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) |
46 | 45 |
*/ |
47 |
public void setApplicationContext(ApplicationContext applicationContext) |
|
48 |
throws BeansException { |
|
46 |
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { |
|
49 | 47 |
this.applicationContext = applicationContext; |
50 | 48 |
} |
51 | 49 |
|
... | ... | |
114 | 112 |
ICdmIO cdmIo = (ICdmIO)applicationContext.getBean(ioBeanName, ICdmIO.class); |
115 | 113 |
if (cdmIo != null){ |
116 | 114 |
registerObservers(config, cdmIo); |
115 |
state.setCurrentIO(cdmIo); |
|
117 | 116 |
result &= cdmIo.check(state); |
118 | 117 |
unRegisterObservers(config, cdmIo); |
119 | 118 |
}else{ |
... | ... | |
167 | 166 |
ImportStateBase state = config.getNewState(); |
168 | 167 |
state.initialize(config); |
169 | 168 |
|
170 |
|
|
169 |
state.setSuccess(true); |
|
171 | 170 |
//do invoke for each class |
172 | 171 |
for (Class<ICdmIO> ioClass: config.getIoClassList()){ |
173 | 172 |
try { |
174 | 173 |
String ioBeanName = getComponentBeanName(ioClass); |
175 | 174 |
ICdmIO cdmIo = (ICdmIO)applicationContext.getBean(ioBeanName, ICdmIO.class); |
176 | 175 |
if (cdmIo != null){ |
177 |
// result &= cdmIo.invoke(config, stores);
|
|
176 |
registerObservers(config, cdmIo);
|
|
178 | 177 |
state.setCurrentIO(cdmIo); |
179 | 178 |
result &= cdmIo.invoke(state); |
179 |
unRegisterObservers(config, cdmIo); |
|
180 | 180 |
}else{ |
181 | 181 |
logger.error("cdmIO was null"); |
182 | 182 |
result = false; |
Also available in: Unified diff
trunk merged into branch