@Override public void run() { synchronized (listeners) { Input<TransactionApplicationEvents, RuntimeException> input = Inputs.iterable( Collections.singleton( transactionDomain ) ); for (Output<TransactionApplicationEvents, ? extends Throwable> listener : listeners) { try { input.transferTo( listener ); } catch (Throwable e) { logger.warn( "Could not notify event listener", e ); } } } } } );
@Test public void testIOString() throws Exception { StringBuilder sb = new StringBuilder(); iterable( byteCollection() ).transferTo( map( valueSerialization.serialize(), text( sb ) ) ); String output = sb.toString(); List<Byte> list = new ArrayList<Byte>(); text( output ).transferTo( map( valueSerialization.deserialize( Byte.class ), collection( list ) ) ); assertEquals( byteCollection(), list ); }
Inputs.iterable( Iterables.iterable( unitOfWorkDomainValue ) ).transferTo( eventOutput );