Command in Java: Decoupling producer form consumer