Class WebSocketFlusher
java.lang.Object
org.eclipse.jetty.websocket.core.util.WebSocketFlusher
- All Implemented Interfaces:
OutgoingFrames
- Direct Known Subclasses:
FragmentingFlusher
This is used to iteratively transform or process a frame into one or more other frames.
When a frame is ready to be processed
onFrame(OutgoingEntry, boolean)
is called.
Subsequent calls to onFrame(OutgoingEntry, boolean)
are after each time the entry is succeeded
until one of these calls returns true to indicate they are done processing the frame and are ready to receive a new one.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Used to close this flusher when there is no explicit failure.void
Used to fail this flusher possibly from an external event such as a callback.protected void
onCompleteFailure
(Throwable cause) Called when the flusher has failed andonFrame(OutgoingEntry, boolean)
will never be called again.protected abstract boolean
onFrame
(OutgoingEntry entry, boolean first) Called when a frame is ready to be transformed.final void
sendFrame
(OutgoingEntry entry) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.websocket.core.OutgoingFrames
sendFrame
-
Constructor Details
-
WebSocketFlusher
public WebSocketFlusher()
-
-
Method Details
-
onFrame
Called when a frame is ready to be transformed.- Parameters:
entry
- the entry containing the frame to be transformed.first
- true if this is the first time this entry is being processed.- Returns:
- true to indicate that you have finished transforming this entry.
-
onCompleteFailure
Called when the flusher has failed andonFrame(OutgoingEntry, boolean)
will never be called again. -
sendFrame
Description copied from interface:OutgoingFrames
- Specified by:
sendFrame
in interfaceOutgoingFrames
- Parameters:
entry
- the frame to eventually write to the network layer.
-
closeFlusher
public void closeFlusher()Used to close this flusher when there is no explicit failure. -
failFlusher
Used to fail this flusher possibly from an external event such as a callback.- Parameters:
t
- the failure.
-