public String registerChaincodeEventListener ( Pattern chaincodeId , Pattern eventName , ChaincodeEventListener chaincodeEventListener ) throws InvalidArgumentException { if ( shutdown ) { throw new InvalidArgumentException ( format ( "Channel %s has been shutdown." , name ) ) ; } if ( chaincodeId == null ) { throw new InvalidArgumentException ( "The chaincodeId argument may not be null." ) ; } if ( eventName == null ) { throw new InvalidArgumentException ( "The eventName argument may not be null." ) ; } if ( chaincodeEventListener == null ) { throw new InvalidArgumentException ( "The chaincodeEventListener argument may not be null." ) ; } ChaincodeEventListenerEntry chaincodeEventListenerEntry = new ChaincodeEventListenerEntry ( chaincodeId , eventName , chaincodeEventListener ) ; synchronized ( this ) { if ( null == blh ) { blh = registerChaincodeListenerProcessor ( ) ; } } return chaincodeEventListenerEntry . handle ; }
Register a chaincode event listener . Both chaincodeId pattern AND eventName pattern must match to invoke the chaincodeEventListener