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

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

本文整理了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

  1. @Override
  2. public void onStatistics(MonitoringStatistics statistics) {
  3. statisticsFactory.get().set(statistics);
  4. }
  5. }

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

  1. @Override
  2. public void onStatistics(MonitoringStatistics statistics) {
  3. statisticsFactory.get().set(statistics);
  4. }
  5. }

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

  1. /**
  2. * Lazily initialize {@link AsyncContext} for this
  3. * request processing context.
  4. * <p>
  5. * The {@code lazyContextValue} will be only invoked once during the first call to {@link #asyncContext()}.
  6. * As such, the asynchronous context for this request can be initialized lazily, on demand.
  7. * </p>
  8. *
  9. * @param lazyContextValue lazily initialized {@code AsyncContext} instance bound to this request processing context.
  10. */
  11. // TODO figure out how to make this package-private.
  12. public void initAsyncContext(Value<AsyncContext> lazyContextValue) {
  13. asyncContextValueRef.set(Values.lazy(lazyContextValue));
  14. }

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

  1. /**
  2. * Lazily initialize {@link AsyncContext} for this
  3. * request processing context.
  4. * <p>
  5. * The {@code lazyContextValue} will be only invoked once during the first call to {@link #asyncContext()}.
  6. * As such, the asynchronous context for this request can be initialized lazily, on demand.
  7. * </p>
  8. *
  9. * @param lazyContextValue lazily initialized {@code AsyncContext} instance bound to this request processing context.
  10. */
  11. // TODO figure out how to make this package-private.
  12. public void initAsyncContext(Value<AsyncContext> lazyContextValue) {
  13. asyncContextValueRef.set(Values.lazy(lazyContextValue));
  14. }

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

  1. @Override
  2. public ClientRequest apply(ClientRequest requestContext) {
  3. requestRefProvider.get().set(requestContext);
  4. requestContext.setWorkers(workersProvider);
  5. requestContext.setWriterInterceptors(writerInterceptors);
  6. requestContext.setReaderInterceptors(readerInterceptors);
  7. return requestContext;
  8. }
  9. }

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

  1. private void processApplicationStatistics(ApplicationEvent event) {
  2. final long now = System.currentTimeMillis();
  3. final ApplicationInfo applicationInfo = new ApplicationInfoImpl(event.getResourceConfig(),
  4. new Date(now), event.getRegisteredClasses(),
  5. event.getRegisteredInstances(), event.getProviders());
  6. applicationInfoRefProvider.get().set(applicationInfo);
  7. }

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

  1. @Override
  2. public ClientRequest apply(ClientRequest requestContext) {
  3. requestRefProvider.get().set(requestContext);
  4. requestContext.setWorkers(workersProvider);
  5. requestContext.setWriterInterceptors(writerInterceptors);
  6. requestContext.setReaderInterceptors(readerInterceptors);
  7. return requestContext;
  8. }
  9. }

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

  1. private void processApplicationStatistics(ApplicationEvent event) {
  2. final long now = System.currentTimeMillis();
  3. final ApplicationInfo applicationInfo = new ApplicationInfoImpl(event.getResourceConfig(),
  4. new Date(now), event.getRegisteredClasses(),
  5. event.getRegisteredInstances(), event.getProviders());
  6. applicationInfoRefProvider.get().set(applicationInfo);
  7. }

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

  1. @Override
  2. public ClientRequest apply(ClientRequest requestContext) {
  3. requestRefProvider.get().set(requestContext);
  4. requestContext.setWorkers(workersProvider);
  5. requestContext.setWriterInterceptors(writerInterceptors);
  6. requestContext.setReaderInterceptors(readerInterceptors);
  7. return requestContext;
  8. }
  9. }

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

  1. varyHeaderValue.set(varyValue);

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

  1. varyHeaderValue.set(varyValue);

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

  1. injectionManager.<Ref<ServerRequest>>getInstance(requestType).set(req);
  2. injectionManager.<Ref<ServerResponse>>getInstance(responseType).set(res);
  3. injectionManager.<Ref<Span>>getInstance(spanType).set(req.span());
  4. injectionManager.<Ref<SpanContext>>getInstance(spanContextType).set(req.spanContext());
  5. });

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

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

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

  1. /**
  2. * Run the data through a chain of stages identified by the root stage.
  3. *
  4. * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef}
  5. * parameter.
  6. *
  7. * @param <DATA> processed data type.
  8. * @param data data to be processed.
  9. * @param rootStage root stage of the stage chain.
  10. * @param inflectorRef a mutable reference to an inflector.
  11. * @return processing result.
  12. */
  13. public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process(
  14. DATA data,
  15. Stage<DATA> rootStage,
  16. Ref<T> inflectorRef) {
  17. Stage<DATA> lastStage = rootStage;
  18. Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage);
  19. while (continuation.next() != null) {
  20. lastStage = continuation.next();
  21. continuation = lastStage.apply(continuation.result());
  22. }
  23. inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage));
  24. return continuation.result();
  25. }

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

  1. /**
  2. * Run the data through a chain of stages identified by the root stage.
  3. *
  4. * If an inflector is found in the leaf stage, it's reference is set into the {@code inflectorRef}
  5. * parameter.
  6. *
  7. * @param <DATA> processed data type.
  8. * @param data data to be processed.
  9. * @param rootStage root stage of the stage chain.
  10. * @param inflectorRef a mutable reference to an inflector.
  11. * @return processing result.
  12. */
  13. public static <DATA, RESULT, T extends Inflector<DATA, RESULT>> DATA process(
  14. DATA data,
  15. Stage<DATA> rootStage,
  16. Ref<T> inflectorRef) {
  17. Stage<DATA> lastStage = rootStage;
  18. Stage.Continuation<DATA> continuation = Stage.Continuation.of(data, lastStage);
  19. while (continuation.next() != null) {
  20. lastStage = continuation.next();
  21. continuation = lastStage.apply(continuation.result());
  22. }
  23. inflectorRef.set(Stages.<DATA, RESULT, T>extractInflector(lastStage));
  24. return continuation.result();
  25. }

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

  1. @Override
  2. public void filter(ContainerRequestContext request) {
  3. boolean closeParentSpan = false;
  4. SpanContext requestSpanContext = parentSpanContextProvider.get();
  5. if (null == requestSpanContext) {
  6. closeParentSpan = true;
  7. Span requestSpan = security().tracer().buildSpan("security-parent").start();
  8. request.setProperty(PROP_PARENT_SPAN, requestSpan);
  9. requestSpanContext = requestSpan.context();
  10. }
  11. request.setProperty(PROP_CLOSE_PARENT_SPAN, closeParentSpan);
  12. // create a new security context
  13. SecurityContext securityContext = security()
  14. .contextBuilder(Integer.toString(CONTEXT_COUNTER.incrementAndGet(), Character.MAX_RADIX))
  15. .tracingSpan(requestSpanContext)
  16. .executorService(executorService)
  17. .build();
  18. injectionManager.<Ref<SecurityContext>>getInstance((new GenericType<Ref<SecurityContext>>() { }).getType())
  19. .set(securityContext);
  20. if (featureConfig().shouldUsePrematchingAuthentication()) {
  21. doFilter(request, securityContext);
  22. }
  23. }

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

  1. @Override
  2. public void handle(final Request request, final Response response) {
  3. final ResponseWriter responseWriter = new ResponseWriter(response, scheduler);
  4. final URI baseUri = getBaseUri(request);
  5. final URI requestUri = getRequestUri(request, baseUri);
  6. try {
  7. final ContainerRequest requestContext = new ContainerRequest(baseUri, requestUri,
  8. request.getMethod(), getSecurityContext(request), new MapPropertiesDelegate());
  9. requestContext.setEntityStream(request.getInputStream());
  10. for (final String headerName : request.getNames()) {
  11. requestContext.headers(headerName, request.getValue(headerName));
  12. }
  13. requestContext.setWriter(responseWriter);
  14. requestContext.setRequestScopedInitializer(injectionManager -> {
  15. injectionManager.<Ref<Request>>getInstance(RequestTYPE).set(request);
  16. injectionManager.<Ref<Response>>getInstance(ResponseTYPE).set(response);
  17. });
  18. appHandler.handle(requestContext);
  19. } catch (final Exception ex) {
  20. throw new RuntimeException(ex);
  21. } finally {
  22. if (!responseWriter.isSuspended()) {
  23. close(response);
  24. }
  25. }
  26. }

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

  1. @Override
  2. public void onStatistics(MonitoringStatistics statistics) {
  3. statisticsFactory.get().set(statistics);
  4. }
  5. }

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

  1. @Override
  2. public void service(final Request request, final Response response) {
  3. final ResponseWriter responseWriter = new ResponseWriter(response, configSetStatusOverSendError);
  4. try {
  5. logger.debugLog("GrizzlyHttpContainer.service(...) started");
  6. URI baseUri = getBaseUri(request);
  7. URI requestUri = getRequestUri(request);
  8. final ContainerRequest requestContext = new ContainerRequest(baseUri,
  9. requestUri, request.getMethod().getMethodString(),
  10. getSecurityContext(request), new GrizzlyRequestPropertiesDelegate(request));
  11. requestContext.setEntityStream(request.getInputStream());
  12. for (final String headerName : request.getHeaderNames()) {
  13. requestContext.headers(headerName, request.getHeaders(headerName));
  14. }
  15. requestContext.setWriter(responseWriter);
  16. requestContext.setRequestScopedInitializer(injectionManager -> {
  17. injectionManager.<Ref<Request>>getInstance(RequestTYPE).set(request);
  18. injectionManager.<Ref<Response>>getInstance(ResponseTYPE).set(response);
  19. });
  20. appHandler.handle(requestContext);
  21. } finally {
  22. logger.debugLog("GrizzlyHttpContainer.service(...) finished");
  23. }
  24. }

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

  1. private void processApplicationStatistics(ApplicationEvent event) {
  2. final long now = System.currentTimeMillis();
  3. final ApplicationInfo applicationInfo = new ApplicationInfoImpl(event.getResourceConfig(),
  4. new Date(now), event.getRegisteredClasses(),
  5. event.getRegisteredInstances(), event.getProviders());
  6. applicationInfoRefProvider.get().set(applicationInfo);
  7. }

相关文章

Ref类方法