public boolean subscribe ( IProvider provider , Map < String , Object > paramMap ) { boolean success = providers . addIfAbsent ( provider ) ; // register event listener if given and just added if ( success && provider instanceof IPipeConnectionListener ) { listeners . addIfAbsent ( ( IPipeConnectionListener ) provider ) ; } return success ; }
Connect provider to this pipe . Doesn t allow to connect one provider twice . Does register event listeners if instance of IPipeConnectionListener is given .