Sets the link substitution handler class.<p>

@param handlerClassName the link substitution handler class name
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);
        }
    }
134320
protected void initEditHandler(Element handlerElement) {

        String editHandlerClass = handlerElement.attributeValue(APPINFO_ATTR_CLASS);
        Map<String, String> params = Maps.newHashMap();
        Element paramsElement = handlerElement.element(APPINFO_PARAMETERS);
        if (paramsElement != null) {
            for (Element paramElement : paramsElement.elements(APPINFO_PARAM)) {
                String name = paramElement.attributeValue(APPINFO_ATTR_NAME);
                String value = paramElement.getText();
                params.put(name, value);
            }
        }
        try {
            m_editHandler = (I_CmsEditHandler)Class.forName(editHandlerClass).newInstance();
            m_editHandler.setParameters(params);
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
        }
    }
917015
public static void configureProtocolHandler() {
        final String pkgs = System.getProperty("java.protocol.handler.pkgs");
        String newValue = "org.mapfish.print.url";
        if (pkgs != null && !pkgs.contains(newValue)) {
            newValue = newValue + "|" + pkgs;
        } else if (pkgs != null) {
            newValue = pkgs;
        }
        System.setProperty("java.protocol.handler.pkgs", newValue);
    }
91991
protected URL resolveHandlerChainFileName(String clzName, String fileName) {
        URL handlerFile = null;
        InputStream in = null;

        String handlerChainFileName = fileName;
        URL baseUrl = classLoader.getResource(getClassResourceName(clzName));

        try {
            //if the filename start with '/', then find and return the resource under the web application home directory directory.
            if (handlerChainFileName.charAt(0) == '/') {
                return classLoader.getResource(handlerChainFileName.substring(1));
            }

            //otherwise, create a new url instance according to the baseurl and the fileName
            handlerFile = new URL(baseUrl, handlerChainFileName);
            in = handlerFile.openStream();
        } catch (Exception e) {
            // log the error msg
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (Exception e) {
                }
            }
        }
        return handlerFile;
    }
1051320
public void setClassname(final String className) {
    Object proc = null;
    try {
      final Class<?> implClass = ProjectDef.class.getClassLoader().loadClass(className);
      try {
        final Method getInstance = implClass.getMethod("getInstance");
        proc = getInstance.invoke(null);
      } catch (final Exception ex) {
        proc = implClass.newInstance();
      }
    } catch (final Exception ex) {
      throw new BuildException(ex);
    }
    this.projectWriter = (ProjectWriter) proc;
  }
1186419
public static void setURLStreamHandlerFactory ( URLStreamHandlerFactory factory ) {
        synchronized ( PROTOCOL_HANDLERS ) {
            if ( Handler.factory != null ) {
                throw new IllegalStateException("URLStreamHandlerFactory already set.");
            }
            PROTOCOL_HANDLERS.clear();
            Handler.factory = factory;
        }
    }
243167
public void setClassNameService(
		com.liferay.portal.kernel.service.ClassNameService classNameService) {
		this.classNameService = classNameService;
	}
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()));
            }
        }
    }
516914
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
    protected void initComponentsHandlers(
            ChannelReplacements channelReplacements) {
        handlers = new ArrayList<HandlerReference>();
        // Have a look at all methods.
        for (Method m : component().getClass().getMethods()) {
            maybeAddHandler(m, channelReplacements);
        }
        handlers = Collections.synchronizedList(handlers);
    }
1136422
@Override
    @SuppressWarnings("unused")
    public void parseURL(URLStreamHandlerSetter setter, URL url, String arg2, int arg3, int arg4) {

        // ------------------------------------------------------------------------------
        // NOTE: the java.net.URLStreamHandler expects that parseURL will be called
        // for the handler associated with a given URL. This associated handler is
        // actually an OSGi handler proxy. Thus we must tempoorarily alter the URL's
        // handler.
        //
        // See org.eclipse.osgi.framework.internal.protocol.URLStreamHandlerProxy
        // and java.net.URLStreamHandler for details.
        // ------------------------------------------------------------------------------

        URLStreamHandler currentHandler = null;

        try {
            currentHandler = (URLStreamHandler) _handlerField.get(url);
            _handlerField.set(url, getInstance());
            _parseURL.invoke(getInstance(), new Object[] { url, arg2, Integer.valueOf(arg3), Integer.valueOf(arg4) });
        } catch (Exception e) {
            FFDCFilter.processException(e, getClass().getName(), "parseURL", new Object[] { url, this, currentHandler });
        } finally {
            if (currentHandler != null) {
                try {
                    _handlerField.set(url, currentHandler);
                } catch (Exception e) {
                    FFDCFilter.processException(e, getClass().getName(), "parseURL", new Object[] { url, this, currentHandler });
                }
            }
        }
    }
240977
public void setSessionHandler(SessionHandler sessionHandler) {
        handler.setSessionsEnabled(sessionHandler != null);
        handler.setSessionHandler(sessionHandler);
    }
1009223
public void setClassNameResolver(final Object classNameResolver) {
        if (classNameResolver instanceof ClassNameResolver) {
            this.classNameResolver = (ClassNameResolver) classNameResolver;
        } else if (classNameResolver instanceof String) {
            this.classNameResolver = new ClassNameResolver() {
                public String resolveClassname(String classname) {
                    return makeClassName((String) classNameResolver, classname);
                }
            };
        } else if (classNameResolver instanceof Closure) {
            final ObjectGraphBuilder self = this;
            this.classNameResolver = new ClassNameResolver() {
                public String resolveClassname(String classname) {
                    Closure cls = (Closure) classNameResolver;
                    cls.setDelegate(self);
                    return (String) cls.call(new Object[]{classname});
                }
            };
        } else if (classNameResolver instanceof Map) {
            Map classNameResolverOptions = (Map) classNameResolver;

            String resolverName = (String) classNameResolverOptions.get(CLASSNAME_RESOLVER_KEY);

            if (resolverName == null) {
                throw new RuntimeException("key '" + CLASSNAME_RESOLVER_KEY + "' not defined");
            }

            if (CLASSNAME_RESOLVER_REFLECTION.equals(resolverName)) {
                String root = (String) classNameResolverOptions.get(CLASSNAME_RESOLVER_REFLECTION_ROOT);

                if (root == null) {
                    throw new RuntimeException("key '" + CLASSNAME_RESOLVER_REFLECTION_ROOT + "' not defined");
                }

                this.classNameResolver = new ReflectionClassNameResolver(root);
            } else {
                throw new RuntimeException("unknown class name resolver " + resolverName);
            }
        } else {
            this.classNameResolver = new DefaultClassNameResolver();
        }
    }
664135
public static String getEventHandler(String className) throws IOException {
        if (getEventHandlers() != null) {
            String newHandler = getEventHandlers().get(className);
            if (newHandler != null)
                return newHandler;
        }
        return className;
    }
155255
public void setEditorHandler(I_CmsEditorHandler clazz) {

        m_editorHandler = clazz;
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_EDITOR_HANDLER_CLASS_1,
                    m_editorHandler.getClass().getName()));
        }
    }
250690
public void setInjectionBinding(InjectionBinding<?> injectionBinding) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "setInjectionBinding : " + injectionBinding);

        ivInjectionBinding = injectionBinding;
    }
178201
private static void initMapDefinedHandler(Map<String, Object> handler) {
		// If the handler is a map, the keys are the class name, values are the
		// parameters.
		for (Map.Entry<String, Object> entry : handler.entrySet()) {
			Tuple<String, Class> namedClass = splitClassAndName(entry.getKey());

			// If the values in the config are a map, construct the object using named
			// parameters.
			if (entry.getValue() instanceof Map) {
				HttpHandler httpHandler;
				try {
					httpHandler = (HttpHandler) ServiceUtil.constructByNamedParams(namedClass.second,
							(Map) entry.getValue());
				} catch (Exception e) {
					throw new RuntimeException(
							"Could not construct a handler with values provided as a map: " + namedClass.second);
				}
				registerMiddlewareHandler(httpHandler);
				handlers.put(namedClass.first, httpHandler);
				handlerListById.put(namedClass.first, Collections.singletonList(httpHandler));
			} else if (entry.getValue() instanceof List) {

				// If the values in the config are a list, call the constructor of the handler
				// with those fields.
				HttpHandler httpHandler;
				try {
					httpHandler = (HttpHandler) ServiceUtil.constructByParameterizedConstructor(namedClass.second,
							(List) entry.getValue());
				} catch (Exception e) {
					throw new RuntimeException(
							"Could not construct a handler with values provided as a list: " + namedClass.second);
				}
				registerMiddlewareHandler(httpHandler);
				handlers.put(namedClass.first, httpHandler);
				handlerListById.put(namedClass.first, Collections.singletonList(httpHandler));
			}
		}
	}
712
function (name, HandlerClass) {
		if (!HandlerClass) { return this; }

		var handler = this[name] = new HandlerClass(this);

		this._handlers.push(handler);

		if (this.options[name]) {
			handler.enable();
		}

		return this;
	}