@Test public void receiveNonMatchingNotPropagated() throws DataSinkException { NamedVehicleMessage message = new NamedVehicleMessage("foo"); sink.register(ExactKeyMatcher.buildExactMatcher(message), listener); message = new NamedVehicleMessage("bar"); sink.receive(message); sink.clearQueue(); assertThat(listener.received, nullValue()); }
public synchronized void register(KeyMatcher matcher, VehicleMessage.Listener listener, boolean persist) { MessageListenerGroup group = mMessageListeners.get(matcher); if (group == null) { group = new MessageListenerGroup(); mMessageListeners.put(matcher, group); } group.add(listener, persist); }
MessageListenerSink extends AbstractQueuedCallbackSink { public synchronized void register(KeyMatcher matcher, VehicleMessage.Listener listener, boolean persist) { MessageListenerGroup group = mMessageListeners.get(matcher); if (group == null) { group = new MessageListenerGroup(); mMessageListeners.put(matcher, group); } group.add(listener, persist); } }
MessageListenerSink extends AbstractQueuedCallbackSink { public synchronized void register(KeyMatcher matcher, VehicleMessage.Listener listener, boolean persist) { MessageListenerGroup group = mMessageListeners.get(matcher); if (group == null) { group = new MessageListenerGroup(); mMessageListeners.put(matcher, group); } group.add(listener, persist); } MessageListenerSink(); }
MessageListenerSink extends AbstractQueuedCallbackSink { public synchronized void register(KeyMatcher matcher, VehicleMessage.Listener listener, boolean persist) { MessageListenerGroup group = mMessageListeners.get(matcher); if (group == null) { group = new MessageListenerGroup(); mMessageListeners.put(matcher, group); } group.add(listener, persist); } MessageListenerSink(); synchronized void register(KeyMatcher matcher,
            VehicleMessage.Listener listener, boolean persist); synchronized void register(KeyMatcher matcher,
            VehicleMessage.Listener listener); synchronized void register(
            Class<? extends VehicleMessage> messageType,
            VehicleMessage.Listener listener); void register(Class<? extends Measurement> measurementType,
            Measurement.Listener listener); synchronized void unregister(
            Class<? extends Measurement> measurementType,
            Measurement.Listener listener); synchronized void unregister(
            Class<? extends VehicleMessage> messageType,
            VehicleMessage.Listener listener); synchronized void unregister(KeyMatcher matcher,
            VehicleMessage.Listener listener); @Override String toString(); }
MessageListenerSink extends AbstractQueuedCallbackSink { public synchronized void register(KeyMatcher matcher, VehicleMessage.Listener listener, boolean persist) { MessageListenerGroup group = mMessageListeners.get(matcher); if (group == null) { group = new MessageListenerGroup(); mMessageListeners.put(matcher, group); } group.add(listener, persist); } MessageListenerSink(); synchronized void register(KeyMatcher matcher,
            VehicleMessage.Listener listener, boolean persist); synchronized void register(KeyMatcher matcher,
            VehicleMessage.Listener listener); synchronized void register(
            Class<? extends VehicleMessage> messageType,
            VehicleMessage.Listener listener); void register(Class<? extends Measurement> measurementType,
            Measurement.Listener listener); synchronized void unregister(
            Class<? extends Measurement> measurementType,
            Measurement.Listener listener); synchronized void unregister(
            Class<? extends VehicleMessage> messageType,
            VehicleMessage.Listener listener); synchronized void unregister(KeyMatcher matcher,
            VehicleMessage.Listener listener); @Override String toString();  }