@Test public void testNotifyThrowsNullPointerException() throws Throwable { QMUX qMUX = new QMUX(); try { qMUX.notify("", Integer.valueOf(2)); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"org.jpos.space.LocalSpace.inp(Object)\" because \"this.sp\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(qMUX.sp, "qMUX.sp"); assertEquals(0, qMUX.listeners.size(), "qMUX.listeners.size()"); } }
@Override public void notify (Object k, Object value) { Object obj = sp.inp (k); if (obj instanceof ISOMsg) { ISOMsg m = (ISOMsg) obj; try { if (isNotifyEligible(m)) { String key = getKey (m); String req = key + ".req"; Object r = isp.inp (req); if (r != null) { if (r instanceof AsyncRequest) { ((AsyncRequest) r).responseReceived (m); } else { isp.out (key, m); } return; } } } catch (ISOException e) { LogEvent evt = getLog().createLogEvent("notify"); evt.addMessage(e); evt.addMessage(obj); Logger.log(evt); } processUnhandled (m); } }
QMUX extends QBeanSupport implements SpaceListener, MUX, QMUXMBean, Loggeable, MetricsProvider { @Override public void notify (Object k, Object value) { Object obj = sp.inp (k); if (obj instanceof ISOMsg) { ISOMsg m = (ISOMsg) obj; try { if (isNotifyEligible(m)) { String key = getKey (m); String req = key + ".req"; Object r = isp.inp (req); if (r != null) { if (r instanceof AsyncRequest) { ((AsyncRequest) r).responseReceived (m); } else { isp.out (key, m); } return; } } } catch (ISOException e) { LogEvent evt = getLog().createLogEvent("notify"); evt.addMessage(e); evt.addMessage(obj); Logger.log(evt); } processUnhandled (m); } } }
QMUX extends QBeanSupport implements SpaceListener, MUX, QMUXMBean, Loggeable, MetricsProvider { @Override public void notify (Object k, Object value) { Object obj = sp.inp (k); if (obj instanceof ISOMsg) { ISOMsg m = (ISOMsg) obj; try { if (isNotifyEligible(m)) { String key = getKey (m); String req = key + ".req"; Object r = isp.inp (req); if (r != null) { if (r instanceof AsyncRequest) { ((AsyncRequest) r).responseReceived (m); } else { isp.out (key, m); } return; } } } catch (ISOException e) { LogEvent evt = getLog().createLogEvent("notify"); evt.addMessage(e); evt.addMessage(obj); Logger.log(evt); } processUnhandled (m); } } QMUX(); }
QMUX extends QBeanSupport implements SpaceListener, MUX, QMUXMBean, Loggeable, MetricsProvider { @Override public void notify (Object k, Object value) { Object obj = sp.inp (k); if (obj instanceof ISOMsg) { ISOMsg m = (ISOMsg) obj; try { if (isNotifyEligible(m)) { String key = getKey (m); String req = key + ".req"; Object r = isp.inp (req); if (r != null) { if (r instanceof AsyncRequest) { ((AsyncRequest) r).responseReceived (m); } else { isp.out (key, m); } return; } } } catch (ISOException e) { LogEvent evt = getLog().createLogEvent("notify"); evt.addMessage(e); evt.addMessage(obj); Logger.log(evt); } processUnhandled (m); } } QMUX(); void initService(); void startService(); void stopService(); void destroyService(); static MUX getMUX(String name); ISOMsg request(ISOMsg m, long timeout); void request(ISOMsg m, long timeout, ISOResponseListener rl, Object handBack); @Override void notify(Object k, Object value); String getKey(ISOMsg m); @Override Metrics getMetrics(); synchronized void setInQueue(String in); String getInQueue(); synchronized void setOutQueue(String out); String getOutQueue(); Space getSpace(); synchronized void setUnhandledQueue(String unhandled); String getUnhandledQueue(); @SuppressWarnings("unused") String[] getReadyIndicatorNames(); void addISORequestListener(ISORequestListener l); boolean removeISORequestListener(ISORequestListener l); synchronized void resetCounters(); String getCountersAsString(); int getTXCounter(); int getRXCounter(); @Override int getTXExpired(); @Override int getTXPending(); @Override int getRXExpired(); @Override int getRXPending(); @Override int getRXUnhandled(); @Override int getRXForwarded(); long getLastTxnTimestampInMillis(); long getIdleTimeInMillis(); void send(ISOMsg m); boolean isConnected(); void dump(PrintStream p, String indent); }
QMUX extends QBeanSupport implements SpaceListener, MUX, QMUXMBean, Loggeable, MetricsProvider { @Override public void notify (Object k, Object value) { Object obj = sp.inp (k); if (obj instanceof ISOMsg) { ISOMsg m = (ISOMsg) obj; try { if (isNotifyEligible(m)) { String key = getKey (m); String req = key + ".req"; Object r = isp.inp (req); if (r != null) { if (r instanceof AsyncRequest) { ((AsyncRequest) r).responseReceived (m); } else { isp.out (key, m); } return; } } } catch (ISOException e) { LogEvent evt = getLog().createLogEvent("notify"); evt.addMessage(e); evt.addMessage(obj); Logger.log(evt); } processUnhandled (m); } } QMUX(); void initService(); void startService(); void stopService(); void destroyService(); static MUX getMUX(String name); ISOMsg request(ISOMsg m, long timeout); void request(ISOMsg m, long timeout, ISOResponseListener rl, Object handBack); @Override void notify(Object k, Object value); String getKey(ISOMsg m); @Override Metrics getMetrics(); synchronized void setInQueue(String in); String getInQueue(); synchronized void setOutQueue(String out); String getOutQueue(); Space getSpace(); synchronized void setUnhandledQueue(String unhandled); String getUnhandledQueue(); @SuppressWarnings("unused") String[] getReadyIndicatorNames(); void addISORequestListener(ISORequestListener l); boolean removeISORequestListener(ISORequestListener l); synchronized void resetCounters(); String getCountersAsString(); int getTXCounter(); int getRXCounter(); @Override int getTXExpired(); @Override int getTXPending(); @Override int getRXExpired(); @Override int getRXPending(); @Override int getRXUnhandled(); @Override int getRXForwarded(); long getLastTxnTimestampInMillis(); long getIdleTimeInMillis(); void send(ISOMsg m); boolean isConnected(); void dump(PrintStream p, String indent);  }