changeset 907:bc4e299de953

remove AbstractNIOConnector
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 07 Oct 2016 15:14:16 -0600
parents eaf271fb747f
children e003b20780c4
files src/org/eclipse/jetty/server/Connector.java src/org/eclipse/jetty/server/nio/AbstractNIOConnector.java src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java src/org/eclipse/jetty/server/nio/SelectChannelConnector.java
diffstat 4 files changed, 28 insertions(+), 57 deletions(-) [+]
line wrap: on
line diff
diff -r eaf271fb747f -r bc4e299de953 src/org/eclipse/jetty/server/Connector.java
--- a/src/org/eclipse/jetty/server/Connector.java	Fri Oct 07 03:59:44 2016 -0600
+++ b/src/org/eclipse/jetty/server/Connector.java	Fri Oct 07 15:14:16 2016 -0600
@@ -75,6 +75,10 @@
 		this.port = port;
 		server.connectors.add(this);
 		addBean(_buffers);
+		_buffers.setRequestBufferType(Type.DIRECT);
+		_buffers.setRequestHeaderType(Type.INDIRECT);
+		_buffers.setResponseBufferType(Type.DIRECT);
+		_buffers.setResponseHeaderType(Type.INDIRECT);
 	}
 
 	/* ------------------------------------------------------------ */
@@ -446,4 +450,24 @@
 	public abstract void close() throws IOException;
 	public abstract int getLocalPort();
 	public abstract Object getConnection();
+
+
+	// from AbstractNIOConnector
+
+	/* ------------------------------------------------------------------------------- */
+	public boolean getUseDirectBuffers()
+	{
+		return getRequestBufferType()==Type.DIRECT;
+	}
+
+	/* ------------------------------------------------------------------------------- */
+	/**
+	 * @param direct If True (the default), the connector can use NIO direct buffers.
+	 * Some JVMs have memory management issues (bugs) with direct buffers.
+	 */
+	public void setUseDirectBuffers(boolean direct)
+	{
+		_buffers.setRequestBufferType(direct?Type.DIRECT:Type.INDIRECT);
+		_buffers.setResponseBufferType(direct?Type.DIRECT:Type.INDIRECT);
+	}
 }
diff -r eaf271fb747f -r bc4e299de953 src/org/eclipse/jetty/server/nio/AbstractNIOConnector.java
--- a/src/org/eclipse/jetty/server/nio/AbstractNIOConnector.java	Fri Oct 07 03:59:44 2016 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-//
-//  ========================================================================
-//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
-//  ------------------------------------------------------------------------
-//  All rights reserved. This program and the accompanying materials
-//  are made available under the terms of the Eclipse Public License v1.0
-//  and Apache License v2.0 which accompanies this distribution.
-//
-//      The Eclipse Public License is available at
-//      http://www.eclipse.org/legal/epl-v10.html
-//
-//      The Apache License v2.0 is available at
-//      http://www.opensource.org/licenses/apache2.0.php
-//
-//  You may elect to redistribute this code under either of these licenses.
-//  ========================================================================
-//
-
-/**
- *
- */
-package org.eclipse.jetty.server.nio;
-
-import org.eclipse.jetty.io.Buffers.Type;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Server;
-
-public abstract class AbstractNIOConnector extends Connector implements NIOConnector
-{
-	public AbstractNIOConnector(Server server,int port)
-	{
-		super(server,port);
-		_buffers.setRequestBufferType(Type.DIRECT);
-		_buffers.setRequestHeaderType(Type.INDIRECT);
-		_buffers.setResponseBufferType(Type.DIRECT);
-		_buffers.setResponseHeaderType(Type.INDIRECT);
-	}
-
-	/* ------------------------------------------------------------------------------- */
-	public boolean getUseDirectBuffers()
-	{
-		return getRequestBufferType()==Type.DIRECT;
-	}
-
-	/* ------------------------------------------------------------------------------- */
-	/**
-	 * @param direct If True (the default), the connector can use NIO direct buffers.
-	 * Some JVMs have memory management issues (bugs) with direct buffers.
-	 */
-	public void setUseDirectBuffers(boolean direct)
-	{
-		_buffers.setRequestBufferType(direct?Type.DIRECT:Type.INDIRECT);
-		_buffers.setResponseBufferType(direct?Type.DIRECT:Type.INDIRECT);
-	}
-}
diff -r eaf271fb747f -r bc4e299de953 src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java
--- a/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java	Fri Oct 07 03:59:44 2016 -0600
+++ b/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java	Fri Oct 07 15:14:16 2016 -0600
@@ -37,6 +37,7 @@
 import org.eclipse.jetty.io.EofException;
 import org.eclipse.jetty.io.nio.ChannelEndPoint;
 import org.eclipse.jetty.server.BlockingHttpConnection;
+import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.Server;
 import org.slf4j.Logger;
@@ -55,7 +56,7 @@
  *
  *
  */
-public final class BlockingChannelConnector extends AbstractNIOConnector
+public final class BlockingChannelConnector extends Connector
 {
 	private static final Logger LOG = LoggerFactory.getLogger(BlockingChannelConnector.class);
 
diff -r eaf271fb747f -r bc4e299de953 src/org/eclipse/jetty/server/nio/SelectChannelConnector.java
--- a/src/org/eclipse/jetty/server/nio/SelectChannelConnector.java	Fri Oct 07 03:59:44 2016 -0600
+++ b/src/org/eclipse/jetty/server/nio/SelectChannelConnector.java	Fri Oct 07 15:14:16 2016 -0600
@@ -35,6 +35,7 @@
 import org.eclipse.jetty.io.nio.SelectorManager;
 import org.eclipse.jetty.io.nio.SelectorManager.SelectSet;
 import org.eclipse.jetty.server.AsyncHttpConnection;
+import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.Server;
 
@@ -64,7 +65,7 @@
  *
  * @org.apache.xbean.XBean element="nioConnector" description="Creates an NIO based socket connector"
  */
-public class SelectChannelConnector extends AbstractNIOConnector
+public class SelectChannelConnector extends Connector
 {
 	private transient ServerSocketChannel _acceptChannel;
 	private int _lowResourcesConnections;