Package org.apache.coyote
Class RequestInfo
- java.lang.Object
-
- org.apache.coyote.RequestInfo
-
public class RequestInfo extends java.lang.ObjectStructure holding the Request and Response objects. It also holds statistical information about request processing and provide management information about the requests being processed. Each thread uses a Request/Response pair that is recycled on each request. This object provides a place to collect global low-level statistics - without having to deal with synchronization (since each thread will have its own RequestProcessorMX).
-
-
Constructor Summary
Constructors Constructor Description RequestInfo(Request req)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBytesReceived()Return the total bytes received.longgetBytesSent()Return the total bytes sent.intgetContentLength()Return the content length.java.lang.StringgetCurrentQueryString()Return the current query string.java.lang.StringgetCurrentUri()Return the current request URI.intgetErrorCount()Return the error count.RequestGroupInfogetGlobalProcessor()Return the global request processor.longgetLastRequestProcessingTime()Return the processing time of the last request.java.lang.StringgetMaxRequestUri()Return the URI of the request with the longest processing time.longgetMaxTime()Return the maximum request processing time.java.lang.StringgetMethod()Return the HTTP method.java.lang.StringgetPeerAddr()Return the peer address.longgetProcessingTime()Return the total processing time.java.lang.StringgetProtocol()Return the protocol.java.lang.StringgetRemoteAddr()Return the remote address.java.lang.StringgetRemoteAddrForwarded()Obtain the remote address for this connection as reported by an intermediate proxy (if any).longgetRequestBytesReceived()Return the bytes received for the current request.longgetRequestBytesSent()Return the bytes sent for the current request.intgetRequestCount()Return the request count.longgetRequestProcessingTime()Return the processing time for the current request.javax.management.ObjectNamegetRpName()Return the MBean name.intgetServerPort()Return the server port.intgetStage()Return the current processing stage.java.lang.StringgetVirtualHost()Return the virtual host.java.lang.StringgetWorkerThreadName()Return the worker thread name.voidrecycleStatistcs()Recycle all statistics.voidsetBytesReceived(long bytesReceived)Reset the bytes received.voidsetBytesSent(long bytesSent)Reset the bytes sent.voidsetErrorCount(int errorCount)Reset the error count.voidsetGlobalProcessor(RequestGroupInfo global)Set the global request processor.voidsetLastRequestProcessingTime(long lastRequestProcessingTime)Set the last request processing time.voidsetMaxRequestUri(java.lang.String maxRequestUri)Set the maximum request URI.voidsetMaxTime(long maxTime)Reset the maximum time.voidsetProcessingTime(long processingTime)Reset the processing time.voidsetRequestCount(int requestCount)Reset the request count.voidsetRpName(javax.management.ObjectName rpName)Set the MBean name.voidsetStage(int stage)Set the current processing stage.voidsetWorkerThreadName(java.lang.String workerThreadName)Set the worker thread name.
-
-
-
Constructor Detail
-
RequestInfo
public RequestInfo(Request req)
Create a new instance.- Parameters:
req- the request
-
-
Method Detail
-
getGlobalProcessor
public RequestGroupInfo getGlobalProcessor()
Return the global request processor.- Returns:
- the global processor
-
setGlobalProcessor
public void setGlobalProcessor(RequestGroupInfo global)
Set the global request processor.- Parameters:
global- the global processor
-
getMethod
public java.lang.String getMethod()
Return the HTTP method.- Returns:
- the HTTP method
-
getCurrentUri
public java.lang.String getCurrentUri()
Return the current request URI.- Returns:
- the current URI
-
getCurrentQueryString
public java.lang.String getCurrentQueryString()
Return the current query string.- Returns:
- the current query string
-
getProtocol
public java.lang.String getProtocol()
Return the protocol.- Returns:
- the protocol
-
getVirtualHost
public java.lang.String getVirtualHost()
Return the virtual host.- Returns:
- the virtual host
-
getServerPort
public int getServerPort()
Return the server port.- Returns:
- the server port
-
getRemoteAddr
public java.lang.String getRemoteAddr()
Return the remote address.- Returns:
- the remote address
-
getPeerAddr
public java.lang.String getPeerAddr()
Return the peer address.- Returns:
- the peer address
-
getRemoteAddrForwarded
public java.lang.String getRemoteAddrForwarded()
Obtain the remote address for this connection as reported by an intermediate proxy (if any).- Returns:
- The remote address for this connection
-
getContentLength
public int getContentLength()
Return the content length.- Returns:
- the content length
-
getRequestBytesReceived
public long getRequestBytesReceived()
Return the bytes received for the current request.- Returns:
- the bytes received
-
getRequestBytesSent
public long getRequestBytesSent()
Return the bytes sent for the current request.- Returns:
- the bytes sent
-
getRequestProcessingTime
public long getRequestProcessingTime()
Return the processing time for the current request.- Returns:
- the processing time
-
getStage
public int getStage()
Return the current processing stage.- Returns:
- the stage
-
setStage
public void setStage(int stage)
Set the current processing stage.- Parameters:
stage- the stage
-
getBytesSent
public long getBytesSent()
Return the total bytes sent.- Returns:
- the bytes sent
-
setBytesSent
public void setBytesSent(long bytesSent)
Reset the bytes sent.- Parameters:
bytesSent- the new bytes sent
-
getBytesReceived
public long getBytesReceived()
Return the total bytes received.- Returns:
- the bytes received
-
setBytesReceived
public void setBytesReceived(long bytesReceived)
Reset the bytes received.- Parameters:
bytesReceived- the new bytes received
-
getProcessingTime
public long getProcessingTime()
Return the total processing time.- Returns:
- the processing time
-
setProcessingTime
public void setProcessingTime(long processingTime)
Reset the processing time.- Parameters:
processingTime- the new processing time
-
getMaxTime
public long getMaxTime()
Return the maximum request processing time.- Returns:
- the maximum time
-
setMaxTime
public void setMaxTime(long maxTime)
Reset the maximum time.- Parameters:
maxTime- the new maximum time
-
getMaxRequestUri
public java.lang.String getMaxRequestUri()
Return the URI of the request with the longest processing time.- Returns:
- the maximum request URI
-
setMaxRequestUri
public void setMaxRequestUri(java.lang.String maxRequestUri)
Set the maximum request URI.- Parameters:
maxRequestUri- the maximum request URI
-
getRequestCount
public int getRequestCount()
Return the request count.- Returns:
- the request count
-
setRequestCount
public void setRequestCount(int requestCount)
Reset the request count.- Parameters:
requestCount- the new request count
-
getErrorCount
public int getErrorCount()
Return the error count.- Returns:
- the error count
-
setErrorCount
public void setErrorCount(int errorCount)
Reset the error count.- Parameters:
errorCount- the new error count
-
getWorkerThreadName
public java.lang.String getWorkerThreadName()
Return the worker thread name.- Returns:
- the worker thread name
-
getRpName
public javax.management.ObjectName getRpName()
Return the MBean name.- Returns:
- the MBean name
-
getLastRequestProcessingTime
public long getLastRequestProcessingTime()
Return the processing time of the last request.- Returns:
- the last request processing time
-
setWorkerThreadName
public void setWorkerThreadName(java.lang.String workerThreadName)
Set the worker thread name.- Parameters:
workerThreadName- the worker thread name
-
setRpName
public void setRpName(javax.management.ObjectName rpName)
Set the MBean name.- Parameters:
rpName- the MBean name
-
setLastRequestProcessingTime
public void setLastRequestProcessingTime(long lastRequestProcessingTime)
Set the last request processing time.- Parameters:
lastRequestProcessingTime- the last request processing time
-
recycleStatistcs
public void recycleStatistcs()
Recycle all statistics.
-
-