public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
StandaloneProcessor.INSTANCE.getStreamWriter(connection); reader = new SSLStreamReader(connectionStreamReader); writer = new SSLStreamWriter(connectionStreamWriter); Future readFuture = reader.notifyAvailable(receivedMessage.length); readFuture.get(10, TimeUnit.SECONDS); assertTrue(readFuture.isDone()); reader.readByteArray(receivedMessage); reader.close(); reader = null; reader.close();
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }
public Future<SSLEngine> handshake(final SSLStreamReader sslStreamReader, final SSLEngineConfigurator configurator, final CompletionHandler<SSLEngine> completionHandler) throws IOException { final Connection connection = getConnection(); SSLEngine sslEngine = SSLUtils.getSSLEngine(getConnection()); if (sslEngine == null) { sslEngine = configurator.createSSLEngine(); SSLUtils.setSSLEngine(connection, sslEngine); checkBuffers(connection, sslEngine); } final boolean isLoggingFinest = logger.isLoggable(Level.FINEST); if (isLoggingFinest) { logger.log(Level.FINEST, "connection={0} engine={1} handshakeStatus={2}", new Object[]{connection, sslEngine, sslEngine.getHandshakeStatus()}); } HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); if (handshakeStatus == HandshakeStatus.NOT_HANDSHAKING) { sslEngine.beginHandshake(); } final FutureImpl<SSLEngine> future = SafeFutureImpl.create(); final HandshakeCompletionHandler hsCompletionHandler = new HandshakeCompletionHandler(future, completionHandler, sslEngine); sslStreamReader.notifyCondition(new SSLHandshakeCondition(sslStreamReader, this, configurator, sslEngine, hsCompletionHandler), hsCompletionHandler); return future; }