Class FillInterest


  • public abstract class FillInterest
    extends java.lang.Object
    A Utility class to help implement EndPoint.fillInterested(Callback) by keeping state and calling the context and callback objects.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FillInterest()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean fillable()
      Call to signal that a read is now possible.
      org.eclipse.jetty.util.thread.Invocable.InvocationType getCallbackInvocationType()  
      boolean isInterested()  
      protected abstract void needsFillInterest()
      Register the read interest Abstract method to be implemented by the Specific ReadInterest to schedule a future call to fillable() or onFail(Throwable)
      void onClose()  
      boolean onFail​(java.lang.Throwable cause)
      Call to signal a failure to a registered interest
      void register​(org.eclipse.jetty.util.Callback callback)
      Call to register interest in a callback when a read is possible.
      java.lang.String toStateString()  
      java.lang.String toString()  
      boolean tryRegister​(org.eclipse.jetty.util.Callback callback)
      Call to register interest in a callback when a read is possible.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FillInterest

        protected FillInterest()
    • Method Detail

      • register

        public void register​(org.eclipse.jetty.util.Callback callback)
                      throws java.nio.channels.ReadPendingException
        Call to register interest in a callback when a read is possible. The callback will be called either immediately if needsFillInterest() returns true or eventually once fillable() is called.
        Parameters:
        callback - the callback to register
        Throws:
        java.nio.channels.ReadPendingException - if unable to read due to pending read op
      • tryRegister

        public boolean tryRegister​(org.eclipse.jetty.util.Callback callback)
        Call to register interest in a callback when a read is possible. The callback will be called either immediately if needsFillInterest() returns true or eventually once fillable() is called.
        Parameters:
        callback - the callback to register
        Returns:
        true if the register succeeded
      • fillable

        public boolean fillable()
        Call to signal that a read is now possible.
      • isInterested

        public boolean isInterested()
        Returns:
        True if a read callback has been registered
      • getCallbackInvocationType

        public org.eclipse.jetty.util.thread.Invocable.InvocationType getCallbackInvocationType()
      • onFail

        public boolean onFail​(java.lang.Throwable cause)
        Call to signal a failure to a registered interest
        Parameters:
        cause - the cause of the failure
        Returns:
        true if the cause was passed to a Callback instance
      • onClose

        public void onClose()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStateString

        public java.lang.String toStateString()
      • needsFillInterest

        protected abstract void needsFillInterest()
                                           throws java.io.IOException
        Register the read interest Abstract method to be implemented by the Specific ReadInterest to schedule a future call to fillable() or onFail(Throwable)
        Throws:
        java.io.IOException - if unable to fulfill interest in fill