Search in sources :

Example 1 with PipeAware

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();
}
Also used : ISender(nl.nn.adapterframework.core.ISender) PipeAware(nl.nn.adapterframework.pipes.PipeAware)

Example 2 with PipeAware

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();
    }
}
Also used : ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) Iterator(java.util.Iterator) PipeAware(nl.nn.adapterframework.pipes.PipeAware) PipeRunException(nl.nn.adapterframework.core.PipeRunException) PipeStartException(nl.nn.adapterframework.core.PipeStartException) IOException(java.io.IOException) ConfigurationException(nl.nn.adapterframework.configuration.ConfigurationException) SenderException(nl.nn.adapterframework.core.SenderException)

Aggregations

PipeAware (nl.nn.adapterframework.pipes.PipeAware)2 IOException (java.io.IOException)1 Iterator (java.util.Iterator)1 ConfigurationException (nl.nn.adapterframework.configuration.ConfigurationException)1 ISender (nl.nn.adapterframework.core.ISender)1 PipeRunException (nl.nn.adapterframework.core.PipeRunException)1 PipeStartException (nl.nn.adapterframework.core.PipeStartException)1 SenderException (nl.nn.adapterframework.core.SenderException)1