public function getRoleEnvironmentData()
    {
        $this->_ensureGoalStateRetrieved();

        if (is_null($this->_currentEnvironmentData)) {
            $current = $this->_currentGoalState;

            if (is_null($current->getEnvironmentPath())) {
                throw new RoleEnvironmentNotAvailableException(
                    'No role environment data for the current goal state'
                );
            }

            $environmentStream = $this->_inputChannel->getInputStream(
                $current->getEnvironmentPath()
            );

            $this->_currentEnvironmentData = $this->_roleEnvironmentDeserializer
                ->deserialize($environmentStream);
        }

        return $this->_currentEnvironmentData;
    }