/**
  * Starts MyService asynchronously if it is not already started and send command to it.
  *
  * @param commandData to the service or null
  */
 public static void sendCommand(CommandData commandData) {
   if (!isServiceAvailable()) {
     // Imitate a soft service error
     commandData.getResult().incrementNumIoExceptions();
     commandData.getResult().setMessage("Service is not available");
     MyServiceEventsBroadcaster.newInstance(MyContextHolder.get(), MyServiceState.STOPPED)
         .setCommandData(commandData)
         .setEvent(MyServiceEvent.AFTER_EXECUTING_COMMAND)
         .broadcast();
     return;
   }
   sendCommandEvenForUnavailable(commandData);
 }