Package org.eclipse.jetty.servlets
Interface EventSource
-
public interface EventSource
EventSource
is the passive half of an event source connection, as defined by the EventSource Specification.EventSource.Emitter
is the active half of the connection and allows to operate on the connection.EventSource
allows applications to be notified of events happening on the connection; two events are being notified: the opening of the event source connection, where methodonOpen(Emitter)
is invoked, and the closing of the event source connection, where methodonClose()
is invoked.- See Also:
EventSourceServlet
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
EventSource.Emitter
EventSource.Emitter
is the active half of an event source connection, and allows applications to operate on the connection by sending events, data or comments, or by closing the connection.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onClose()
Callback method invoked when an event source connection is closed.void
onOpen(EventSource.Emitter emitter)
Callback method invoked when an event source connection is opened.
-
-
-
Method Detail
-
onOpen
void onOpen(EventSource.Emitter emitter) throws java.io.IOException
Callback method invoked when an event source connection is opened.
- Parameters:
emitter
- theEventSource.Emitter
instance that allows to operate on the connection- Throws:
java.io.IOException
- if the implementation of the method throws such exception
-
onClose
void onClose()
Callback method invoked when an event source connection is closed.
-
-