use of ee.jakarta.tck.ws.rs.common.impl.JaxbKeyValueBean in project jaxrs-api by eclipse-ee4j.
the class MediaTypeResource method sendXML.
@GET
@Path("xml")
@Produces(MediaType.SERVER_SENT_EVENTS)
public void sendXML(@Context SseEventSink sink, @Context Sse sse) {
try (SseEventSink s = sink) {
JaxbKeyValueBean bean = new JaxbKeyValueBean();
bean.set("key", SSEMessage.MESSAGE);
s.send(sse.newEventBuilder().data(bean).mediaType(mediaType).build());
}
}
Aggregations