Top Description Fields Constructors Methods
org.apache.catalina.core

pack-priv final Class StandardWrapperValve

extends ValveBase
Class Inheritance
Imports
java.io.IOException, java.util.concurrent.atomic.AtomicInteger, .LongAdder, jakarta.servlet.DispatcherType, .RequestDispatcher, .Servlet, .ServletException, .UnavailableException, jakarta.servlet.http.HttpServletResponse, org.apache.catalina.Container, .Context, .Globals, .LifecycleException, org.apache.catalina.connector.Request, .Response, org.apache.catalina.valves.ValveBase, org.apache.coyote.BadRequestException, .CloseNowException, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.buf.MessageBytes, org.apache.tomcat.util.log.SystemLogHandler, org.apache.tomcat.util.res.StringManager

Valve that implements the default basic behavior for the StandardWrapper container implementation.
Author
Craig R. McClanahan

Field Summary

Modifier and TypeField and Description
private final AtomicInteger
private volatile long
private volatile long
private final LongAdder
private final AtomicInteger
private static final StringManager
Inherited from org.apache.catalina.valves.ValveBase:
asyncSupportedcontainercontainerLognext

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private void
exception(Request
The request being processed
request
,
Response
The response being generated
response
,
Throwable
The exception that occurred (which possibly wraps a root cause exception
exception
)

Handle the specified ServletException encountered while processing the specified Request to produce the specified Response.

private void
exception(Request request, Response response, Throwable exception, int errorCode)

public int

Returns:

the number of requests processed by the associated wrapper that resulted in an error.
getErrorCount
()
Deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to storing the result of calls to this method in a long value rather than an int.

Returns the number of requests processed by the associated wrapper that resulted in an error.

public long
public long
public long
public int

Returns:

the number of requests processed by the associated wrapper.
getRequestCount
()
Deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to storing the result of calls to this method in a long value rather than an int.

Returns the number of requests processed by the associated wrapper.

public void
protected void
initInternal()

Overrides org.apache.catalina.valves.ValveBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

public void
invoke(Request
Request to be processed
request
,
Response
Response to be produced
response
)

Implements org.apache.catalina.Valve.invoke.

Invoke the servlet we are managing, respecting the rules regarding servlet lifecycle support.

Inherited from org.apache.catalina.valves.ValveBase:
backgroundProcessgetContainergetDomainInternalgetNextgetObjectNameKeyPropertiesisAsyncSupportedsetAsyncSupportedsetContainersetNextstartInternalstopInternaltoString

Field Detail

errorCountback to summary
private final AtomicInteger errorCount
maxTimeback to summary
private volatile long maxTime
minTimeback to summary
private volatile long minTime
processingTimeback to summary
private final LongAdder processingTime
requestCountback to summary
private final AtomicInteger requestCount
smback to summary
private static final StringManager sm

Hides org.apache.catalina.valves.ValveBase.sm.

Constructor Detail

StandardWrapperValveback to summary
pack-priv StandardWrapperValve()

Method Detail

checkWrapperAvailableback to summary
private void checkWrapperAvailable(Response response, StandardWrapper wrapper) throws IOException
exceptionback to summary
private void exception(Request request, Response response, Throwable exception)

Handle the specified ServletException encountered while processing the specified Request to produce the specified Response. Any exceptions that occur during generation of the exception report are logged and swallowed.

Parameters
request:Request

The request being processed

response:Response

The response being generated

exception:Throwable

The exception that occurred (which possibly wraps a root cause exception

exceptionback to summary
private void exception(Request request, Response response, Throwable exception, int errorCode)
Annotations
@SuppressWarnings:deprecation
getErrorCountback to summary
public int getErrorCount()

Deprecated

The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to storing the result of calls to this method in a long value rather than an int.

Returns the number of requests processed by the associated wrapper that resulted in an error.

Returns:int

the number of requests processed by the associated wrapper that resulted in an error.

Annotations
@Deprecated
getMaxTimeback to summary
public long getMaxTime()
getMinTimeback to summary
public long getMinTime()
getProcessingTimeback to summary
public long getProcessingTime()
getRequestCountback to summary
public int getRequestCount()

Deprecated

The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to storing the result of calls to this method in a long value rather than an int.

Returns the number of requests processed by the associated wrapper.

Returns:int

the number of requests processed by the associated wrapper.

Annotations
@Deprecated
incrementErrorCountback to summary
public void incrementErrorCount()
initInternalback to summary
protected void initInternal() throws LifecycleException

Overrides org.apache.catalina.valves.ValveBase.initInternal.

Doc from org.apache.catalina.util.LifecycleMBeanBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

Annotations
@Override
Exceptions
LifecycleException:

Doc from org.apache.catalina.util.LifecycleBase.initInternal.

If the initialisation fails

invokeback to summary
public void invoke(Request request, Response response) throws IOException, ServletException

Implements org.apache.catalina.Valve.invoke.

Invoke the servlet we are managing, respecting the rules regarding servlet lifecycle support.

Parameters
request:Request

Request to be processed

response:Response

Response to be produced

Annotations
@Override
Exceptions
IOException:
if an input/output error occurred
ServletException:
if a servlet error occurred