public static function registry(ObjectRegistry $registry = null)
    {
        if ($registry) {
            static::$_registry = $registry;
        }

        if (empty(static::$_registry)) {
            static::$_registry = new QueueEngineRegistry();
        }

        return static::$_registry;
    }