|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.glassfish.jersey.media.sse.Broadcaster
public class Broadcaster
Used for broadcasting sse to multiple EventChannel instances.
| Constructor Summary | |
|---|---|
Broadcaster()
|
|
| Method Summary | |
|---|---|
void |
broadcast(java.lang.Object data,
java.lang.Class<?> dataType)
Broadcast a message with given parameters to all registered EventChannel instances. |
void |
broadcast(java.lang.String eventName,
java.lang.Object data,
java.lang.Class<?> dataType)
Broadcast a message with given parameters to all registered EventChannel instances. |
void |
broadcast(java.lang.String eventName,
java.lang.String eventId,
java.lang.Class dataType,
java.lang.Object data)
Broadcast a message with given parameters to all registered EventChannel instances. |
void |
close()
Close all registered EventChannel instances. |
void |
registerEventChannel(EventChannel eventChannel)
Register EventChannel to current Broadcaster instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Broadcaster()
| Method Detail |
|---|
public void registerEventChannel(EventChannel eventChannel)
EventChannel to current Broadcaster instance.
eventChannel - EventChannel to register.
public void broadcast(java.lang.String eventName,
java.lang.String eventId,
java.lang.Class dataType,
java.lang.Object data)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
EventChannel instances.
eventName - event name.eventId - event id.dataType - Class which will be used for MessageBodyWriter lookup.
MUST NOT be null.data - actual data. MUST NOT be null.
java.lang.IllegalStateException - when trying to write message to closed EventChannel.
java.lang.IllegalArgumentException - when dataType or data is null.
public void broadcast(java.lang.String eventName,
java.lang.Object data,
java.lang.Class<?> dataType)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
EventChannel instances.
eventName - event name.dataType - Class which will be used for MessageBodyWriter lookup.
MUST NOT be null.data - actual data. MUST NOT be null.
java.lang.IllegalStateException - when trying to write message to closed EventChannel.
java.lang.IllegalArgumentException - when dataType or data is null.
public void broadcast(java.lang.Object data,
java.lang.Class<?> dataType)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
EventChannel instances.
dataType - Class which will be used for MessageBodyWriter lookup.
MUST NOT be null.data - actual data. MUST NOT be null.
java.lang.IllegalStateException - when trying to write message to closed EventChannel.
java.lang.IllegalArgumentException - when dataType or data is null.public void close()
EventChannel instances.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||