|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glassfish.jersey.server.ChunkedResponse<T>
public class ChunkedResponse<T>
Used for sending messages in "typed" chunks. Useful for long running processes, which are able to produce partial responses.
Constructor Summary | |
---|---|
ChunkedResponse(java.lang.Class<T> clazz)
Create ChunkedResponse with specified type. |
|
ChunkedResponse(java.lang.Class<T> clazz,
java.lang.Long interval,
java.util.concurrent.TimeUnit timeUnit)
Create ChunkedResponse with specified type and polling interval. |
Method Summary | |
---|---|
void |
close()
Close this response - it will be finalized and underlying connections will be closed or made available for another response. |
protected T |
getChunk()
|
protected java.lang.Class<T> |
getChunkType()
|
void |
write(T t)
Write 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.Class<T> clazz)
ChunkedResponse
with specified type.
TODO: make EventChannel use this class as impl base
clazz
- chunk typepublic ChunkedResponse(java.lang.Class<T> clazz, java.lang.Long interval, java.util.concurrent.TimeUnit timeUnit)
ChunkedResponse
with specified type and polling interval. Polling interval is used when retrieving
data - basically it specifies how often will be connection checked if it is closed from the client side.
interval
- polling interval. Default value is 5
.timeUnit
- polling interval TimeUnit
. Default value is TimeUnit.SECONDS
.clazz
- chunk typeMethod Detail |
---|
public void write(T t)
t
- chunk instance to be written.
java.lang.IllegalStateException
- when ChunkedResponse
is closed.public void close()
protected java.lang.Class<T> getChunkType()
protected T getChunk() throws java.lang.InterruptedException
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |