public static function createJob($className, $args)
    {
        list($plugin, $model) = pluginSplit($className);

        if (self::$rootFolder === null) {
            self::$rootFolder = dirname(dirname(dirname(__DIR__))) . DS;
        }

        $classpath = self::$rootFolder . (empty($plugin) ? '' : 'Plugin' . DS . $plugin . DS) . 'Shell' . DS . $model . '.php';

        if (file_exists($classpath)) {
            require_once $classpath;
        } else {
            throw new Resque_Exception('Could not find job class ' . $className . '.');
        }

        if (!class_exists($model)) {
            throw new Resque_Exception('Could not find job class ' . $className . '.');
        }

        if (!method_exists($model, 'perform')) {
            throw new Resque_Exception('Job class ' . $className . ' does not contain a perform method.');
        }

        if (!isset($args[0]) || !method_exists($model, $args[0])) {
            throw new Resque_Exception('Job class ' . $className . ' does not contain ' . $args[0] . ' method.');
        }

        return new $model();
    }