Package org.simpleframework.transport
Class OperationFactory
- java.lang.Object
-
- org.simpleframework.transport.OperationFactory
-
class OperationFactory extends java.lang.Object
TheOperationFactory
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 anSSLEngine
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.
-
Constructor Summary
Constructors Constructor Description OperationFactory(TransportProcessor processor, Reactor reactor, int buffer)
Constructor for theOperationFactory
object.OperationFactory(TransportProcessor processor, Reactor reactor, int buffer, int threshold)
Constructor for theOperationFactory
object.OperationFactory(TransportProcessor processor, Reactor reactor, int buffer, int threshold, boolean client)
Constructor for theOperationFactory
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Operation
getInstance(Socket socket)
This method is used to createOperation
object to process the next phase of the negotiation.private Operation
getInstance(Socket socket, javax.net.ssl.SSLEngine engine)
This method is used to createOperation
object to process the next phase of the negotiation.
-
-
-
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 theOperationFactory
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 transportreactor
- this is the reactor used for I/O notificationsbuffer
- this is the initial size of the buffer to use
-
OperationFactory
public OperationFactory(TransportProcessor processor, Reactor reactor, int buffer, int threshold)
Constructor for theOperationFactory
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 transportreactor
- this is the reactor used for I/O notificationsbuffer
- this is the initial size of the buffer to usethreshold
- maximum size of the output buffer to use
-
OperationFactory
public OperationFactory(TransportProcessor processor, Reactor reactor, int buffer, int threshold, boolean client)
Constructor for theOperationFactory
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 transportreactor
- this is the reactor used for I/O notificationsbuffer
- this is the initial size of the buffer to usethreshold
- maximum size of the output buffer to useclient
- 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 createOperation
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 createOperation
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 processedengine
- this is the engine used for SSL negotiations- Returns:
- this returns the operation used for processing
- Throws:
java.io.IOException
-
-