|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jersey.api.client.TerminatingClientHandler
public abstract class TerminatingClientHandler
A terminating client handler that is invoked to produce an HTTP request to send to a resource and process the HTTP response received from the resource.
This class can be extended to integrate HTTP protocol functionality with the Client API. Utilitly methods are provided for converting header values and writing a request entity.
Nested Class Summary | |
---|---|
protected static interface |
TerminatingClientHandler.RequestEntityWriter
A writer for writing a request entity. |
protected static interface |
TerminatingClientHandler.RequestEntityWriterListener
A lister for listensing to events when writing a request entity. |
Field Summary | |
---|---|
protected static java.lang.annotation.Annotation[] |
EMPTY_ANNOTATIONS
|
Constructor Summary | |
---|---|
TerminatingClientHandler()
|
Method Summary | |
---|---|
protected MessageBodyWorkers |
getMessageBodyWorkers()
|
protected TerminatingClientHandler.RequestEntityWriter |
getRequestEntityWriter(ClientRequest ro)
Get a request entity writer capable of writing the request entity. |
protected java.lang.String |
headerValueToString(java.lang.Object headerValue)
Convert a header value to a String instance. |
protected void |
writeRequestEntity(ClientRequest ro,
TerminatingClientHandler.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 |
Methods inherited from interface com.sun.jersey.api.client.ClientHandler |
---|
handle |
Field Detail |
---|
protected static final java.lang.annotation.Annotation[] EMPTY_ANNOTATIONS
Constructor Detail |
---|
public TerminatingClientHandler()
Method Detail |
---|
protected MessageBodyWorkers getMessageBodyWorkers()
protected java.lang.String headerValueToString(java.lang.Object headerValue)
This method defers to ClientRequest.getHeaderValue(java.lang.Object)
.
headerValue
- the header value.
protected TerminatingClientHandler.RequestEntityWriter getRequestEntityWriter(ClientRequest ro)
ro
- the client request.
protected void writeRequestEntity(ClientRequest ro, TerminatingClientHandler.RequestEntityWriterListener listener) throws java.io.IOException
The method TerminatingClientHandler.RequestEntityWriterListener.onRequestEntitySize(long)
will be invoked
with the size of the request entity to be serialized.
The method TerminatingClientHandler.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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |