Search in sources :

Example 6 with ISenderWithParameters

use of nl.nn.adapterframework.core.ISenderWithParameters in project iaf by ibissource.

the class SenderSeries method doSendMessage.

public String doSendMessage(String correlationID, String message, ParameterResolutionContext prc) throws SenderException, TimeOutException {
    long t1 = System.currentTimeMillis();
    for (Iterator<ISender> it = getSenderIterator(); it.hasNext(); ) {
        ISender sender = it.next();
        if (log.isDebugEnabled())
            log.debug(getLogPrefix() + "sending correlationID [" + correlationID + "] message [" + message + "] to sender [" + sender.getName() + "]");
        if (sender instanceof ISenderWithParameters) {
            message = ((ISenderWithParameters) sender).sendMessage(correlationID, message, prc);
        } else {
            message = sender.sendMessage(correlationID, message);
        }
        long t2 = System.currentTimeMillis();
        StatisticsKeeper sk = getStatisticsKeeper(sender);
        sk.addValue(t2 - t1);
        t1 = t2;
    }
    return message;
}
Also used : ISender(nl.nn.adapterframework.core.ISender) ISenderWithParameters(nl.nn.adapterframework.core.ISenderWithParameters) StatisticsKeeper(nl.nn.adapterframework.statistics.StatisticsKeeper)

Aggregations

ISenderWithParameters (nl.nn.adapterframework.core.ISenderWithParameters)6 ISender (nl.nn.adapterframework.core.ISender)5 ParameterResolutionContext (nl.nn.adapterframework.parameters.ParameterResolutionContext)3 HashMap (java.util.HashMap)2 SenderException (nl.nn.adapterframework.core.SenderException)2 StatisticsKeeper (nl.nn.adapterframework.statistics.StatisticsKeeper)2 StringWriter (java.io.StringWriter)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 Guard (nl.nn.adapterframework.util.Guard)1 XmlBuilder (nl.nn.adapterframework.util.XmlBuilder)1 TaskExecutor (org.springframework.core.task.TaskExecutor)1