Class OperationFactory

java.lang.Object
org.simpleframework.transport.OperationFactory

class OperationFactory extends 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 Details

    • 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 Details

    • 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 Details

    • getInstance

      public Operation getInstance(Socket socket) throws 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:
      IOException
    • getInstance

      private Operation getInstance(Socket socket, SSLEngine engine) throws 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:
      IOException