src/main/java/org/hyperledger/fabric/sdk/Channel.java
/**
     * Own block listener to manage transactions.
     *
     * @return
     */
Own block listener to manage transactions.
@return
Own block listener to manage transactions . @return
private String registerTransactionListenerProcessor() throws InvalidArgumentException {
        logger.debug(format("Channel %s registerTransactionListenerProcessor starting", name));
        return registerBlockListener(blockEvent -> {
            if (txListeners.isEmpty()) {
                return;
            }
            for (TransactionEvent transactionEvent : blockEvent.getTransactionEvents()) {
                logger.debug(format("Channel %s got event for transaction %s ", name, transactionEvent.getTransactionID()));
                List<TL> txL = new ArrayList<>(txListeners.size() + 2);
                synchronized (txListeners) {
                    LinkedList<TL> list = txListeners.get(transactionEvent.getTransactionID());
                    if (null != list) {
                        txL.addAll(list);
                    }
                }
                for (TL l : txL) {
                    try {
                        if (l.eventReceived(transactionEvent)) {
                            l.fire(transactionEvent);
                        }
                    } catch (Throwable e) {
                        logger.error(e); 
                    }
                }
            }
        });
    }
private String registerTransactionListenerProcessor ( ) throws InvalidArgumentException { logger . debug ( format ( "Channel %s registerTransactionListenerProcessor starting" , name ) ) ; return registerBlockListener ( blockEvent -> { if ( txListeners . isEmpty ( ) ) { return ; } for ( TransactionEvent transactionEvent : blockEvent . getTransactionEvents ( ) ) { logger . debug ( format ( "Channel %s got event for transaction %s " , name , transactionEvent . getTransactionID ( ) ) ) ; List < TL > txL = new ArrayList < > ( txListeners . size ( ) + 2 ) ; synchronized ( txListeners ) { LinkedList < TL > list = txListeners . get ( transactionEvent . getTransactionID ( ) ) ; if ( null != list ) { txL . addAll ( list ) ; } } for ( TL l : txL ) { try { if ( l . eventReceived ( transactionEvent ) ) { l . fire ( transactionEvent ) ; } } catch ( Throwable e ) { logger . error ( e ) ; } } } } ) ; }
Own block listener to manage transactions.
Own block listener to manage transactions .
// Transaction listener is internal Block listener for transactions // only if we get events from each eventhub on the channel fire the transactions event. //   if (getEventHubs().containsAll(l.eventReceived(transactionEvent.getEventHub()))) { // Don't let one register stop rest.