org.glassfish.jersey.internal.util.collection.Ref.set()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.glassfish.jersey.internal.util.collection.Ref.set方法的一些代码示例,展示了Ref.set的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ref.set方法的具体详情如下:
包路径:org.glassfish.jersey.internal.util.collection.Ref
类名称:Ref
方法名:set

Ref.set介绍

暂无

代码示例

代码示例来源:origin: jersey/jersey

@Override
  public void onStatistics(MonitoringStatistics statistics) {
    statisticsFactory.get().set(statistics);
  }
}

代码示例来源:origin: jersey/jersey

@Override
  public void onStatistics(MonitoringStatistics statistics) {
    statisticsFactory.get().set(statistics);
  }
}

代码示例来源: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

/**
 * 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

@Override
  public ClientRequest apply(ClientRequest requestContext) {
    requestRefProvider.get().set(requestContext);
    requestContext.setWorkers(workersProvider);
    requestContext.setWriterInterceptors(writerInterceptors);
    requestContext.setReaderInterceptors(readerInterceptors);

    return requestContext;
  }
}

代码示例来源: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 ClientRequest apply(ClientRequest requestContext) {
    requestRefProvider.get().set(requestContext);
    requestContext.setWorkers(workersProvider);
    requestContext.setWriterInterceptors(writerInterceptors);
    requestContext.setReaderInterceptors(readerInterceptors);

    return requestContext;
  }
}

代码示例来源: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: org.glassfish.jersey.core/jersey-client

@Override
  public ClientRequest apply(ClientRequest requestContext) {
    requestRefProvider.get().set(requestContext);
    requestContext.setWorkers(workersProvider);
    requestContext.setWriterInterceptors(writerInterceptors);
    requestContext.setReaderInterceptors(readerInterceptors);

    return requestContext;
  }
}

代码示例来源:origin: jersey/jersey

varyHeaderValue.set(varyValue);

代码示例来源:origin: jersey/jersey

varyHeaderValue.set(varyValue);

代码示例来源: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

injectionManager.<Ref<Request>>getInstance(REQUEST_TYPE).set(request);
  injectionManager.<Ref<Response>>getInstance(RESPONSE_TYPE).set(response);
});

代码示例来源:origin: jersey/jersey

/**
 * Run the data through a chain of stages identified by the root stage.
 *
 * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef}
 * parameter.
 *
 * @param <DATA>       processed data type.
 * @param data         data to be processed.
 * @param rootStage    root stage of the stage chain.
 * @param inflectorRef a mutable reference to an inflector.
 * @return processing result.
 */
public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process(
    DATA data,
    Stage<DATA> rootStage,
    Ref<T> inflectorRef) {
  Stage<DATA> lastStage = rootStage;
  Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage);
  while (continuation.next() != null) {
    lastStage = continuation.next();
    continuation = lastStage.apply(continuation.result());
  }
  inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage));
  return continuation.result();
}

代码示例来源:origin: jersey/jersey

/**
 * Run the data through a chain of stages identified by the root stage.
 *
 * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef}
 * parameter.
 *
 * @param <DATA>       processed data type.
 * @param data         data to be processed.
 * @param rootStage    root stage of the stage chain.
 * @param inflectorRef a mutable reference to an inflector.
 * @return processing result.
 */
public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process(
    DATA data,
    Stage<DATA> rootStage,
    Ref<T> inflectorRef) {
  Stage<DATA> lastStage = rootStage;
  Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage);
  while (continuation.next() != null) {
    lastStage = continuation.next();
    continuation = lastStage.apply(continuation.result());
  }
  inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage));
  return continuation.result();
}

代码示例来源:origin: oracle/helidon

@Override
public void filter(ContainerRequestContext request) {
  boolean closeParentSpan = false;
  SpanContext requestSpanContext = parentSpanContextProvider.get();
  if (null == requestSpanContext) {
    closeParentSpan = true;
    Span requestSpan = security().tracer().buildSpan("security-parent").start();
    request.setProperty(PROP_PARENT_SPAN, requestSpan);
    requestSpanContext = requestSpan.context();
  }
  request.setProperty(PROP_CLOSE_PARENT_SPAN, closeParentSpan);
  // create a new security context
  SecurityContext securityContext = security()
      .contextBuilder(Integer.toString(CONTEXT_COUNTER.incrementAndGet(), Character.MAX_RADIX))
      .tracingSpan(requestSpanContext)
      .executorService(executorService)
      .build();
  injectionManager.<Ref<SecurityContext>>getInstance((new GenericType<Ref<SecurityContext>>() { }).getType())
      .set(securityContext);
  if (featureConfig().shouldUsePrematchingAuthentication()) {
    doFilter(request, securityContext);
  }
}

代码示例来源:origin: jersey/jersey

@Override
public void handle(final Request request, final Response response) {
  final ResponseWriter responseWriter = new ResponseWriter(response, scheduler);
  final URI baseUri = getBaseUri(request);
  final URI requestUri = getRequestUri(request, baseUri);
  try {
    final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri,
        request.getMethod(), getSecurityContext(request), new MapPropertiesDelegate());
    requestContext.setEntityStream(request.getInputStream());
    for (final String headerName : request.getNames()) {
      requestContext.headers(headerName, request.getValue(headerName));
    }
    requestContext.setWriter(responseWriter);
    requestContext.setRequestScopedInitializer(injectionManager -> {
      injectionManager.<Ref<Request>>getInstance(RequestTYPE).set(request);
      injectionManager.<Ref<Response>>getInstance(ResponseTYPE).set(response);
    });
    appHandler.handle(requestContext);
  } catch (final Exception ex) {
    throw new RuntimeException(ex);
  } finally {
    if (!responseWriter.isSuspended()) {
      close(response);
    }
  }
}

代码示例来源:origin: org.glassfish.jersey.core/jersey-server

@Override
  public void onStatistics(MonitoringStatistics statistics) {
    statisticsFactory.get().set(statistics);
  }
}

代码示例来源:origin: jersey/jersey

@Override
public void service(final Request request, final Response response) {
  final ResponseWriter responseWriter = new ResponseWriter(response, configSetStatusOverSendError);
  try {
    logger.debugLog("GrizzlyHttpContainer.service(...) started");
    URI baseUri = getBaseUri(request);
    URI requestUri = getRequestUri(request);
    final ContainerRequest requestContext = new ContainerRequest(baseUri,
        requestUri, request.getMethod().getMethodString(),
        getSecurityContext(request), new GrizzlyRequestPropertiesDelegate(request));
    requestContext.setEntityStream(request.getInputStream());
    for (final String headerName : request.getHeaderNames()) {
      requestContext.headers(headerName, request.getHeaders(headerName));
    }
    requestContext.setWriter(responseWriter);
    requestContext.setRequestScopedInitializer(injectionManager -> {
      injectionManager.<Ref<Request>>getInstance(RequestTYPE).set(request);
      injectionManager.<Ref<Response>>getInstance(ResponseTYPE).set(response);
    });
    appHandler.handle(requestContext);
  } finally {
    logger.debugLog("GrizzlyHttpContainer.service(...) finished");
  }
}

代码示例来源:origin: org.glassfish.jersey.core/jersey-server

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);
}

相关文章

Ref类方法