org.glassfish.jersey.client
Class RequestWriter

java.lang.Object
  extended by org.glassfish.jersey.client.RequestWriter

public class RequestWriter
extends Object

A request writer for writing header values and a request entity.

Author:
Paul Sandoz

Nested Class Summary
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.
 
Field Summary
protected static Annotation[] EMPTY_ANNOTATIONS
           
 
Constructor Summary
RequestWriter()
           
 
Method Summary
protected  RequestWriter.RequestEntityWriter getRequestEntityWriter(javax.ws.rs.core.Request request)
          Get a request entity writer capable of writing the request entity.
protected  void writeRequestEntity(javax.ws.rs.core.Request request, RequestWriter.RequestEntityWriterListener listener)
          Write a request entity using an appropriate message body writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_ANNOTATIONS

protected static final Annotation[] EMPTY_ANNOTATIONS
Constructor Detail

RequestWriter

public RequestWriter()
Method Detail

getRequestEntityWriter

protected RequestWriter.RequestEntityWriter getRequestEntityWriter(javax.ws.rs.core.Request request)
Get a request entity writer capable of writing the request entity.

Parameters:
request - the client request.
Returns:
the request entity writer.

writeRequestEntity

protected void writeRequestEntity(javax.ws.rs.core.Request request,
                                  RequestWriter.RequestEntityWriterListener listener)
                           throws IOException
Write a request entity using an appropriate message body writer.

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.

Parameters:
request - 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.
Throws:
IOException


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.