Listen to events on selective paths of the tree

@param listener listener
@param pathSelector path selector
@return builder
428327
public TreeBuilder<T> listen(Listener<T> listener, PathSelector pathSelector) {
        return TreeBuilder.<T>builder(new ListenerTree<T>(build(), listener, pathSelector));
    }
454817
public void setListener(T listener) {
		Assert.notNull(listener, "Listener must not be null");
		Assert.isTrue(isSupportedType(listener), "Listener is not of a supported type");
		this.listener = listener;
	}
1355703
private void createMultipleListeners(final SibRaMessagingEngineConnection connection) throws ResourceException
    {
        final String methodName = "createMultipleListeners";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName, connection);
        }

        try
        {
            final SICoreConnection coreConnection = connection.getConnection();

            /*
             * Create destination listener
             */

            final DestinationListener destinationListener = new SibRaDestinationListener(
                            connection, _messageEndpointFactory);

            /*
             * Determine destination type
             */

            final DestinationType destinationType = _endpointConfiguration
                            .getDestinationType();

            /*
             * Register destination listener
             */

            final SIDestinationAddress[] destinations = coreConnection
                            .addDestinationListener(_endpointConfiguration.getDestinationName(),
                                                    destinationListener,
                                                    destinationType,
                                                    DestinationAvailability.RECEIVE);

            if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
            {
                SibTr.debug(P2PTRACE, "Found " + destinations.length + " destinations that make the wildcard");
            }

            /*
             * Create a listener for each destination ...
             */

            for (int j = 0; j < destinations.length; j++)
            {
                try
                {
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
                    {
                        SibTr.debug(P2PTRACE, "Creating a consumer for destination " + destinations[j]);
                    }
                    connection.createListener(destinations[j], _messageEndpointFactory);
                } catch (final ResourceException exception)
                {
                    FFDCFilter.processException(exception, CLASS_NAME + "."
                                                           + methodName, "1:877:1.45", this);
                    SibTr.error(TRACE, "CREATE_LISTENER_FAILED_CWSIV0803",
                                new Object[] { exception,
                                              destinations[j].getDestinationName(),
                                              connection.getConnection().getMeName(),
                                              connection.getBusName() });
                }
            }
        } catch (final SIException exception)
        {
            FFDCFilter.processException(exception, CLASS_NAME + "."
                                                   + methodName, "1:889:1.45", this);
            SibTr.error(TRACE, "ADD_DESTINATION_LISTENER_FAILED_CWSIV0804",
                        new Object[] { exception, connection.getConnection().getMeName(),
                                      connection.getBusName() });
            _connections.remove(connection.getConnection().getMeUuid());
            connection.close();
        }

        if (connection.getNumberListeners() == 0)
        {
            SibTr.warning(TRACE, "NO_LISTENERS_CREATED_CWSIV0809", new Object[] { _endpointConfiguration.getDestinationName(),
                                                                                 connection.getConnection().getMeName(),
                                                                                 connection.getBusName() });
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName);
        }
    }
1188667
protected Future<T> addToListeners(
    final GenericCompletionListener<? extends Future<T>> listener) {
    if (listener == null) {
      throw new IllegalArgumentException("The listener can't be null.");
    }

    synchronized(this) {
      listeners.add(listener);
    }

    if(isDone()) {
      notifyListeners();
    }

    return this;
  }
1191737
public void addListener(final PathAlterationListener listener) {
    if (listener != null) {
      this.listeners.put(listener, new ExceptionCatchingPathAlterationListenerDecorator(listener));
    }
  }
980095
def handle_walk(self, listener: TreeListener, tree: Union[ast.Node, dict, list]) -> None:
        
        if isinstance(tree, ast.Node):
            self.walk(listener, tree)
        elif isinstance(tree, dict):
            for k in tree.keys():
                self.handle_walk(listener, tree[k])
        elif isinstance(tree, list):
            for i in range(len(tree)):
                self.handle_walk(listener, tree[i])
        else:
            pass
129740
public RetryTemplateBuilder withListener(RetryListener listener) {
		Assert.notNull(listener, "Listener should not be null");
		listenersList().add(listener);
		return this;
	}
1217577
public static @Nullable View.OnClickListener guarded(@Nullable final View.OnClickListener listener) {
		if (listener != null) {
			return new View.OnClickListener() {
				@Override
				public void onClick(View v) {
					try {
						listener.onClick(v);
					} catch (Exception e) {
						ApptentiveLog.e(e, "Exception while handling click listener");
						logException(e);
					}
				}
			};
		}

		return null;
	}
1017200
protected Future<T> removeFromListeners(
    GenericCompletionListener<? extends Future<T>> listener) {
    if (listener == null) {
      throw new IllegalArgumentException("The listener can't be null.");
    }

    if (!isDone()) {
      synchronized(this) {
        listeners.remove(listener);
      }
    }
    return this;
  }
110025
public S onSuccess(CheckedConsumer<? extends ExecutionCompletedEvent<R>> listener) {
    successListener = EventListener.of(Assert.notNull(listener, "listener"));
    return (S) this;
  }
921656
public <R extends BProgramRunnerListener> R addListener(R aListener) {
        listeners.add(aListener);
        return aListener;
    }
456639
@Override
    public void checkListener(Object listener)
    {
        if (listener instanceof SelectionListener)
        {
            selector.addListener((SelectionListener) listener);
        }
    }
944996
function (node, property, recursive, listeners) {
        // add property specific recursive listeners
        listeners = __appendListeners(node[__getListenerMetaName(property, true)], listeners);
        if (!recursive) {
            // add property specific non-recursive listeners
            listeners = __appendListeners(node[__getListenerMetaName(property)], listeners);
        }
        return listeners;
    }
1282084
public void addNameSourceListener( NameSource.Listener listener ) {
        if ( nameSourceListeners == null )
            nameSourceListeners = new ArrayList();
        nameSourceListeners.add( listener );
    }
138425
public void addListener(final NodeTypeManagerListener listener)
   {
      if (!this.listeners.containsKey(listener))
      {
         this.listeners.put(listener, listener);
      }
   }
286367
function (listenerId, f) {
    var samePathListeners = findSamePathListeners(this, listenerId);
    if (samePathListeners) {
      var descriptor = samePathListeners[listenerId];
      descriptor.disabled = true;
      Util.afterComplete(f, function () { descriptor.disabled = false; });
    } else {
      f();
    }
    return this;
  }
1176133
protected <E extends Event> void subscribeEvent(Class<E> eventClass, final Listener<E> listener) {
        locator.inject(listener);
        locator.postConstruct(listener);
        subscribe(eventClass, listener);
    }