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);
}
}
}