Example usage for javax.net.ssl SSLEngine getDelegatedTask

List of usage examples for javax.net.ssl SSLEngine getDelegatedTask

Introduction

In this page you can find the example usage for javax.net.ssl SSLEngine getDelegatedTask.

Prototype

public abstract Runnable getDelegatedTask();

Source Link

Document

Returns a delegated Runnable task for this SSLEngine .

Usage

From source file:org.globus.gsi.gssapi.GlobusGSSContextImpl.java

private void runDelegatedTasks(SSLEngine engine) throws Exception {

    Runnable runnable;/*from w  w w .j a  v a  2  s . c om*/
    while ((runnable = engine.getDelegatedTask()) != null) {
        logger.debug("\trunning delegated task...");
        runnable.run();
    }
    SSLEngineResult.HandshakeStatus hsStatus = engine.getHandshakeStatus();
    if (hsStatus == SSLEngineResult.HandshakeStatus.NEED_TASK) {
        throw new Exception("handshake shouldn't need additional tasks");
    }
    logger.debug("\tnew HandshakeStatus: " + hsStatus);
}