Package org.simpleframework.transport
Class OperationFactory
java.lang.Object
org.simpleframework.transport.OperationFactory
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
FieldsModifier and TypeFieldDescriptionprivate final intThis is the size of the buffers to be used by the transport.private final booleanThis determines if the SSL handshake is for the client side.private final TransportProcessorThis is the processor used to process the created transport.private final ReactorThis is the reactor used to register for I/O notifications.private final intThis is the threshold for the asynchronous buffers to use. -
Constructor Summary
ConstructorsConstructorDescriptionOperationFactory(TransportProcessor processor, Reactor reactor, int buffer) Constructor for theOperationFactoryobject.OperationFactory(TransportProcessor processor, Reactor reactor, int buffer, int threshold) Constructor for theOperationFactoryobject.OperationFactory(TransportProcessor processor, Reactor reactor, int buffer, int threshold, boolean client) Constructor for theOperationFactoryobject. -
Method Summary
Modifier and TypeMethodDescriptiongetInstance(Socket socket) This method is used to createOperationobject to process the next phase of the negotiation.private OperationgetInstance(Socket socket, SSLEngine engine) This method is used to createOperationobject to process the next phase of the negotiation.
-
Field Details
-
processor
This is the processor used to process the created transport. -
reactor
This is the reactor used to register for I/O notifications. -
threshold
private final int thresholdThis is the threshold for the asynchronous buffers to use. -
buffer
private final int bufferThis is the size of the buffers to be used by the transport. -
client
private final boolean clientThis determines if the SSL handshake is for the client side.
-
-
Constructor Details
-
OperationFactory
Constructor for theOperationFactoryobject. 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
Constructor for theOperationFactoryobject. 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 theOperationFactoryobject. 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 Details
-
getInstance
This method is used to createOperationobject 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
This method is used to createOperationobject 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:
IOException
-