Class TransformingFlusher
java.lang.Object
org.eclipse.jetty.websocket.core.util.TransformingFlusher
- 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(Frame, Callback, boolean)
is called.
Subsequent calls to transform(Callback)
are made on each callback success until one of these calls returns
true to indicate they are done processing the frame and are ready to receive a new one.
The Callback
passed in to both these method must be succeeded in order to continue processing.-
Constructor Summary
-
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 abstract boolean
Called when a frame is ready to be transformed.final void
protected abstract boolean
Called to transform the frame given inonFrame(Frame, Callback, boolean)
.
-
Constructor Details
-
TransformingFlusher
public TransformingFlusher()
-
-
Method Details
-
onFrame
Called when a frame is ready to be transformed.- Parameters:
frame
- the frame to transform.callback
- used to signal to start processing again.batch
- whether this frame can be batched.- Returns:
- true to indicate that you have finished transforming this frame.
-
transform
Called to transform the frame given inonFrame(Frame, Callback, boolean)
. This method is called on each callback success until it returns true. If the call toonFrame(Frame, Callback, boolean)
returns true then this method will not be called.- Parameters:
callback
- used to signal to start processing again.- Returns:
- true to indicate that you have finished transforming this frame.
-
sendFrame
-
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.
-