Jetty9 - Added lifecycle callbacks for onOpen() for the application AsyncConnection linked to the SslConnection.

This commit is contained in:
Simone Bordet 2012-07-29 14:57:29 +02:00
parent ef7c46f56a
commit 0af40c4db2
3 changed files with 10 additions and 9 deletions

View File

@ -1,18 +1,11 @@
package org.eclipse.jetty.io;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLEngineResult;
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
@ -27,6 +20,12 @@ import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest
{
@ -60,6 +59,8 @@ public class SelectChannelEndPointSslTest extends SelectChannelEndPointTest
AsyncConnection appConnection = super.newConnection(channel,sslConnection.getSslEndPoint());
sslConnection.getSslEndPoint().setAsyncConnection(appConnection);
_manager.connectionOpened(appConnection);
return sslConnection;
}

View File

@ -56,9 +56,9 @@ public class SslConnectionTest
AsyncConnection appConnection = new TestConnection(sslConnection.getSslEndPoint());
sslConnection.getSslEndPoint().setAsyncConnection(appConnection);
connectionOpened(appConnection);
return sslConnection;
}
@Override

View File

@ -15,7 +15,6 @@ package org.eclipse.jetty.server.ssl;
import java.io.IOException;
import java.nio.channels.SocketChannel;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLSession;
@ -540,6 +539,7 @@ public class SslSelectChannelConnector extends SelectChannelConnector implements
SslConnection connection = newSslConnection(endpoint, engine);
AsyncConnection delegate = newPlainConnection(channel, connection.getSslEndPoint());
connection.getSslEndPoint().setAsyncConnection(delegate);
getSelectorManager().connectionOpened(delegate);
return connection;
}
catch (IOException e)