Package org.glassfish.jersey.server
Interface BroadcasterListener<T>
- All Known Implementing Classes:
Broadcaster
,SseBroadcaster
public interface BroadcasterListener<T>
Listener interface that can be implemented to listen to events fired by
Broadcaster
object.
To listen to events, implementation of this interface needs to register with a particular Broadcaster
instance
using Broadcaster.add(BroadcasterListener)
.- Author:
- Martin Matula
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onClose
(ChunkedOutput<T> chunkedOutput) Called when the chunkedOutput has been closed (either by client closing the connection or by callingChunkedOutput.close()
on the server side.void
onException
(ChunkedOutput<T> chunkedOutput, Exception exception) Called when exception was thrown by a given chunked response when trying to write to it or close it.
-
Method Details
-
onException
Called when exception was thrown by a given chunked response when trying to write to it or close it.- Parameters:
chunkedOutput
- instance that threw exceptionexception
- thrown exception
-
onClose
Called when the chunkedOutput has been closed (either by client closing the connection or by callingChunkedOutput.close()
on the server side.- Parameters:
chunkedOutput
- instance that has been closed.
-