List of usage examples for org.eclipse.jgit.internal.ketch Proposal getState
public State getState()
From source file:org.uberfire.java.nio.fs.jgit.util.commands.RefTreeUpdateCommand.java
License:Apache License
private void proposeKetch(final List<Command> n, final RevCommit _commit) throws IOException, InterruptedException { final Proposal proposal = new Proposal(n).setAuthor(_commit.getAuthorIdent()).setMessage("push"); git.getKetchLeader().queueProposal(proposal); if (proposal.isDone()) { // This failed fast, e.g. conflict or bad precondition. throw new GitException("Error"); }/* ww w .j a va2s . co m*/ if (proposal.getState() == QUEUED) { waitForQueue(proposal); } if (!proposal.isDone()) { waitForPropose(proposal); } }
From source file:org.uberfire.java.nio.fs.jgit.util.commands.RefTreeUpdateCommand.java
License:Apache License
private void waitForQueue(final Proposal proposal) throws InterruptedException { while (!proposal.awaitStateChange(QUEUED, 250, MILLISECONDS)) { System.out.println("waiting queue..."); }/* w w w . ja va2s. c o m*/ switch (proposal.getState()) { case RUNNING: default: break; case EXECUTED: break; case ABORTED: break; } }