ISPN-4559 Replace fails with cache loader

https://issues.jboss.org/browse/ISPN-4559
https://issues.jboss.org/browse/ISPN-4649
I'm not sure we need this if/else/else, it should be enough to check if the command implements `FlagAffectedCommand`