Start moving the NIO connectors towards using SocketWrapper<NioChannel> rather than NioChannel to align them with BIO/APR and permit further refactoring.
Do this in small steps since when I tried to do it in one hit, everything broke.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1138677 13f79535-47bb-0310-9956-
ffa450edef68
import org.apache.tomcat.util.net.NioEndpoint.Handler;
import org.apache.tomcat.util.net.SSLImplementation;
import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
/**
}
@Override
- public SocketState process(NioChannel socket, SocketStatus status) {
+ public SocketState process(SocketWrapper<NioChannel> socketWrapper,
+ SocketStatus status) {
+ NioChannel socket = socketWrapper.getSocket();
AjpNioProcessor processor = connections.remove(socket);
NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
import org.apache.tomcat.util.net.SSLImplementation;
import org.apache.tomcat.util.net.SecureNioChannel;
import org.apache.tomcat.util.net.SocketStatus;
+import org.apache.tomcat.util.net.SocketWrapper;
/**
@Override
- public SocketState process(NioChannel socket, SocketStatus status) {
+ public SocketState process(SocketWrapper<NioChannel> socketWrapper,
+ SocketStatus status) {
+ NioChannel socket = socketWrapper.getSocket();
Http11NioProcessor processor = connections.remove(socket);
NioEndpoint.KeyAttachment att = (NioEndpoint.KeyAttachment)socket.getAttachment(false);
* thread local fields.
*/
public interface Handler extends AbstractEndpoint.Handler {
- public SocketState process(NioChannel socket, SocketStatus status);
+ public SocketState process(SocketWrapper<NioChannel> socket,
+ SocketStatus status);
public void release(NioChannel socket);
public void release(SocketChannel socket);
public SSLImplementation getSslImplementation();
SocketState state = SocketState.OPEN;
// Process the request from this socket
if (status == null) {
- state = handler.process(socket, SocketStatus.OPEN);
+ state = handler.process(
+ (KeyAttachment) key.attachment(),
+ SocketStatus.OPEN);
} else {
- state = handler.process(socket, status);
+ state = handler.process(
+ (KeyAttachment) key.attachment(),
+ status);
}
if (state == SocketState.CLOSED) {