public interface CommitHandler
Implementations may use Network.addCommitListener(CommitListener, java.util.Collection, String)
to identify when specific peers have committed the transaction they are tracking.
限定符和类型 | 方法和说明 |
---|---|
void |
cancelListening()
Called to interrupt the waiting state of
waitForEvents(long, TimeUnit) before completion. |
void |
startListening()
Called to initiate listening for transaction events.
|
void |
waitForEvents(long timeout,
TimeUnit timeUnit)
Block until enough transaction commit events have been received to satisfy the event handling strategy.
|
void startListening()
void waitForEvents(long timeout, TimeUnit timeUnit) throws ContractException, TimeoutException, InterruptedException
timeout
- the maximum time to wait.timeUnit
- the time unit of the timeout argument.ContractException
- if the commit fails, either by being rejected by a peer of failing to meet the
requirements of the strategy.TimeoutException
- if the strategy was not satisfied in time.InterruptedException
- if the current thread is interrupted while waiting.void cancelListening()
waitForEvents(long, TimeUnit)
before completion.Copyright © 2023. All rights reserved.