Register all methods in the specified controller classes.

@param controllers
161359
public final void init(Class<? extends Controller>... controllers) {
        List<Class<?>> classes = Arrays.asList(controllers);
        init(classes);
    }
1066918
private Map<Method, Class<? extends Annotation>> getControllerMethods(Class<? extends Controller> controllerClass) {
        // collect the annotated methods
        Map<Method, Class<? extends Annotation>> controllerMethods = new LinkedHashMap<>();

        // discover all annotated controllers methods
        for (Method method : ClassUtils.getDeclaredMethods(controllerClass)) {
            for (Annotation annotation : method.getAnnotations()) {
                Class<? extends Annotation> annotationClass = annotation.annotationType();
                if (httpMethodAnnotationClasses.contains(annotationClass)) {
                    controllerMethods.put(method, annotationClass);
                    break;
                }
            }
        }

        return controllerMethods;
    }
140661
public function checkController($controllers)
    {
        if (!$this->controller) {
            return false;
        }

        if (in_array($this->controller, (array)$controllers)) {
            return true;
        }

        return false;
    }
148027
public void registerControlAdapters()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "registerControlAdapters");

    // do nothing
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "registerControlAdapters");    
  }
27014
@Override
    public void registerControlAdapters()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "registerControlAdapters");

        //register the local queue point/publication point as appropriate
        _protoRealization.registerControlAdapters();

        // If _remoteQueuePoints not null indicates Queue destination
        SIMPIterator itr = null;
        if (_remoteQueuePoints != null)
        {
            //register the xmit queue points
            itr = _remoteQueuePoints.iterator();
            while (itr.hasNext())
            {
                ControlAdapter remote = (ControlAdapter) itr.next();
                remote.registerControlAdapterAsMBean();
            }
            itr.finished();
        }

        if (isLink())
        {
            //register the xmit queue points
            Iterator it = _localisationManager.getXmitQueueIterator();
            while (it.hasNext())
            {
                ControlAdapter remote = ((PtoPXmitMsgsItemStream) it.next()).getControlAdapter();
                remote.registerControlAdapterAsMBean();
            }
        }

        //We're not registering the BDH's control handler at this time
        // But we register the link as a SIBLink MBean
        if (isLink())
            getControlAdapter().registerControlAdapterAsMBean();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "registerControlAdapters");
    }
753160
public static function registerHelpers( $classes ) {

		if( !is_array($classes) )
			$classes = [$classes];

		foreach( $classes as $class ) {

			$class   = new \ReflectionClass($class);
			$methods = $class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_STATIC);

			foreach( $methods as $m ) {
				static::addHelperMethod($class->name, $m->name);
			}
			
		}

	}
220313
public void addClasses(Set<Class<?>> classes) {
        for (Class<?> classToAdd: classes) {
            localClassCache.put(classToAdd.getName(), classToAdd);
        }
    }
328216
private void registerMethod(Class<?> type, Method method) {
    Class<?> returnType = method.getReturnType();
    if (returnType == void.class || returnType == Void.class) {
      registerVoidMethod(type, method);
    } else {
      registerValueMethod(type, method);
    }
  }
637144
private function initialize(AbstractController $controller)
    {
        foreach ($this->initializers as $initializer) {
            if ($initializer instanceof InitializerInterface) {
                $initializer->initialize($controller, $this);
            } else {
                call_user_func($initializer, $controller, $this);
            }
        }
    }
513676
public static void registerConverters(Set<?> converters, ConverterRegistry registry) {
		if (converters != null) {
			for (Object converter : converters) {
				if (converter instanceof GenericConverter) {
					registry.addConverter((GenericConverter) converter);
				}
				else if (converter instanceof Converter<?, ?>) {
					registry.addConverter((Converter<?, ?>) converter);
				}
				else if (converter instanceof ConverterFactory<?, ?>) {
					registry.addConverterFactory((ConverterFactory<?, ?>) converter);
				}
				else {
					throw new IllegalArgumentException("Each converter object must implement one of the " +
							"Converter, ConverterFactory, or GenericConverter interfaces");
				}
			}
		}
	}
199234
public static function register_elements() {
		foreach ( self::$_elements as $element => $locations ) {
			$class = self::get_element_class_name( $element );

			if ( method_exists( $class, 'init' ) ) {
				call_user_func( [ $class, 'init' ], $locations );
			}
		}
	}
796189
private function registerControllers()
    {
        $this->_controller = new Controller();
        $this->_controller->load($this->_router,
        $this->_config->get('basepath'));
    }
381192
public function initialize(Controller $controller) {
		$this->_controller = $controller;
		if (!$this->_controller->Components->loaded('RequestHandler')) {
			$this->_controller->RequestHandler = $this->_controller->Components->load('RequestHandler');
			$this->_controller->RequestHandler->initialize($this->_controller);
		}
		if (empty($this->modelName)) {
			$this->_model = $this->_controller->{$this->_controller->modelClass};
		} else {
			$this->_model = ClassRegistry::init($this->modelName, true);
			if ($this->_model === false) {
				throw new InternalErrorException(__d('view_extension', 'Invalid name of target model for component'));
			}
		}
		if (!$this->_model->Behaviors->loaded('Tree')) {
			throw new InternalErrorException(__d('view_extension', 'Tree behavior is not loaded'));
		}
	}
606214
private void registerControllerMethods(Map<Method, Class<? extends Annotation>> discoveredMethods) {

        Collection<Method> methods = sortMethods(discoveredMethods.keySet());

        Map<Class<? extends Controller>, Set<String>> controllers = new HashMap<>();
        for (Method method : methods) {
            Class<? extends Controller> controllerClass = (Class<? extends Controller>) method.getDeclaringClass();
            if (!controllers.containsKey(controllerClass)) {
                Set<String> paths = collectPaths(controllerClass);
                controllers.put(controllerClass, paths);
            }

            Class<? extends Annotation> httpMethodAnnotationClass = discoveredMethods.get(method);
            Annotation httpMethodAnnotation = method.getAnnotation(httpMethodAnnotationClass);

            String httpMethod = httpMethodAnnotation.annotationType().getAnnotation(HttpMethod.class).value();
            String[] methodPaths = ClassUtil.executeDeclaredMethod(httpMethodAnnotation, "value");

            Set<String> controllerPaths = controllers.get(controllerClass);
            if (controllerPaths.isEmpty()) {
                // add an empty string to allow controllerPaths iteration
                controllerPaths.add("");
            }

            for (String controllerPath : controllerPaths) {

                if (methodPaths.length == 0) {
                    // method does not specify a path, inherit from controller
                    String fullPath = StringUtils.addStart(StringUtils.removeEnd(controllerPath, "/"), "/");
                    ControllerHandler handler = new ControllerHandler(injector, controllerClass, method.getName());
                    handler.validateMethodArgs(fullPath);

                    RouteRegistration registration = new RouteRegistration(httpMethod, fullPath, handler);
                    configureRegistration(registration, method);
                    routeRegistrations.add(registration);
                } else {
                    // method specifies one or more paths, concatenate with controller paths
                    for (String methodPath : methodPaths) {
                        String path = Joiner.on("/").skipNulls().join(StringUtils.removeEnd(controllerPath, "/"), StringUtils.removeStart(methodPath, "/"));
                        String fullPath = StringUtils.addStart(StringUtils.removeEnd(path, "/"), "/");

                        ControllerHandler handler = new ControllerHandler(injector, controllerClass, method.getName());
                        handler.validateMethodArgs(fullPath);

                        RouteRegistration registration = new RouteRegistration(httpMethod, fullPath, handler);
                        configureRegistration(registration, method);
                        routeRegistrations.add(registration);
                    }
                }

            }

        }
    }
508856
function(controller, callback) {
            self.prepareControllerActions(controller, function(err, actions) {
                callback(err, controller, actions);
            });
        }
1207012
public void setTables(final List<Table> tables) {
        this.tablesMap.clear();
        for (final Table table : tables)
            this.addTableConfig(table.getConfigEntry());
    }
760381
private Collection<Method> sortControllerMethods(Set<Method> controllerMethods) {
        List<Method> list = new ArrayList<>(controllerMethods);
        list.sort((m1, m2) -> {
            int o1 = Integer.MAX_VALUE;
            Order order1 = ClassUtils.getAnnotation(m1, Order.class);
            if (order1 != null) {
                o1 = order1.value();
            }

            int o2 = Integer.MAX_VALUE;
            Order order2 = ClassUtils.getAnnotation(m2, Order.class);
            if (order2 != null) {
                o2 = order2.value();
            }

            if (o1 == o2) {
                // same or unsorted, compare controller+controllerMethod
                String s1 = LangUtils.toString(m1);
                String s2 = LangUtils.toString(m2);

                return s1.compareTo(s2);
            }

            return (o1 < o2) ? -1 : 1;
        });

        return list;
    }