Package org.apache.tomcat.util.net
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:
java.lang.Runnable
- Direct Known Subclasses:
Nio2Endpoint.SocketProcessor,NioEndpoint.SocketProcessor
public abstract class SocketProcessorBase<S> extends java.lang.Object implements java.lang.RunnableBase class for socket processors that handle I/O events on a wrapped socket. Subclasses implementdoRun()to define the processing logic.
-
-
Field Summary
Fields Modifier and Type Field Description protected SocketEventeventThe event that triggered this processor (e.g., READ, WRITE).protected SocketWrapperBase<S>socketWrapperThe socket wrapper that provides access to the underlying socket and its state.
-
Constructor Summary
Constructors Constructor Description SocketProcessorBase(SocketWrapperBase<S> socketWrapper, SocketEvent event)Creates a new socket processor for the given wrapper and event.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected 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.voidrun()
-
-
-
Field Detail
-
socketWrapper
protected SocketWrapperBase<S> socketWrapper
The socket wrapper that provides access to the underlying socket and its state.
-
event
protected SocketEvent event
The event that triggered this processor (e.g., READ, WRITE).
-
-
Constructor Detail
-
SocketProcessorBase
public SocketProcessorBase(SocketWrapperBase<S> socketWrapper, SocketEvent event)
Creates a new socket processor for the given wrapper and event.- Parameters:
socketWrapper- the socket wrapperevent- the socket event to process
-
-
Method Detail
-
reset
public void reset(SocketWrapperBase<S> socketWrapper, SocketEvent event)
Resets this processor with a new socket wrapper and event, allowing reuse.- Parameters:
socketWrapper- the socket wrapperevent- the socket event to process
-
run
public final void run()
- Specified by:
runin interfacejava.lang.Runnable
-
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.
-
-