org.glassfish.jersey.client
Class RequestWriter

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

public class RequestWriter
extends java.lang.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 listener for listening to events when writing a request entity.
 
Field Summary
protected static java.lang.annotation.Annotation[] EMPTY_ANNOTATIONS
           
 
Constructor Summary
RequestWriter()
           
 
Method Summary
protected  RequestWriter.RequestEntityWriter getRequestEntityWriter(Request request)
          Get a request entity writer capable of writing the request entity.
protected  void writeRequestEntity(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 java.lang.annotation.Annotation[] EMPTY_ANNOTATIONS
Constructor Detail

RequestWriter

public RequestWriter()
Method Detail

getRequestEntityWriter

protected RequestWriter.RequestEntityWriter getRequestEntityWriter(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(Request request,
                                  RequestWriter.RequestEntityWriterListener listener)
                           throws java.io.IOException
Write a request entity using an appropriate message body writer.

The method MessageBodyWorkers.MessageBodySizeCallback.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:
java.io.IOException


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