Class OperationFactory


  • class OperationFactory
    extends java.lang.Object
    The OperationFactory is used to create operations for the transport processor. Depending on the configuration of the pipeline object this will create different operations. Typically this will create an SSL handshake operation if the pipeline has an SSLEngine instance. This allows the transport processor to complete the handshake before handing the transport to the transporter for processing.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int buffer
      This is the size of the buffers to be used by the transport.
      private boolean client
      This determines if the SSL handshake is for the client side.
      private TransportProcessor processor
      This is the processor used to process the created transport.
      private Reactor reactor
      This is the reactor used to register for I/O notifications.
      private int threshold
      This is the threshold for the asynchronous buffers to use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Operation getInstance​(Socket socket)
      This method is used to create Operation object to process the next phase of the negotiation.
      private Operation getInstance​(Socket socket, javax.net.ssl.SSLEngine engine)
      This method is used to create Operation object to process the next phase of the negotiation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • processor

        private final TransportProcessor processor
        This is the processor used to process the created transport.
      • reactor

        private final Reactor reactor
        This is the reactor used to register for I/O notifications.
      • threshold

        private final int threshold
        This is the threshold for the asynchronous buffers to use.
      • buffer

        private final int buffer
        This is the size of the buffers to be used by the transport.
      • client

        private final boolean client
        This determines if the SSL handshake is for the client side.
    • Constructor Detail

      • OperationFactory

        public OperationFactory​(TransportProcessor processor,
                                Reactor reactor,
                                int buffer)
        Constructor for the OperationFactory object. This uses the processor provided to hand off the created transport when it has been created. All operations created typically execute in an asynchronous thread.
        Parameters:
        processor - the processor used to dispatch the transport
        reactor - this is the reactor used for I/O notifications
        buffer - this is the initial size of the buffer to use
      • OperationFactory

        public OperationFactory​(TransportProcessor processor,
                                Reactor reactor,
                                int buffer,
                                int threshold)
        Constructor for the OperationFactory object. This uses the processor provided to hand off the created transport when it has been created. All operations created typically execute in an asynchronous thread.
        Parameters:
        processor - the processor used to dispatch the transport
        reactor - this is the reactor used for I/O notifications
        buffer - this is the initial size of the buffer to use
        threshold - maximum size of the output buffer to use
      • OperationFactory

        public OperationFactory​(TransportProcessor processor,
                                Reactor reactor,
                                int buffer,
                                int threshold,
                                boolean client)
        Constructor for the OperationFactory object. This uses the processor provided to hand off the created transport when it has been created. All operations created typically execute in an asynchronous thread.
        Parameters:
        processor - the processor used to dispatch the transport
        reactor - this is the reactor used for I/O notifications
        buffer - this is the initial size of the buffer to use
        threshold - maximum size of the output buffer to use
        client - determines if the SSL handshake is for a client
    • Method Detail

      • getInstance

        public Operation getInstance​(Socket socket)
                              throws java.io.IOException
        This method is used to create Operation object to process the next phase of the negotiation. The operations that are created using this factory ensure the processing can be done asynchronously, which reduces the overhead the connection thread has when handing the pipelines over for processing.
        Parameters:
        socket - this is the pipeline that is to be processed
        Returns:
        this returns the operation used for processing
        Throws:
        java.io.IOException
      • getInstance

        private Operation getInstance​(Socket socket,
                                      javax.net.ssl.SSLEngine engine)
                               throws java.io.IOException
        This method is used to create Operation object to process the next phase of the negotiation. The operations that are created using this factory ensure the processing can be done asynchronously, which reduces the overhead the connection thread has when handing the pipelines over for processing.
        Parameters:
        socket - this is the pipeline that is to be processed
        engine - this is the engine used for SSL negotiations
        Returns:
        this returns the operation used for processing
        Throws:
        java.io.IOException