org.eclipse.jetty.server.Response.isCommitted()方法的使用及代码示例

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

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

Response.isCommitted介绍

暂无

代码示例

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

@Override
public void failure(final Throwable error) {
  try {
    if (!response.isCommitted()) {
      try {
        if (configSetStatusOverSendError) {
          response.reset();
          //noinspection deprecation
          response.setStatus(INTERNAL_SERVER_ERROR, "Request failed.");
        } else {
          response.sendError(INTERNAL_SERVER_ERROR, "Request failed.");
        }
      } catch (final IllegalStateException ex) {
        // a race condition externally committing the response can still occur...
        LOGGER.log(Level.FINER, "Unable to reset failed response.", ex);
      } catch (final IOException ex) {
        throw new ContainerException(LocalizationMessages.EXCEPTION_SENDING_ERROR_RESPONSE(INTERNAL_SERVER_ERROR,
            "Request failed."), ex);
      }
    }
  } finally {
    LOGGER.log(Level.FINEST, "failure(...) called");
    commit();
    rethrow(error);
  }
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public void resetBuffer()
{
  if (isCommitted())
    throw new IllegalStateException("Committed");
  _connection.getGenerator().resetBuffer();
}

代码示例来源:origin: org.eclipse.jetty/server

public void resetBuffer()
{
  if (isCommitted())
    throw new IllegalStateException("Committed");
  _connection.getGenerator().resetBuffer();
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public void resetBuffer()
{
  if (isCommitted())
    throw new IllegalStateException("Committed");
  _connection.getGenerator().resetBuffer();
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.jetty.server

@Override
public void setBufferSize(int size)
{
  if (isCommitted() || getContentCount() > 0)
    throw new IllegalStateException("cannot set buffer size on committed response");
  if (size <= 0)
    size = __MIN_BUFFER_SIZE;
  _out.setBufferSize(size);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public void resetBuffer()
{
  if (isCommitted())
    throw new IllegalStateException("Committed");
  _connection.getGenerator().resetBuffer();
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

@Override
public void setBufferSize(int size)
{
  if (isCommitted() || getContentCount() > 0)
    throw new IllegalStateException("Committed or content written");
  _out.setBufferSize(size);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public void setBufferSize(int size)
{
  if (isCommitted() || getContentCount()>0)
    throw new IllegalStateException("Committed or content written");
  if (size <= 0)
    size = __MIN_BUFFER_SIZE;
  _connection.getGenerator().increaseContentBufferSize(size);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public void setBufferSize(int size)
{
  if (isCommitted() || getContentCount()>0)
    throw new IllegalStateException("Committed or content written");
  if (size <= 0)
    size = __MIN_BUFFER_SIZE;
  _connection.getGenerator().increaseContentBufferSize(size);
}

代码示例来源:origin: org.eclipse.jetty/server

public void setBufferSize(int size)
{
  if (isCommitted() || getContentCount()>0)
    throw new IllegalStateException("Committed or content written");
  _connection.getGenerator().increaseContentBufferSize(size);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public void setBufferSize(int size)
{
  if (isCommitted() || getContentCount()>0)
    throw new IllegalStateException("Committed or content written");
  if (size <= 0)
    size = __MIN_BUFFER_SIZE;
  _connection.getGenerator().increaseContentBufferSize(size);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public void sendProcessing() throws IOException
{
  if (_connection.isExpecting102Processing() && !isCommitted())
    ((HttpGenerator)_connection.getGenerator()).send1xx(HttpStatus.PROCESSING_102);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp

public void sendProcessing() throws IOException
{
  if (_connection.isExpecting102Processing() && !isCommitted())
    ((HttpGenerator)_connection.getGenerator()).send1xx(HttpStatus.PROCESSING_102);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9

public void setLongContentLength(long len)
{
  // Protect from setting after committed as default handling
  // of a servlet HEAD request ALWAYS sets _content length, even
  // if the getHandling committed the response!
  if (isCommitted() || isIncluding())
    return;
  _contentLength = len;
  _fields.putLongField(HttpHeader.CONTENT_LENGTH.toString(), len);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus

public void sendProcessing() throws IOException
{
  if (_connection.isExpecting102Processing() && !isCommitted())
    ((HttpGenerator)_connection.getGenerator()).send1xx(HttpStatus.PROCESSING_102);
}

代码示例来源:origin: Nextdoor/bender

public void setLongContentLength(long len)
{
  // Protect from setting after committed as default handling
  // of a servlet HEAD request ALWAYS sets _content length, even
  // if the getHandling committed the response!
  if (isCommitted() || isIncluding())
    return;
  _contentLength = len;
  _fields.putLongField(HttpHeader.CONTENT_LENGTH.toString(), len);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public void sendProcessing() throws IOException
{
  if (_connection.isExpecting102Processing() && !isCommitted())
    ((HttpGenerator)_connection.getGenerator()).send1xx(HttpStatus.PROCESSING_102);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-server

public void setLongContentLength(long len)
{
  // Protect from setting after committed as default handling
  // of a servlet HEAD request ALWAYS sets _content length, even
  // if the getHandling committed the response!
  if (isCommitted() || _connection.isIncluding())
    return;
  _connection._generator.setContentLength(len);
  _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
}

代码示例来源:origin: org.eclipse.jetty/server

public void setLongContentLength(long len)
{
  // Protect from setting after committed as default handling
  // of a servlet HEAD request ALWAYS sets _content length, even
  // if the getHandling committed the response!
  if (isCommitted() || _connection.isIncluding())
    return;
  _connection._generator.setContentLength(len);
  _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
}

代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server

public void setLongContentLength(long len)
{
  // Protect from setting after committed as default handling
  // of a servlet HEAD request ALWAYS sets _content length, even
  // if the getHandling committed the response!
  if (isCommitted() || _connection.isIncluding())
    return;
  _connection._generator.setContentLength(len);
  _connection.getResponseFields().putLongField(HttpHeaders.CONTENT_LENGTH, len);
}

相关文章