diff src/org/eclipse/jetty/server/Connector.java @ 907:bc4e299de953

remove AbstractNIOConnector
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 07 Oct 2016 15:14:16 -0600
parents eaf271fb747f
children c60c1adfac3e
line wrap: on
line diff
--- 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);
+	}
 }