The public method to register a new event receiver.

@param eventClass
the class of event to be received.
@param receiver
The receiver to get the event.
@param namePattern
a name pattern for the method used as handler.
@return this to enable chaining.
358387
public synchronized EventScope<T> register(final Class<? extends T> eventClass, final Object receiver,
			final Pattern namePattern) {

		final Method method = this.detectReceiverMethod(receiver, eventClass, namePattern);
		this.registerInternal(receiver, method, eventClass);
		return this;
	}
110697
@Nonnull
  public final HandlerRegistration addMessageHandler( @Nonnull final MessageEvent.Handler handler )
  {
    return _eventBus.addHandler( MessageEvent.getType(), handler );
  }
1271301
private static <T> EventInterfaceDescriptor<T> getDescriptor(Class<T> t) {
        EventInterfaceDescriptor<T> r = descriptors.get(t);
        if(r==null) {
            r = new EventInterfaceDescriptor<T>(t);
            descriptors.put(t,r);
        }
        return r;
    }
1036622
@GET
  @Produces(APPLICATION_JSON)
  @Timed
  @ExceptionMetered
  public List<String> list(@QueryParam("namePattern") final String namePattern,
                           @QueryParam("selector") final List<String> hostSelectors) {

    List<String> hosts = namePattern == null ? model.listHosts() : model.listHosts(namePattern);

    if (!hostSelectors.isEmpty()) {
      // check that all supplied selectors are parseable/valid
      final List<HostSelector> selectors = hostSelectors.stream()
          .map(selectorStr -> {
            final HostSelector parsed = HostSelector.parse(selectorStr);
            if (parsed == null) {
              throw new WebApplicationException(
                  Response.status(Response.Status.BAD_REQUEST)
                      .entity("Invalid host selector: " + selectorStr)
                      .build()
              );
            }
            return parsed;
          })
          .collect(Collectors.toList());

      final Map<String, Map<String, String>> hostsAndLabels = getLabels(hosts);

      final HostMatcher matcher = new HostMatcher(hostsAndLabels);
      hosts = matcher.getMatchingHosts(selectors);
    }

    return hosts;
  }
321038
protected <T> void setEventNotifier(Class<T> eventSet, T notifier)
    {
        _notifiers.put(eventSet,notifier);

        //
        // Register this notifier for all EventSet interfaces up the interface inheritance
        // hiearachy as well
        //
        List<Class> superEventSets = new ArrayList<Class>();
        getSuperEventSets(eventSet, superEventSets);
        Iterator<Class> i = superEventSets.iterator();
        while (i.hasNext())
        {
            Class superEventSet = i.next();
            _notifiers.put(superEventSet,notifier);
        }
    }
422051
protected <T extends DomainEvent> T registerEvent(T event) {
        Assert.notNull(event, "Domain event must not be null!");

        this.domainEvents.add(event);
        return event;
    }
826185
public <T> void register(Class<T> event, EventObserver<T> observer){
        if(event == null){
            throw new IllegalArgumentException("Null Event type passed to register");
        }
        if(observer == null){
            throw new IllegalArgumentException("Null observer passed to register");
        }
        nullSafeGet(event).add(observer);
    }
761533
public EventDispatcher getEventDispatcher(EventPublisher source) {
	EventDispatcher ret = dispatchers.get(source);
	if (ret == null) {
	    ret = createDispatcher(source);
	}
	return ret;
    }
982259
private void tfClassNameActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_tfClassNameActionPerformed
    {//GEN-HEADEREND:event_tfClassNameActionPerformed
        // Commit on ENTER
        aTable.setClassName(tfClassName.getText());
    }
423338
protected boolean makeClassForNameCall(Expression origin, Expression receiver, Expression message, Expression arguments) {
        if (! (receiver instanceof ClassExpression)) return false;
        ClassExpression ce = (ClassExpression) receiver;
        if (!ClassHelper.CLASS_Type.equals(ce.getType())) return false;
        String msg = getMethodName(message);
        if (!"forName".equals(msg)) return false;
        ArgumentListExpression ae = makeArgumentList(arguments);
        if (ae.getExpressions().size()!=1) return false;
        return writeDirectMethodCall(CLASS_FOR_NAME_STRING,false, receiver, ae);
    }
196161
protected final <U extends GenericEvent> void bind(
      EventBus eventBus,
      List<HandlerRegistration> registrations,
      Class<U> type,
      GenericEventHandler handler) {
    registrations.add(eventBus.addHandler(GenericEventType.getTypeOf(type), handler));
  }
848675
public static void registerSigner(
            final String signerType,
            final Class<? extends Signer> signerClass) {

        if (signerType == null) {
            throw new IllegalArgumentException("signerType cannot be null");
        }
        if (signerClass == null) {
            throw new IllegalArgumentException("signerClass cannot be null");
        }

        SIGNERS.put(signerType, signerClass);
    }
258161
private String registerChaincodeListenerProcessor() throws InvalidArgumentException {
        logger.debug(format("Channel %s registerChaincodeListenerProcessor starting", name));

        // Chaincode event listener is internal Block listener for chaincode events.

        return registerBlockListener(blockEvent -> {

            if (chainCodeListeners.isEmpty()) {
                return;
            }

            LinkedList<ChaincodeEvent> chaincodeEvents = new LinkedList<>();

            //Find the chaincode events in the transactions.

            for (TransactionEvent transactionEvent : blockEvent.getTransactionEvents()) {

                logger.debug(format("Channel %s got event for transaction %s ", name, transactionEvent.getTransactionID()));

                for (BlockInfo.TransactionEnvelopeInfo.TransactionActionInfo info : transactionEvent.getTransactionActionInfos()) {

                    ChaincodeEvent event = info.getEvent();
                    if (null != event) {
                        chaincodeEvents.add(event);
                    }

                }

            }

            if (!chaincodeEvents.isEmpty()) {

                class MatchPair {
                    final ChaincodeEventListenerEntry eventListener;
                    final ChaincodeEvent event;

                    MatchPair(ChaincodeEventListenerEntry eventListener, ChaincodeEvent event) {
                        this.eventListener = eventListener;
                        this.event = event;
                    }
                }

                List<MatchPair> matches = new LinkedList<>(); //Find matches.

                synchronized (chainCodeListeners) {

                    for (ChaincodeEventListenerEntry chaincodeEventListenerEntry : chainCodeListeners.values()) {

                        for (ChaincodeEvent chaincodeEvent : chaincodeEvents) {

                            if (chaincodeEventListenerEntry.isMatch(chaincodeEvent)) {

                                matches.add(new MatchPair(chaincodeEventListenerEntry, chaincodeEvent));
                            }

                        }

                    }
                }

                //fire events
                for (MatchPair match : matches) {

                    ChaincodeEventListenerEntry chaincodeEventListenerEntry = match.eventListener;
                    ChaincodeEvent ce = match.event;
                    chaincodeEventListenerEntry.fire(blockEvent, ce);

                }

            }

        });
    }
244520
@Override
  public JAnnotation getAnnotation(String name)
  {
    Annotation []ann = _class.getAnnotations();

    for (int i = 0; i < ann.length; i++) {
      if (ann[i].annotationType().getName().equals(name))
        return new JAnnotationWrapper(ann[i]);
    }

    return null;
  }
333296
public void setHandler(String handlerClassName) {

        try {
            m_handler = (I_CmsStaticExportHandler)Class.forName(handlerClassName).newInstance();
        } catch (Exception e) {
            // should never happen
            LOG.error(e.getLocalizedMessage(), e);
        }
    }
531427
protected <E extends Event> Listener subscribeSystemEvent(Class<E> eventClass, final Class<? extends Listener<E>> listenerClass) {
        Listener<E> listener = locator.createAndInitialize(listenerClass);
        SystemEventBus.subscribe(eventClass, listener);
        return listener;
    }
271196
function register(string $name, string $class) {
        if(!\in_array('CharlotteDunois\Yasmin\Interfaces\WSEventInterface', \class_implements($class))) {
            throw new \RuntimeException('Specified event class does not implement interface');
        }
        
        $this->wsevents[$name] = new $class($this->wshandler->wsmanager->client, $this->wshandler->wsmanager);
    }