Search in sources :

Example 1 with ISORequestListener

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

the class QMUXTest method testRemoveISORequestListener1.

@Test
public void testRemoveISORequestListener1() throws Throwable {
    QMUX qMUX = new QMUX();
    ISORequestListener l = new Connector();
    qMUX.addISORequestListener(l);
    boolean result = qMUX.removeISORequestListener(l);
    assertEquals("qMUX.listeners.size()", 0, qMUX.listeners.size());
    assertFalse("qMUX.listeners.contains(l)", qMUX.listeners.contains(l));
    assertTrue("result", result);
}
Also used : Connector(org.jpos.iso.Connector) ISORequestListener(org.jpos.iso.ISORequestListener) Test(org.junit.Test)

Example 2 with ISORequestListener

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

the class QServer method addListeners.

private void addListeners() throws ConfigurationException {
    QFactory factory = getFactory();
    Iterator iter = getPersist().getChildren("request-listener").iterator();
    while (iter.hasNext()) {
        Element l = (Element) iter.next();
        ISORequestListener listener = (ISORequestListener) factory.newInstance(l.getAttributeValue("class"));
        factory.setLogger(listener, l);
        factory.setConfiguration(listener, l);
        server.addISORequestListener(listener);
    }
}
Also used : Element(org.jdom2.Element) Iterator(java.util.Iterator) QFactory(org.jpos.q2.QFactory) ISORequestListener(org.jpos.iso.ISORequestListener)

Aggregations

ISORequestListener (org.jpos.iso.ISORequestListener)2 Iterator (java.util.Iterator)1 Element (org.jdom2.Element)1 Connector (org.jpos.iso.Connector)1 QFactory (org.jpos.q2.QFactory)1 Test (org.junit.Test)1