org.glassfish.grizzly.http.server.Request.getInputBuffer()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(134)

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

Request.getInputBuffer介绍

暂无

代码示例

代码示例来源:origin: org.glassfish.main.web/web-core

  1. /**
  2. * Associated Grizzly request.
  3. *
  4. * @param grizzlyRequest Associated Grizzly request
  5. */
  6. public void setRequest(Request grizzlyRequest) {
  7. this.grizzlyRequest = grizzlyRequest;
  8. this.grizzlyInputBuffer = grizzlyRequest.getInputBuffer();
  9. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

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

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: javaee/grizzly

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

  1. /**
  2. * Override the default implementation to notify the {@link ReadHandler},
  3. * if available, of any read error that has occurred during processing.
  4. *
  5. * @param ctx event processing {@link FilterChainContext}
  6. * @param error error, which occurred during <tt>FilterChain</tt> execution
  7. */
  8. @Override
  9. public void exceptionOccurred(final FilterChainContext ctx,
  10. final Throwable error) {
  11. final HttpContext context = HttpContext.get(ctx);
  12. if (context != null) {
  13. final Request request = httpRequestInProgress.get(context);
  14. if (request != null) {
  15. final ReadHandler handler = request.getInputBuffer().getReadHandler();
  16. if (handler != null) {
  17. handler.onError(error);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server

  1. public static Object populateCertificateAttribute(final Request request) {
  2. Object certificates = null;
  3. if (request.getRequest().isSecure()) {
  4. if (!request.getRequest().isUpgrade()) {
  5. // It's normal HTTP request, not upgraded one
  6. try {
  7. request.getInputBuffer().fillFully(
  8. request.getHttpFilter().getConfiguration().getMaxBufferedPostSize());
  9. } catch (IOException e) {
  10. throw new IllegalStateException("Can't complete SSL re-negotation", e);
  11. }
  12. }
  13. GrizzlyFuture<Object[]> certFuture =
  14. new CertificateEvent(true).trigger(request.getContext());
  15. try {
  16. // TODO: make the timeout configurable
  17. certificates = certFuture.get(30, TimeUnit.SECONDS);
  18. } catch (Exception e) {
  19. if (LOGGER.isLoggable(Level.FINE)) {
  20. LOGGER.log(Level.FINE,
  21. "Unable to obtain certificates from peer.",
  22. e);
  23. }
  24. }
  25. request.setAttribute(SSLSupport.CERTIFICATE_KEY, certificates);
  26. }
  27. return certificates;
  28. }

代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server

  1. request.httpServerFilter, ctx.getConnection(), request);
  2. final InputBuffer inputBuffer = request.getInputBuffer();
  3. if (!inputBuffer.isFinished()) {
  4. inputBuffer.terminate();

代码示例来源:origin: javaee/grizzly

  1. request.httpServerFilter, ctx.getConnection(), request);
  2. final InputBuffer inputBuffer = request.getInputBuffer();
  3. if (!inputBuffer.isFinished()) {
  4. inputBuffer.terminate();

代码示例来源:origin: javaee/grizzly

  1. request.httpServerFilter, ctx.getConnection(), request);
  2. final InputBuffer inputBuffer = request.getInputBuffer();
  3. if (!inputBuffer.isFinished()) {
  4. inputBuffer.terminate();

代码示例来源:origin: javaee/grizzly

  1. request.httpServerFilter, ctx.getConnection(), request);
  2. final InputBuffer inputBuffer = request.getInputBuffer();
  3. if (!inputBuffer.isFinished()) {
  4. inputBuffer.terminate();

代码示例来源:origin: javaee/grizzly

  1. request.httpServerFilter, ctx.getConnection(), request);
  2. final InputBuffer inputBuffer = request.getInputBuffer();
  3. if (!inputBuffer.isFinished()) {
  4. inputBuffer.terminate();

代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server

  1. request.httpServerFilter, ctx.getConnection(), request);
  2. final InputBuffer inputBuffer = request.getInputBuffer();
  3. if (!inputBuffer.isFinished()) {
  4. inputBuffer.terminate();

代码示例来源:origin: javaee/grizzly

  1. public static Object populateCertificateAttribute(final Request request) {
  2. Object certificates = null;
  3. if (request.getRequest().isSecure()) {
  4. if (!request.getRequest().isUpgrade()) {
  5. // It's normal HTTP request, not upgraded one
  6. try {
  7. request.getInputBuffer().fillFully(
  8. request.getHttpFilter().getConfiguration().getMaxBufferedPostSize());
  9. } catch (IOException e) {
  10. throw new IllegalStateException("Can't complete SSL re-negotation", e);
  11. }
  12. }
  13. GrizzlyFuture<Object[]> certFuture =
  14. new CertificateEvent(true).trigger(request.getContext());
  15. try {
  16. // TODO: make the timeout configurable
  17. certificates = certFuture.get(30, TimeUnit.SECONDS);
  18. } catch (Exception e) {
  19. if (LOGGER.isLoggable(Level.FINE)) {
  20. LOGGER.log(Level.FINE,
  21. "Unable to obtain certificates from peer.",
  22. e);
  23. }
  24. }
  25. request.setAttribute(SSLSupport.CERTIFICATE_KEY, certificates);
  26. }
  27. return certificates;
  28. }

相关文章

Request类方法