public function init(
        ServicesInterface $services,
        ListenersInterface $listeners,
        EventsInterface $events,
        ConfigInterface $config
    ) {
        if ($this->initialized) {
            throw new RuntimeException(
                'The components have already been initialized.'
            );
        }
        $this->initialized = true;

        foreach ($this->container as $component) {
            if (method_exists($component, 'getServicesConfig')) {
                $services->add($component->getServicesConfig());
            }
            if (method_exists($component, 'getListenersConfig')) {
                $listeners->add($component->getListenersConfig());
            }
            if (method_exists($component, 'getEventsConfig')) {
                foreach ($component->getEventsConfig() as $item) {
                    call_user_func_array([$events, 'attach'], $item);
                }
            }
            if (method_exists($component, 'getSystemConfig')) {
                $config->merge($component->getSystemConfig());
            }
        }
    }