diff src/org/eclipse/jetty/io/nio/SslConnection.java @ 952:669769bcdf5c

simplify AsyncEndPoint
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 12 Oct 2016 19:47:45 -0600
parents 89fe80dfab2c
children 1094975d013b
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/nio/SslConnection.java	Wed Oct 12 18:12:12 2016 -0600
+++ b/src/org/eclipse/jetty/io/nio/SslConnection.java	Wed Oct 12 19:47:45 2016 -0600
@@ -61,7 +61,7 @@
 	private NIOBuffer _inbound;
 	private NIOBuffer _unwrapBuf;
 	private NIOBuffer _outbound;
-	private AsyncEndPoint _aEndp;
+	private final AsyncEndPoint _aEndp;
 	private boolean _allowRenegotiate=true;
 	private boolean _handshook;
 	private boolean _ishut;
@@ -85,26 +85,18 @@
 		}
 	}
 
-	/* ------------------------------------------------------------ */
-	public SslConnection(SSLEngine engine,EndPoint endp)
+	public SslConnection(SSLEngine engine,AsyncEndPoint endp)
 	{
 		this(engine,endp,System.currentTimeMillis());
 	}
 
-	/* ------------------------------------------------------------ */
-	public SslConnection(SSLEngine engine,EndPoint endp, long timeStamp)
+	private SslConnection(SSLEngine engine,AsyncEndPoint endp, long timeStamp)
 	{
 		super(endp,timeStamp);
 		_engine=engine;
 		_session=_engine.getSession();
-		_aEndp=(AsyncEndPoint)endp;
-		_sslEndPoint = newSslEndPoint();
-	}
-
-	/* ------------------------------------------------------------ */
-	protected SslEndPoint newSslEndPoint()
-	{
-		return new SslEndPoint();
+		_aEndp=endp;
+		_sslEndPoint = new SslEndPoint();
 	}
 
 	/* ------------------------------------------------------------ */
@@ -604,8 +596,7 @@
 		return ByteBuffer.wrap(buffer.array());
 	}
 
-	/* ------------------------------------------------------------ */
-	public AsyncEndPoint getSslEndPoint()
+	public SslEndPoint getSslEndPoint()
 	{
 		return _sslEndPoint;
 	}
@@ -616,9 +607,8 @@
 		return String.format("%s %s", super.toString(), _sslEndPoint);
 	}
 
-	/* ------------------------------------------------------------ */
-	/* ------------------------------------------------------------ */
-	public class SslEndPoint implements AsyncEndPoint
+
+	public final class SslEndPoint implements AsyncEndPoint
 	{
 		public SSLEngine getSslEngine()
 		{
@@ -743,31 +733,11 @@
 			_aEndp.dispatch();
 		}
 
-		public void scheduleWrite()
-		{
-			_aEndp.scheduleWrite();
-		}
-
-		public void onIdleExpired(long idleForMs)
-		{
-			_aEndp.onIdleExpired(idleForMs);
-		}
-
 		public void setCheckForIdle(boolean check)
 		{
 			_aEndp.setCheckForIdle(check);
 		}
 
-		public boolean isCheckForIdle()
-		{
-			return _aEndp.isCheckForIdle();
-		}
-
-		public boolean isWritable()
-		{
-			return _aEndp.isWritable();
-		}
-
 		public boolean hasProgressed()
 		{
 			return _progressed.getAndSet(false);