本文整理汇总了Java中org.apache.coyote.RequestInfo.setStage方法的典型用法代码示例。如果您正苦于以下问题:Java RequestInfo.setStage方法的具体用法?Java RequestInfo.setStage怎么用?Java RequestInfo.setStage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.coyote.RequestInfo
的用法示例。
在下文中一共展示了RequestInfo.setStage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status)
throws IOException {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().event(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
// 500 - Internal Server Error
response.setStatus(500);
setErrorState(ErrorState.CLOSE_NOW, t);
getAdapter().log(request, response, 0);
log.error(sm.getString("http11processor.request.process"), t);
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError() || status==SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.LONG;
}
}
示例2: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException
* error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status) throws IOException {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().event(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
// 500 - Internal Server Error
response.setStatus(500);
setErrorState(ErrorState.CLOSE_NOW, t);
getAdapter().log(request, response, 0);
log.error(sm.getString("http11processor.request.process"), t);
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError() || status == SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.LONG;
}
}
示例3: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
error = !adapter.asyncDispatch(request, response, status);
resetTimeouts();
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLog().error(sm.getString("http11processor.request.process"), t);
error = true;
} finally {
if (error) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (isAsync()) {
if (error) {
request.updateCounters();
return SocketState.CLOSED;
} else {
return SocketState.LONG;
}
} else {
request.updateCounters();
if (error) {
return SocketState.CLOSED;
} else {
return SocketState.OPEN;
}
}
}
示例4: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
error = !adapter.asyncDispatch(request, response, status);
resetTimeouts();
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLog().error(sm.getString("http11processor.request.process"), t);
error = true;
} finally {
if (error) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (error) {
return SocketState.CLOSED;
} else if (isAsync()) {
return SocketState.LONG;
} else {
if (!keepAlive) {
return SocketState.CLOSED;
} else {
getInputBuffer().nextRequest();
getOutputBuffer().nextRequest();
return SocketState.OPEN;
}
}
}
示例5: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status)
throws IOException {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
error = !adapter.event(request, response, status);
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.error(sm.getString("http11processor.request.process"), t);
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
error = true;
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (error || status==SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.LONG;
}
}
示例6: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().asyncDispatch(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
resetTimeouts();
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
setErrorState(ErrorState.CLOSE_NOW, t);
getLog().error(sm.getString("http11processor.request.process"), t);
} finally {
if (getErrorState().isError()) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError()) {
return SocketState.CLOSED;
} else if (isAsync()) {
return SocketState.LONG;
} else {
if (!keepAlive) {
return SocketState.CLOSED;
} else {
getInputBuffer().nextRequest();
getOutputBuffer().nextRequest();
return SocketState.OPEN;
}
}
}
示例7: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
error = !adapter.asyncDispatch(request, response, status);
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
getLog().error(sm.getString("http11processor.request.process"), t);
error = true;
} finally {
if (error) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (isAsync()) {
if (error) {
request.updateCounters();
return SocketState.CLOSED;
} else {
return SocketState.LONG;
}
} else {
request.updateCounters();
if (error) {
return SocketState.CLOSED;
} else {
return SocketState.OPEN;
}
}
}
示例8: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if(!getAdapter().asyncDispatch(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
resetTimeouts();
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
setErrorState(ErrorState.CLOSE_NOW, t);
getLog().error(sm.getString("http11processor.request.process"), t);
} finally {
if (getErrorState().isError()) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (isAsync()) {
if (getErrorState().isError()) {
request.updateCounters();
return SocketState.CLOSED;
} else {
return SocketState.LONG;
}
} else {
request.updateCounters();
if (getErrorState().isError()) {
return SocketState.CLOSED;
} else {
recycle(false);
return SocketState.OPEN;
}
}
}
示例9: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status) throws IOException {
long soTimeout = endpoint.getSoTimeout();
RequestInfo rp = request.getRequestProcessor();
final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().event(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
if (!getErrorState().isError()) {
if (attach != null) {
attach.setComet(comet);
if (comet) {
Integer comettimeout = (Integer) request.getAttribute(
org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
if (comettimeout != null) {
attach.setTimeout(comettimeout.longValue());
}
} else {
//reset the timeout
if (keepAlive) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
}
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
// 500 - Internal Server Error
response.setStatus(500);
setErrorState(ErrorState.CLOSE_NOW, t);
log.error(sm.getString("http11processor.request.process"), t);
getAdapter().log(request, response, 0);
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError() || status==SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
if (keepAlive) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.CLOSED;
}
} else {
return SocketState.LONG;
}
}
示例10: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().asyncDispatch(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
resetTimeouts();
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
setErrorState(ErrorState.CLOSE_NOW, t);
getLog().error(sm.getString("http11processor.request.process"), t);
} finally {
if (getErrorState().isError()) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (isAsync()) {
if (getErrorState().isError()) {
request.updateCounters();
return SocketState.CLOSED;
} else {
return SocketState.LONG;
}
} else {
request.updateCounters();
if (getErrorState().isError()) {
return SocketState.CLOSED;
} else {
recycle(false);
return SocketState.OPEN;
}
}
}
示例11: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().asyncDispatch(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
resetTimeouts();
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
setErrorState(ErrorState.CLOSE_NOW, t);
getLog().error(sm.getString("http11processor.request.process"), t);
} finally {
if (getErrorState().isError()) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError()) {
return SocketState.CLOSED;
} else if (isAsync()) {
return SocketState.LONG;
} else {
if (!keepAlive) {
return SocketState.CLOSED;
} else {
endRequest();
getInputBuffer().nextRequest();
getOutputBuffer().nextRequest();
return SocketState.OPEN;
}
}
}
示例12: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException
* error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status) throws IOException {
long soTimeout = endpoint.getSoTimeout();
RequestInfo rp = request.getRequestProcessor();
final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment) socketWrapper.getSocket().getAttachment();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().event(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
if (!getErrorState().isError()) {
if (attach != null) {
attach.setComet(comet);
if (comet) {
Integer comettimeout = (Integer) request
.getAttribute(org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
if (comettimeout != null) {
attach.setTimeout(comettimeout.longValue());
}
} else {
// reset the timeout
if (keepAlive) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
}
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
// 500 - Internal Server Error
response.setStatus(500);
setErrorState(ErrorState.CLOSE_NOW, t);
log.error(sm.getString("http11processor.request.process"), t);
getAdapter().log(request, response, 0);
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError() || status == SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
if (keepAlive) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.CLOSED;
}
} else {
return SocketState.LONG;
}
}
示例13: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status)
throws IOException {
long soTimeout = endpoint.getSoTimeout();
RequestInfo rp = request.getRequestProcessor();
final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false);
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
error = !adapter.event(request, response, status);
if ( !error ) {
if (attach != null) {
attach.setComet(comet);
if (comet) {
Integer comettimeout = (Integer) request.getAttribute(
org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
if (comettimeout != null) {
attach.setTimeout(comettimeout.longValue());
}
} else {
//reset the timeout
if (keepAlive) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
}
} catch (InterruptedIOException e) {
error = true;
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.error(sm.getString("http11processor.request.process"), t);
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
error = true;
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (error || status==SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
if (keepAlive) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.CLOSED;
}
} else {
return SocketState.LONG;
}
}
示例14: asyncDispatch
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
@Override
public SocketState asyncDispatch(SocketStatus status) {
RequestInfo rp = request.getRequestProcessor();
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if(!getAdapter().asyncDispatch(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
resetTimeouts();
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
setErrorState(ErrorState.CLOSE_NOW, t);
getLog().error(sm.getString("http11processor.request.process"), t);
} finally {
if (getErrorState().isError()) {
// 500 - Internal Server Error
response.setStatus(500);
adapter.log(request, response, 0);
}
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (isAsync()) {
if (getErrorState().isError()) {
request.updateCounters();
return SocketState.CLOSED;
} else {
return SocketState.LONG;
}
} else {
request.updateCounters();
if (getErrorState().isError()) {
return SocketState.CLOSED;
} else {
return SocketState.OPEN;
}
}
}
示例15: event
import org.apache.coyote.RequestInfo; //导入方法依赖的package包/类
/**
* Process pipelined HTTP requests using the specified input and output
* streams.
*
* @throws IOException error during an I/O operation
*/
@Override
public SocketState event(SocketStatus status) throws IOException {
long soTimeout = endpoint.getSoTimeout();
RequestInfo rp = request.getRequestProcessor();
final NioEndpoint.KeyAttachment attach = (NioEndpoint.KeyAttachment)socketWrapper.getSocket().getAttachment(false);
try {
rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE);
if (!getAdapter().event(request, response, status)) {
setErrorState(ErrorState.CLOSE_NOW, null);
}
if (!getErrorState().isError()) {
if (attach != null) {
attach.setComet(comet);
if (comet) {
Integer comettimeout = (Integer) request.getAttribute(
org.apache.coyote.Constants.COMET_TIMEOUT_ATTR);
if (comettimeout != null) {
attach.setTimeout(comettimeout.longValue());
}
} else {
//reset the timeout
if (keepAlive) {
attach.setTimeout(keepAliveTimeout);
} else {
attach.setTimeout(soTimeout);
}
}
}
}
} catch (InterruptedIOException e) {
setErrorState(ErrorState.CLOSE_NOW, e);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
// 500 - Internal Server Error
response.setStatus(500);
setErrorState(ErrorState.CLOSE_NOW, t);
log.error(sm.getString("http11processor.request.process"), t);
getAdapter().log(request, response, 0);
}
rp.setStage(org.apache.coyote.Constants.STAGE_ENDED);
if (getErrorState().isError() || status==SocketStatus.STOP) {
return SocketState.CLOSED;
} else if (!comet) {
if (keepAlive) {
inputBuffer.nextRequest();
outputBuffer.nextRequest();
return SocketState.OPEN;
} else {
return SocketState.CLOSED;
}
} else {
return SocketState.LONG;
}
}