Package org.glassfish.jersey.media.sse
Class SseBroadcaster
java.lang.Object
org.glassfish.jersey.server.Broadcaster<OutboundEvent>
org.glassfish.jersey.media.sse.SseBroadcaster
- All Implemented Interfaces:
BroadcasterListener<OutboundEvent>
Used for broadcasting SSE to multiple
EventOutput
instances.- Author:
- Pavel Bucek, Martin Matula
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new instance.protected
SseBroadcaster
(Class<? extends SseBroadcaster> subclass) Can be used by subclasses to override the default functionality of adding self to the set oflisteners
. -
Method Summary
Methods inherited from class org.glassfish.jersey.server.Broadcaster
add, add, broadcast, closeAll, onClose, onException, remove, remove
-
Constructor Details
-
SseBroadcaster
public SseBroadcaster()Creates a new instance. If this constructor is called by a subclass, it assumes the the reason for the subclass to exist is to implementBroadcaster.onClose(org.glassfish.jersey.server.ChunkedOutput)
andBroadcaster.onException(org.glassfish.jersey.server.ChunkedOutput, Exception)
methods, so it adds the newly created instance as the listener. To avoid this, subclasses may callSseBroadcaster(Class)
passing their class as an argument. -
SseBroadcaster
Can be used by subclasses to override the default functionality of adding self to the set oflisteners
. If creating a direct instance of a subclass passed in the parameter, the broadcaster will not register itself as a listener.- Parameters:
subclass
- subclass of SseBroadcaster that should not be registered as a listener - if creating a direct instance of this subclass, this constructor will not register the new instance as a listener.- See Also:
-