def register_callback(self, class_type, callback, component_scope=scope.InstancePerDependency, register_as=None):
        """
        Registers the given class for creation via the given callback.
        :param class_type: The class type.
        :param callback: The function to call to create/get an instance, of the form fn(component_context)
        :param component_scope: The scope of the component, defaults to instance per dependency.
        :param register_as: The types to register the class as, defaults to the given class_type.
        """
        registration = _CallbackRegistration(callback, component_scope())
        self._register(class_type, registration, register_as)