private void abort(GridProcess gridProcess, List<IResponseTO> responses) {
    if (gridProcess.getState().isRunnable()) {
      gridProcess.setGridProcessState(GridProcessState.ABORTED);
      gridProcess.getReplicaAccounting().setState(GridProcessState.ABORTED);

      GridProcessAccounting accounting = setAccountingFields(gridProcess);
      accounting.setTransfersProgress(convertTransfer(gridProcess.getTransfersProgress()));

      reportReplicaAccounting(gridProcess, responses);

      gridProcess.getOperations().cancelOperations(responses);

      executionEnded(gridProcess, GridProcessState.ABORTED, responses);
    }
  }
  private void reportReplicaAccounting(GridProcess process, List<IResponseTO> responses) {

    GridProcessAccounting accounting = setAccountingFields(process);
    accounting.setTransfersProgress(convertTransfer(process.getTransfersProgress()));
    String peerID = process.getWorkerProviderID();

    String peerAddress = StringUtil.deploymentIDToAddress(peerID);

    ReportReplicaAccountingResponseTO to = new ReportReplicaAccountingResponseTO();
    to.setCreationTime(accounting.getCreationTime());
    to.setErrorCause(accounting.getErrorCause());
    to.setExecutionErrorType(accounting.getExecutionErrorType());
    to.setExitValue(accounting.getExitValue());
    to.setFinalBeginning(accounting.getFinalBeginning());
    to.setFinalEnd(accounting.getFinalEnd());
    to.setInitBeginning(accounting.getInitBeginning());
    to.setInitEnd(accounting.getInitEnd());
    to.setJobID(process.getJobId());

    to.setLatestPhase(accounting.getLatestPhase());
    to.setMaxFails(accounting.getMaxFails());
    to.setMaxReplicas(accounting.getMaxReplicas());
    to.setPeerAddress(peerAddress);
    to.setRemoteBeginning(accounting.getRemoteBeginning());
    to.setRemoteEnd(accounting.getRemoteEnd());
    to.setRequestID(accounting.getRequestId());
    to.setRequiredWorkers(accounting.getRequiredWorkers());
    to.setSabotageCheck(accounting.getSabotageCheck());
    to.setState(accounting.getState().name());
    to.setStderr(accounting.getStderr());
    to.setStdout(accounting.getStdout());
    to.setTaskSequenceNumber(accounting.getTaskSequenceNumber());
    to.setGridProcessSequenceNumber(accounting.getGridProcessSequenceNumber());
    to.setWorkerID(accounting.getWorkerID());
    to.setWorkerPK(accounting.getWorkerPublicKey());

    String workerAddress = StringUtil.deploymentIDToAddress(accounting.getWorkerID());
    WorkerSpecification workerSpec =
        BrokerDAOFactory.getInstance().getWorkerDAO().getWorkerSpec(workerAddress);
    to.setWorkerSpec(workerSpec);

    to.setGetOperationsList(
        fillFinalGetOperations(
            accounting.getFinalCommands(),
            process.getTask(),
            process.getId(),
            process.getWorkerEntry().getWorkerID(),
            accounting.getRequestId()));
    to.setInitOperationsList(
        fillInitGetOperations(
            accounting.getInitCommands(),
            process.getTask(),
            process.getId(),
            process.getWorkerEntry().getWorkerID(),
            accounting.getRequestId()));
    to.setPeerBalancesList(fillPeerBalances(accounting.getAccountings().getBalances()));
    to.setTransferProgressList(
        fillTransferProgress(accounting.getTransfersProgress(), "" + process.getId()));

    responses.add(to);
  }