@Override
    public Object getContext(CommandInvocation invocation, Class<?> clazz)
    {
        if (clazz.isAssignableFrom(invocation.getCommandSource().getClass()))
        {
            return invocation.getCommandSource();
        }
        throw new RestrictedSourceException(null, (Class<?>)clazz);
    }