Top Inners Fields Constructors Methods
org.apache.tomcat.util.net

public Class Acceptor<U>

extends Object
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Known Direct Subclasses
org.apache.tomcat.util.net.Nio2Endpoint.Nio2Acceptor
Imports
java.util.concurrent.CountDownLatch, .TimeUnit, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.res.StringManager

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private final AbstractEndpoint<?, U>
private static final int
private static final Log
private static final int
private static final StringManager
protected volatile Acceptor.AcceptorState
private volatile boolean
private final CountDownLatch
private String

Constructor Summary

AccessConstructor and Description
public
Acceptor(AbstractEndpoint<?, U> endpoint)

Method Summary

Modifier and TypeMethod and Description
public final Acceptor.AcceptorState
pack-priv final String
protected int

Returns:

The delay to apply on the next failure
handleExceptionWithDelay
(int
The current delay being applied on failure
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.

public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

pack-priv final void
setThreadName(final String threadName)

public void
stop(int
The time to wait in seconds. Use a value less than zero for no wait.
waitSeconds
)

Signals the Acceptor to stop, optionally waiting for that stop process to complete before returning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

endpointback to summary
private final AbstractEndpoint<?, U> endpoint
INITIAL_ERROR_DELAYback to summary
private static final int INITIAL_ERROR_DELAY
logback to summary
private static final Log log
MAX_ERROR_DELAYback to summary
private static final int MAX_ERROR_DELAY
smback to summary
private static final StringManager sm
stateback to summary
protected volatile Acceptor.AcceptorState state
stopCalledback to summary
private volatile boolean stopCalled
stopLatchback to summary
private final CountDownLatch stopLatch
threadNameback to summary
private String threadName

Constructor Detail

Acceptorback to summary
public Acceptor(AbstractEndpoint<?, U> endpoint)

Method Detail

getStateback to summary
public final Acceptor.AcceptorState getState()
getThreadNameback to summary
pack-priv final String getThreadName()
handleExceptionWithDelayback to summary
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:int

The current delay being applied on failure

Returns:int

The delay to apply on the next failure

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
setThreadNameback to summary
pack-priv final void setThreadName(final String threadName)
stopback to summary
public void stop(int waitSeconds)

Signals the Acceptor to stop, optionally waiting for that stop process to complete before returning. If a wait is requested and the stop does not complete in that time a warning will be logged.

Parameters
waitSeconds:int

The time to wait in seconds. Use a value less than zero for no wait.

org.apache.tomcat.util.net back to summary

public final Enum Acceptor.AcceptorState

extends Enum<Acceptor.AcceptorState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final Acceptor.AcceptorState
public static final Acceptor.AcceptorState
public static final Acceptor.AcceptorState
public static final Acceptor.AcceptorState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Acceptor.AcceptorState
public static Acceptor.AcceptorState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ENDEDback to summary
public static final Acceptor.AcceptorState ENDED
NEWback to summary
public static final Acceptor.AcceptorState NEW
PAUSEDback to summary
public static final Acceptor.AcceptorState PAUSED
RUNNINGback to summary
public static final Acceptor.AcceptorState RUNNING

Constructor Detail

AcceptorStateback to summary
private AcceptorState()

Method Detail

valueOfback to summary
public static Acceptor.AcceptorState valueOf(String name)
valuesback to summary
public static Acceptor.AcceptorState[] values()