public class RequestWriter
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static interface |
RequestWriter.RequestEntityWriter
A writer for writing a request entity.
|
protected static interface |
RequestWriter.RequestEntityWriterListener
A lister for listening to events when writing a request entity.
|
Modifier and Type | Field and Description |
---|---|
protected static java.lang.annotation.Annotation[] |
EMPTY_ANNOTATIONS |
Constructor and Description |
---|
RequestWriter() |
RequestWriter(MessageBodyWorkers workers) |
Modifier and Type | Method and Description |
---|---|
MessageBodyWorkers |
getMessageBodyWorkers() |
protected RequestWriter.RequestEntityWriter |
getRequestEntityWriter(ClientRequest ro)
Get a request entity writer capable of writing the request entity.
|
void |
setMessageBodyWorkers(MessageBodyWorkers workers) |
protected void |
writeRequestEntity(ClientRequest ro,
RequestWriter.RequestEntityWriterListener listener)
Write a request entity using an appropriate message body writer.
|
protected static final java.lang.annotation.Annotation[] EMPTY_ANNOTATIONS
public RequestWriter()
public RequestWriter(MessageBodyWorkers workers)
@Context public void setMessageBodyWorkers(MessageBodyWorkers workers)
public MessageBodyWorkers getMessageBodyWorkers()
protected RequestWriter.RequestEntityWriter getRequestEntityWriter(ClientRequest ro)
ro
- the client request.protected void writeRequestEntity(ClientRequest ro, RequestWriter.RequestEntityWriterListener listener) throws java.io.IOException
The method RequestWriter.RequestEntityWriterListener.onRequestEntitySize(long)
will be invoked
with the size of the request entity to be serialized.
The method RequestWriter.RequestEntityWriterListener.onGetOutputStream()
will be invoked
when the output stream is required to write the request entity.
ro
- the client request containing the request entity. If the
request entity is null then the method will not write any entity.listener
- the request entity listener.java.io.IOException
Copyright © 2016 Oracle Corporation. All Rights Reserved.