本文整理汇总了Java中org.bitcoinj.wallet.listeners.WalletChangeEventListener类的典型用法代码示例。如果您正苦于以下问题:Java WalletChangeEventListener类的具体用法?Java WalletChangeEventListener怎么用?Java WalletChangeEventListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WalletChangeEventListener类属于org.bitcoinj.wallet.listeners包,在下文中一共展示了WalletChangeEventListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maybeQueueOnWalletChanged
import org.bitcoinj.wallet.listeners.WalletChangeEventListener; //导入依赖的package包/类
protected void maybeQueueOnWalletChanged() {
// Don't invoke the callback in some circumstances, eg, whilst we are re-organizing or fiddling with
// transactions due to a new block arriving. It will be called later instead.
checkState(lock.isHeldByCurrentThread());
checkState(onWalletChangedSuppressions >= 0);
if (onWalletChangedSuppressions > 0) return;
for (final ListenerRegistration<WalletChangeEventListener> registration : changeListeners) {
registration.executor.execute(new Runnable() {
@Override
public void run() {
registration.listener.onWalletChanged(Wallet.this);
}
});
}
}
示例2: addChangeEventListener
import org.bitcoinj.wallet.listeners.WalletChangeEventListener; //导入依赖的package包/类
/**
* Adds an event listener object. Methods on this object are called when something interesting happens,
* like receiving money. The listener is executed by the given executor.
*/
public void addChangeEventListener(Executor executor, WalletChangeEventListener listener) {
// This is thread safe, so we don't need to take the lock.
changeListeners.add(new ListenerRegistration<>(listener, executor));
}
示例3: addChangeEventListener
import org.bitcoinj.wallet.listeners.WalletChangeEventListener; //导入依赖的package包/类
/**
* Adds an event listener object. Methods on this object are called when something interesting happens,
* like receiving money. The listener is executed by the given executor.
*/
public void addChangeEventListener(Executor executor, WalletChangeEventListener listener) {
// This is thread safe, so we don't need to take the lock.
changeListeners.add(new ListenerRegistration<WalletChangeEventListener>(listener, executor));
}
示例4: removeChangeEventListener
import org.bitcoinj.wallet.listeners.WalletChangeEventListener; //导入依赖的package包/类
/**
* Removes the given event listener object. Returns true if the listener was removed, false if that listener
* was never added.
*/
public boolean removeChangeEventListener(WalletChangeEventListener listener) {
return ListenerRegistration.removeFromList(listener, changeListeners);
}