public function getSourceInstance($type, $name, array $parameters, array $globalParameters = array())
    {
        // The source object variable
        $sourceObj = null;

        // Getting SourceConfig object for an Imap Source object
        $sourceConfig = $this->getSourceConfig($name, $type, $parameters, $globalParameters);

        // Creating a Source object with the given source config object
        if ($sourceConfig instanceof SourceConfig ) {
            // Creating a Source object instance according to the given type
            switch ($type) {
                case SourceConfig::SOURCE_TYPE_IMAP:
                    // Initializing an Imap Source object
                    $sourceObj = new Imap();
                    break;
                case SourceConfig::SOURCE_TYPE_POP:
                    // Initializing a Pop Source object
                    $sourceObj = new Pop();
                    break;
                default:
                    throw new Exception\BadSourceConfigConfigurationException(
                        sprintf(
                            "Unrecognized Parser Source type '%s'. Accepted values are: '%s'",
                            $type,
                            SourceConfig::SOURCE_TYPE_IMAP
                        )
                    );
            }

            // Setting the source config to the new source object
            if ($sourceObj instanceof SourceInterface) {
                $sourceObj->setConfig($sourceConfig);
            } else {
                throw new Exception\BadSourceConfigConfigurationException(
                    sprintf(
                        "Unexpected object type: expected 'Msl\ResourceProxy\Source\SourceInterface' for type '%s' but got '%s'.",
                        $type,
                        get_class($sourceObj)
                    )
                );
            }
        } else {
            throw new Exception\BadSourceConfigConfigurationException(
                sprintf(
                    "Unexpected object type: expected 'Msl\ResourceProxy\Source\SourceConfig' for type '%s' but got '%s'.",
                    $type,
                    get_class($sourceConfig)
                )
            );
        }

        // Returning result
        return $sourceObj;
    }