@Test public void testRelayToSingleListenerWithoutMessageDestination() throws Exception { MotechEvent motechEvent = createEvent(); setUpListeners(SUBJECT, eventListener); eventRelay.relayQueueEvent(motechEvent); verify(eventListener, never()).handle(motechEvent); }
public void relayQueueEvent(MotechEvent event) { verifyEventNotNull(event); String messageDestination = event.getMessageDestination(); if (null != messageDestination) { EventListener listener = getEventListener(event, messageDestination); if (null != listener) { MotechEvent e = copyMotechEvent(event); handleQueueEvent(listener, e); } else { LOGGER.warn("Event listener with identifier {} not present to handle the event: {}", messageDestination, event); } } else { LOGGER.warn("Message destination not present in event: {}", event); } }
ServerEventRelay implements EventRelay, EventHandler { public void relayQueueEvent(MotechEvent event) { verifyEventNotNull(event); String messageDestination = event.getMessageDestination(); if (null != messageDestination) { EventListener listener = getEventListener(event, messageDestination); if (null != listener) { MotechEvent e = copyMotechEvent(event); handleQueueEvent(listener, e); } else { LOGGER.warn("Event listener with identifier {} not present to handle the event: {}", messageDestination, event); } } else { LOGGER.warn("Message destination not present in event: {}", event); } } }
ServerEventRelay implements EventRelay, EventHandler { public void relayQueueEvent(MotechEvent event) { verifyEventNotNull(event); String messageDestination = event.getMessageDestination(); if (null != messageDestination) { EventListener listener = getEventListener(event, messageDestination); if (null != listener) { MotechEvent e = copyMotechEvent(event); handleQueueEvent(listener, e); } else { LOGGER.warn("Event listener with identifier {} not present to handle the event: {}", messageDestination, event); } } else { LOGGER.warn("Message destination not present in event: {}", event); } } @Autowired  ServerEventRelay(OutboundEventGateway outboundEventGateway, EventListenerRegistry eventListenerRegistry, MotechEventConfig motechEventConfig,
                            EventAdmin osgiEventAdmin, BundleContext bundleContext); }
ServerEventRelay implements EventRelay, EventHandler { public void relayQueueEvent(MotechEvent event) { verifyEventNotNull(event); String messageDestination = event.getMessageDestination(); if (null != messageDestination) { EventListener listener = getEventListener(event, messageDestination); if (null != listener) { MotechEvent e = copyMotechEvent(event); handleQueueEvent(listener, e); } else { LOGGER.warn("Event listener with identifier {} not present to handle the event: {}", messageDestination, event); } } else { LOGGER.warn("Message destination not present in event: {}", event); } } @Autowired  ServerEventRelay(OutboundEventGateway outboundEventGateway, EventListenerRegistry eventListenerRegistry, MotechEventConfig motechEventConfig,
                            EventAdmin osgiEventAdmin, BundleContext bundleContext); @Override void sendEventMessage(MotechEvent event); @Override void broadcastEventMessage(MotechEvent event); void relayQueueEvent(MotechEvent event); void relayTopicEvent(MotechEvent event); @Override void handleEvent(Event osgiEvent); }
ServerEventRelay implements EventRelay, EventHandler { public void relayQueueEvent(MotechEvent event) { verifyEventNotNull(event); String messageDestination = event.getMessageDestination(); if (null != messageDestination) { EventListener listener = getEventListener(event, messageDestination); if (null != listener) { MotechEvent e = copyMotechEvent(event); handleQueueEvent(listener, e); } else { LOGGER.warn("Event listener with identifier {} not present to handle the event: {}", messageDestination, event); } } else { LOGGER.warn("Message destination not present in event: {}", event); } } @Autowired  ServerEventRelay(OutboundEventGateway outboundEventGateway, EventListenerRegistry eventListenerRegistry, MotechEventConfig motechEventConfig,
                            EventAdmin osgiEventAdmin, BundleContext bundleContext); @Override void sendEventMessage(MotechEvent event); @Override void broadcastEventMessage(MotechEvent event); void relayQueueEvent(MotechEvent event); void relayTopicEvent(MotechEvent event); @Override void handleEvent(Event osgiEvent);  }