@Override
  public void run() {
    try {
      if (endpoint == null) {
        handleMissingEndpoint();
      } else if (isAuthenticationMessage()) {
        initializeAndProcessMessage();
      } else if (!endpoint.isAuthenticated()) {
        handleAuthenticationFailure();
      } else {
        initializeAndProcessMessage();
      }

    } catch (Throwable e) {
      logProcessingFailure(e);
      handleProcessingFailure(e);
    }
  }