Package org.jppf.nio

Class SSLHandlerImpl

All Implemented Interfaces:
SSLHandler

public class SSLHandlerImpl extends AbstractSSLHandler
Wrapper for an SSLEngine and an associated channel.
  • Constructor Details

    • SSLHandlerImpl

      public SSLHandlerImpl(SocketChannel channel, SSLEngine sslEngine) throws Exception
      Instantiate this SSLHandler with the specified channel and SSL engine.
      Parameters:
      channel - the channel from which data is read or to which data is written.
      sslEngine - performs the SSL-related operations before sending data/after receiving data.
      Throws:
      Exception - if any error occurs.
  • Method Details

    • read

      public int read() throws Exception
      Description copied from interface: SSLHandler
      Read from the channel via the SSLEngine into the application receive buffer. Called in blocking mode when input is expected, or in non-blocking mode when the channel is readable.
      Returns:
      the number of bytes read from the application receive buffer.
      Throws:
      Exception - if any error occurs.
    • write

      public int write() throws Exception
      Description copied from interface: SSLHandler
      Write from the application send buffer to the channel via the SSLEngine.
      Returns:
      the number of bytes consumed from the application.
      Throws:
      Exception - if any error occurs.
    • close

      public void close() throws Exception
      Description copied from interface: SSLHandler
      Close the underlying channel and SSL engine.
      Throws:
      Exception - if any error occurs.