Package org.apache.tomcat.util.net
Class Acceptor<U>
- java.lang.Object
-
- org.apache.tomcat.util.net.Acceptor<U>
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
Nio2Endpoint.Nio2Acceptor
public class Acceptor<U> extends java.lang.Object implements java.lang.Runnable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Acceptor.AcceptorState
-
Field Summary
Fields Modifier and Type Field Description protected Acceptor.AcceptorState
state
-
Constructor Summary
Constructors Constructor Description Acceptor(AbstractEndpoint<?,U> endpoint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Acceptor.AcceptorState
getState()
protected int
handleExceptionWithDelay(int currentErrorDelay)
Handles exceptions where a delay is required to prevent a Thread from entering a tight loop which will consume CPU and may also trigger large amounts of logging.void
run()
-
-
-
Field Detail
-
state
protected volatile Acceptor.AcceptorState state
-
-
Constructor Detail
-
Acceptor
public Acceptor(AbstractEndpoint<?,U> endpoint)
-
-
Method Detail
-
getState
public final Acceptor.AcceptorState getState()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
handleExceptionWithDelay
protected int handleExceptionWithDelay(int currentErrorDelay)
Handles exceptions where a delay is required to prevent a Thread from entering a tight loop which will consume CPU and may also trigger large amounts of logging. For example, this can happen if the ulimit for open files is reached.- Parameters:
currentErrorDelay
- The current delay being applied on failure- Returns:
- The delay to apply on the next failure
-
-