apply a command on handlers that can process this type of command and parents