class AMRMClientRelayer extends AbstractService implements ApplicationMasterProtocol {

  @Override
  public FinishApplicationMasterResponse finishApplicationMaster(
      FinishApplicationMasterRequest request)
      throws YarnException, IOException {
    try {
      return this.rmClient.finishApplicationMaster(request);
    } catch (ApplicationMasterNotRegisteredException e) {
      LOG.warn("Out of sync with RM " + rmId
          + " for " + this.appId + ", hence resyncing.");
      // re register with RM
      reRegisterApplicationMaster(this.amRegistrationRequest);
      return finishApplicationMaster(request);
    }
  }

  public  AMRMClientRelayer();
  public  AMRMClientRelayer(ApplicationMasterProtocol rmClient,
      ApplicationId appId, String rmId);

}