public function resolve()
    {
        if (empty($this->componentType)) {
            throw new \BadMethodCallException('You have to provide a component type to create a component.');
        }

        $this->component = new $this->componentClass();
        $this->component->setComponentType($this->componentType);
        $this->component->setData($this->data);

        $this->assertEntityIsValid($this->component, array('Component', 'creation'));

        $this->fireEvent(
            ComponentEvents::COMPONENT_CREATED,
            new ComponentEvent($this->component, $this)
        );

        return $this->component;
    }