当前位置: 首页>>代码示例>>Java>>正文


Java SocketStatus.STOP属性代码示例

本文整理汇总了Java中org.apache.tomcat.util.net.SocketStatus.STOP属性的典型用法代码示例。如果您正苦于以下问题:Java SocketStatus.STOP属性的具体用法?Java SocketStatus.STOP怎么用?Java SocketStatus.STOP使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.tomcat.util.net.SocketStatus的用法示例。


在下文中一共展示了SocketStatus.STOP属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: event

/**
 * 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;
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:40,代码来源:Http11AprProcessor.java

示例2: event

/**
 * 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;
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:40,代码来源:Http11AprProcessor.java

示例3: event

/**
 * 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;
    }
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:38,代码来源:Http11AprProcessor.java

示例4: event

/**
 * 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;
    }
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:65,代码来源:Http11NioProcessor.java

示例5: event

/**
 * 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;
	}
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:66,代码来源:Http11NioProcessor.java

示例6: event

/**
 * 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;
    }
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:64,代码来源:Http11NioProcessor.java

示例7: event

/**
 * 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;
    }
}
 
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:65,代码来源:Http11NioProcessor.java


注:本文中的org.apache.tomcat.util.net.SocketStatus.STOP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。