本文整理了Java中org.glassfish.grizzly.http.server.Response.reset
方法的一些代码示例,展示了Response.reset
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.reset
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Response
类名称:Response
方法名:reset
[英]Clears any data that exists in the buffer as well as the status code and headers.
[中]清除缓冲区中存在的所有数据以及状态代码和标头。
代码示例来源:origin: jersey/jersey
@Override
@SuppressWarnings("MagicNumber")
public void failure(final Throwable error) {
try {
if (!grizzlyResponse.isCommitted()) {
try {
if (configSetStatusOverSendError) {
grizzlyResponse.reset();
grizzlyResponse.setStatus(500, "Request failed.");
} else {
grizzlyResponse.sendError(500, "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(500, "Request failed."),
ex);
}
}
} finally {
logger.debugLog("{0} - failure(...) called", name);
rethrow(error);
}
}
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Clear any content written to the buffer.
*
* @exception IllegalStateException if this response has already
* been committed
*/
public void reset() {
if (included)
return; // Ignore any call from an included servlet
coyoteResponse.reset();
outputBuffer.reset();
// reset Grizzly duplicated internal attributes
coyoteResponse.resetBuffer(true);
usingOutputStream = false;
usingWriter = false;
isCharacterEncodingSet = false;
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public void reset() {
if (isCommitted())
throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed.");
response.reset();
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* {@inheritDoc}
*/
@Override
public void reset() {
if (isCommitted())
throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed.");
response.reset();
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public void reset() {
if (isCommitted())
throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed.");
response.reset();
}
代码示例来源:origin: org.mule.glassfish.grizzly/grizzly-http-server
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public void reset() {
if (isCommitted())
throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed.");
response.reset();
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public void reset() {
if (isCommitted())
throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed.");
response.reset();
}
代码示例来源:origin: javaee/grizzly
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public void reset() {
if (isCommitted())
throw new IllegalStateException("Illegal attempt to reset the response after it has already been committed.");
response.reset();
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
/**
* Reset this response, and specify the values for the HTTP status code
* and corresponding message.
*
* @exception IllegalStateException if this response has already been
* committed
*/
public void reset(final int status, final String message) {
reset();
setStatus(status, message);
}
代码示例来源:origin: org.glassfish.jersey.containers/jersey-container-grizzly2-http
@Override
@SuppressWarnings("MagicNumber")
public void failure(final Throwable error) {
try {
if (!grizzlyResponse.isCommitted()) {
try {
if (configSetStatusOverSendError) {
grizzlyResponse.reset();
grizzlyResponse.setStatus(500, "Request failed.");
} else {
grizzlyResponse.sendError(500, "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(500, "Request failed."),
ex);
}
}
} finally {
logger.debugLog("{0} - failure(...) called", name);
rethrow(error);
}
}
内容来源于网络,如有侵权,请联系作者删除!