本文整理汇总了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);
}
};
}
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:9,代码来源:AbstractService.java
示例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);
}
};
}
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:9,代码来源:AbstractService.java
示例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);
}
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:11,代码来源:AbstractService.java
示例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);
}
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:10,代码来源:ServiceManager.java
示例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());
}
};
}
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:8,代码来源:ListenerCallQueueTest.java
示例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();
}
};
}
开发者ID:paul-hammant,项目名称:googles-monorepo-demo,代码行数:8,代码来源:ListenerCallQueueTest.java
示例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);
}
开发者ID:antlr,项目名称:codebuff,代码行数:12,代码来源:AbstractService.java
示例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);
}
};
}
开发者ID:sander120786,项目名称:guava-libraries,代码行数:8,代码来源:AbstractService.java
示例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);
}
};
}
开发者ID:sander120786,项目名称:guava-libraries,代码行数:8,代码来源:AbstractService.java
示例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);
}
开发者ID:sander120786,项目名称:guava-libraries,代码行数:10,代码来源:AbstractService.java
示例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);
}
开发者ID:sander120786,项目名称:guava-libraries,代码行数:9,代码来源:ServiceManager.java
注:本文中的com.google.common.util.concurrent.ListenerCallQueue.Callback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论