org.simpleframework.http.Response.isCommitted()方法的使用及代码示例

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

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

Response.isCommitted介绍

[英]This can be used to determine whether the Response has been committed. This is true if the Response was committed, either due to an explicit invocation of the commit method or due to the writing of content. If the Response has committed the reset method will not work in resetting content already written.
[中]这可用于确定Response是否已提交。如果由于显式调用commit方法或由于写入内容而提交了Response,则是如此。如果Response已提交,reset方法将无法重置已写入的内容。

代码示例

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

@Override
public void failure(final Throwable error) {
  try {
    if (!response.isCommitted()) {
      response.setCode(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
      response.setDescription(error.getMessage());
    }
  } finally {
    logger.debugLog("failure(...) called");
    commit();
    rethrow(error);
  }
}

代码示例来源:origin: ngallagher/simpleframework

/**
* This can be used to determine whether the <code>Response</code>
* has been committed. This is true if the <code>Response</code> 
* was committed, either due to an explicit invocation of the
* <code>commit</code> method or due to the writing of content. If
* the <code>Response</code> has committed the <code>reset</code> 
* method will not work in resetting content already written.
*
* @return true if the response has been fully committed
*/ 
public boolean isCommitted() {
 return response.isCommitted();
}

代码示例来源:origin: org.simpleframework/simple

/**
* This can be used to determine whether the <code>Response</code>
* has been committed. This is true if the <code>Response</code> 
* was committed, either due to an explicit invocation of the
* <code>commit</code> method or due to the writing of content. If
* the <code>Response</code> has committed the <code>reset</code> 
* method will not work in resetting content already written.
*
* @return true if the response has been fully committed
*/ 
public boolean isCommitted() {
 return response.isCommitted();
}

代码示例来源:origin: org.simpleframework/simple-http

/**
* This can be used to determine whether the <code>Response</code>
* has been committed. This is true if the <code>Response</code> 
* was committed, either due to an explicit invocation of the
* <code>commit</code> method or due to the writing of content. If
* the <code>Response</code> has committed the <code>reset</code> 
* method will not work in resetting content already written.
*
* @return true if the response has been fully committed
*/ 
public boolean isCommitted() {
 return response.isCommitted();
}

代码示例来源:origin: org.glassfish.jersey.containers/jersey-container-simple-http

@Override
public void failure(final Throwable error) {
  try {
    if (!response.isCommitted()) {
      response.setCode(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
      response.setDescription(error.getMessage());
    }
  } finally {
    logger.debugLog("failure(...) called");
    commit();
    rethrow(error);
  }
}

相关文章