Let modules register for a pre-command and post-command hooks in the pre-command hook, they should also reject the command. in the post-command hook, they can just flush things or update stats. TBD.
Comment From: oranagra
maybe no longer necessary after adding #11199