Adds a handler to the root.

@param handler the handler to add
970380
public synchronized static void addHandler(Handler handler) {
      java.util.logging.Logger root = java.util.logging.LogManager.getLogManager().getLogger(StringUtils.EMPTY);
      root.addHandler(handler);
   }
1060881
public HandlerRegistration setLocationNotFoundHandler(LocationNotFoundHandler handler) {
		if (handlerManager.getHandlerCount(LocationNotFoundHandler.TYPE) > 0) {
			LocationNotFoundHandler previous = handlerManager.getHandler(LocationNotFoundHandler.TYPE, 0);
			handlerManager.removeHandler(LocationNotFoundHandler.TYPE, previous);
		}
		return handlerManager.addHandler(LocationNotFoundHandler.TYPE, handler);
	}
575558
def add_loghandler (handler):
    """"""
    format = "%(levelname)s %(name)s %(asctime)s %(threadName)s %(message)s"
    handler.setFormatter(logging.Formatter(format))
    logging.getLogger(LOG_ROOT).addHandler(handler)
    logging.getLogger().addHandler(handler)
1092974
function (method, handler) {
            if (!method || !handler) {
                return;
            }
            if (!this.handlers[method]) {
                //initialize array
                this.handlers[method] = [];
            }
            // add handler to the stack
            this.handlers[method].push(handler);
        }
1198403
public void addInstruction(InstructionHandle handle) {
        if (firstInstruction == null) {
            firstInstruction = lastInstruction = handle;
        } else {
            if (VERIFY_INTEGRITY && handle != lastInstruction.getNext()) {
                throw new IllegalStateException("Adding non-consecutive instruction");
            }
            lastInstruction = handle;
        }
    }
1304972
@Override
	public void registerErrorHandler(ErrorHandler handler) {
		if (handler != null) {
			this.errorHandlers.add(handler);
			Collections.sort(this.errorHandlers, DefaultErrorManager.PRIORITY_COMPARATOR);
		}
	}
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());
      }
    }
  }
114135
protected <H extends EventHandler> HandlerRegistration addHandler(final H handler, GwtEvent.Type<H> type) {

        return ensureHandlers().addHandlerToSource(type, this, handler);
    }
900307
def _registerHandler(self, handler):
        
        self._logger.addHandler(handler)
        self._handlers.append(handler)
973775
@Override
    public HandlerRegistration addChangeHandler(final ChangeHandler handler) {
        return getRangeInputElement().addDomHandler(handler, ChangeEvent.getType());
    }
731535
protected void addRequestHandler(I_CmsRequestHandler handler) {

        if (handler == null) {
            return;
        }
        String[] names = handler.getHandlerNames();
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            if (m_requestHandlers.get(name) != null) {
                CmsLog.INIT.error(Messages.get().getBundle().key(Messages.LOG_DUPLICATE_REQUEST_HANDLER_1, name));
                continue;
            }
            m_requestHandlers.put(name, handler);
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(
                    Messages.get().getBundle().key(
                        Messages.INIT_ADDED_REQUEST_HANDLER_2,
                        name,
                        handler.getClass().getName()));
            }
        }
    }
898633
public static void call(Class<? extends Unit> unitClass, Handler<UnitResponse> handler) {
        call(unitClass, new HashMap<>(), handler);
    }
251702
@Override
    public void setContentHandler(ContentHandler handler) {
        if (handler == null) {
            handler = base;
        }
        contentHandler = handler;
    }
1218777
private void addHandler(Handler handler, ClassLoader loader)
  {
    // handlers ordered by level
    ArrayList<Handler> handlers = new ArrayList<Handler>();

    handlers.add(handler);

    for (ClassLoader ptr = loader; ptr != null; ptr = ptr.getParent()) {
      Handler []localHandlers = _localHandlers.getLevel(ptr);

      if (localHandlers != null) {
        for (int i = 0; i < localHandlers.length; i++) {
          int p = handlers.indexOf(localHandlers[i]);

          if (p < 0) {
            handlers.add(localHandlers[i]);
          }
          else {
            Handler oldHandler = handlers.get(p);

            if (localHandlers[i].getLevel().intValue()
                < oldHandler.getLevel().intValue()) {
              handlers.set(p, localHandlers[i]);
            }
          }
        }
      }
    }

    Handler []newHandlers = new Handler[handlers.size()];
    handlers.toArray(newHandlers);
    
    if (loader == _systemClassLoader)
      loader = null;

    _localHandlers.set(newHandlers, loader);
  }
508904
public static void put(@NotNull String path, @NotNull Handler handler) {
        staticInstance().put(prefixPath(path), handler);
    }
1317399
public void insertHandler(Class<?> restrictionClass, H handler) {
    // note that the handlers list is kept in a list that is traversed in
    // backwards order.
    handlers.add(new Pair<Class<?>, H>(restrictionClass, handler));
  }
1014451
@Override
	public void putHandler(String url, HandlerDefinition handler) {
		handlerMappingStorage.put(url, handler);
		removeHandlerWithView(url);
	}