本文整理了Java中org.glassfish.jersey.internal.util.collection.Ref
类的一些代码示例,展示了Ref
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ref
类的具体详情如下:
包路径:org.glassfish.jersey.internal.util.collection.Ref
类名称:Ref
[英]A possibly mutable value reference. Reference can be initialized by #set(Object)and the reference can be get by #get().
[中]一个可能可变的值引用。引用可以通过#set(Object)初始化,引用可以通过#get()获取。
代码示例来源:origin: jersey/jersey
@Override
public void onStatistics(MonitoringStatistics statistics) {
statisticsFactory.get().set(statistics);
}
}
代码示例来源:origin: jersey/jersey
@Override
public T get() {
return referenceFactory.get().get();
}
代码示例来源:origin: jersey/jersey
/**
* Lazily initialize {@link AsyncContext} for this
* request processing context.
* <p>
* The {@code lazyContextValue} will be only invoked once during the first call to {@link #asyncContext()}.
* As such, the asynchronous context for this request can be initialized lazily, on demand.
* </p>
*
* @param lazyContextValue lazily initialized {@code AsyncContext} instance bound to this request processing context.
*/
// TODO figure out how to make this package-private.
public void initAsyncContext(Value<AsyncContext> lazyContextValue) {
asyncContextValueRef.set(Values.lazy(lazyContextValue));
}
代码示例来源:origin: jersey/jersey
/**
* Get a {@link Value} instance holding the asynchronous context associated with this request processing context.
*
* May return an empty value if no asynchronous context has been initialized in this request processing context yet.
*
* @return value instance holding the asynchronous context associated with this request processing context.
* The returned value may be empty, if no asynchronous context has been initialized yet
* (see {@link #initAsyncContext(org.glassfish.jersey.internal.util.collection.Value)}).
*/
public Value<AsyncContext> asyncContextValue() {
return asyncContextValueRef.get();
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-common
public RestResult delete(String path, Map<String, Object> params) {
Ref<WebTarget> target = Refs.of(this.target);
for (String key : params.keySet()) {
target.set(target.get().queryParam(key, params.get(key)));
}
Response response = this.request(() -> {
return target.get().path(path).request().delete();
});
checkStatus(response, Response.Status.NO_CONTENT,
Response.Status.ACCEPTED);
return new RestResult(response);
}
代码示例来源:origin: jersey/jersey
/**
* Lazily initialize {@link AsyncContext} for this
* request processing context.
* <p>
* The {@code lazyContextValue} will be only invoked once during the first call to {@link #asyncContext()}.
* As such, the asynchronous context for this request can be initialized lazily, on demand.
* </p>
*
* @param lazyContextValue lazily initialized {@code AsyncContext} instance bound to this request processing context.
*/
// TODO figure out how to make this package-private.
public void initAsyncContext(Value<AsyncContext> lazyContextValue) {
asyncContextValueRef.set(Values.lazy(lazyContextValue));
}
代码示例来源:origin: jersey/jersey
/**
* Get a {@link Value} instance holding the asynchronous context associated with this request processing context.
*
* May return an empty value if no asynchronous context has been initialized in this request processing context yet.
*
* @return value instance holding the asynchronous context associated with this request processing context.
* The returned value may be empty, if no asynchronous context has been initialized yet
* (see {@link #initAsyncContext(org.glassfish.jersey.internal.util.collection.Value)}).
*/
public Value<AsyncContext> asyncContextValue() {
return asyncContextValueRef.get();
}
代码示例来源:origin: com.baidu.hugegraph/hugegraph-common
public RestResult put(String path, String id, Object object,
Map<String, Object> params) {
Ref<WebTarget> target = Refs.of(this.target);
if (params != null && !params.isEmpty()) {
for (String key : params.keySet()) {
target.set(target.get().queryParam(key, params.get(key)));
}
}
Response response = this.request(() -> {
return target.get().path(path).path(encode(id)).request()
.put(Entity.json(object));
});
// If check status failed, throw client exception.
checkStatus(response, Response.Status.OK, Response.Status.ACCEPTED);
return new RestResult(response);
}
代码示例来源:origin: jersey/jersey
@Override
public void onStatistics(MonitoringStatistics statistics) {
statisticsFactory.get().set(statistics);
}
}
代码示例来源:origin: jersey/jersey
@Override
public T provide() {
return referenceFactory.get().get();
}
代码示例来源:origin: jersey/jersey
varyHeaderValue.set(varyValue);
代码示例来源:origin: jersey/jersey
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof Ref)) {
return false;
}
Object otherRef = ((Ref) obj).get();
T localRef = this.reference;
return localRef == otherRef || (localRef != null && localRef.equals(otherRef));
}
代码示例来源:origin: jersey/jersey
@Override
public ClientRequest apply(ClientRequest requestContext) {
requestRefProvider.get().set(requestContext);
requestContext.setWorkers(workersProvider);
requestContext.setWriterInterceptors(writerInterceptors);
requestContext.setReaderInterceptors(readerInterceptors);
return requestContext;
}
}
代码示例来源:origin: jersey/jersey
@Override
public T provide() {
return referenceFactory.get().get();
}
代码示例来源:origin: jersey/jersey
varyHeaderValue.set(varyValue);
代码示例来源:origin: jersey/jersey
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof Ref)) {
return false;
}
Object otherRef = ((Ref) obj).get();
return this.reference == otherRef || (this.reference != null && this.reference.equals(otherRef));
}
代码示例来源:origin: jersey/jersey
private void processApplicationStatistics(ApplicationEvent event) {
final long now = System.currentTimeMillis();
final ApplicationInfo applicationInfo = new ApplicationInfoImpl(event.getResourceConfig(),
new Date(now), event.getRegisteredClasses(),
event.getRegisteredInstances(), event.getProviders());
applicationInfoRefProvider.get().set(applicationInfo);
}
代码示例来源:origin: jersey/jersey
@Override
public T get() {
return referenceFactory.get().get();
}
代码示例来源:origin: oracle/helidon
injectionManager.<Ref<ServerRequest>>getInstance(requestType).set(req);
injectionManager.<Ref<ServerResponse>>getInstance(responseType).set(res);
injectionManager.<Ref<Span>>getInstance(spanType).set(req.span());
injectionManager.<Ref<SpanContext>>getInstance(spanContextType).set(req.spanContext());
});
代码示例来源:origin: jersey/jersey
@Override
public boolean equals(final Object obj) {
if (obj == null) {
return false;
}
if (!(obj instanceof Ref)) {
return false;
}
Object otherRef = ((Ref) obj).get();
return this.reference == otherRef || (this.reference != null && this.reference.equals(otherRef));
}
内容来源于网络,如有侵权,请联系作者删除!