@Override
    public void listen(final Component<?> linkedObject, final WaveChecker waveChecker, final Method method, final WaveType... waveTypes) throws JRebirthThreadException {

        JRebirth.checkJIT();

        // For each given wave type, add linked Object to call
        for (final WaveType waveType : waveTypes) {

            // IF this wave type isn't registered into the map, we add it with an empty list of LinkedObject
            if (!this.notifierMap.containsKey(waveType)) {
                this.notifierMap.put(waveType, LoopBuilder.newSubscription(waveType));
            }
            // Retrieve the list associated to this Wave Type
            final WaveSubscription ws = this.notifierMap.get(waveType);

            // Remove the linked object to unregister it
            boolean contains = false;
            for (int i = 0; !contains && i < ws.getWaveHandlers().size(); i++) {
                if (ws.getWaveHandlers().get(i).getWaveReady().equals(linkedObject)) {
                    contains = true;
                }
            }
            if (ws.getWaveHandlers().isEmpty() || !contains) {
                // Add the linked object if the list is empty or if the object isn't yet contained
                ws.getWaveHandlers().add(LoopBuilder.newHandler(linkedObject, waveChecker, method));
            }

            // // Manage return wave type registration
            // WaveType returnWaveType = waveType.returnWaveType();
            // if (returnWaveType != null) {
            // listen(linkedObject, waveChecker, method, returnWaveType);
            // }
        }
    }
@ Override public void listen ( final Component < ? > linkedObject , final WaveChecker waveChecker , final Method method , final WaveType ... waveTypes ) throws JRebirthThreadException { JRebirth . checkJIT ( ) ; for ( final WaveType waveType : waveTypes ) { if ( ! this . notifierMap . containsKey ( waveType ) ) { this . notifierMap . put ( waveType , LoopBuilder . newSubscription ( waveType ) ) ; } final WaveSubscription ws = this . notifierMap . get ( waveType ) ; boolean contains = false ; for ( int i = 0 ; ! contains && i < ws . getWaveHandlers ( ) . size ( ) ; i ++ ) { if ( ws . getWaveHandlers ( ) . get ( i ) . getWaveReady ( ) . equals ( linkedObject ) ) { contains = true ; } } if ( ws . getWaveHandlers ( ) . isEmpty ( ) || ! contains ) { ws . getWaveHandlers ( ) . add ( LoopBuilder . newHandler ( linkedObject , waveChecker , method ) ) ; } } }
{@inheritDoc}