public static function update_handlers_for_component($componentname) {
        global $DB;

        $componentname = \core_component::normalize_componentname($componentname);
        $existinghandlers = $DB->get_recordset('messageinbound_handlers', array('component' => $componentname));
        foreach ($existinghandlers as $handler) {
            if (!class_exists($handler->classname)) {
                self::remove_messageinbound_handler($handler);
            }
        }
        $existinghandlers->close();

        self::create_missing_messageinbound_handlers_for_component($componentname);
    }