public class SseEventOutputImpl extends GenericType<OutboundSseEvent> implements SseEventSink
Constructor and Description |
---|
SseEventOutputImpl(MessageBodyWriter<OutboundSseEvent> writer) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the
SseEventSink instance and release all associated resources. |
boolean |
equals(Object o) |
protected void |
flushResponseToClient() |
int |
hashCode() |
boolean |
isClosed()
Check if the stream has been closed already.
|
CompletionStage<?> |
send(OutboundSseEvent event)
Send an outbound Server-sent event to this sink.
|
protected void |
writeEvent(OutboundSseEvent event) |
forInstance, getRawType, getType, toString
public SseEventOutputImpl(MessageBodyWriter<OutboundSseEvent> writer)
public void close()
SseEventSink
SseEventSink
instance and release all associated resources.
Subsequent calls have no effect and are ignored. Once the SseEventSink
is closed,
invoking any method other than this one and SseEventSink.isClosed()
would result in
an IllegalStateException
being thrown.
close
in interface AutoCloseable
close
in interface SseEventSink
protected void flushResponseToClient()
public boolean isClosed()
SseEventSink
Please note that the client connection represented by this SseServerSink
can be closed by the
client side when a client decides to close connection and disconnect from the server.
isClosed
in interface SseEventSink
true
when closed, false
otherwise.public CompletionStage<?> send(OutboundSseEvent event)
SseEventSink
Event will be serialized and sent to the client.
send
in interface SseEventSink
event
- event to be written.protected void writeEvent(OutboundSseEvent event) throws IOException
IOException
public boolean equals(Object o)
equals
in class GenericType<OutboundSseEvent>
public int hashCode()
hashCode
in class GenericType<OutboundSseEvent>
Copyright © 2019 JBoss by Red Hat. All rights reserved.