code: private void attachCommandExecutor() {
          if (this.commandExecutor instanceof GuardedActionCommandExecutor) {
              GuardedActionCommandExecutor dynamicHandler = (GuardedActionCommandExecutor)commandExecutor;
              setEnabled(dynamicHandler.isEnabled());
              subscribeToGuardedCommandDelegate();
          }
          else {
              setEnabled(true);
          }
          if (logger.isDebugEnabled()) {
              logger.debug("Command executor '" + this.commandExecutor + "' attached.");
          }
      }
docs: Attaches the currently assigned command executor to this instance. The command will
  be enabled by default unless the executor is a {@link GuardedActionCommandExecutor},
  in which case the command will be assigned the enabled state of the executor.