org.apache.jackrabbit.mk.util
Class CommitGate
java.lang.Object
org.apache.jackrabbit.mk.util.CommitGate
public class CommitGate
- extends Object
A gate where listeners can wait for a new commit.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CommitGate
public CommitGate()
waitForCommit
public String waitForCommit(String lastHead,
long millis)
throws InterruptedException
- Wait for a new commit to occur. In very few cases, this method may return
with the old head before the requested timeout.
- Parameters:
lastHead - the last headmillis - the maximum number of milliseconds to wait (0 means don't wait)
- Returns:
- the new head (or old head, if no new commit occurred)
- Throws:
InterruptedException - if the thread was interrupted
commit
public void commit(String newHead)
- Commit a new head. Waiting threads are awoken.
- Parameters:
newHead - the new head
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.