本文整理了Java中org.glassfish.grizzly.http.server.Response.isCommitted
方法的一些代码示例,展示了Response.isCommitted
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.isCommitted
方法的具体详情如下:
包路径:org.glassfish.grizzly.http.server.Response
类名称:Response
方法名:isCommitted
[英]Has the output of this response already been committed?
[中]此响应的输出是否已提交?
代码示例来源: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: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public boolean isCommitted() {
if (response == null) {
throw new IllegalStateException("Null response object");
}
return response.isCommitted();
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public boolean isCommitted() {
if (response == null) {
throw new IllegalStateException("Null response object");
}
return response.isCommitted();
}
代码示例来源:origin: javaee/grizzly
/**
* {@inheritDoc}
*/
@Override
public boolean isCommitted() {
if (response == null) {
throw new IllegalStateException("Null response object");
}
return response.isCommitted();
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server
/**
* Set the specified integer header to the specified value.
*
* @param name Name of the header to set
* @param value Integer value to be set
*/
public void setIntHeader(String name, int value) {
if (isCommitted())
return;
setHeader(name, "" + value);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server
/**
* Add the specified integer header to the specified value.
*
* @param name Name of the header to set
* @param value Integer value to be set
*/
public void addIntHeader(final String name, final int value) {
if (isCommitted())
return;
addHeader(name, "" + value);
}
代码示例来源:origin: javaee/grizzly
/**
* Add the specified integer header to the specified value.
*
* @param name Name of the header to set
* @param value Integer value to be set
*/
public void addIntHeader(final String name, final int value) {
if (isCommitted())
return;
addHeader(name, "" + value);
}
代码示例来源:origin: javaee/grizzly
/**
* Set the specified integer header to the specified value.
*
* @param name Name of the header to set
* @param value Integer value to be set
*/
public void setIntHeader(String name, int value) {
if (isCommitted())
return;
setHeader(name, "" + value);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
/**
* Add the specified integer header to the specified value.
*
* @param name Name of the header to set
* @param value Integer value to be set
*/
public void addIntHeader(final String name, final int value) {
if (isCommitted())
return;
addHeader(name, "" + value);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server
/**
* Set the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void setHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.setHeader(name, value);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server
/**
* Add the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void addHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.addHeader(name, value);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
public void setCharacterEncoding(String charset) {
checkResponse();
if (isCommitted())
return;
// Ignore any call made after the getWriter has been invoked
// The default should be used
if (usingWriter)
return;
response.setCharacterEncoding(charset);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* Set the Locale that is appropriate for this response, including
* setting the appropriate character encoding.
*
* @param locale The new locale
*/
public void setLocale(final Locale locale) {
checkResponse();
if (isCommitted())
return;
response.setLocale(locale);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-websockets-server
/**
* Set the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void setHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.setHeader(name, value);
}
代码示例来源:origin: javaee/grizzly
/**
* Add the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void addHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.addHeader(name, value);
}
代码示例来源:origin: javaee/grizzly
/**
* Add the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void addHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.addHeader(name, value);
}
代码示例来源:origin: javaee/grizzly
public void setCharacterEncoding(String charset) {
checkResponse();
if (isCommitted())
return;
// Ignore any call made after the getWriter has been invoked
// The default should be used
if (usingWriter)
return;
response.setCharacterEncoding(charset);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
/**
* Set the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void setHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.setHeader(name, value);
}
代码示例来源:origin: org.glassfish.grizzly/grizzly-http-server-core
/**
* Set the HTTP status and message to be returned with this response.
* @param status {@link HttpStatus} to set
*/
public void setStatus(HttpStatus status) {
checkResponse();
if (isCommitted())
return;
status.setValues(response);
}
代码示例来源:origin: javaee/grizzly
/**
* Set the specified header to the specified value.
*
* @param name Name of the header to set
* @param value Value to be set
*/
public void setHeader(final String name, final String value) {
checkResponse();
if (isCommitted())
return;
response.setHeader(name, value);
}
内容来源于网络,如有侵权,请联系作者删除!