注册特定消息格式的处理单元

@param clazz 特定的消息类
@param handler
357641
public static void registerMessageHandler(Class<? extends AVIMMessage> clazz,
                                            MessageHandler<?> handler) {
    Set<MessageHandler> handlerSet = new CopyOnWriteArraySet<>();

    Set<MessageHandler> set = messageHandlerRepository.putIfAbsent(clazz, handlerSet);
    if (set != null) {
      handlerSet = set;
    }
    handlerSet.add(handler);
  }
1359112
public static void unregisterMessageHandler(Class<? extends AVIMMessage> clazz,
                                              MessageHandler<?> handler) {
    Set<MessageHandler> handlerSet = messageHandlerRepository.get(clazz);
    if (handlerSet != null) {
      handlerSet.remove(handler);
    }
  }
240915
private function load_handler_as_method($handler) {
	list($class, $method) = explode('->', $handler);
	
	$object = new $class;
	$object->$method($this->url, $this->method, $this->arguments);
}
89168
public void setInvocationHandler(Object proxy, InvocationHandler handler) {
        Field field = getInvocationHandlerField();
        try {
            field.set(proxy, handler);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
390053
public void addContentHandler(Class<? extends Content> clazz, JavaMailContentHandler handler) {
		map.put(clazz, handler);
	}
519024
public HandlerRegistration addChangedHandler(final ChangedHandler handler) {
		return enabledForm.addItemChangedHandler(new ItemChangedHandler() {

			public void onItemChanged(ItemChangedEvent event) {
				handler.onChanged(new ChangedEvent(EnableToggleFormItem.this.getJsObj()));
			}
		});

	}
853978
private function load_handler_as_static($handler) {
	list($class, $method) = explode('::', $handler);
	
	$class::$method($this->url, $this->method, $this->arguments);
}
741429
@Override
    public void setErrorHandler(ErrorHandler handler) {
        if (errorHandlerLocked) {
            return;
        }
        if (handler == null) {
            handler = base;
        }
        this.errorHandler = handler;
    }
89534
public void getPushState(GetPushStateHandler handler) {
        HMSAgentLog.i("getPushState:handler=" + StrUtils.objDesc(handler));
        this.handler = handler;
        connect();
    }
789906
@Nullable
	@SuppressWarnings("unchecked")
	public static <C> C findConfiguration(Class<C> clazz,
										  @Nullable ChannelHandler handler) {
		Objects.requireNonNull(clazz, "configuration type");
		if (handler instanceof BootstrapPipelineHandler) {
			BootstrapPipelineHandler rph =
					(BootstrapPipelineHandler) handler;
			for (PipelineConfiguration aRph : rph) {
				if (clazz.isInstance(aRph.consumer)) {
					return (C) aRph.consumer;
				}
				if (clazz.isInstance(aRph.deferredConsumer)) {
					return (C) aRph.deferredConsumer;
				}
			}
		}
		return null;
	}
943001
public static TerribleFailureHandler setWtfHandler(TerribleFailureHandler handler) {
        if (handler == null) {
            throw new NullPointerException("handler == null");
        }
        TerribleFailureHandler oldHandler = sWtfHandler;
        sWtfHandler = handler;
        return oldHandler;
    }
754231
final void addHandler(final HttpHandler handler) {
    if (handler != null) {
      if (!eventHandlers.containsKey(handler.getUriSpecification().toLowerCase())) {
        eventHandlers.put(handler.getUriSpecification().toLowerCase(), handler);
      } else {
        LOG.log(Level.WARNING, "JettyHandler handle is already registered: {0} ", handler.getUriSpecification());
      }
    }
  }
371168
public HandlerRegistration addIconClickHandler(final ClickHandler handler) {

        final HandlerRegistration internalHandlerRegistration = m_iconPanel.addDomHandler(
            handler,
            ClickEvent.getType());
        m_iconClickHandlers.add(handler);
        HandlerRegistration result = new HandlerRegistration() {

            public void removeHandler() {

                internalHandlerRegistration.removeHandler();
                m_iconClickHandlers.remove(handler);
            }
        };
        return result;
    }
392790
function(handler) {
      for (var i = 0; i < this.lines_.length; ++i) {
        var line = this.lines_[i];
        handler.apply(this, line);
      }
    }
605474
@Override
  public FutureResultImpl<T> setHandler(Handler<AsyncResult<T>> handler) {
    this.handler = handler;
    checkCallHandler();
    return this;
  }
1112638
@Override
  public void removeHandler(Handler handler)
  {
    synchronized (this) {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      
      if (loader == null) {
        loader = _systemClassLoader;
      }

      for (int i = _loaders.size() - 1; i >= 0; i--) {
        WeakReference<ClassLoader> ref = _loaders.get(i);
        ClassLoader refLoader = ref.get();

        if (refLoader == null) {
          _loaders.remove(i);
        }

        if (isParentLoader(loader, refLoader)) {
          removeHandler(handler, refLoader);
        }
      }

      HandlerEntry ownHandlers = _ownHandlers.get();
      if (ownHandlers != null)
        ownHandlers.removeHandler(handler);
    }
  }
565968
public List<Assignment> enumerateAllModels(final ModelEnumerationHandler handler) {
        return this.enumerateAllModels((Collection<Variable>) null, handler);
    }