public class SSEWriter extends Object
SSEvent with write(SSEvent) to
the client.
Example:
@ExtDirectMethod(ExtDirectMethodType.SSE)
public void sse(SSEWriter sseWriter) {
SSEvent event = new SSEvent();
event.set....
sseWriter.write(event);
//do something else or wait for something or ...
sseWriter.write(event);
//...
}
| Constructor and Description |
|---|
SSEWriter(javax.servlet.http.HttpServletResponse response) |
| Modifier and Type | Method and Description |
|---|---|
void |
write(Object data)
Creates a
SSEvent object and sets the data property to the provided
parameter. |
void |
write(SSEvent sseEvent)
Writes the event into the servlet output stream and flushes the response.
|
public void write(Object data) throws IOException
SSEvent object and sets the data property to the provided
parameter. Then it writes the event into the servlet output stream and flushes the
response.data - the value that becomes the data part of the SSEvent. If null
nothing is written.IOExceptionpublic void write(SSEvent sseEvent) throws IOException
sseEvent - the event objectIOExceptionCopyright © 2010–2015. All rights reserved.