Search in sources :

Example 1 with ISOFilter

use of org.jpos.iso.ISOFilter in project jPOS by jpos.

the class OneShotChannelAdaptorMK2 method addFilters.

private void addFilters(FilteredChannel channel, Element e, QFactory fact) throws ConfigurationException {
    for (Object o : e.getChildren("filter")) {
        Element f = (Element) o;
        String clazz = f.getAttributeValue("class");
        ISOFilter filter = (ISOFilter) fact.newInstance(clazz);
        fact.setLogger(filter, f);
        fact.setConfiguration(filter, f);
        String direction = f.getAttributeValue("direction");
        if (direction == null) {
            channel.addFilter(filter);
        } else if ("incoming".equalsIgnoreCase(direction)) {
            channel.addIncomingFilter(filter);
        } else if ("outgoing".equalsIgnoreCase(direction)) {
            channel.addOutgoingFilter(filter);
        } else if ("both".equalsIgnoreCase(direction)) {
            channel.addIncomingFilter(filter);
            channel.addOutgoingFilter(filter);
        }
    }
}
Also used : ISOFilter(org.jpos.iso.ISOFilter) Element(org.jdom2.Element)

Aggregations

Element (org.jdom2.Element)1 ISOFilter (org.jpos.iso.ISOFilter)1