本文整理汇总了Java中org.apache.coyote.RequestInfo类的典型用法代码示例。如果您正苦于以下问题:Java RequestInfo类的具体用法?Java RequestInfo怎么用?Java RequestInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestInfo类属于org.apache.coyote包,在下文中一共展示了RequestInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: register
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void register(AjpProcessor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(global);
ObjectName rpName = new ObjectName
(proto.getDomain() + ":type=RequestProcessor,worker="
+ proto.getName() + ",name=AjpRequest" + count);
if (log.isDebugEnabled()) {
log.debug("Register " + rpName);
}
Registry.getRegistry(null, null).registerComponent(rp, rpName, null);
rp.setRpName(rpName);
} catch (Exception e) {
log.warn("Error registering request");
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AjpProtocol.java
示例2: unregister
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void unregister(AjpProcessor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(null);
ObjectName rpName = rp.getRpName();
if (log.isDebugEnabled()) {
log.debug("Unregister " + rpName);
}
Registry.getRegistry(null, null).unregisterComponent(rpName);
rp.setRpName(null);
} catch (Exception e) {
log.warn("Error unregistering request", e);
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AjpProtocol.java
示例3: register
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void register(AjpAprProcessor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(global);
ObjectName rpName = new ObjectName
(proto.getDomain() + ":type=RequestProcessor,worker="
+ proto.getName() + ",name=AjpRequest" + count);
if (log.isDebugEnabled()) {
log.debug("Register " + rpName);
}
Registry.getRegistry(null, null).registerComponent(rp, rpName, null);
rp.setRpName(rpName);
} catch (Exception e) {
log.warn("Error registering request");
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:AjpAprProtocol.java
示例4: unregister
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void unregister(AjpAprProcessor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(null);
ObjectName rpName = rp.getRpName();
if (log.isDebugEnabled()) {
log.debug("Unregister " + rpName);
}
Registry.getRegistry(null, null).unregisterComponent(rpName);
rp.setRpName(null);
} catch (Exception e) {
log.warn("Error unregistering request", e);
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:AjpAprProtocol.java
示例5: register
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void register(Http11Processor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(global);
ObjectName rpName = new ObjectName
(proto.getDomain() + ":type=RequestProcessor,worker="
+ proto.getName() + ",name=HttpRequest" + count);
if (log.isDebugEnabled()) {
log.debug("Register " + rpName);
}
Registry.getRegistry(null, null).registerComponent(rp, rpName, null);
rp.setRpName(rpName);
} catch (Exception e) {
log.warn("Error registering request");
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:Http11Protocol.java
示例6: unregister
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void unregister(Http11Processor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(null);
ObjectName rpName = rp.getRpName();
if (log.isDebugEnabled()) {
log.debug("Unregister " + rpName);
}
Registry.getRegistry(null, null).unregisterComponent(rpName);
rp.setRpName(null);
} catch (Exception e) {
log.warn("Error unregistering request", e);
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:Http11Protocol.java
示例7: register
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void register(Http11AprProcessor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
long count = registerCount.incrementAndGet();
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(global);
ObjectName rpName = new ObjectName
(proto.getDomain() + ":type=RequestProcessor,worker="
+ proto.getName() + ",name=HttpRequest" + count);
if (log.isDebugEnabled()) {
log.debug("Register " + rpName);
}
Registry.getRegistry(null, null).registerComponent(rp, rpName, null);
rp.setRpName(rpName);
} catch (Exception e) {
log.warn("Error registering request");
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:Http11AprProtocol.java
示例8: unregister
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
protected void unregister(Http11AprProcessor processor) {
if (proto.getDomain() != null) {
synchronized (this) {
try {
RequestInfo rp = processor.getRequest().getRequestProcessor();
rp.setGlobalProcessor(null);
ObjectName rpName = rp.getRpName();
if (log.isDebugEnabled()) {
log.debug("Unregister " + rpName);
}
Registry.getRegistry(null, null).unregisterComponent(rpName);
rp.setRpName(null);
} catch (Exception e) {
log.warn("Error unregistering request", e);
}
}
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:Http11AprProtocol.java
示例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 {
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,代码行数:41,代码来源:Http11AprProcessor.java
示例10: addElement
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
@Override
public void addElement(StringBuilder buf, Date date, Request request,
Response response, long time) {
RequestInfo info = request.getCoyoteRequest().getRequestProcessor();
if(info != null) {
buf.append(info.getWorkerThreadName());
} else {
buf.append("-");
}
}
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:11,代码来源:AccessLogValve.java
示例11: 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;
}
}
开发者ID:how2j,项目名称:lazycat,代码行数:41,代码来源:Http11AprProcessor.java
示例12: 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;
}
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:41,代码来源:AbstractAjpProcessor.java
示例13: 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;
}
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:39,代码来源:AbstractHttp11Processor.java
示例14: 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;
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:39,代码来源:Http11AprProcessor.java
示例15: 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;
}
}
}
开发者ID:sdw2330976,项目名称:apache-tomcat-7.0.57,代码行数:41,代码来源:AbstractHttp11Processor.java
示例16: 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;
}
}
}
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:40,代码来源:AbstractAjpProcessor.java
示例17: logDebug
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
private void logDebug(String method) {
String rHashCode;
String crHashCode;
String rpHashCode;
String stage;
StringBuilder uri = new StringBuilder();
if (request == null) {
rHashCode = "null";
crHashCode = "null";
rpHashCode = "null";
stage = "-";
uri.append("N/A");
} else {
rHashCode = Integer.toHexString(request.hashCode());
org.apache.coyote.Request coyoteRequest = request.getCoyoteRequest();
if (coyoteRequest == null) {
crHashCode = "null";
rpHashCode = "null";
stage = "-";
} else {
crHashCode = Integer.toHexString(coyoteRequest.hashCode());
RequestInfo rp = coyoteRequest.getRequestProcessor();
if (rp == null) {
rpHashCode = "null";
stage = "-";
} else {
rpHashCode = Integer.toHexString(rp.hashCode());
stage = Integer.toString(rp.getStage());
}
}
uri.append(request.getRequestURI());
if (request.getQueryString() != null) {
uri.append('?');
uri.append(request.getQueryString());
}
}
String threadName = Thread.currentThread().getName();
int len = threadName.length();
if (len > 20) {
threadName = threadName.substring(len - 20, len);
}
String msg = String.format(
"Req: %1$8s CReq: %2$8s RP: %3$8s Stage: %4$s " +
"Thread: %5$20s State: %6$20s Method: %7$11s URI: %8$s",
rHashCode, crHashCode, rpHashCode, stage,
threadName, "N/A", method, uri);
if (log.isTraceEnabled()) {
log.trace(msg, new DebugException());
} else {
log.debug(msg);
}
}
开发者ID:liaokailin,项目名称:tomcat7,代码行数:53,代码来源:AsyncContextImpl.java
示例18: addElement
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
public void addElement(StringBuffer buf, Date date, Request request,
Response response, long time) {
RequestInfo info = request.getCoyoteRequest().getRequestProcessor();
if(info != null) {
buf.append(info.getWorkerThreadName());
} else {
buf.append("-");
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:AccessLogValve.java
示例19: pause
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
public void pause() throws Exception {
try {
endpoint.pause();
} catch (Exception ex) {
log.error(sm.getString("ajpprotocol.endpoint.pauseerror"), ex);
throw ex;
}
// Wait for a while until all the processors are idle
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
while (!done && retry < 20) {
retry++;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
;
}
continue;
}
}
done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("ajpprotocol.pause", getName()));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:AjpProtocol.java
示例20: pause
import org.apache.coyote.RequestInfo; //导入依赖的package包/类
public void pause() throws Exception {
try {
endpoint.pause();
} catch (Exception ex) {
log.error(sm.getString("http11protocol.endpoint.pauseerror"), ex);
throw ex;
}
// Wait for a while until all the processors are no longer processing requests
RequestInfo[] states = cHandler.global.getRequestProcessors();
int retry = 0;
boolean done = false;
while (!done && retry < 20) {
retry++;
for (int i = 0; i < states.length; i++) {
if (states[i].getStage() == org.apache.coyote.Constants.STAGE_SERVICE) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
;
}
continue;
}
}
done = true;
}
if (log.isInfoEnabled())
log.info(sm.getString("http11protocol.pause", getName()));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:Http11Protocol.java
注:本文中的org.apache.coyote.RequestInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论