本文整理了Java中org.apache.catalina.connector.Request.isEventMode
方法的一些代码示例,展示了Request.isEventMode
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.isEventMode
方法的具体详情如下:
包路径:org.apache.catalina.connector.Request
类名称:Request
方法名:isEventMode
[英]Return true if the current request is using event mode.
[中]如果当前请求使用事件模式,则返回true。
代码示例来源:origin: org.jboss.web/jbossweb
/**
* Close the input buffer.
*
* @throws IOException An underlying IOException occurred
*/
public void close()
throws IOException {
if (request.getUpgradeHandler() != null && request.isEventMode()) {
request.getEvent().close();
} else {
closed = true;
}
}
代码示例来源:origin: org.jboss.web/jbossweb
if (request.isEventMode() && !response.isClosed()) {
代码示例来源:origin: jboss.web/jbossweb
if (request.isEventMode() && !response.isClosed()) {
代码示例来源:origin: jboss.web/jbossweb
public int available() {
if (eof || closed) {
return -1;
}
int available = 0;
if (state != CHAR_STATE) {
available = bb.getLength();
if (request.isEventMode() && available == 0) {
try {
coyoteRequest.action(ActionCode.ACTION_AVAILABLE, null);
available = realReadBytes(null, 0, 0);
} catch (IOException e) {
// Ignore, will return 0, and another error
// will occur elsewhere
}
}
} else {
available = cb.getLength();
if (request.isEventMode() && available == 0) {
try {
coyoteRequest.action(ActionCode.ACTION_AVAILABLE, null);
available = realReadChars(null, 0, cb.getBuffer().length);
} catch (IOException e) {
// Ignore, will return 0, and another error
// will occur elsewhere
}
}
}
return available;
}
代码示例来源:origin: org.jboss.web/jbossweb
public int available() {
if (eof || closed) {
return -1;
}
int available = 0;
if (state != CHAR_STATE) {
available = bb.getLength();
if (request.isEventMode() && available == 0) {
try {
coyoteRequest.action(ActionCode.ACTION_AVAILABLE, null);
available = realReadBytes(null, 0, 0);
} catch (IOException e) {
// Ignore, will return 0, and another error
// will occur elsewhere
}
}
} else {
available = cb.getLength();
if (request.isEventMode() && available == 0) {
try {
coyoteRequest.action(ActionCode.ACTION_AVAILABLE, null);
available = realReadChars(null, 0, cb.getBuffer().length);
} catch (IOException e) {
// Ignore, will return 0, and another error
// will occur elsewhere
}
}
}
return available;
}
代码示例来源:origin: org.jboss.web/jbossweb
public void setReadListener(ReadListener readListener) {
if (this.readListener != null) {
throw MESSAGES.readListenerAlreadySet();
}
if (readListener == null) {
throw MESSAGES.nullListener();
}
if (!request.isEventMode()) {
throw MESSAGES.cannotSetListenerWithoutUpgradeOrAsync();
}
this.readListener = readListener;
coyoteRequest.action(ActionCode.ACTION_EVENT_READ_BEGIN,
(request.getUpgradeHandler() != null) ? readListener : null);
}
代码示例来源:origin: org.jboss.web/jbossweb
public void setWriteListener(WriteListener writeListener) {
if (this.writeListener != null) {
throw MESSAGES.writeListenerAlreadySet();
}
if (writeListener == null) {
throw MESSAGES.nullListener();
}
if (!response.getRequest().isEventMode()) {
throw MESSAGES.cannotSetListenerWithoutUpgradeOrAsync();
}
this.writeListener = writeListener;
coyoteResponse.action(ActionCode.ACTION_EVENT_WRITE_BEGIN,
(response.getRequest().getUpgradeHandler() != null) ? writeListener : null);
}
代码示例来源:origin: jboss.web/jbossweb
Request.AsyncContextImpl asyncContext = (Request.AsyncContextImpl) request.getAsyncContext();
if ((event.getType() == EventType.TIMEOUT || event.getType() == EventType.ERROR)
&& request.isEventMode() && asyncContext.getPath() == null) {
Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
if (t != null) {
if (request.isEventMode() && asyncContext.getPath() == null) {
asyncContext.complete();
代码示例来源:origin: org.jboss.web/jbossweb
Request.AsyncContextImpl asyncContext = (Request.AsyncContextImpl) request.getAsyncContext();
if ((event.getType() == EventType.TIMEOUT || event.getType() == EventType.ERROR)
&& request.isEventMode() && asyncContext.getPath() == null) {
Throwable t = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
if (t != null) {
if (request.isEventMode() && asyncContext.getPath() == null) {
asyncContext.complete();
代码示例来源:origin: org.jboss.web/jbossweb
if (request.getUpgradeHandler() != null && request.isEventMode()) {
request.getEvent().close();
return;
代码示例来源:origin: jboss.web/jbossweb
if (request instanceof Request) {
Request coreRequest = (Request) request;
event = coreRequest.isEventMode();
requestFacade = (RequestFacade) coreRequest.getRequest();
} else {
代码示例来源:origin: org.jboss.web/jbossweb
if (request instanceof Request) {
Request coreRequest = (Request) request;
event = coreRequest.isEventMode();
requestFacade = (RequestFacade) coreRequest.getRequest();
} else {
代码示例来源:origin: org.jboss.web/jbossweb
if (request.isEventMode()) {
if (!response.isClosed() && !response.isError()) {
res.action(ActionCode.ACTION_EVENT_BEGIN,
代码示例来源:origin: jboss.web/jbossweb
if (request.isEventMode()) {
if (!response.isClosed() && !response.isError()) {
res.action(ActionCode.ACTION_EVENT_BEGIN,
代码示例来源:origin: org.jboss.web/jbossweb
if (timeout && request.isEventMode() && asyncContext.getPath() == null) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
end = true;
if (error && request.isEventMode() && asyncContext.getPath() == null) {
exception(request, response, asyncContext.getError());
代码示例来源:origin: jboss.web/jbossweb
if (!request.isEventMode()) {
if (!request.isEventMode()) {
if (!request.isEventMode()) {
break;
case TIMEOUT:
if (!request.isEventMode()) {
代码示例来源:origin: org.jboss.web/jbossweb
if (request.isEventMode() && !request.isAsyncStarted()) {
代码示例来源:origin: org.jboss.web/jbossweb
if (!request.isEventMode()) {
if (!request.isEventMode()) {
if (!request.isEventMode()) {
break;
case TIMEOUT:
if (!request.isEventMode()) {
代码示例来源:origin: jboss.web/jbossweb
if (request.isEventMode() && !request.isAsyncStarted()) {
内容来源于网络,如有侵权,请联系作者删除!