Package org.simpleframework.http.core
Class BodyEncoderFactory
java.lang.Object
org.simpleframework.http.core.BodyEncoderFactory
The
BodyEncoderFactory
is used to create a producer to
match the HTTP header sent with the response. This interprets the
headers within the response and composes a producer that will
match those. Producers can be created to send in chunked encoding
format, as well as fixed length and connection close for HTTP/1.0.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BodyObserver
This is the monitor used to notify the initiator of events.private final Conversation
This is used to determine the semantics of the HTTP pipeline.private final ByteWriter
This is the underlying sender used to deliver the raw data. -
Constructor Summary
ConstructorsConstructorDescriptionBodyEncoderFactory
(BodyObserver observer, Conversation support, Channel channel) Constructor for theBodyEncoderFactory
object. -
Method Summary
Modifier and TypeMethodDescriptionThis is used to create an aBodyEncoder
object that can be used to encode content according to the HTTP header.private BodyEncoder
getInstance
(boolean chunkable) This is used to create an aBodyEncoder
object that can be used to encode content according to the HTTP header.
-
Field Details
-
support
This is used to determine the semantics of the HTTP pipeline. -
observer
This is the monitor used to notify the initiator of events. -
writer
This is the underlying sender used to deliver the raw data.
-
-
Constructor Details
-
BodyEncoderFactory
Constructor for theBodyEncoderFactory
object. This is used to create producers that can encode data in a HTTP compliant format. Each producer created will produce its data and deliver it to the specified sender, should an I/O events occur such as an error, or completion of the response then the monitor is notified and the server kernel takes action.- Parameters:
observer
- this is used to deliver signals to the kernelsupport
- this contains details regarding the semanticswriter
- this is used to send to the underlying transport
-
-
Method Details
-
getInstance
This is used to create an aBodyEncoder
object that can be used to encode content according to the HTTP header. If the request was from a HTTP/1.0 client that did not ask for keep alive connection semantics a simple close producer is created. Otherwise the content is chunked encoded or sent according the the Content-Length.- Returns:
- this returns the producer used to send the response
-
getInstance
This is used to create an aBodyEncoder
object that can be used to encode content according to the HTTP header. If the request was from a HTTP/1.0 client that did not ask for keep alive connection semantics a simple close producer is created. Otherwise the content is chunked encoded or sent according the the Content-Length.- Parameters:
chunkable
- does the connected client support chunked- Returns:
- this returns the producer used to send the response
-