use of nl.nn.adapterframework.pipes.PipeAware in project iaf by ibissource.
the class SenderSeries method configure.
public void configure() throws ConfigurationException {
for (Iterator<ISender> it = getSenderIterator(); it.hasNext(); ) {
ISender sender = it.next();
if (sender instanceof PipeAware) {
((PipeAware) sender).setPipe(getPipe());
}
sender.configure();
}
super.configure();
}
use of nl.nn.adapterframework.pipes.PipeAware in project iaf by ibissource.
the class StreamTransformerPipe method configure.
public void configure() throws ConfigurationException {
super.configure();
if (registeredManagers.size() == 0) {
log.info(getLogPrefix(null) + "creating default manager");
IRecordHandlerManager manager = new RecordHandlerManager();
manager.setInitial(true);
manager.setName("default");
RecordHandlingFlow flow = new RecordHandlingFlow();
flow.setRecordKey("*");
Iterator itrch = registeredRecordHandlers.keySet().iterator();
if (itrch.hasNext()) {
String recordHandlerName = (String) itrch.next();
flow.setRecordHandlerRef(recordHandlerName);
}
Iterator itrsh = registeredResultHandlers.keySet().iterator();
if (itrsh.hasNext()) {
String resultHandlerName = (String) itrsh.next();
flow.setResultHandlerRef(resultHandlerName);
}
manager.addHandler(flow);
try {
registerManager(manager);
} catch (Exception e) {
throw new ConfigurationException(getLogPrefix(null) + "could not register default manager and flow");
}
}
if (initialManager == null) {
throw new ConfigurationException(getLogPrefix(null) + "no initial manager specified");
}
for (Iterator it = registeredManagers.keySet().iterator(); it.hasNext(); ) {
String managerName = (String) it.next();
IRecordHandlerManager manager = getManager(managerName);
manager.configure(registeredManagers, registeredRecordHandlers, registeredResultHandlers, defaultHandler);
}
for (Iterator it = registeredRecordHandlers.keySet().iterator(); it.hasNext(); ) {
String recordHandlerName = (String) it.next();
IRecordHandler handler = getRecordHandler(recordHandlerName);
if (handler instanceof PipeAware) {
((PipeAware) handler).setPipe(this);
}
handler.configure();
}
for (Iterator it = registeredResultHandlers.keySet().iterator(); it.hasNext(); ) {
String resultHandlerName = (String) it.next();
IResultHandler handler = getResultHandler(resultHandlerName);
handler.configure();
}
}
Aggregations