Class FrameFlusher

java.lang.Object
org.eclipse.jetty.util.IteratingCallback
org.eclipse.jetty.websocket.core.internal.FrameFlusher
All Implemented Interfaces:
Callback, Invocable

public class FrameFlusher extends IteratingCallback
  • Field Details

    • FLUSH_FRAME

      public static final Frame FLUSH_FRAME
  • Constructor Details

  • Method Details

    • isUseDirectByteBuffers

      public boolean isUseDirectByteBuffers()
    • setUseDirectByteBuffers

      public void setUseDirectByteBuffers(boolean useDirectByteBuffers)
    • enqueue

      public boolean enqueue(Frame frame, Callback callback, boolean batch)
      Enqueue a Frame to be written to the endpoint.
      Parameters:
      frame - The frame to queue
      callback - The callback to call once the frame is sent
      batch - True if batch mode is to be used
      Returns:
      returns true if the frame was enqueued and iterate needs to be called, returns false if the FrameFlusher was closed
    • onClose

      public void onClose(Throwable cause)
    • process

      protected IteratingCallback.Action process() throws Throwable
      Description copied from class: IteratingCallback
      Method called by IteratingCallback.iterate() to process the asynchronous sub-task.

      Implementations must initiate the asynchronous execution of the sub-task (if any) and return an appropriate action:

      Specified by:
      process in class IteratingCallback
      Returns:
      the appropriate Action
      Throws:
      Throwable - if the sub-task processing throws
    • timeoutExpired

      public void timeoutExpired()
    • onCompleteFailure

      public void onCompleteFailure(Throwable failure)
      Description copied from class: IteratingCallback
      Invoked when the overall task has completed with a failure.
      Overrides:
      onCompleteFailure in class IteratingCallback
      Parameters:
      failure - the throwable to indicate cause of failure
      See Also:
    • notifyCallbackSuccess

      protected void notifyCallbackSuccess(Callback callback)
    • notifyCallbackFailure

      protected void notifyCallbackFailure(Callback callback, Throwable failure)
    • setIdleTimeout

      public void setIdleTimeout(long idleTimeout)
    • getIdleTimeout

      public long getIdleTimeout()
    • getMessagesOut

      public long getMessagesOut()
    • getBytesOut

      public long getBytesOut()
    • toString

      public String toString()
      Overrides:
      toString in class IteratingCallback