|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.server.ChunkedResponse<T>
T - chunk type.public class ChunkedResponse<T>
Used for sending messages in "typed" chunks. Useful for long running processes, which needs to produce partial responses.
| Constructor Summary | |
|---|---|
ChunkedResponse(GenericType<T> genericType)
Creates a new instance of ChunkResponse, passing the chunk type as an instance of GenericType. |
|
ChunkedResponse(java.lang.reflect.Type chunkType)
Create ChunkedResponse with specified type. |
|
| Method Summary | |
|---|---|
void |
close()
Close this response - it will be finalized and underlying connections will be closed or made available for another response. |
boolean |
isClosed()
Get state information. |
void |
write(T chunk)
Write a chunk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChunkedResponse(java.lang.reflect.Type chunkType)
ChunkedResponse with specified type.
chunkType - chunk typepublic ChunkedResponse(GenericType<T> genericType)
GenericType.
genericType - chunk type| Method Detail |
|---|
public void write(T chunk)
throws java.io.IOException
chunk - a chunk instance to be written.
java.lang.IllegalStateException - when ChunkedResponse is closed.
java.io.IOException - when encountered any problem during serializing or writing a chunk.
public void close()
throws java.io.IOException
close in interface java.io.Closeablejava.io.IOExceptionpublic boolean isClosed()
ChunkedResponse can be closed by the client side - client can close connection
from its side.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||