Class SocketProcessorBase<S>
java.lang.Object
org.apache.tomcat.util.net.SocketProcessorBase<S>
- Type Parameters:
S- the type of the socket associated with the wrapper
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
Nio2Endpoint.SocketProcessor, NioEndpoint.SocketProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SocketEventThe event that triggered this processor (e.g., READ, WRITE).protected SocketWrapperBase<S> The socket wrapper that provides access to the underlying socket and its state. -
Constructor Summary
ConstructorsConstructorDescriptionSocketProcessorBase(SocketWrapperBase<S> socketWrapper, SocketEvent event) Creates a new socket processor for the given wrapper and event. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoRun()Performs the actual socket processing work.voidreset(SocketWrapperBase<S> socketWrapper, SocketEvent event) Resets this processor with a new socket wrapper and event, allowing reuse.final voidrun()
-
Field Details
-
socketWrapper
The socket wrapper that provides access to the underlying socket and its state. -
event
The event that triggered this processor (e.g., READ, WRITE).
-
-
Constructor Details
-
SocketProcessorBase
Creates a new socket processor for the given wrapper and event.- Parameters:
socketWrapper- the socket wrapperevent- the socket event to process
-
-
Method Details
-
reset
Resets this processor with a new socket wrapper and event, allowing reuse.- Parameters:
socketWrapper- the socket wrapperevent- the socket event to process
-
run
-
doRun
protected abstract void doRun()Performs the actual socket processing work. Subclasses implement this method to define the specific processing logic for each endpoint type.
-