@Test public void shouldCallOnEventInSequence() throws Exception { final int[] event = { 7 }; final long sequence = 3L; final boolean endOfBatch = true; final AggregateEventHandler<int[]> aggregateEventHandler = new AggregateEventHandler<int[]>( eh1, eh2, eh3); aggregateEventHandler.onEvent(event, sequence, endOfBatch); assertLastEvent(event, sequence, eh1, eh2, eh3); }
@Override public void onEvent(final T event, final long sequence, final boolean endOfBatch) throws Exception { for (final EventHandler<T> eventHandler : eventHandlers) { eventHandler.onEvent(event, sequence, endOfBatch); } }
AggregateEventHandler implements EventHandler<T>, LifecycleAware { @Override public void onEvent(final T event, final long sequence, final boolean endOfBatch) throws Exception { for (final EventHandler<T> eventHandler : eventHandlers) { eventHandler.onEvent(event, sequence, endOfBatch); } } }
AggregateEventHandler implements EventHandler<T>, LifecycleAware { @Override public void onEvent(final T event, final long sequence, final boolean endOfBatch) throws Exception { for (final EventHandler<T> eventHandler : eventHandlers) { eventHandler.onEvent(event, sequence, endOfBatch); } } AggregateEventHandler(final EventHandler<T>... eventHandlers); }
AggregateEventHandler implements EventHandler<T>, LifecycleAware { @Override public void onEvent(final T event, final long sequence, final boolean endOfBatch) throws Exception { for (final EventHandler<T> eventHandler : eventHandlers) { eventHandler.onEvent(event, sequence, endOfBatch); } } AggregateEventHandler(final EventHandler<T>... eventHandlers); @Override void onEvent(final T event, final long sequence, final boolean endOfBatch); @Override void onStart(); @Override void onShutdown(); }
AggregateEventHandler implements EventHandler<T>, LifecycleAware { @Override public void onEvent(final T event, final long sequence, final boolean endOfBatch) throws Exception { for (final EventHandler<T> eventHandler : eventHandlers) { eventHandler.onEvent(event, sequence, endOfBatch); } } AggregateEventHandler(final EventHandler<T>... eventHandlers); @Override void onEvent(final T event, final long sequence, final boolean endOfBatch); @Override void onStart(); @Override void onShutdown();  }