org.glassfish.jersey.examples.aggregator
Class MessageStreamResource
java.lang.Object
org.glassfish.jersey.examples.aggregator.MessageStreamResource
@Path(value="message/stream")
public class MessageStreamResource
- extends Object
Resource that aggregates incoming messages and broadcasts them
to the registered Server-Sent Even (SSE) client streams.
- Author:
- Marek Potociar (marek.potociar at oracle.com)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageStreamResource
public MessageStreamResource()
putMessage
@PUT
@Consumes(value="application/json")
public void putMessage(Message message)
- Put a new message to the stream.
The message will be broadcast to all registered SSE clients.
- Parameters:
message - message to be broadcast.
getMessageStream
@GET
@Produces(value="text/event-stream")
public EventOutput getMessageStream()
- Get the new SSE message stream channel.
- Returns:
- new SSE message stream channel.
Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.