public class RequestWriter extends 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 listener for listening to events when writing a request entity.
|
| Constructor and Description |
|---|
RequestWriter()
Create new request writer.
|
| Modifier and Type | Method and Description |
|---|---|
protected RequestWriter.RequestEntityWriter |
getRequestEntityWriter(ClientRequest request)
Get a request entity writer capable of writing the request entity.
|
protected void |
writeRequestEntity(ClientRequest requestContext,
RequestWriter.RequestEntityWriterListener listener)
Write a request entity using an appropriate message body writer.
|
protected RequestWriter.RequestEntityWriter getRequestEntityWriter(ClientRequest request)
request - the client request.protected void writeRequestEntity(ClientRequest requestContext, RequestWriter.RequestEntityWriterListener listener) throws IOException
The method MessageBodyWorkers.MessageBodySizeCallback.onRequestEntitySize(long) will be invoked
with the size of the request entity to be serialized.
The method RequestWriter.RequestEntityWriterListener.onGetStreamProvider() will be invoked
when the output stream is required to write the request entity.
requestContext - the client request context containing the request entity. If the
request entity is null then the method will not write any entity.listener - the request entity listener.IOException - in case of an IO error.Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.