Package org.eclipse.jetty.io
Class FillInterest
- java.lang.Object
-
- org.eclipse.jetty.io.FillInterest
-
public abstract class FillInterest extends java.lang.ObjectA Utility class to help implementEndPoint.fillInterested(Callback)by keeping state and calling the context and callback objects.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFillInterest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanfillable()Call to signal that a read is now possible.Invocable.InvocationTypegetCallbackInvocationType()booleanisInterested()protected abstract voidneedsFillInterest()Register the read interest Abstract method to be implemented by the Specific ReadInterest to schedule a future call tofillable()oronFail(Throwable)voidonClose()booleanonFail(java.lang.Throwable cause)Call to signal a failure to a registered interestvoidregister(Callback callback)Call to register interest in a callback when a read is possible.java.lang.StringtoStateString()java.lang.StringtoString()booleantryRegister(Callback callback)Call to register interest in a callback when a read is possible.
-
-
-
Method Detail
-
register
public void register(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 ifneedsFillInterest()returns true or eventually oncefillable()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(Callback callback)
Call to register interest in a callback when a read is possible. The callback will be called either immediately ifneedsFillInterest()returns true or eventually oncefillable()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.- Returns:
- whether the callback was notified that a read is now possible
-
isInterested
public boolean isInterested()
- Returns:
- True if a read callback has been registered
-
getCallbackInvocationType
public 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
Callbackinstance
-
onClose
public void onClose()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toStateString
public java.lang.String toStateString()
-
needsFillInterest
protected abstract void needsFillInterest() throws java.io.IOExceptionRegister the read interest Abstract method to be implemented by the Specific ReadInterest to schedule a future call tofillable()oronFail(Throwable)- Throws:
java.io.IOException- if unable to fulfill interest in fill
-
-