@API(status = API.Status.STABLE)
    protected final void lockRegistration() {
        if (this.state() == RegistrationState.BEFORE_REGISTRATION) {
            this.transitionOrThrow(RegistrationState.BEFORE_REGISTRATION, RegistrationState.AFTER_REGISTRATION);
            return;
        }
        this.transitionOrThrow(RegistrationState.REGISTERING, RegistrationState.AFTER_REGISTRATION);
    }
Transition the command manager from either {@link RegistrationState#BEFORE_REGISTRATION} or
{@link RegistrationState#REGISTERING} to {@link RegistrationState#AFTER_REGISTRATION}.

@throws IllegalStateException if the manager is not in the expected state
cloud-core/src/main/java/org/incendo/cloud/CommandManager.java