本文整理汇总了Java中com.google.common.util.concurrent.ListenerCallQueue.Callback类的典型用法代码示例。如果您正苦于以下问题:Java Callback类的具体用法?Java Callback怎么用?Java Callback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Callback类属于com.google.common.util.concurrent.ListenerCallQueue包,在下文中一共展示了Callback类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: terminatedCallback
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
private static Callback<Listener> terminatedCallback(final State from) {
return new Callback<Listener>("terminated({from = " + from + "})") {
@Override
void call(Listener listener) {
listener.terminated(from);
}
};
}
示例2: stoppingCallback
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
private static Callback<Listener> stoppingCallback(final State from) {
return new Callback<Listener>("stopping({from = " + from + "})") {
@Override
void call(Listener listener) {
listener.stopping(from);
}
};
}
示例3: failed
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
@GuardedBy("monitor")
private void failed(final State from, final Throwable cause) {
// can't memoize this one due to the exception
new Callback<Listener>("failed({from = " + from + ", cause = " + cause + "})") {
@Override
void call(Listener listener) {
listener.failed(from, cause);
}
}.enqueueOn(listeners);
}
示例4: fireFailedListeners
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
@GuardedBy("monitor")
void fireFailedListeners(final Service service) {
new Callback<Listener>("failed({service=" + service + "})") {
@Override
void call(Listener listener) {
listener.failure(service);
}
}.enqueueOn(listeners);
}
示例5: incrementingCallback
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
private Callback<Object> incrementingCallback(final AtomicInteger counter, final int expected) {
return new Callback<Object>("incrementing") {
@Override void call(Object listener) {
assertEquals(expected, counter.incrementAndGet());
}
};
}
示例6: countDownCallback
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
private Callback<Object> countDownCallback(final CountDownLatch latch) {
return new Callback<Object>("countDown") {
@Override void call(Object listener) {
latch.countDown();
}
};
}
示例7: failed
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
@GuardedBy("monitor")
private void failed(
final State from, final Throwable cause) {
// can't memoize this one due to the exception
new Callback<Listener>("failed({from = " + from + ", cause = " + cause + "})") {
@Override
void call(Listener listener) {
listener.failed(from, cause);
}
}.enqueueOn(listeners);
}
示例8: terminatedCallback
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
private static Callback<Listener> terminatedCallback(final State from) {
return new Callback<Listener>("terminated({from = " + from + "})") {
@Override void call(Listener listener) {
listener.terminated(from);
}
};
}
示例9: stoppingCallback
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
private static Callback<Listener> stoppingCallback(final State from) {
return new Callback<Listener>("stopping({from = " + from + "})") {
@Override void call(Listener listener) {
listener.stopping(from);
}
};
}
示例10: failed
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
@GuardedBy("monitor")
private void failed(final State from, final Throwable cause) {
// can't memoize this one due to the exception
new Callback<Listener>("failed({from = " + from + ", cause = " + cause + "})") {
@Override void call(Listener listener) {
listener.failed(from, cause);
}
}.enqueueOn(listeners);
}
示例11: fireFailedListeners
import com.google.common.util.concurrent.ListenerCallQueue.Callback; //导入依赖的package包/类
@GuardedBy("monitor")
void fireFailedListeners(final Service service) {
new Callback<Listener>("failed({service=" + service + "})") {
@Override void call(Listener listener) {
listener.failure(service);
}
}.enqueueOn(listeners);
}