java.util.concurrent.Executor#getClass ( )源码实例Demo

下面列出了java.util.concurrent.Executor#getClass ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: arcusplatform   文件: WatchdogChecks.java
public static void addExecutorWatchdog(String name, Executor exec) {
   if (exec instanceof ThreadPoolExecutor) {
      WatchdogService.addWatchdogCheck(new ThreadPoolExecutorWatchdog(name,(ThreadPoolExecutor)exec));
   } else {
      throw new RuntimeException("cannot monitor executor of type: " + exec.getClass());
   }
}
 
源代码2 项目: etcd-java   文件: GrpcClient.java
public static Executor serialized(Executor parent, int bufferSize) {
    return parent instanceof SerializingExecutor
            || parent instanceof io.grpc.internal.SerializingExecutor
            || parent instanceof OrderedEventExecutor
            || parent.getClass() == GSE_CLASS
            ? parent : new SerializingExecutor(parent, bufferSize);
}
 
源代码3 项目: vind   文件: CompletableSearchServer.java
private CompletableSearchServer(SearchServer backend, Executor executor, boolean shutdownExecutorOnClose) {
    if(shutdownExecutorOnClose && !(executor instanceof ExecutorService)) {
        throw new IllegalArgumentException("shutdownExecutorOnClose requires 'executor' being an 'ExecutorService', actually got: " + executor.getClass());
    }
    this.backend = backend;
    this.executor = executor;
    this.shutdownExecutorOnClose = shutdownExecutorOnClose;
}
 
源代码4 项目: vespa   文件: ThreadedRequestHandler.java
/**
 * Creates a threaded request handler
 *
 * @param executor the executor to use to execute requests
 * @param metric the metric object to which event in this are to be collected
 * @param allowAsyncResponse true to allow the response header to be created asynchronously.
 *                           If false (default), this will create an error response if the response header
 *                           is not returned by the subclass of this before handleRequest returns.
 */
@Inject
protected ThreadedRequestHandler(Executor executor, Metric metric, boolean allowAsyncResponse) {
    executor.getClass(); // throws NullPointerException
    this.executor = executor;
    this.metric = (metric == null) ? new NullRequestMetric() : metric;
    this.allowAsyncResponse = allowAsyncResponse;
}
 
 同类方法