I have setup the SSL context in this NioSocketService.java class using the following code.
KeyStore ks = KeyStore.getInstance("JKS");
KeyStore ts = ...
SSLContext context = SSLContext.getInstance("TLS");
context.init(kmf.getKeyManagers, tmf.getTrustManagers(), null);
But where should I be writing the SSL engine code for the server at? The socket channel is opened at the constructor but how can I ensure the socket is communicating over SSL?