本文整理了Java中com.sun.jersey.api.client.Client.getExecutorService()
方法的一些代码示例,展示了Client.getExecutorService()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Client.getExecutorService()
方法的具体详情如下:
包路径:com.sun.jersey.api.client.Client
类名称:Client
方法名:getExecutorService
[英]Get the ExecutorService for sending asynchronous HTTP requests when no underlying asynchronous HTTP implementation is utilized.
By default the implementation returned from Executors#newCachedThreadPool() is utilized.
[中]获取ExecutorService,用于在未使用基础异步HTTP实现时发送异步HTTP请求。
默认情况下,将使用从执行器#newCachedThreadPool()返回的实现。
代码示例来源:origin: com.sun.jersey/jersey-bundle
protected AsyncViewResource(Client c, URI u) {
super((ClientHandler)c);
this.client = c;
this.executorService = c.getExecutorService();
this.u = u;
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> create(final List<E> entities, final String serviceName) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.create(entities,serviceName);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> delete(final List<E> entities) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.delete(entities);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public Future<GenericServiceAPIResponseEntity<String>> delete(final EagleServiceSingleEntityQueryRequest request) throws EagleServiceClientException, IOException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.delete(request);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public void close() throws IOException {
if(LOG.isDebugEnabled()) LOG.debug("Executor service is shutting down");
this.client.getJerseyClient().getExecutorService().shutdown();
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> update(final List<E> entities, final String serviceName) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.update(entities, serviceName);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> create(final List<E> entities, final Class<E> entityClass) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.create(entities,entityClass);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> update(final List<E> entities) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.update(entities);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> update(final List<E> entities, final Class<E> entityClass) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.update(entities, entityClass);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public <E> Future<GenericServiceAPIResponseEntity<String>> search(final EagleServiceSingleEntityQueryRequest request) throws EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.search(request);
}
});
}
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> delete(final List<E> entities, final String serviceName) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.delete(entities, serviceName);
}
});
}
代码示例来源:origin: org.apache.eagle/eagle-client-base
@Override
public Future<GenericServiceAPIResponseEntity<String>> delete(final EagleServiceSingleEntityQueryRequest request) throws EagleServiceClientException, IOException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.delete(request);
}
});
}
代码示例来源:origin: com.sun.jersey/jersey-bundle
protected AsyncWebResource(Client c, CopyOnWriteHashMap<String, Object> properties, URI u) {
super((ClientHandler)c);
this.executorService = c.getExecutorService();
this.u = u;
this.properties = properties.clone();
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> create(final List<E> entities) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.create(entities);
}
});
}
代码示例来源:origin: apache/eagle
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> delete(final List<E> entities, final Class<E> entityClass) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.create(entities,entityClass);
}
});
}
代码示例来源:origin: org.apache.eagle/eagle-client-base
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> create(final List<E> entities) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.create(entities);
}
});
}
代码示例来源:origin: org.apache.eagle/eagle-client-base
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> update(final List<E> entities, final String serviceName) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.update(entities, serviceName);
}
});
}
代码示例来源:origin: org.apache.eagle/eagle-client-base
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> update(final List<E> entities, final Class<E> entityClass) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.update(entities, entityClass);
}
});
}
代码示例来源:origin: org.apache.eagle/eagle-client-base
@Override
public <E extends TaggedLogAPIEntity> Future<GenericServiceAPIResponseEntity<String>> update(final List<E> entities) throws IOException, EagleServiceClientException {
return this.client.getJerseyClient().getExecutorService().submit(new Callable<GenericServiceAPIResponseEntity<String>>() {
@Override
public GenericServiceAPIResponseEntity<String> call() throws Exception {
return client.update(entities);
}
});
}
代码示例来源:origin: com.atlassian.plugins/base-hipchat-integration-plugin-api
@Override
// we need to get rid of the thread pool in the ExecutorService we created, otherwise we leak threads when new versions of the plugin are
// installed, and when the plugin is disabled and re-enabled https://jira.atlassian.com/browse/HC-13981
public void destroy() throws Exception {
if (client.isInitialized()) {
client.get().getExecutorService().shutdown();
}
}
}
内容来源于网络,如有侵权,请联系作者删除!